diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-08 20:53:35 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-08 20:53:35 +0300 |
commit | 57a65ede77b7bbae6e3b2a7aa52135de7b0c2f8e (patch) | |
tree | 3f1d72a04c3deefb8a911d013e686b036541af60 /app/views | |
parent | 8589b4e137f50293952923bb07e2814257d7784d (diff) |
Improve application settings and write tests
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/application_settings/_form.html.haml | 44 | ||||
-rw-r--r-- | app/views/admin/application_settings/edit.html.haml | 5 | ||||
-rw-r--r-- | app/views/admin/application_settings/show.html.haml | 21 | ||||
-rw-r--r-- | app/views/layouts/devise.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/nav/_admin.html.haml | 5 |
5 files changed, 34 insertions, 45 deletions
diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 846d74d433d..5ca9585e9a9 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -5,25 +5,29 @@ - @application_setting.errors.full_messages.each do |msg| %p= msg - .form-group - = f.label :default_projects_limit, class: 'control-label' - .col-sm-10 - = f.number_field :default_projects_limit, class: 'form-control' - .form-group - = f.label :signup_enabled, class: 'control-label' - .col-sm-10 - = f.check_box :signup_enabled, class: 'checkbox' - .form-group - = f.label :signin_enabled, class: 'control-label' - .col-sm-10 - = f.check_box :signin_enabled, class: 'checkbox' - .form-group - = f.label :gravatar_enabled, class: 'control-label' - .col-sm-10 - = f.check_box :gravatar_enabled, class: 'checkbox' - .form-group - = f.label :sign_in_text, class: 'control-label' - .col-sm-10 - = f.text_area :sign_in_text, class: 'form-control' + %fieldset + %legend Features + .form-group + = f.label :signup_enabled, class: 'control-label' + .col-sm-10 + = f.check_box :signup_enabled, class: 'checkbox' + .form-group + = f.label :signin_enabled, class: 'control-label' + .col-sm-10 + = f.check_box :signin_enabled, class: 'checkbox' + .form-group + = f.label :gravatar_enabled, class: 'control-label' + .col-sm-10 + = f.check_box :gravatar_enabled, class: 'checkbox' + %fieldset + %legend Misc + .form-group + = f.label :default_projects_limit, class: 'control-label' + .col-sm-10 + = f.number_field :default_projects_limit, class: 'form-control' + .form-group + = f.label :sign_in_text, class: 'control-label' + .col-sm-10 + = f.text_area :sign_in_text, class: 'form-control' .form-actions = f.submit 'Save', class: 'btn btn-primary' diff --git a/app/views/admin/application_settings/edit.html.haml b/app/views/admin/application_settings/edit.html.haml deleted file mode 100644 index 62c0617ca4f..00000000000 --- a/app/views/admin/application_settings/edit.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%h1 Editing application_setting - -= render 'form' - -= link_to 'Back', admin_application_settings_path diff --git a/app/views/admin/application_settings/show.html.haml b/app/views/admin/application_settings/show.html.haml index 1c77886546d..39b66647a5a 100644 --- a/app/views/admin/application_settings/show.html.haml +++ b/app/views/admin/application_settings/show.html.haml @@ -1,18 +1,3 @@ -%table.table - %tr - %td Default projects limit: - %td= @application_setting.default_projects_limit - %tr - %td Signup enabled: - %td= @application_setting.signup_enabled - %tr - %td Signin enabled: - %td= @application_setting.signin_enabled - %tr - %td Gravatar enabled: - %td= @application_setting.gravatar_enabled - %tr - %td Sign in text: - %td= @application_setting.sign_in_text - -= link_to 'Edit', edit_admin_application_settings_path +%h3.page-title Application settings +%hr += render 'form' diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml index 8b3872e535d..857ebd9b8d9 100644 --- a/app/views/layouts/devise.html.haml +++ b/app/views/layouts/devise.html.haml @@ -25,8 +25,8 @@ Perform code reviews and enhance collaboration with merge requests. Each project can also have an issue tracker and a wiki. - - if extra_config.has_key?('sign_in_text') - = markdown(extra_config.sign_in_text) + - if extra_sign_in_text.present? + = markdown(extra_sign_in_text) %hr .container diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml index ea503a9cc2e..fdc517617e3 100644 --- a/app/views/layouts/nav/_admin.html.haml +++ b/app/views/layouts/nav/_admin.html.haml @@ -40,3 +40,8 @@ %span Background Jobs + = nav_link(controller: :application_settings) do + = link_to admin_application_settings_path do + %i.fa.fa-cogs + %span + Settings |