Commit b1fbd6583247c85096bc9c7362907db3539e806b

Authored by Dmitriy Zaporozhets
1 parent bbb06e50

Improve UI for project snippets

app/views/projects/snippets/_snippet.html.haml
1 %li 1 %li
2 - .snippet-title  
3 - - if snippet.private?  
4 - %i.icon-lock.cgreen  
5 - - else  
6 - %i.icon-globe.cblue 2 + %h4.snippet-title
7 = link_to reliable_snippet_path(snippet) do 3 = link_to reliable_snippet_path(snippet) do
8 - %h5.inline  
9 - = truncate(snippet.title, length: 60)  
10 - %span.cgray 4 + = truncate(snippet.title, length: 60)
  5 + %span.cgray.monospace.tiny.pull-right
11 = snippet.file_name 6 = snippet.file_name
12 7
13 %small.pull-right.cgray 8 %small.pull-right.cgray
@@ -17,9 +12,10 @@ @@ -17,9 +12,10 @@
17 - else 12 - else
18 Never 13 Never
19 14
20 - .snippet-info.prepend-left-20 15 + .snippet-info
21 = "##{snippet.id}" 16 = "##{snippet.id}"
22 - %span.light 17 + %span
23 by 18 by
24 = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16" 19 = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16"
25 = snippet.author_name 20 = snippet.author_name
  21 + %span.light #{time_ago_in_words(snippet.created_at)} ago
app/views/projects/snippets/show.html.haml
1 %h3.page-title 1 %h3.page-title
2 - %i.icon-lock.cgreen  
3 = @snippet.title 2 = @snippet.title
4 3
5 %small.pull-right 4 %small.pull-right
db/fixtures/development/12_snippets.rb
@@ -13,7 +13,7 @@ Gitlab::Seeder.quiet do @@ -13,7 +13,7 @@ Gitlab::Seeder.quiet do
13 PersonalSnippet.seed(:id, [{ 13 PersonalSnippet.seed(:id, [{
14 id: i, 14 id: i,
15 author_id: user.id, 15 author_id: user.id,
16 - title: Faker::Lorem.sentence(6), 16 + title: Faker::Lorem.sentence(3),
17 file_name: Faker::Internet.domain_word + '.sh', 17 file_name: Faker::Internet.domain_word + '.sh',
18 private: [true, false].sample, 18 private: [true, false].sample,
19 content: contents.sample, 19 content: contents.sample,