Add config option to disable the invites

Some foodcoops require that an admin adds all users to have more control
over the users.
This commit is contained in:
Patrick Gansterer 2016-03-06 13:56:33 +01:00
parent f5b6fbcf18
commit e16a0fb336
12 changed files with 25 additions and 11 deletions

View file

@ -2,5 +2,6 @@
= config_input form, :use_wiki, as: :boolean
= config_input form, :use_nick, as: :boolean
= config_input form, :tolerance_is_costly, as: :boolean
= config_input form, :disable_invite, as: :boolean
= config_input form, :help_url, as: :url, input_html: {class: 'input-xlarge'}
= config_input form, :webstats_tracking_code, as: :text, input_html: {class: 'input-xxlarge', rows: 3}

View file

@ -1,4 +1,4 @@
- unless @ordergroup.new_record?
- unless @ordergroup.new_record? || FoodsoftConfig[:disable_invite]
%p= t('.first_paragraph', url: link_to(t('.here'), new_invite_path(id: @ordergroup.id), remote: true)).html_safe
= simple_form_for [:admin, @ordergroup] do |f|
- captured = capture do

View file

@ -1,4 +1,5 @@
%p= t('.first_paragraph', url: link_to(t('.here'), new_invite_path(id: @workgroup.id), remote: true)).html_safe
- unless FoodsoftConfig[:disable_invite]
%p= t('.first_paragraph', url: link_to(t('.here'), new_invite_path(id: @workgroup.id), remote: true)).html_safe
= simple_form_for [:admin, @workgroup] do |f|
- captured = capture do
%h4= t 'admin.access_to'

View file

@ -1,6 +1,7 @@
- title t('.title')
%p= t('.invite_new', invite_link: link_to(t('.invite_link'), new_invite_path(id: @workgroup.id))).html_safe
- unless FoodsoftConfig[:disable_invite]
%p= t('.invite_new', invite_link: link_to(t('.invite_link'), new_invite_path(id: @workgroup.id))).html_safe
= simple_form_for [:foodcoop, @workgroup] do |f|
= render 'shared/group_form_fields', f: f
.form-actions

View file

@ -12,7 +12,8 @@
%p
%b= heading_helper(Ordergroup, :user_tokens) + ':'
= @ordergroup.memberships.map{|m| show_user m.user}.join(', ')
= link_to t('.invite'), new_invite_path(:id => @ordergroup), :remote => true, class: 'btn btn-primary'
- unless FoodsoftConfig[:disable_invite]
= link_to t('.invite'), new_invite_path(:id => @ordergroup), :remote => true, class: 'btn btn-primary'
.span8
%h2= t('.account_summary')
.well.well-small

View file

@ -22,8 +22,9 @@
- else
= @current_user.ordergroup.name
%td.right
= link_to t('.groups.invite'), new_invite_path(id: @current_user.ordergroup),
remote: true, class: 'btn btn-success btn-small'
- unless FoodsoftConfig[:disable_invite]
= link_to t('.groups.invite'), new_invite_path(id: @current_user.ordergroup),
remote: true, class: 'btn btn-success btn-small'
- if @current_user.workgroups.any?
%h3= User.human_attribute_name(:workgroup, count: 2)
%table.table.table-striped