- Add code for placing the features information on the frontend

- Add a Features service for examining feature flags on the frontend
- Add a directive (quay-requires) that matches feature flags and, if any one does not match, removes the element from the DOM
- Add a directive (quay-show) that injects the features into the scope so that expressions of the form "Features.BILLING || something" work out of the box to show/hide the element
- Add a directive (quay-classes) that allows for setting of CSS classes on an element based on feature expression(s) such as {"!BILLING": "active"} (e.g. the BILLING flag is set to false, add the class "active".
This commit is contained in:
Joseph Schorr 2014-04-04 23:26:10 -04:00
parent 4f4112b18d
commit c374e8146a
6 changed files with 185 additions and 13 deletions

View file

@ -73,6 +73,7 @@
<script type="text/javascript">
window.__endpoints = {{ route_data|safe }}.apis;
window.__features = {{ feature_set|safe }};
window.__token = '{{ csrf_token() }}';
</script>