mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Add enterprise limit modal
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
angular.module('admin.enterprises').directive 'enterpriseLimit', (InfoDialog) ->
|
||||
restrict: 'A'
|
||||
scope: {
|
||||
limit_reached: '=enterpriseLimit',
|
||||
modal_message: '@modalMessage'
|
||||
}
|
||||
link: (scope, element, attr) ->
|
||||
element.bind 'click', (event)->
|
||||
if scope.limit_reached
|
||||
event.preventDefault()
|
||||
InfoDialog.open 'error', scope.modal_message
|
||||
@@ -2,7 +2,7 @@
|
||||
- if flash[:action]
|
||||
%p= flash[:action]
|
||||
|
||||
= form_for @enterprise_set, url: main_app.bulk_update_admin_enterprises_path, html: {"ng-app" => "admin.enterprises"} do |f|
|
||||
= form_for @enterprise_set, url: main_app.bulk_update_admin_enterprises_path do |f|
|
||||
%table#listing_enterprises.index
|
||||
%colgroup
|
||||
%col{style: "width: 25%;"}/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
%div{ ng: { app: 'admin.enterprises', controller: 'enterprisesCtrl' } }
|
||||
%div{ ng: { controller: 'enterprisesCtrl' } }
|
||||
.row{ 'ng-hide' => '!loaded' }
|
||||
.controls{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px;" }
|
||||
.four.columns.alpha
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
- content_for :page_title do
|
||||
= t('.title')
|
||||
|
||||
- content_for :app_wrapper_attrs do
|
||||
= "ng-app='admin.enterprises'"
|
||||
|
||||
- content_for :page_actions do
|
||||
= render 'admin/shared/user_guide_link'
|
||||
|
||||
- if spree_current_user.can_own_more_enterprises?
|
||||
%li#new_product_link
|
||||
= button_link_to t('.new_enterprise'), main_app.new_admin_enterprise_path, icon: 'icon-plus', id: 'admin_new_enterprise_link'
|
||||
%li#new_product_link
|
||||
- button_href = spree_current_user.can_own_more_enterprises? ? main_app.new_admin_enterprise_path : '#'
|
||||
- modal_message = t('js.admin.enterprise_limit_reached', contact_email: ContentConfig.footer_email)
|
||||
= button_link_to t('.new_enterprise'), button_href, icon: 'icon-plus', id: 'admin_new_enterprise_link', 'enterprise-limit' => !spree_current_user.can_own_more_enterprises?, 'modal-message' => modal_message
|
||||
|
||||
= admin_inject_monthly_bill_description
|
||||
= admin_inject_column_preferences module: 'admin.enterprises', action: "enterprises_index"
|
||||
|
||||
@@ -2203,6 +2203,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
resolve_errors: Please resolve the following errors
|
||||
more_items: "+ %{count} More"
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached your enterprise limit. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
tag_rule_help:
|
||||
|
||||
Reference in New Issue
Block a user