Commit 33347efa26857243c9e61d4c89d1c4631244c5be

Authored by Dmitriy Zaporozhets
1 parent 82e1fe46

User links to user snippets

app/assets/stylesheets/gitlab_bootstrap/lists.scss
... ... @@ -75,7 +75,6 @@ ul.bordered-list {
75 75 display: block;
76 76 margin: 0px;
77 77 &:last-child { border:none }
78   -
79 78 &.active {
80 79 background: #f9f9f9;
81 80 a { font-weight: bold; }
... ...
app/assets/stylesheets/sections/snippets.scss
... ... @@ -7,3 +7,9 @@
7 7 }
8 8 }
9 9 }
  10 +
  11 +.my-snippets li:first-child {
  12 + h4 { margin-top: 0; }
  13 + padding-top: 0;
  14 +}
  15 +
... ...
app/views/snippets/_snippet.html.haml
... ... @@ -17,6 +17,7 @@
17 17 = "##{snippet.id}"
18 18 %span
19 19 by
20   - = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: ''
21   - = snippet.author_name
  20 + = link_to user_snippets_path(snippet.author) do
  21 + = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: ''
  22 + = snippet.author_name
22 23 %span.light #{time_ago_in_words(snippet.created_at)} ago
... ...
app/views/snippets/current_user_index.html.haml
... ... @@ -19,6 +19,6 @@
19 19 = nav_tab :scope, 'public' do
20 20 = link_to "Public", user_snippets_path(@user, scope: 'public')
21 21  
22   - .span9
  22 + .span9.my-snippets
23 23 = render 'snippets'
24 24  
... ...
app/views/snippets/index.html.haml
... ... @@ -9,7 +9,5 @@
9 9 My snippets
10 10  
11 11 %hr
12   -.row
13   - .span12
14   - = render 'snippets'
  12 += render 'snippets'
15 13  
... ...
app/views/snippets/show.html.haml
... ... @@ -16,8 +16,9 @@
16 16 = "##{@snippet.id}"
17 17 %span.light
18 18 by
19   - = image_tag gravatar_icon(@snippet.author_email), class: "avatar avatar-inline s16"
20   - = @snippet.author_name
  19 + = link_to user_snippets_path(@snippet.author) do
  20 + = image_tag gravatar_icon(@snippet.author_email), class: "avatar avatar-inline s16"
  21 + = @snippet.author_name
21 22  
22 23 .back-link
23 24 - if @snippet.author == current_user
... ...
app/views/snippets/user_index.html.haml
... ... @@ -4,7 +4,6 @@
4 4 %span
5 5 \/
6 6 Snippets
7   - %small share code pastes with others out of git repository
8 7 = link_to new_snippet_path, class: "btn btn-small add_new pull-right", title: "New Snippet" do
9 8 Add new snippet
10 9  
... ...