Commit c52f9e1a32e76ae7ea48a939baf162e20de67a82

Authored by Dmitriy Zaporozhets
1 parent a3b0dc2e

use control-group classes for inline forms in project new/edit pages

app/views/profiles/keys/_form.html.haml
@@ -6,12 +6,12 @@ @@ -6,12 +6,12 @@
6 - @key.errors.full_messages.each do |msg| 6 - @key.errors.full_messages.each do |msg|
7 %li= msg 7 %li= msg
8 8
9 - .clearfix 9 + .control-group
10 = f.label :title 10 = f.label :title
11 - .input= f.text_field :title  
12 - .clearfix 11 + .controls= f.text_field :title
  12 + .control-group
13 = f.label :key 13 = f.label :key
14 - .input 14 + .controls
15 %p.light 15 %p.light
16 Paste your public key here. Read more about how generate it #{link_to "here", help_ssh_path} 16 Paste your public key here. Read more about how generate it #{link_to "here", help_ssh_path}
17 = f.text_area :key, class: [:xxlarge, :thin_area] 17 = f.text_area :key, class: [:xxlarge, :thin_area]
app/views/projects/edit.html.haml
@@ -8,24 +8,24 @@ @@ -8,24 +8,24 @@
8 .form-holder 8 .form-holder
9 = form_for(@project, remote: true) do |f| 9 = form_for(@project, remote: true) do |f|
10 %fieldset 10 %fieldset
11 - .clearfix.project_name_holder 11 + .control-group.project_name_holder
12 = f.label :name do 12 = f.label :name do
13 Project name is 13 Project name is
14 - .input 14 + .controls
15 = f.text_field :name, placeholder: "Example Project", class: "span5" 15 = f.text_field :name, placeholder: "Example Project", class: "span5"
16 16
17 17
18 - .clearfix 18 + .control-group
19 = f.label :description do 19 = f.label :description do
20 Project description 20 Project description
21 %span.light (optional) 21 %span.light (optional)
22 - .input 22 + .controls
23 = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250 23 = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250
24 24
25 - if @project.repository.exists? && @project.repository.branch_names.any? 25 - if @project.repository.exists? && @project.repository.branch_names.any?
26 - .clearfix 26 + .control-group
27 = f.label :default_branch, "Default Branch" 27 = f.label :default_branch, "Default Branch"
28 - .input= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'}) 28 + .controls= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'})
29 29
30 30
31 - if can?(current_user, :change_public_mode, @project) 31 - if can?(current_user, :change_public_mode, @project)
@@ -66,11 +66,11 @@ @@ -66,11 +66,11 @@
66 - if Project.issues_tracker.values.count > 1 66 - if Project.issues_tracker.values.count > 1
67 .control-group 67 .control-group
68 = f.label :issues_tracker, "Issues tracker", class: 'control-label' 68 = f.label :issues_tracker, "Issues tracker", class: 'control-label'
69 - .input= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled }) 69 + .controls= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled })
70 70
71 - .clearfix 71 + .control-group
72 = f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label' 72 = f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label'
73 - .input= f.text_field :issues_tracker_id, disabled: !@project.can_have_issues_tracker_id? 73 + .controls= f.text_field :issues_tracker_id, disabled: !@project.can_have_issues_tracker_id?
74 74
75 .control-group 75 .control-group
76 = f.label :merge_requests_enabled, "Merge Requests", class: 'control-label' 76 = f.label :merge_requests_enabled, "Merge Requests", class: 'control-label'
@@ -110,7 +110,7 @@ @@ -110,7 +110,7 @@
110 = f.label :namespace_id do 110 = f.label :namespace_id do
111 %span Namespace 111 %span Namespace
112 .controls 112 .controls
113 - .clearfix 113 + .control-group
114 = f.select :namespace_id, namespaces_options(@project.namespace_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'} 114 = f.select :namespace_id, namespaces_options(@project.namespace_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'}
115 %ul 115 %ul
116 %li Be careful. Changing project namespace can have unintended side effects 116 %li Be careful. Changing project namespace can have unintended side effects
@@ -130,7 +130,7 @@ @@ -130,7 +130,7 @@
130 = f.label :path do 130 = f.label :path do
131 %span Path 131 %span Path
132 .controls 132 .controls
133 - .clearfix 133 + .control-group
134 = f.text_field :path 134 = f.text_field :path
135 %ul 135 %ul
136 %li Be careful. Rename of project repo can have unintended side effects 136 %li Be careful. Rename of project repo can have unintended side effects
app/views/projects/new.html.haml
@@ -3,36 +3,36 @@ @@ -3,36 +3,36 @@
3 = render 'projects/errors' 3 = render 'projects/errors'
4 .project-edit-content 4 .project-edit-content
5 = form_for @project, remote: true do |f| 5 = form_for @project, remote: true do |f|
6 - .clearfix.project_name_holder 6 + .control-group.project_name_holder
7 = f.label :name do 7 = f.label :name do
8 Project name is 8 Project name is
9 - .input 9 + .controls
10 = f.text_field :name, placeholder: "Example Project", class: "xxlarge", tabindex: 1, autofocus: true 10 = f.text_field :name, placeholder: "Example Project", class: "xxlarge", tabindex: 1, autofocus: true
11 11
12 - if current_user.can_select_namespace? 12 - if current_user.can_select_namespace?
13 - .clearfix 13 + .control-group
14 = f.label :namespace_id do 14 = f.label :namespace_id do
15 %span Namespace 15 %span Namespace
16 - .input 16 + .controls
17 = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen', tabindex: 2} 17 = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen', tabindex: 2}
18 18
19 - .clearfix  
20 - .input 19 + .control-group
  20 + .controls
21 = link_to "#", class: 'appear-link' do 21 = link_to "#", class: 'appear-link' do
22 %i.icon-upload-alt 22 %i.icon-upload-alt
23 %span Import existing repository? 23 %span Import existing repository?
24 - .clearfix.appear-data.import-url-data 24 + .control-group.appear-data.import-url-data
25 = f.label :import_url do 25 = f.label :import_url do
26 %span Import existing repo 26 %span Import existing repo
27 - .input 27 + .controls
28 = f.text_field :import_url, class: 'xlarge', placeholder: 'https://github.com/randx/six.git' 28 = f.text_field :import_url, class: 'xlarge', placeholder: 'https://github.com/randx/six.git'
29 .light 29 .light
30 URL must be cloneable 30 URL must be cloneable
31 - .clearfix 31 + .control-group
32 = f.label :description do 32 = f.label :description do
33 Description 33 Description
34 %span.light (optional) 34 %span.light (optional)
35 - .input 35 + .controls
36 = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250, tabindex: 3 36 = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250, tabindex: 3
37 37
38 %p.padded 38 %p.padded
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 42
43 - if current_user.can_create_group? 43 - if current_user.can_create_group?
44 .pull-right 44 .pull-right
45 - .input.light 45 + .controls.light
46 Need a group for several dependent projects? 46 Need a group for several dependent projects?
47 = link_to new_group_path, class: "btn btn-tiny" do 47 = link_to new_group_path, class: "btn btn-tiny" do
48 Create a group 48 Create a group
app/views/snippets/_form.html.haml
@@ -9,16 +9,16 @@ @@ -9,16 +9,16 @@
9 - @snippet.errors.full_messages.each do |msg| 9 - @snippet.errors.full_messages.each do |msg|
10 %li= msg 10 %li= msg
11 11
12 - .clearfix 12 + .control-group
13 = f.label :title 13 = f.label :title
14 - .input= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true  
15 - .clearfix 14 + .controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true
  15 + .control-group
16 = f.label "Private?" 16 = f.label "Private?"
17 - .input= f.check_box :private, {class: ''}  
18 - .clearfix 17 + .controls= f.check_box :private, {class: ''}
  18 + .control-group
19 .file-editor 19 .file-editor
20 = f.label :file_name, "File" 20 = f.label :file_name, "File"
21 - .input 21 + .controls
22 .file-holder.snippet 22 .file-holder.snippet
23 .file-title 23 .file-title
24 = f.text_field :file_name, placeholder: "example.rb", class: 'snippet-file-name', required: true 24 = f.text_field :file_name, placeholder: "example.rb", class: 'snippet-file-name', required: true