Commit 083990c795c74a0dfc76813e44706289a7ede43d
1 parent
0175e665
Exists in
master
and in
4 other branches
Minor UI improvements
Showing
8 changed files
with
29 additions
and
12 deletions
Show diff stats
app/assets/stylesheets/sections/snippets.scss
app/views/projects/merge_requests/index.html.haml
app/views/projects/merge_requests/show/_mr_accept.html.haml
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | .automerge_widget.cannot_be_merged{style: "display:none"} |
33 | 33 | .alert.alert-disabled |
34 | 34 | %span |
35 | - = link_to "Show how to merge", "#modal_merge_info", class: "how_to_merge_link btn btn-small padded", title: "How To Merge", "data-toggle" => "modal" | |
35 | + = link_to "Show how to merge", "#modal_merge_info", class: "how_to_merge_link btn padded", title: "How To Merge", "data-toggle" => "modal" | |
36 | 36 | |
37 | 37 | %strong This request can't be merged with GitLab. You should do it manually |
38 | 38 | ... | ... |
app/views/projects/snippets/_form.html.haml
... | ... | @@ -27,8 +27,11 @@ |
27 | 27 | = f.hidden_field :content, class: 'snippet-file-content' |
28 | 28 | |
29 | 29 | .form-actions |
30 | - = f.submit 'Save', class: "btn-save btn" | |
31 | - = link_to "Cancel", project_snippets_path(@project), class: " btn" | |
30 | + - if @snippet.new_record? | |
31 | + = f.submit 'Create snippet', class: "btn-create btn" | |
32 | + - else | |
33 | + = f.submit 'Save', class: "btn-save btn" | |
34 | + = link_to "Cancel", project_snippets_path(@project), class: " btn btn-cancel" | |
32 | 35 | - unless @snippet.new_record? |
33 | 36 | .pull-right= link_to 'Destroy', project_snippet_path(@project, @snippet), confirm: 'Are you sure?', method: :delete, class: "btn pull-right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}" |
34 | 37 | ... | ... |
app/views/projects/snippets/index.html.haml
1 | 1 | %h3.page-title |
2 | 2 | Snippets |
3 | - %small share code pastes with others out of git repository | |
4 | - | |
5 | 3 | - if can? current_user, :write_project_snippet, @project |
6 | - = link_to new_project_snippet_path(@project), class: "btn btn-small add_new pull-right", title: "New Snippet" do | |
4 | + = link_to new_project_snippet_path(@project), class: "btn btn-new pull-right", title: "New Snippet" do | |
7 | 5 | Add new snippet |
6 | + | |
7 | +%p.light | |
8 | + Share code pastes with others out of git repository | |
9 | + | |
8 | 10 | %hr |
9 | 11 | %ul.bordered-list |
10 | 12 | = render partial: "projects/snippets/snippet", collection: @snippets | ... | ... |
app/views/snippets/_form.html.haml
... | ... | @@ -14,7 +14,8 @@ |
14 | 14 | .controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true |
15 | 15 | .control-group |
16 | 16 | = f.label "Private?" |
17 | - .controls= f.check_box :private, {class: ''} | |
17 | + .controls | |
18 | + = f.check_box :private, {class: ''} | |
18 | 19 | .control-group |
19 | 20 | .file-editor |
20 | 21 | = f.label :file_name, "File" |
... | ... | @@ -32,7 +33,7 @@ |
32 | 33 | - else |
33 | 34 | = f.submit 'Save', class: "btn-save btn" |
34 | 35 | |
35 | - = link_to "Cancel", snippets_path(@project), class: " btn" | |
36 | + = link_to "Cancel", snippets_path(@project), class: "btn btn-cancel" | |
36 | 37 | - unless @snippet.new_record? |
37 | 38 | .pull-right= link_to 'Destroy', snippet_path(@snippet), confirm: 'Removed snippet cannot be restored! Are you sure?', method: :delete, class: "btn pull-right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}" |
38 | 39 | ... | ... |
app/views/snippets/current_user_index.html.haml
... | ... | @@ -14,11 +14,20 @@ |
14 | 14 | .span3 |
15 | 15 | %ul.nav.nav-pills.nav-stacked |
16 | 16 | = nav_tab :scope, nil do |
17 | - = link_to "All", user_snippets_path(@user) | |
17 | + = link_to user_snippets_path(@user) do | |
18 | + All | |
19 | + %span.pull-right | |
20 | + = @user.snippets.count | |
18 | 21 | = nav_tab :scope, 'private' do |
19 | - = link_to "Private", user_snippets_path(@user, scope: 'private') | |
22 | + = link_to user_snippets_path(@user, scope: 'private') do | |
23 | + Private | |
24 | + %span.pull-right | |
25 | + = @user.snippets.private.count | |
20 | 26 | = nav_tab :scope, 'public' do |
21 | - = link_to "Public", user_snippets_path(@user, scope: 'public') | |
27 | + = link_to user_snippets_path(@user, scope: 'public') do | |
28 | + Public | |
29 | + %span.pull-right | |
30 | + = @user.snippets.public.count | |
22 | 31 | |
23 | 32 | .span9.my-snippets |
24 | 33 | = render 'snippets' | ... | ... |
features/steps/project/project_snippets.rb
... | ... | @@ -58,7 +58,7 @@ class ProjectSnippets < Spinach::FeatureSteps |
58 | 58 | within('.file-editor') do |
59 | 59 | find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three' |
60 | 60 | end |
61 | - click_button "Save" | |
61 | + click_button "Create snippet" | |
62 | 62 | end |
63 | 63 | |
64 | 64 | Then 'I should see snippet "Snippet three"' do | ... | ... |