Commit 2e0a3734 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'improve/proper_form_classes' of /home/git/repositories/gitlab/gitlabhq

parents 89d0d75c b2152847
form {
@extend .form-horizontal;
 
.actions {
@extend .form-actions;
}
.clearfix {
@extend .control-group;
}
.input {
@extend .controls;
}
label {
@extend .control-label;
}
.xlarge {
@extend .input-xlarge;
}
.xxlarge {
@extend .input-xxlarge;
}
}
 
input {
......
......@@ -4,22 +4,22 @@
- if @group.errors.any?
.alert.alert-error
%span= @group.errors.full_messages.first
.clearfix.group_name_holder
.control-group.group_name_holder
= f.label :name do
Group name is
.input
= f.text_field :name, placeholder: "Example Group", class: "xxlarge"
.controls
= f.text_field :name, placeholder: "Example Group", class: "input-xxlarge"
 
.clearfix.group-description-holder
.control-group.group-description-holder
= f.label :description, "Details"
.input
= f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4
.controls
= f.text_area :description, maxlength: 250, class: "input-xxlarge js-gfm-input", rows: 4
 
.clearfix.group_name_holder
.control-group.group_name_holder
= f.label :path do
%span.cred Group path is
.input
= f.text_field :path, placeholder: "example-group", class: "xxlarge danger"
.controls
= f.text_field :path, placeholder: "example-group", class: "input-xxlarge danger"
%ul.cred
%li Changing group path can have unintended side effects.
%li Renaming group path will rename directory for all related projects
......
......@@ -4,15 +4,15 @@
- if @group.errors.any?
.alert.alert-error
%span= @group.errors.full_messages.first
.clearfix
.control-group
= f.label :name do
Group name is
.input
= f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
.clearfix.group-description-holder
.controls
= f.text_field :name, placeholder: "Ex. OpenSource", class: "input-xxlarge left"
.control-group.group-description-holder
= f.label :description, "Details"
.input
= f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4
.controls
= f.text_area :description, maxlength: 250, class: "input-xxlarge js-gfm-input", rows: 4
 
.form-actions
= f.submit 'Create group', class: "btn btn-create"
......
......@@ -10,9 +10,9 @@
.alert.alert-error
- @hook.errors.full_messages.each do |msg|
%p= msg
.clearfix
.control-group
= f.label :url, "URL:"
.input
.controls
= f.text_field :url, class: "text_field xxlarge input-xpadding"
 
= f.submit "Add System Hook", class: "btn btn-create"
......
......@@ -8,28 +8,28 @@
 
%fieldset
%legend Account
.clearfix
.control-group
= f.label :name
.input
.controls
= f.text_field :name, required: true, autocomplete: "off"
%span.help-inline * required
.clearfix
.control-group
= f.label :username
.input
.controls
= f.text_field :username, required: true, autocomplete: "off"
%span.help-inline * required
.clearfix
.control-group
= f.label :email
.input
.controls
= f.text_field :email, required: true, autocomplete: "off"
%span.help-inline * required
 
- if @user.new_record?
%fieldset
%legend Password
.clearfix
.control-group
= f.label :password
.input
.controls
%strong
A temporary password will be generated and sent to user.
%br
......@@ -37,33 +37,33 @@
- else
%fieldset
%legend Password
.clearfix
.control-group
= f.label :password
.input= f.password_field :password, disabled: f.object.force_random_password
.clearfix
.controls= f.password_field :password, disabled: f.object.force_random_password
.control-group
= f.label :password_confirmation
.input= f.password_field :password_confirmation, disabled: f.object.force_random_password
.controls= f.password_field :password_confirmation, disabled: f.object.force_random_password
 
%fieldset
%legend Access
.row
.span8
.clearfix
.control-group
= f.label :projects_limit
.input= f.number_field :projects_limit
.controls= f.number_field :projects_limit
 
.clearfix
.control-group
= f.label :can_create_group
.input= f.check_box :can_create_group
.controls= f.check_box :can_create_group
 
.clearfix
.control-group
= f.label :can_create_team
.input= f.check_box :can_create_team
.controls= f.check_box :can_create_team
 
.clearfix
.control-group
= f.label :admin do
%strong.cred Administrator
.input= f.check_box :admin
.controls= f.check_box :admin
.span4
- unless @user.new_record?
.alert.alert-error
......@@ -75,17 +75,17 @@
= link_to 'Block User', block_admin_user_path(@user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-small btn-remove"
%fieldset
%legend Profile
.clearfix
.control-group
= f.label :skype
.input= f.text_field :skype
.clearfix
.controls= f.text_field :skype
.control-group
= f.label :linkedin
.input= f.text_field :linkedin
.clearfix
.controls= f.text_field :linkedin
.control-group
= f.label :twitter
.input= f.text_field :twitter
.controls= f.text_field :twitter
 
.actions
.form-actions
- if @user.new_record?
= f.submit 'Create user', class: "btn btn-create"
= link_to 'Cancel', admin_users_path, class: "btn btn-cancel"
......
......@@ -6,14 +6,14 @@
group
 
%p 1. Choose users you want in the group
.clearfix
.control-group
= f.label :user_ids, "People"
.input= users_select_tag(:user_ids, multiple: true, class: 'input-large')
.controls= users_select_tag(:user_ids, multiple: true, class: 'input-large')
 
%p 2. Set access level for them
.clearfix
.control-group
= f.label :group_access, "Group Access"
.input= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen"
.controls= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen"
 
.form-actions
= f.submit 'Add users into group', class: "btn btn-create"
......
......@@ -26,16 +26,16 @@
- if @group.errors.any?
.alert.alert-error
%span= @group.errors.full_messages.first
.clearfix
.control-group
= f.label :name do
Group name is
.input
= f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
.controls
= f.text_field :name, placeholder: "Ex. OpenSource", class: "input-xxlarge left"
 
.clearfix.group-description-holder
.control-group.group-description-holder
= f.label :description, "Details"
.input
= f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4
.controls
= f.text_area :description, maxlength: 250, class: "input-xxlarge js-gfm-input", rows: 4
 
.form-actions
= f.submit 'Save group', class: "btn btn-save"
......
......@@ -2,19 +2,19 @@
- if @group.errors.any?
.alert.alert-error
%span= @group.errors.full_messages.first
.clearfix
.control-group
= f.label :name do
Group name is
.input
= f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
.controls
= f.text_field :name, placeholder: "Ex. OpenSource", class: "input-xxlarge left"
 
.clearfix.group-description-holder
.control-group.group-description-holder
= f.label :description, "Details"
.input
= f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4
.controls
= f.text_area :description, maxlength: 250, class: "input-xxlarge js-gfm-input", rows: 4
 
.clearfix
.input
.control-group
.controls
%ul
%li Group is kind of directory for several projects
%li All created groups are private
......
......@@ -27,15 +27,15 @@
- @user.errors.full_messages.each do |msg|
%li= msg
 
.clearfix
.control-group
= f.label :password
.input= f.password_field :password, required: true
.clearfix
.controls= f.password_field :password, required: true
.control-group
= f.label :password_confirmation
.input
.controls
= f.password_field :password_confirmation, required: true
.clearfix
.input
.control-group
.controls
= f.submit 'Save password', class: "btn btn-save"
 
 
......@@ -54,7 +54,7 @@
It can be used for atom feed or API
%p.cgray
- if current_user.private_token
= text_field_tag "token", current_user.private_token, class: "xxlarge large_text"
= text_field_tag "token", current_user.private_token, class: "input-xxlarge large_text"
= f.submit 'Reset', confirm: "Are you sure?", class: "btn btn-primary btn-build-token"
- else
%span You don`t have one yet. Click generate to fix it.
......@@ -70,7 +70,7 @@
= form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
.padded
= f.label :username
.input
.controls
= f.text_field :username, required: true
 
%span.loading-gif.hide= image_tag "ajax_loader.gif"
......@@ -83,7 +83,7 @@
%ul.cred
%li It will change web url for personal projects.
%li It will change the git path to repositories for personal projects.
.input
.controls
= f.submit 'Save username', class: "btn btn-save"
 
- if gitlab_config.signup_enabled
......
......@@ -6,18 +6,18 @@
- @key.errors.full_messages.each do |msg|
%li= msg
 
.clearfix
.control-group
= f.label :title
.input= f.text_field :title
.clearfix
.controls= f.text_field :title
.control-group
= f.label :key
.input
.controls
%p.light
Paste your public key here. Read more about how generate it #{link_to "here", help_ssh_path}
= f.text_area :key, class: [:xxlarge, :thin_area]
 
 
.actions
.form-actions
= f.submit 'Add key', class: "btn btn-create"
= link_to "Cancel", profile_keys_path, class: "btn btn-cancel"
 
......@@ -10,13 +10,13 @@
- @user.errors.full_messages.each do |msg|
%li= msg
 
.clearfix
.control-group
= f.label :password
.input= f.password_field :password, required: true
.clearfix
.controls= f.password_field :password, required: true
.control-group
= f.label :password_confirmation
.input
.controls
= f.password_field :password_confirmation, required: true
.clearfix
.input
.control-group
.controls
= f.submit 'Set new password', class: "btn btn-create"
......@@ -14,9 +14,9 @@
.pull-left
- if params[:to] && params[:from]
= link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'}
= text_field_tag :from, params[:from], placeholder: "master", class: "xlarge input-xpadding"
= text_field_tag :from, params[:from], placeholder: "master", class: "input-xlarge input-xpadding"
= "..."
= text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge input-xpadding"
= text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "input-xlarge input-xpadding"
.pull-left
 
= submit_tag "Compare", class: "btn btn-create commits-compare-btn"
......
......@@ -6,18 +6,18 @@
- @key.errors.full_messages.each do |msg|
%li= msg
 
.clearfix
.control-group
= f.label :title
.input= f.text_field :title
.clearfix
.controls= f.text_field :title
.control-group
= f.label :key
.input
.controls
= f.text_area :key, class: [:xxlarge, :thin_area]
%p.hint
Paste a machine public key here. Read more about how generate it
= link_to "here", help_ssh_path
 
.actions
.form-actions
= f.submit 'Create', class: "btn-create btn"
= link_to "Cancel", project_deploy_keys_path(@project), class: "btn btn-cancel"
 
......@@ -8,24 +8,24 @@
.form-holder
= form_for(@project, remote: true) do |f|
%fieldset
.clearfix.project_name_holder
.control-group.project_name_holder
= f.label :name do
Project name is
.input
.controls
= f.text_field :name, placeholder: "Example Project", class: "span5"
 
 
.clearfix
.control-group
= f.label :description do
Project description
%span.light (optional)
.input
.controls
= f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250
 
- if @project.repository.exists? && @project.repository.branch_names.any?
.clearfix
.control-group
= f.label :default_branch, "Default Branch"
.input= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'})
.controls= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'})
 
 
- if can?(current_user, :change_public_mode, @project)
......@@ -66,11 +66,11 @@
- if Project.issues_tracker.values.count > 1
.control-group
= f.label :issues_tracker, "Issues tracker", class: 'control-label'
.input= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled })
.controls= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled })
 
.clearfix
.control-group
= f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label'
.input= f.text_field :issues_tracker_id, disabled: !@project.can_have_issues_tracker_id?
.controls= f.text_field :issues_tracker_id, disabled: !@project.can_have_issues_tracker_id?
 
.control-group
= f.label :merge_requests_enabled, "Merge Requests", class: 'control-label'
......@@ -110,7 +110,7 @@
= f.label :namespace_id do
%span Namespace
.controls
.clearfix
.control-group
= f.select :namespace_id, namespaces_options(@project.namespace_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'}
%ul
%li Be careful. Changing project namespace can have unintended side effects
......@@ -130,7 +130,7 @@
= f.label :path do
%span Path
.controls
.clearfix
.control-group
= f.text_field :path
%ul
%li Be careful. Rename of project repo can have unintended side effects
......
......@@ -11,9 +11,9 @@
.alert.alert-error
- @hook.errors.full_messages.each do |msg|
%p= msg
.clearfix
.control-group
= f.label :url, "URL:"
.input
.controls
= f.text_field :url, class: "text_field xxlarge input-xpadding", placeholder: 'http://example.com/trigger-ci.json'
 
= f.submit "Add Web Hook", class: "btn btn-create"
......
......@@ -8,18 +8,18 @@
%br
.ui-box.ui-box-show
.ui-box-head
.clearfix
.control-group
= f.label :title do
%strong= "Subject *"
.input
= f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true
.controls
= f.text_field :title, maxlength: 255, class: "input-xxlarge js-gfm-input", autofocus: true, required: true
.ui-box-body
.clearfix
.control-group
.issue_assignee.pull-left
= f.label :assignee_id do
%i.icon-user
Assign to
.input
.controls
.pull-left
= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'})
.pull-right
......@@ -29,25 +29,25 @@
= f.label :milestone_id do
%i.icon-time
Milestone
.input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
.controls= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
 
.ui-box-bottom
.clearfix
.control-group
= f.label :label_list do
%i.icon-tag
Labels
.input
= f.text_field :label_list, maxlength: 2000, class: "xxlarge"
.controls
= f.text_field :label_list, maxlength: 2000, class: "input-xxlarge"
%p.hint Separate labels with commas.
 
.clearfix
.control-group
= f.label :description, "Details"
.input
= f.text_area :description, class: "xxlarge js-gfm-input", rows: 14
.controls
= f.text_area :description, class: "input-xxlarge js-gfm-input", rows: 14
%p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
 
 
.actions
.form-actions
- if @issue.new_record?
= f.submit 'Submit new issue', class: "btn btn-create"
-else
......
......@@ -31,21 +31,21 @@
%i.icon-paper-clip
Details
.merge-request-form-info
.clearfix
.control-group
= f.label :title do
%strong= "Title *"
.input= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true
.clearfix
.controls= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true
.control-group
.left
= f.label :assignee_id do
%i.icon-user
Assign to
.input= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'})
.controls= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'})
.left
= f.label :milestone_id do
%i.icon-time
Milestone
.input= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
.controls= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'})
 
 
.form-actions
......
......@@ -26,7 +26,7 @@
.span6
.control-group
= f.label :due_date, "Due Date", class: "control-label"
.input= f.hidden_field :due_date
.controls= f.hidden_field :due_date
.controls
.datepicker
 
......
......@@ -15,7 +15,7 @@
.control-group
= label_tag :search , "Looking for commit:", class: 'control-label light'
.controls
= text_field_tag :q, @options[:q], placeholder: "Input SHA", class: "search-input xlarge"
= text_field_tag :q, @options[:q], placeholder: "Input SHA", class: "search-input input-xlarge"
= button_tag type: 'submit', class: 'btn vtop' do
%i.icon-search
- @options.each do |key, value|
......
......@@ -3,36 +3,36 @@
= render 'projects/errors'
.project-edit-content
= form_for @project, remote: true do |f|