add foodcoop configuration screen
This commit is contained in:
parent
dd3ac0971c
commit
7b000c39eb
20 changed files with 562 additions and 12 deletions
10
app/views/admin/configs/_tab_foodcoop.html.haml
Normal file
10
app/views/admin/configs/_tab_foodcoop.html.haml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
= config_input form, :name, required: true, input_html: {class: 'input-xlarge'}
|
||||
= form.fields_for :contact do |c|
|
||||
= config_input c, :street, input_html: {class: 'input-xlarge'}
|
||||
.fold-line
|
||||
= config_input c, :zip_code, input_html: {class: 'input-mini'}
|
||||
= config_input c, :city, input_html: {class: 'input-medium'}
|
||||
= config_input c, :country, as: :string, input_html: {class: 'input-xlarge'}
|
||||
= config_input c, :email, required: true, input_html: {class: 'input-xlarge'}
|
||||
= config_input c, :phone, input_html: {class: 'input-medium'}
|
||||
= config_input form, :homepage, required: true, as: :url, input_html: {class: 'input-xlarge'}
|
||||
3
app/views/admin/configs/_tab_language.html.haml
Normal file
3
app/views/admin/configs/_tab_language.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
= config_input form, :default_locale,
|
||||
collection: I18n.available_locales.map {|l| [t("simple_form.options.settings.profile.language.#{l}"), l]}
|
||||
= config_input form, :ignore_browser_locale, as: :boolean
|
||||
7
app/views/admin/configs/_tab_layout.html.haml
Normal file
7
app/views/admin/configs/_tab_layout.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
= config_input form, :page_footer, as: :text, input_html: {class: 'input-xxlarge', rows: 2, placeholder: "#{link_to(FoodsoftConfig[:name], FoodsoftConfig[:homepage])}"}
|
||||
|
||||
%h4= t '.pdf_title'
|
||||
.fold-line
|
||||
= config_input form, :pdf_font_size, as: :integer, input_html: {class: 'input-mini'}
|
||||
= config_input form, :pdf_page_size, input_html: {class: 'input-medium'}
|
||||
= config_input form, :pdf_add_page_breaks, as: :boolean
|
||||
7
app/views/admin/configs/_tab_messages.html.haml
Normal file
7
app/views/admin/configs/_tab_messages.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
%fieldset
|
||||
%label
|
||||
%h4= t '.emails_title'
|
||||
= config_input form, :email_from, as: :string, input_html: {class: 'input-xlarge', placeholder: "#{@cfg[:name]} <#{@cfg[:contact][:email]}>"}
|
||||
= config_input form, :email_replyto, as: :string, input_html: {class: 'input-xlarge'}
|
||||
-# sender is better configured by server administrator, since it affects SPF records
|
||||
-#= config_input form, :email_sender, as: :string, input_html: {class: 'input-xlarge'}
|
||||
5
app/views/admin/configs/_tab_others.html.haml
Normal file
5
app/views/admin/configs/_tab_others.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
- if defined? FoodsoftWiki # avoid requiring deface here (the single exception)
|
||||
= 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, :help_url, as: :url, input_html: {class: 'input-xlarge'}
|
||||
12
app/views/admin/configs/_tab_payment.html.haml
Normal file
12
app/views/admin/configs/_tab_payment.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
= config_input form, :price_markup do
|
||||
.input-append
|
||||
= config_input_field form, :price_markup, as: :decimal, class: 'input-mini'
|
||||
%span.add-on %
|
||||
= config_input form, :tax_default do
|
||||
.input-append
|
||||
= config_input_field form, :tax_default, as: :decimal, class: 'input-mini'
|
||||
%span.add-on %
|
||||
= config_input form, :minimum_balance do
|
||||
.input-prepend
|
||||
%span.add-on= t 'number.currency.format.unit'
|
||||
= config_input_field form, :minimum_balance, as: :decimal, class: 'input-small'
|
||||
3
app/views/admin/configs/_tab_tasks.html.haml
Normal file
3
app/views/admin/configs/_tab_tasks.html.haml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
-#= config_use_heading form, :use_tasks do
|
||||
= config_use_heading form, :use_apple_points do
|
||||
= config_input form, :stop_ordering_under, as: :numeric, input_html: {class: 'input-small'}
|
||||
11
app/views/admin/configs/_tabs.html.haml
Normal file
11
app/views/admin/configs/_tabs.html.haml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
%ul.nav.nav-tabs.nav-tabs-with-heading
|
||||
%li.heading
|
||||
%h1= t '.title'
|
||||
|
||||
- for tab in @tabs
|
||||
- url = action_name == 'show' ? nil : admin_config_path(tab: tab)
|
||||
%li{class: ('active' if @current_tab==tab)}= link_to t("config.tabs.#{tab}"), "#{url}#tab-#{tab}", data: ({toggle: 'tab'} unless url)
|
||||
|
||||
-# make this a button to give some indicator that navigation away might lose changes
|
||||
%li.pull-right{class: ('active' if @current_tab=='list')}
|
||||
= link_to t('config.tabs.list'), list_admin_config_path, class: ('btn' unless @current_tab=='list')
|
||||
16
app/views/admin/configs/list.html.haml
Normal file
16
app/views/admin/configs/list.html.haml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
- title t('.title'), false
|
||||
|
||||
= render 'tabs'
|
||||
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.key'
|
||||
%th= t '.value'
|
||||
%tbody
|
||||
- @keys.each do |key|
|
||||
%tr
|
||||
%td
|
||||
%tt= key
|
||||
%td{style: if @cfg[key] != @dfl[key] then 'font-weight: bold' end}
|
||||
= show_config_value key, @cfg[key]
|
||||
13
app/views/admin/configs/show.html.haml
Normal file
13
app/views/admin/configs/show.html.haml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
- title t('admin.configs.tabs.title'), false
|
||||
|
||||
= simple_form_for :config, method: :patch do |f|
|
||||
|
||||
= render 'tabs', url: nil
|
||||
|
||||
.tab-content
|
||||
- for tab in @tabs
|
||||
.tab-pane{class: ('active' if @current_tab==tab), id: "tab-#{tab}"}= render "tab_#{tab}", form: f
|
||||
|
||||
.form-actions
|
||||
= f.submit t('.submit'), class: 'btn btn-primary'
|
||||
|
||||
|
|
@ -10,9 +10,9 @@
|
|||
%li= link_to t('.profile'), my_profile_path
|
||||
%li= link_to t('.ordergroup'), my_ordergroup_path
|
||||
%li= link_to t('.logout'), logout_path
|
||||
%li{class: ('disabled' if FoodsoftConfig.config[:homepage].blank?)}
|
||||
= link_to FoodsoftConfig.config[:name], FoodsoftConfig.config[:homepage]
|
||||
%li= link_to t('.help'), FoodsoftConfig.config[:help_url]
|
||||
%li{class: ('disabled' if FoodsoftConfig[:homepage].blank?)}
|
||||
= link_to FoodsoftConfig[:name], FoodsoftConfig[:homepage]
|
||||
%li= link_to t('.help'), FoodsoftConfig[:help_url]
|
||||
%li= link_to t('.feedback.title'), new_feedback_path, title: t('.feedback.desc')
|
||||
.clearfix
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue