Commit 34245ceb9962050bd8a953b4ea79e8e990558ab4
1 parent
a81002d9
Exists in
spb-stable
and in
3 other branches
Fix snippet form
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
3 changed files
with
8 additions
and
19 deletions
Show diff stats
app/assets/stylesheets/common.scss
@@ -119,18 +119,6 @@ p.time { | @@ -119,18 +119,6 @@ p.time { | ||
119 | margin: 30px 3px 3px 2px; | 119 | margin: 30px 3px 3px 2px; |
120 | } | 120 | } |
121 | 121 | ||
122 | -.search-holder { | ||
123 | - label, input { | ||
124 | - height: 30px; | ||
125 | - padding: 0; | ||
126 | - font-size: 14px; | ||
127 | - } | ||
128 | - label { | ||
129 | - line-height: 30px; | ||
130 | - color: #666; | ||
131 | - } | ||
132 | -} | ||
133 | - | ||
134 | .highlight { | 122 | .highlight { |
135 | text-shadow: none; | 123 | text-shadow: none; |
136 | } | 124 | } |
app/views/public/projects/index.html.haml
@@ -6,8 +6,9 @@ | @@ -6,8 +6,9 @@ | ||
6 | .clearfix | 6 | .clearfix |
7 | .pull-left | 7 | .pull-left |
8 | = form_tag public_projects_path, method: :get, class: 'form-inline form-tiny' do |f| | 8 | = form_tag public_projects_path, method: :get, class: 'form-inline form-tiny' do |f| |
9 | - .search-holder | ||
10 | - = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "span4 search-text-input", id: "projects_search" | 9 | + .form-group |
10 | + = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "projects_search" | ||
11 | + .form-group | ||
11 | = submit_tag 'Search', class: "btn btn-primary wide" | 12 | = submit_tag 'Search', class: "btn btn-primary wide" |
12 | 13 | ||
13 | .pull-right | 14 | .pull-right |
app/views/snippets/_form.html.haml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | = @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}" | 2 | = @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}" |
3 | %hr | 3 | %hr |
4 | .snippet-form-holder | 4 | .snippet-form-holder |
5 | - = form_for @snippet, as: :personal_snippet, url: url do |f| | 5 | + = form_for @snippet, as: :personal_snippet, url: url, html: { class: "form-horizontal snippet-form" } do |f| |
6 | -if @snippet.errors.any? | 6 | -if @snippet.errors.any? |
7 | .alert.alert-danger | 7 | .alert.alert-danger |
8 | %ul | 8 | %ul |
@@ -10,10 +10,10 @@ | @@ -10,10 +10,10 @@ | ||
10 | %li= msg | 10 | %li= msg |
11 | 11 | ||
12 | .form-group | 12 | .form-group |
13 | - = f.label :title | 13 | + = f.label :title, class: 'control-label' |
14 | .col-sm-10= f.text_field :title, placeholder: "Example Snippet", class: 'form-control', required: true | 14 | .col-sm-10= f.text_field :title, placeholder: "Example Snippet", class: 'form-control', required: true |
15 | .form-group | 15 | .form-group |
16 | - = f.label "Access" | 16 | + = f.label "Access", class: 'control-label' |
17 | .col-sm-10 | 17 | .col-sm-10 |
18 | = f.label :private_true, class: 'radio-label' do | 18 | = f.label :private_true, class: 'radio-label' do |
19 | = f.radio_button :private, true | 19 | = f.radio_button :private, true |
@@ -29,11 +29,11 @@ | @@ -29,11 +29,11 @@ | ||
29 | 29 | ||
30 | .form-group | 30 | .form-group |
31 | .file-editor | 31 | .file-editor |
32 | - = f.label :file_name, "File" | 32 | + = f.label :file_name, "File", class: 'control-label' |
33 | .col-sm-10 | 33 | .col-sm-10 |
34 | .file-holder.snippet | 34 | .file-holder.snippet |
35 | .file-title | 35 | .file-title |
36 | - = f.text_field :file_name, placeholder: "example.rb", class: 'snippet-file-name', required: true | 36 | + = f.text_field :file_name, placeholder: "example.rb", class: 'form-control snippet-file-name', required: true |
37 | .file-content.code | 37 | .file-content.code |
38 | %pre#editor= @snippet.content | 38 | %pre#editor= @snippet.content |
39 | = f.hidden_field :content, class: 'snippet-file-content' | 39 | = f.hidden_field :content, class: 'snippet-file-content' |