From 33347efa26857243c9e61d4c89d1c4631244c5be Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 18 Jul 2013 13:33:43 +0300 Subject: [PATCH] User links to user snippets --- app/assets/stylesheets/gitlab_bootstrap/lists.scss | 1 - app/assets/stylesheets/sections/snippets.scss | 6 ++++++ app/views/snippets/_snippet.html.haml | 5 +++-- app/views/snippets/current_user_index.html.haml | 2 +- app/views/snippets/index.html.haml | 4 +--- app/views/snippets/show.html.haml | 5 +++-- app/views/snippets/user_index.html.haml | 1 - 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/lists.scss b/app/assets/stylesheets/gitlab_bootstrap/lists.scss index 0fa4da44d..cc7084d27 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/lists.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/lists.scss @@ -75,7 +75,6 @@ ul.bordered-list { display: block; margin: 0px; &:last-child { border:none } - &.active { background: #f9f9f9; a { font-weight: bold; } diff --git a/app/assets/stylesheets/sections/snippets.scss b/app/assets/stylesheets/sections/snippets.scss index feeca655c..7dab0bfe0 100644 --- a/app/assets/stylesheets/sections/snippets.scss +++ b/app/assets/stylesheets/sections/snippets.scss @@ -7,3 +7,9 @@ } } } + +.my-snippets li:first-child { + h4 { margin-top: 0; } + padding-top: 0; +} + diff --git a/app/views/snippets/_snippet.html.haml b/app/views/snippets/_snippet.html.haml index cdad949f0..9689c9c4d 100644 --- a/app/views/snippets/_snippet.html.haml +++ b/app/views/snippets/_snippet.html.haml @@ -17,6 +17,7 @@ = "##{snippet.id}" %span by - = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: '' - = snippet.author_name + = link_to user_snippets_path(snippet.author) do + = image_tag gravatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: '' + = snippet.author_name %span.light #{time_ago_in_words(snippet.created_at)} ago diff --git a/app/views/snippets/current_user_index.html.haml b/app/views/snippets/current_user_index.html.haml index 1d9b60f73..b60026f45 100644 --- a/app/views/snippets/current_user_index.html.haml +++ b/app/views/snippets/current_user_index.html.haml @@ -19,6 +19,6 @@ = nav_tab :scope, 'public' do = link_to "Public", user_snippets_path(@user, scope: 'public') - .span9 + .span9.my-snippets = render 'snippets' diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index 1502a6698..c65ed4fb9 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -9,7 +9,5 @@ My snippets %hr -.row - .span12 - = render 'snippets' += render 'snippets' diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 811e429d2..5cf1fefe5 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -16,8 +16,9 @@ = "##{@snippet.id}" %span.light by - = image_tag gravatar_icon(@snippet.author_email), class: "avatar avatar-inline s16" - = @snippet.author_name + = link_to user_snippets_path(@snippet.author) do + = image_tag gravatar_icon(@snippet.author_email), class: "avatar avatar-inline s16" + = @snippet.author_name .back-link - if @snippet.author == current_user diff --git a/app/views/snippets/user_index.html.haml b/app/views/snippets/user_index.html.haml index a9563b75e..49636c3f5 100644 --- a/app/views/snippets/user_index.html.haml +++ b/app/views/snippets/user_index.html.haml @@ -4,7 +4,6 @@ %span \/ Snippets - %small share code pastes with others out of git repository = link_to new_snippet_path, class: "btn btn-small add_new pull-right", title: "New Snippet" do Add new snippet -- 2.11.0