diff --git a/app/views/projects/snippets/_form.html.haml b/app/views/projects/snippets/_form.html.haml index c4664a58a01..7f27b479402 100644 --- a/app/views/projects/snippets/_form.html.haml +++ b/app/views/projects/snippets/_form.html.haml @@ -2,7 +2,7 @@ = @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}" %hr .snippet-form-holder - = form_for [@project, @snippet], as: :project_snippet, url: url do |f| + = form_for [@project, @snippet], as: :project_snippet, url: url, html: {class: "form-horizontal snippet-form"} do |f| -if @snippet.errors.any? .alert.alert-danger %ul @@ -10,14 +10,11 @@ %li= msg .form-group - = f.label :title + = f.label :title, class: 'control-label' .col-sm-10= f.text_field :title, placeholder: "Example Snippet", class: 'form-control', required: true - .form-group - = f.label "Lifetime" - .col-sm-10= f.select :expires_at, lifetime_select_options, {}, {class: 'select2 span2'} .form-group .file-editor - = f.label :file_name, "File" + = f.label :file_name, "File", class: 'control-label' .col-sm-10 .file-holder.snippet .file-title @@ -31,10 +28,11 @@ = f.submit 'Create snippet', class: "btn-create btn" - else = f.submit 'Save', class: "btn-save btn" - = link_to "Cancel", project_snippets_path(@project), class: "btn btn-cancel" - - unless @snippet.new_record? - = 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}" + - unless @snippet.new_record? + .pull-right.prepend-left-20 + = 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}" + = link_to "Cancel", project_snippets_path(@project), class: "btn btn-cancel" :javascript var editor = ace.edit("editor"); diff --git a/features/steps/project/project_snippets.rb b/features/steps/project/project_snippets.rb index 5082b31198a..82ff895970e 100644 --- a/features/steps/project/project_snippets.rb +++ b/features/steps/project/project_snippets.rb @@ -53,7 +53,6 @@ class ProjectSnippets < Spinach::FeatureSteps And 'I submit new snippet "Snippet three"' do fill_in "project_snippet_title", :with => "Snippet three" - select "forever", :from => "project_snippet_expires_at" fill_in "project_snippet_file_name", :with => "my_snippet.rb" within('.file-editor') do find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three'