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