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

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|
.clearfix.project_name_holder
.control-group.project_name_holder
= f.label :name do
Project name is
.input
= f.text_field :name, placeholder: "Example Project", class: "xxlarge", tabindex: 1, autofocus: true
.controls
= f.text_field :name, placeholder: "Example Project", class: "input-xxlarge", tabindex: 1, autofocus: true
- if current_user.can_select_namespace?
.clearfix
.control-group
= f.label :namespace_id do
%span Namespace
.input
.controls
= f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen', tabindex: 2}
.clearfix
.input
.control-group
.controls
= link_to "#", class: 'appear-link' do
%i.icon-upload-alt
%span Import existing repository?
.clearfix.appear-data.import-url-data
.control-group.appear-data.import-url-data
= f.label :import_url do
%span Import existing repo
.input
.controls
= f.text_field :import_url, class: 'xlarge', placeholder: 'https://github.com/randx/six.git'
.light
URL must be cloneable
.clearfix
.control-group
= f.label :description do
Description
%span.light (optional)
.input
.controls
= f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250, tabindex: 3
%p.padded
......@@ -42,7 +42,7 @@
- if current_user.can_create_group?
.pull-right
.input.light
.controls.light
Need a group for several dependent projects?
= link_to new_group_path, class: "btn btn-tiny" do
Create a group
......
......@@ -9,16 +9,16 @@
- @snippet.errors.full_messages.each do |msg|
%li= msg
.clearfix
.control-group
= f.label :title
.input= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true
.clearfix
.controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true
.control-group
= f.label "Lifetime"
.input= f.select :expires_at, lifetime_select_options, {}, {class: 'chosen span2'}
.clearfix
.controls= f.select :expires_at, lifetime_select_options, {}, {class: 'chosen span2'}
.control-group
.file-editor
= f.label :file_name, "File"
.input
.controls
.file-holder.snippet
.file-title
= f.text_field :file_name, placeholder: "example.rb", class: 'snippet-file-name', required: true
......
......@@ -9,16 +9,16 @@
%li= msg
%h6 1. Choose people you want in the team
.clearfix
.control-group
= f.label :user_ids, "People"
.input
.controls
= users_select_tag(:user_ids, multiple: true)
%h6 2. Set access level for them
.clearfix
.control-group
= f.label :project_access, "Project Access"
.input= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen"
.controls= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen"
.actions
.form-actions
= f.submit 'Add users', class: "btn btn-create"
= link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel"
......@@ -6,9 +6,9 @@
= form_tag apply_import_project_team_members_path(@project), method: 'post' do
.padded
= label_tag :source_project_id, "Project"
.input= select_tag(:source_project_id, options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace), prompt: "Select project", class: "chosen xxlarge", required: true)
.controls= select_tag(:source_project_id, options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace), prompt: "Select project", class: "chosen xxlarge", required: true)
.actions
.form-actions
= submit_tag 'Import project members', class: "btn btn-create"
= link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel"
......@@ -15,7 +15,7 @@
= f.select :format, options_for_select(GollumWiki::MARKUPS, {selected: @wiki.format}), {}, class: "pull-right input-medium"
= f.label :format, class: "pull-right", style: "padding-right: 20px;"
.ui-box-body
.input
.controls
%span.cgray
Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
To link to a (new) page you can just type
......@@ -24,11 +24,11 @@
.ui-box-bottom
= f.label :content
.input= f.text_area :content, class: 'span8 js-gfm-input'
.controls= f.text_area :content, class: 'span8 js-gfm-input'
.ui-box-bottom
= f.label :commit_message
.input= f.text_field :message, class: 'span8'
.actions
.controls= f.text_field :message, class: 'span8'
.form-actions
- if @wiki && @wiki.persisted?
= f.submit 'Save changes', class: "btn-save btn"
= link_to "Cancel", project_wiki_path(@project, @wiki), class: "btn btn-cancel"
......
......@@ -7,7 +7,7 @@
.pull-right
= form_tag public_projects_path, method: :get, class: 'form-inline' do |f|
.search-holder
.input
.controls
= search_field_tag :search, params[:search], placeholder: "gitlab-ci", class: "span3 search-text-input", id: "projects_search"
= submit_tag 'Search', class: "btn btn-primary wide"
......
......@@ -2,7 +2,7 @@
.search-holder
= label_tag :search do
%span Looking for
.input
.controls
= search_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge search-text-input", id: "dashboard_search"
= hidden_field_tag :project_id, params[:project_id]
= hidden_field_tag :group_id, params[:group_id]
......
......@@ -9,16 +9,16 @@
- @snippet.errors.full_messages.each do |msg|
%li= msg
.clearfix
.control-group
= f.label :title
.input= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true
.clearfix
.controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true
.control-group
= f.label "Private?"
.input= f.check_box :private, {class: ''}
.clearfix
.controls= f.check_box :private, {class: ''}
.control-group
.file-editor
= f.label :file_name, "File"
.input
.controls
.file-holder.snippet
.file-title
= f.text_field :file_name, placeholder: "example.rb", class: 'snippet-file-name', required: true
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment