From 68c1e3a1568d9f61bf1e01d6ff55ce59c5c3eaaf Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Thu, 8 Dec 2016 14:29:15 -0600 Subject: update snippets list design --- app/views/shared/snippets/_snippet.html.haml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'app/views/shared/snippets') diff --git a/app/views/shared/snippets/_snippet.html.haml b/app/views/shared/snippets/_snippet.html.haml index ea17bec8677..95985ad6afb 100644 --- a/app/views/shared/snippets/_snippet.html.haml +++ b/app/views/shared/snippets/_snippet.html.haml @@ -4,14 +4,11 @@ .title = link_to reliable_snippet_path(snippet) do = snippet.title - - if snippet.private? - %span.label.label-gray.hidden-xs - = icon('lock') - private - %span.monospace.pull-right.hidden-xs - = snippet.file_name + - if snippet.file_name + %span.snippet-filename.monospace.hidden-xs + = snippet.file_name - %ul.controls.visible-xs + %ul.controls %li - note_count = snippet.notes.user.count = link_to reliable_snippet_path(snippet, anchor: 'notes'), class: ('no-comments' if note_count.zero?) do @@ -22,11 +19,11 @@ = visibility_level_label(snippet.visibility_level) = visibility_level_icon(snippet.visibility_level, fw: false) - %small.pull-right.cgray.hidden-xs - - if snippet.project_id? - = link_to snippet.project.name_with_namespace, namespace_project_path(snippet.project.namespace, snippet.project) - - .snippet-info.hidden-xs + .snippet-info + #{snippet.to_reference} · + authored #{time_ago_with_tooltip(snippet.created_at, placement: 'bottom')} by = link_to user_snippets_path(snippet.author) do = snippet.author_name - authored #{time_ago_with_tooltip(snippet.created_at)} + + .pull-right.snippet-updated-at + %span updated #{time_ago_with_tooltip(snippet.updated_at, placement: 'bottom', html_class: 'snippet_update_ago')} -- cgit v1.2.1 From 7f3fc26ec98193fa0c3bfeb7b78c81176bb9c689 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Thu, 8 Dec 2016 16:13:23 -0600 Subject: fix failing tests --- app/views/shared/snippets/_snippet.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views/shared/snippets') diff --git a/app/views/shared/snippets/_snippet.html.haml b/app/views/shared/snippets/_snippet.html.haml index 95985ad6afb..65946910529 100644 --- a/app/views/shared/snippets/_snippet.html.haml +++ b/app/views/shared/snippets/_snippet.html.haml @@ -21,9 +21,9 @@ .snippet-info #{snippet.to_reference} · - authored #{time_ago_with_tooltip(snippet.created_at, placement: 'bottom')} by + authored #{time_ago_with_tooltip(snippet.created_at, placement: 'bottom', html_class: 'snippet-created-ago')} by = link_to user_snippets_path(snippet.author) do = snippet.author_name .pull-right.snippet-updated-at - %span updated #{time_ago_with_tooltip(snippet.updated_at, placement: 'bottom', html_class: 'snippet_update_ago')} + %span updated #{time_ago_with_tooltip(snippet.updated_at, placement: 'bottom')} -- cgit v1.2.1 From 0608ecbc69c991efcf56f7872cf1b06416d4bd10 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 9 Dec 2016 10:54:13 -0600 Subject: conditionally display assoc project info in snippets index --- app/views/shared/snippets/_snippet.html.haml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/views/shared/snippets') diff --git a/app/views/shared/snippets/_snippet.html.haml b/app/views/shared/snippets/_snippet.html.haml index 65946910529..5d2d2317f22 100644 --- a/app/views/shared/snippets/_snippet.html.haml +++ b/app/views/shared/snippets/_snippet.html.haml @@ -1,3 +1,5 @@ +- link_project = local_assigns.fetch(:link_project, false) + %li.snippet-row = image_tag avatar_icon(snippet.author_email), class: "avatar s40 hidden-xs", alt: '' @@ -21,9 +23,15 @@ .snippet-info #{snippet.to_reference} · - authored #{time_ago_with_tooltip(snippet.created_at, placement: 'bottom', html_class: 'snippet-created-ago')} by + authored #{time_ago_with_tooltip(snippet.created_at, placement: 'bottom', html_class: 'snippet-created-ago')} + by = link_to user_snippets_path(snippet.author) do = snippet.author_name + - if link_project && snippet.project_id? + %span.hidden-xs + in + = link_to namespace_project_path(snippet.project.namespace, snippet.project) do + = snippet.project.name_with_namespace .pull-right.snippet-updated-at %span updated #{time_ago_with_tooltip(snippet.updated_at, placement: 'bottom')} -- cgit v1.2.1 From eaf92daa2ce2601426c991c794aab57c4d0da420 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 9 Dec 2016 11:48:53 -0600 Subject: move snippet edited timeago under the snippet title --- app/views/shared/snippets/_header.html.haml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/views/shared/snippets') diff --git a/app/views/shared/snippets/_header.html.haml b/app/views/shared/snippets/_header.html.haml index d7506e07ff6..d084f5e9684 100644 --- a/app/views/shared/snippets/_header.html.haml +++ b/app/views/shared/snippets/_header.html.haml @@ -8,10 +8,6 @@ %span.creator authored = 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') by #{link_to_member(@project, @snippet.author, size: 24, author_class: "author item-title", avatar_class: "hidden-xs")} .snippet-actions @@ -20,5 +16,9 @@ - else = render "snippets/actions" -%h2.snippet-title.prepend-top-0.append-bottom-0 - = markdown_field(@snippet, :title) +.snippet-header + %h2.snippet-title.prepend-top-0.append-bottom-0 + = markdown_field(@snippet, :title) + + - if @snippet.updated_at != @snippet.created_at + = edited_time_ago_with_tooltip(@snippet, placement: 'bottom', html_class: 'snippet-edited-ago') -- cgit v1.2.1