OSDN Git Service

Improve UI for project snippets
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 18 Jul 2013 10:21:56 +0000 (13:21 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 18 Jul 2013 10:21:56 +0000 (13:21 +0300)
app/views/projects/snippets/_snippet.html.haml
app/views/projects/snippets/show.html.haml
db/fixtures/development/12_snippets.rb

index 72865bf..fc1c089 100644 (file)
@@ -1,13 +1,8 @@
 %li
-  .snippet-title
-    - if snippet.private?
-      %i.icon-lock.cgreen
-    - else
-      %i.icon-globe.cblue
+  %h4.snippet-title
     = link_to reliable_snippet_path(snippet) do
-      %h5.inline
-        = truncate(snippet.title, length: 60)
-    %span.cgray
+      = truncate(snippet.title, length: 60)
+    %span.cgray.monospace.tiny.pull-right
       = snippet.file_name
 
   %small.pull-right.cgray
     - else
       Never
 
-  .snippet-info.prepend-left-20
+  .snippet-info
     = "##{snippet.id}"
-    %span.light
+    %span
       by
       = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16"
       = snippet.author_name
+      %span.light #{time_ago_in_words(snippet.created_at)} ago
index 564c2e8..4a07ebf 100644 (file)
@@ -1,5 +1,4 @@
 %h3.page-title
-  %i.icon-lock.cgreen
   = @snippet.title
 
   %small.pull-right
index 78f2444..4ca8afe 100644 (file)
@@ -13,7 +13,7 @@ Gitlab::Seeder.quiet do
     PersonalSnippet.seed(:id, [{
       id: i,
       author_id: user.id,
-      title: Faker::Lorem.sentence(6),
+      title: Faker::Lorem.sentence(3),
       file_name:  Faker::Internet.domain_word + '.sh',
       private: [true, false].sample,
       content: contents.sample,