summaryrefslogtreecommitdiff
path: root/app/views/shared
diff options
context:
space:
mode:
authorHan Loong Liauw <hanloongliauw@gmail.com>2015-10-14 23:12:08 +1100
committerHan Loong Liauw <hanloongliauw@gmail.com>2015-10-14 23:53:52 +1100
commit1f92c22fec8493fa0efb8a53829a4c726e78934e (patch)
tree51dd95359ef6dcd4a509114eccd32cc09350778b /app/views/shared
parenta60853fda09b37c2990b2437baa7a5d13b54572d (diff)
downloadgitlab-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/shared')
-rw-r--r--app/views/shared/snippets/_header.html.haml25
-rw-r--r--app/views/shared/snippets/_snippet.html.haml2
2 files changed, 26 insertions, 1 deletions
diff --git a/app/views/shared/snippets/_header.html.haml b/app/views/shared/snippets/_header.html.haml
new file mode 100644
index 00000000000..95786ee3377
--- /dev/null
+++ b/app/views/shared/snippets/_header.html.haml
@@ -0,0 +1,25 @@
+.snippet
+ .snippet-details
+ .page-title
+ .snippet-box{class: visibility_level_color(@snippet.visibility_level)}
+ = visibility_level_icon(@snippet.visibility_level)
+ = visibility_level_label(@snippet.visibility_level)
+ %span.snippet-id Snippet ##{@snippet.id}
+ %span.creator
+ &middot; created by #{link_to_member(@project, @snippet.author, size: 24)}
+ &middot;
+ = time_ago_with_tooltip(@snippet.created_at, placement: 'bottom', html_class: 'snippet_updated_ago')
+ - if @snippet.updated_at != @snippet.created_at
+ %span
+ &middot;
+ = icon('edit', title: 'edited')
+ = time_ago_with_tooltip(@snippet.updated_at, placement: 'bottom', html_class: 'snippet_edited_ago')
+
+ .pull-right
+ - if @snippet.project_id?
+ = render "projects/snippets/actions"
+ - else
+ = render "snippets/actions"
+ .gray-content-block.middle-block
+ %h2.snippet-title
+ = gfm escape_once(@snippet.title)
diff --git a/app/views/shared/snippets/_snippet.html.haml b/app/views/shared/snippets/_snippet.html.haml
index 6f4b0453ad3..c6294caddc7 100644
--- a/app/views/shared/snippets/_snippet.html.haml
+++ b/app/views/shared/snippets/_snippet.html.haml
@@ -17,4 +17,4 @@
= link_to user_snippets_path(snippet.author) do
= image_tag avatar_icon(snippet.author_email), class: "avatar s24", alt: ''
= snippet.author_name
- authored #{time_ago_with_tooltip(snippet.updated_at)}
+ authored #{time_ago_with_tooltip(snippet.created_at)}