diff options
author | Han Loong Liauw <hanloongliauw@gmail.com> | 2015-10-14 23:12:08 +1100 |
---|---|---|
committer | Han Loong Liauw <hanloongliauw@gmail.com> | 2015-10-14 23:53:52 +1100 |
commit | 1f92c22fec8493fa0efb8a53829a4c726e78934e (patch) | |
tree | 51dd95359ef6dcd4a509114eccd32cc09350778b /app/views/snippets | |
parent | a60853fda09b37c2990b2437baa7a5d13b54572d (diff) | |
download | gitlab-ce-1f92c22fec8493fa0efb8a53829a4c726e78934e.tar.gz |
New snippet design for projects
Split out header into shared partial
Used action partials to have unique actions for shared and personal
snippets
changed back to created date in list view
Switched to using existing color classes
Diffstat (limited to 'app/views/snippets')
-rw-r--r-- | app/views/snippets/_actions.html.haml | 8 | ||||
-rw-r--r-- | app/views/snippets/show.html.haml | 32 |
2 files changed, 9 insertions, 31 deletions
diff --git a/app/views/snippets/_actions.html.haml b/app/views/snippets/_actions.html.haml new file mode 100644 index 00000000000..a4fdf89a4ee --- /dev/null +++ b/app/views/snippets/_actions.html.haml @@ -0,0 +1,8 @@ += link_to new_snippet_path, class: 'btn btn-grouped new-snippet-link', title: "New Snippet" do + = icon('plus') + new snippet += link_to "remove", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-grouped btn-remove", title: 'Delete Snippet' +- if can?(current_user, :update_personal_snippet, @snippet) + = link_to edit_snippet_path(@snippet), class: "btn btn-grouped snippable-edit" do + = icon('pencil-square-o') + Edit diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 9d20b76cbf2..202a43bc57d 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -1,35 +1,5 @@ - page_title @snippet.title, "Snippets" - -.snippet - .snippet-details - .page-title - - if @snippet.private? - .snippet-box.snippet-box-locked - %i.fa.fa-lock - Private - %span.snippet-id Snippet ##{@snippet.id} - %span.creator - · created by #{link_to_member(@project, @snippet.author, size: 24)} - · - = time_ago_with_tooltip(@snippet.created_at, placement: 'bottom', html_class: 'snippet_updated_ago') - - if @snippet.updated_at != @snippet.created_at - %span - · - = icon('edit', title: 'edited') - = time_ago_with_tooltip(@snippet.updated_at, placement: 'bottom', html_class: 'snippet_edited_ago') - - .pull-right - = link_to new_snippet_path, class: 'btn btn-grouped new-snippet-link', title: "New Snippet" do - = icon('plus') - new snippet - = link_to "remove", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-grouped btn-remove", title: 'Delete Snippet' - - if can?(current_user, :update_personal_snippet, @snippet) - = link_to edit_snippet_path(@snippet), class: "btn btn-grouped issuabled-edit" do - = icon('pencil-square-o') - Edit - .gray-content-block.middle-block - %h2.snippet-title - = gfm escape_once(@snippet.title) += render 'shared/snippets/header' .file-holder .file-title |