Commit b1fbd6583247c85096bc9c7362907db3539e806b
1 parent
bbb06e50
Exists in
master
and in
4 other branches
Improve UI for project snippets
Showing
3 changed files
with
7 additions
and
12 deletions
Show diff stats
app/views/projects/snippets/_snippet.html.haml
1 | 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 | 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 | 6 | = snippet.file_name |
12 | 7 | |
13 | 8 | %small.pull-right.cgray |
... | ... | @@ -17,9 +12,10 @@ |
17 | 12 | - else |
18 | 13 | Never |
19 | 14 | |
20 | - .snippet-info.prepend-left-20 | |
15 | + .snippet-info | |
21 | 16 | = "##{snippet.id}" |
22 | - %span.light | |
17 | + %span | |
23 | 18 | by |
24 | 19 | = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16" |
25 | 20 | = snippet.author_name |
21 | + %span.light #{time_ago_in_words(snippet.created_at)} ago | ... | ... |
app/views/projects/snippets/show.html.haml
db/fixtures/development/12_snippets.rb
... | ... | @@ -13,7 +13,7 @@ Gitlab::Seeder.quiet do |
13 | 13 | PersonalSnippet.seed(:id, [{ |
14 | 14 | id: i, |
15 | 15 | author_id: user.id, |
16 | - title: Faker::Lorem.sentence(6), | |
16 | + title: Faker::Lorem.sentence(3), | |
17 | 17 | file_name: Faker::Internet.domain_word + '.sh', |
18 | 18 | private: [true, false].sample, |
19 | 19 | content: contents.sample, | ... | ... |