Commit 2eb1220f6701442660b090fba66c82f8008ee1f6

Authored by Jeroen van Baarsen
1 parent 753a2f17

Removed expiration from snippets

* Removed the expiration from the project snippets
* Fixed the layout for the project snippets
app/views/projects/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 [@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 -if @snippet.errors.any? 6 -if @snippet.errors.any?
7 .alert.alert-danger 7 .alert.alert-danger
8 %ul 8 %ul
@@ -10,14 +10,11 @@ @@ -10,14 +10,11 @@
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 "Lifetime"  
17 - .col-sm-10= f.select :expires_at, lifetime_select_options, {}, {class: 'select2 span2'}  
18 - .form-group  
19 .file-editor 16 .file-editor
20 - = f.label :file_name, "File" 17 + = f.label :file_name, "File", class: 'control-label'
21 .col-sm-10 18 .col-sm-10
22 .file-holder.snippet 19 .file-holder.snippet
23 .file-title 20 .file-title
@@ -31,10 +28,11 @@ @@ -31,10 +28,11 @@
31 = f.submit 'Create snippet', class: "btn-create btn" 28 = f.submit 'Create snippet', class: "btn-create btn"
32 - else 29 - else
33 = f.submit 'Save', class: "btn-save btn" 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 :javascript 37 :javascript
40 var editor = ace.edit("editor"); 38 var editor = ace.edit("editor");
features/steps/project/project_snippets.rb
@@ -53,7 +53,6 @@ class ProjectSnippets < Spinach::FeatureSteps @@ -53,7 +53,6 @@ class ProjectSnippets < Spinach::FeatureSteps
53 53
54 And 'I submit new snippet "Snippet three"' do 54 And 'I submit new snippet "Snippet three"' do
55 fill_in "project_snippet_title", :with => "Snippet three" 55 fill_in "project_snippet_title", :with => "Snippet three"
56 - select "forever", :from => "project_snippet_expires_at"  
57 fill_in "project_snippet_file_name", :with => "my_snippet.rb" 56 fill_in "project_snippet_file_name", :with => "my_snippet.rb"
58 within('.file-editor') do 57 within('.file-editor') do
59 find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three' 58 find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three'