Commit 2eb1220f6701442660b090fba66c82f8008ee1f6
1 parent
753a2f17
Exists in
spb-stable
and in
3 other branches
Removed expiration from snippets
* Removed the expiration from the project snippets * Fixed the layout for the project snippets
Showing
2 changed files
with
7 additions
and
10 deletions
Show diff stats
app/views/projects/snippets/_form.html.haml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | = @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}" |
3 | 3 | %hr |
4 | 4 | .snippet-form-holder |
5 | - = form_for [@project, @snippet], as: :project_snippet, url: url do |f| | |
5 | + = form_for [@project, @snippet], as: :project_snippet, url: url, html: {class: "form-horizontal snippet-form"} do |f| | |
6 | 6 | -if @snippet.errors.any? |
7 | 7 | .alert.alert-danger |
8 | 8 | %ul |
... | ... | @@ -10,14 +10,11 @@ |
10 | 10 | %li= msg |
11 | 11 | |
12 | 12 | .form-group |
13 | - = f.label :title | |
13 | + = f.label :title, class: 'control-label' | |
14 | 14 | .col-sm-10= f.text_field :title, placeholder: "Example Snippet", class: 'form-control', required: true |
15 | 15 | .form-group |
16 | - = f.label "Lifetime" | |
17 | - .col-sm-10= f.select :expires_at, lifetime_select_options, {}, {class: 'select2 span2'} | |
18 | - .form-group | |
19 | 16 | .file-editor |
20 | - = f.label :file_name, "File" | |
17 | + = f.label :file_name, "File", class: 'control-label' | |
21 | 18 | .col-sm-10 |
22 | 19 | .file-holder.snippet |
23 | 20 | .file-title |
... | ... | @@ -31,10 +28,11 @@ |
31 | 28 | = f.submit 'Create snippet', class: "btn-create btn" |
32 | 29 | - else |
33 | 30 | = f.submit 'Save', class: "btn-save btn" |
34 | - = link_to "Cancel", project_snippets_path(@project), class: "btn btn-cancel" | |
35 | 31 | |
36 | - - unless @snippet.new_record? | |
37 | - = link_to 'Remove snippet', project_snippet_path(@project, @snippet), data: { confirm: 'Are you sure?' }, method: :delete, class: "btn pull-right btn-remove delete-snippet prepend-left-10", id: "destroy_snippet_#{@snippet.id}" | |
32 | + - unless @snippet.new_record? | |
33 | + .pull-right.prepend-left-20 | |
34 | + = link_to 'Remove snippet', project_snippet_path(@project, @snippet), data: { confirm: 'Are you sure?' }, method: :delete, class: "btn pull-right btn-remove delete-snippet prepend-left-10", id: "destroy_snippet_#{@snippet.id}" | |
35 | + = link_to "Cancel", project_snippets_path(@project), class: "btn btn-cancel" | |
38 | 36 | |
39 | 37 | :javascript |
40 | 38 | var editor = ace.edit("editor"); | ... | ... |
features/steps/project/project_snippets.rb
... | ... | @@ -53,7 +53,6 @@ class ProjectSnippets < Spinach::FeatureSteps |
53 | 53 | |
54 | 54 | And 'I submit new snippet "Snippet three"' do |
55 | 55 | fill_in "project_snippet_title", :with => "Snippet three" |
56 | - select "forever", :from => "project_snippet_expires_at" | |
57 | 56 | fill_in "project_snippet_file_name", :with => "my_snippet.rb" |
58 | 57 | within('.file-editor') do |
59 | 58 | find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three' | ... | ... |