Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ gem 'jquery-turbolinks'

gem 'addressable'
gem 'bootstrap-sass', '~> 3.0'
gem 'bootstrap_form'
gem 'font-awesome-rails', '~> 4.2'
gem 'gitlab_emoji', '~> 0.1'
gem 'gon', '~> 5.0.0'
Expand Down
5 changes: 2 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ GEM
bootstrap-sass (3.3.4.1)
autoprefixer-rails (>= 5.0.0.1)
sass (>= 3.2.19)
bootstrap_form (2.3.0)
brakeman (3.0.1)
erubis (~> 2.6)
fastercsv (~> 1.5)
Expand Down Expand Up @@ -749,6 +750,7 @@ DEPENDENCIES
better_errors
binding_of_caller
bootstrap-sass (~> 3.0)
bootstrap_form
brakeman
browser (~> 0.8.0)
byebug
Expand Down Expand Up @@ -875,6 +877,3 @@ DEPENDENCIES
virtus
webmock (~> 1.21.0)
wikicloth (= 0.8.1)

BUNDLED WITH
1.10.5
2 changes: 1 addition & 1 deletion app/assets/javascripts/admin.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class @Admin

$('body').on 'click', '.js-toggle-colors-link', (e) ->
e.preventDefault()
$('.js-toggle-colors-link').hide()
$('.js-toggle-colors-link').parents('.form-group').hide()
$('.js-toggle-colors-container').show()

$('input#broadcast_message_color').on 'input', ->
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*= require_self
*= require dropzone/basic
*= require cal-heatmap
*= require rails_bootstrap_forms
*/


Expand Down
31 changes: 19 additions & 12 deletions app/assets/stylesheets/base/gl_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,13 @@ $pagination-disabled-border: transparent;
//
//## Define colors for form feedback states and, by default, alerts.

$state-success-text: #fff;
$state-success-bg: $brand-success;
$state-success-border: $brand-success;
$state-success-text: $brand-success;

$state-info-text: #fff;
$state-info-bg: $brand-info;
$state-info-border: $brand-info;
$state-info-text: $brand-info;

$state-warning-text: #fff;
$state-warning-bg: $brand-warning;
$state-warning-border: $brand-warning;
$state-warning-text: $brand-warning;

$state-danger-text: #fff;
$state-danger-bg: $brand-danger;
$state-danger-border: $brand-danger;
$state-danger-text: $brand-danger;


//== Alerts
Expand All @@ -104,6 +96,21 @@ $state-danger-border: $brand-danger;

$alert-border-radius: 0;

$alert-success-text: #fff;
$alert-success-bg: $brand-success;
$alert-success-border: $brand-success;

$alert-info-text: #fff;
$alert-info-bg: $brand-info;
$alert-info-border: $brand-info;

$alert-warning-text: #fff;
$alert-warning-bg: $brand-warning;
$alert-warning-border: $brand-warning;

$alert-danger-text: #fff;
$alert-danger-bg: $brand-danger;
$alert-danger-border: $brand-danger;

//== Panels
//
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/generic/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ label {
&.inline-label {
margin: 0;
}

&.required:after {
content:" *";
}
}

.inline-input-group {
Expand Down
107 changes: 25 additions & 82 deletions app/views/admin/application_settings/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
= form_for @application_setting, url: admin_application_settings_path, html: { class: 'form-horizontal fieldset-form' } do |f|
- if @application_setting.errors.any?
#error_explanation
.alert.alert-danger
- @application_setting.errors.full_messages.each do |msg|
%p= msg
= bootstrap_form_for @application_setting, url: admin_application_settings_path, layout: :horizontal, html: { class: 'fieldset-form' } do |f|
= f.alert_message 'Please check your form for possible errors.'

%fieldset
%legend Visibility and Access Controls
.form-group
= f.label :default_branch_protection, class: 'control-label col-sm-2'
.col-sm-10
= f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control'
= f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection)
.form-group.project-visibility-level-holder
= f.label :default_project_visibility, class: 'control-label col-sm-2'
.col-sm-10
Expand All @@ -27,83 +20,33 @@
- restricted_level_checkboxes('restricted-visibility-help').each do |level|
= level
%span.help-block#restricted-visibility-help Selected levels cannot be used by non-admin users for projects or snippets
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :version_check_enabled do
= f.check_box :version_check_enabled
Version check enabled
= f.form_group :version_check_enabled do
= f.check_box :version_check_enabled

%fieldset
%legend Account and Limit Settings
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :gravatar_enabled do
= f.check_box :gravatar_enabled
Gravatar enabled
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :twitter_sharing_enabled do
= f.check_box :twitter_sharing_enabled, :'aria-describedby' => 'twitter_help_block'
Twitter enabled
%span.help-block#twitter_help_block Show users a button to share their newly created public or internal projects on twitter
.form-group
= f.label :default_projects_limit, class: 'control-label col-sm-2'
.col-sm-10
= f.number_field :default_projects_limit, class: 'form-control'
.form-group
= f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'control-label col-sm-2'
.col-sm-10
= f.number_field :max_attachment_size, class: 'form-control'
.form-group
= f.label :session_expire_delay, 'Session duration (minutes)', class: 'control-label col-sm-2'
.col-sm-10
= f.number_field :session_expire_delay, class: 'form-control'
%span.help-block#session_expire_delay_help_block GitLab restart is required to apply changes
.form-group
= f.label :user_oauth_applications, 'User OAuth applications', class: 'control-label col-sm-2'
.col-sm-10
.checkbox
= f.label :user_oauth_applications do
= f.check_box :user_oauth_applications
Allow users to register any application to use GitLab as an OAuth provider
= f.form_group :gravatar_enabled do
= f.check_box :gravatar_enabled
= f.form_group :twitter_sharing_enabled, help: 'Show users a button to share their newly created public or internal projects on twitter' do
= f.check_box :twitter_sharing_enabled, label: 'Twitter enabled'
= f.number_field :default_projects_limit
= f.number_field :max_attachment_size, label: 'Maximum attachment size (MB)'
= f.number_field :session_expire_delay, label: 'Session duration (minutes)', help: 'GitLab restart is required to apply changes'
= f.form_group :user_oauth_applications, help: 'Allow users to register any application to use GitLab as an OAuth provider' do
= f.check_box :user_oauth_applications, label: 'User OAuth applications'

%fieldset
%legend Sign-in Restrictions
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :signup_enabled do
= f.check_box :signup_enabled
Sign-up enabled
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :signin_enabled do
= f.check_box :signin_enabled
Sign-in enabled
.form-group
= f.label :restricted_signup_domains, 'Restricted domains for sign-ups', class: 'control-label col-sm-2'
.col-sm-10
= f.text_area :restricted_signup_domains_raw, placeholder: 'domain.com', class: 'form-control'
.help-block Only users with e-mail addresses that match these domain(s) will be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com
.form-group
= f.label :home_page_url, class: 'control-label col-sm-2'
.col-sm-10
= f.text_field :home_page_url, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'home_help_block'
%span.help-block#home_help_block We will redirect non-logged in users to this page
.form-group
= f.label :after_sign_out_path, class: 'control-label col-sm-2'
.col-sm-10
= f.text_field :after_sign_out_path, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'after_sign_out_path_help_block'
%span.help-block#after_sign_out_path_help_block We will redirect users to this page after they sign out
.form-group
= f.label :sign_in_text, class: 'control-label col-sm-2'
.col-sm-10
= f.text_area :sign_in_text, class: 'form-control', rows: 4
.help-block Markdown enabled
= f.form_group :signup_enabled do
= f.check_box :signup_enabled, label: 'Sign-up enabled'
= f.form_group :signin_enabled do
= f.check_box :signin_enabled, label: 'Sign-in enabled'
= f.text_area :restricted_signup_domains_raw, placeholder: 'domain.com',
label: 'Restricted domains for sign-ups',
help: 'Only users with e-mail addresses that match these domain(s) will be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com'
= f.text_field :home_page_url, placeholder: 'http://company.example.com', help: 'We will redirect non-logged in users to this page'
= f.text_field :after_sign_out_path, placeholder: 'http://company.example.com', help: 'We will redirect users to this page after they sign out'
= f.text_area :sign_in_text, rows: 4, help: 'Markdown enabled'

.form-actions
= f.submit 'Save', class: 'btn btn-primary'
= f.primary 'Save'
7 changes: 3 additions & 4 deletions app/views/admin/applications/_delete_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- submit_btn_css ||= 'btn btn-link btn-remove btn-sm'
= form_tag admin_application_path(application) do
%input{:name => "_method", :type => "hidden", :value => "delete"}/
= submit_tag 'Destroy', onclick: "return confirm('Are you sure?')", class: submit_btn_css
- submit_btn_css ||= 'btn btn-remove btn-sm'
= bootstrap_form_tag url: admin_application_path(application), method: 'delete' do |f|
= f.submit 'Destroy', onclick: "return confirm('Are you sure?')", class: submit_btn_css
33 changes: 8 additions & 25 deletions app/views/admin/applications/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
= form_for [:admin, @application], url: @url, html: {class: 'form-horizontal', role: 'form'} do |f|
- if application.errors.any?
.alert.alert-danger
%button{ type: "button", class: "close", "data-dismiss" => "alert"} ×
- application.errors.full_messages.each do |msg|
%p= msg
= content_tag :div, class: 'form-group' do
= f.label :name, class: 'col-sm-2 control-label'
.col-sm-10
= f.text_field :name, class: 'form-control'
= doorkeeper_errors_for application, :name
= content_tag :div, class: 'form-group' do
= f.label :redirect_uri, class: 'col-sm-2 control-label'
.col-sm-10
= f.text_area :redirect_uri, class: 'form-control'
= doorkeeper_errors_for application, :redirect_uri
%span.help-block
Use one line per URI
- if Doorkeeper.configuration.native_redirect_uri
%span.help-block
Use
%code= Doorkeeper.configuration.native_redirect_uri
for local tests
= bootstrap_form_for [:admin, @application], url: @url, layout: :horizontal do |f|
= f.alert_message 'Please check your form for possible errors.'

= f.text_field :name
= f.text_area :redirect_uri, help: 'Use one line per URI'

.form-actions
= f.submit 'Submit', class: "btn btn-primary wide"
= link_to "Cancel", admin_applications_path, class: "btn btn-default"
= f.primary 'Submit'
= link_to 'Cancel', admin_applications_path, class: 'btn btn-default'
42 changes: 13 additions & 29 deletions app/views/admin/broadcast_messages/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,20 @@
%i.fa.fa-bullhorn
%span Your message here

= form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form form-horizontal'} do |f|
-if @broadcast_message.errors.any?
.alert.alert-danger
- @broadcast_message.errors.full_messages.each do |msg|
%p= msg
.form-group
= f.label :message, class: 'control-label'
.col-sm-10
= f.text_area :message, class: "form-control", rows: 2, required: true
%div
= link_to '#', class: 'js-toggle-colors-link' do
Customize colors
.form-group.js-toggle-colors-container.hide
= f.label :color, "Background Color", class: 'control-label'
.col-sm-10
= f.color_field :color, value: "#eb9532", class: "form-control"
.form-group.js-toggle-colors-container.hide
= f.label :font, "Font Color", class: 'control-label'
.col-sm-10
= f.color_field :font, value: "#FFFFFF", class: "form-control"
.form-group
= f.label :starts_at, class: 'control-label'
.col-sm-10.datetime-controls
= f.datetime_select :starts_at
.form-group
= f.label :ends_at, class: 'control-label'
.col-sm-10.datetime-controls
= f.datetime_select :ends_at
= bootstrap_form_for [:admin, @broadcast_message], layout: :horizontal do |f|
= f.alert_message 'Please check your form for possible errors.'

= f.text_area :message, required: true
= f.static_control label: 'Colors' do
= link_to 'Customize colors', '#', class: 'js-toggle-colors-link'
.js-toggle-colors-container.hide
= f.color_field :color, value: '#eb9532'
= f.color_field :font, value: '#FFFFFF'
= f.datetime_select :starts_at
= f.datetime_select :ends_at

.form-actions
= f.submit "Add broadcast message", class: "btn btn-create"
= f.submit 'Add broadcast message', class: 'btn btn-create'

-if @broadcast_messages.any?
%ul.bordered-list.broadcast-messages
Expand Down
25 changes: 6 additions & 19 deletions app/views/admin/deploy_keys/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,12 @@
%hr

%div
= form_for [:admin, @deploy_key], html: { class: 'deploy-key-form form-horizontal' } do |f|
-if @deploy_key.errors.any?
.alert.alert-danger
%ul
- @deploy_key.errors.full_messages.each do |msg|
%li= msg
= bootstrap_form_for [:admin, @deploy_key], layout: :horizontal, html: { class: 'deploy-key-form' } do |f|
= f.alert_message 'Please check your form for possible errors.'

.form-group
= f.label :title, class: "control-label"
.col-sm-10= f.text_field :title, class: 'form-control'
.form-group
= f.label :key, class: "control-label"
.col-sm-10
%p.light
Paste a machine public key here. Read more about how to generate it
= link_to "here", help_page_path("ssh", "README")
= f.text_area :key, class: "form-control thin_area", rows: 5
= f.text_field :title
= f.text_area :key, rows: 5, help: 'Paste a machine public key here. Read more about how to generate it on ssh doc.'

.form-actions
= f.submit 'Create', class: "btn-create btn"
= link_to "Cancel", admin_deploy_keys_path, class: "btn btn-cancel"

= f.submit 'Create', class: 'btn-create btn'
= link_to 'Cancel', admin_deploy_keys_path, class: 'btn btn-cancel'
28 changes: 12 additions & 16 deletions app/views/admin/groups/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
= form_for [:admin, @group], html: { class: "form-horizontal" } do |f|
- if @group.errors.any?
.alert.alert-danger
%span= @group.errors.full_messages.first
= bootstrap_form_for [:admin, @group], layout: :horizontal do |f|
= f.alert_message 'Please check your form for possible errors.'

= render 'shared/group_form', f: f

.form-group.group-description-holder
= f.label :avatar, "Group avatar", class: 'control-label'
.col-sm-10
= render 'shared/choose_group_avatar_button', f: f
= f.form_group :avatar, label: { text: 'Group avatar' } do
= render 'shared/choose_group_avatar_button', f: f

- if @group.new_record?
.form-group
.col-sm-offset-2.col-sm-10
.alert.alert-info
= render 'shared/group_tips'
= f.form_group do
.alert.alert-info
= render 'shared/group_tips'

.form-actions
= f.submit 'Create group', class: "btn btn-create"
= link_to 'Cancel', admin_groups_path, class: "btn btn-cancel"
= f.submit 'Create group', class: 'btn btn-create'
= link_to 'Cancel', admin_groups_path, class: 'btn btn-cancel'

- else
.form-actions
= f.submit 'Save changes', class: "btn btn-primary"
= link_to 'Cancel', admin_group_path(@group), class: "btn btn-cancel"
= f.primary 'Save changes'
= link_to 'Cancel', admin_group_path(@group), class: 'btn btn-cancel'

Loading