From b4708d006c7a423a1682916403cfab848a9a48b8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 26 Oct 2012 18:37:12 +0300 Subject: [PATCH] Restyled git tags page. Added truncated tags message --- .../stylesheets/gitlab_bootstrap/common.scss | 1 + .../stylesheets/gitlab_bootstrap/tables.scss | 5 +++++ app/decorators/commit_decorator.rb | 2 +- app/views/repositories/tags.html.haml | 22 ++++++++++--------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/common.scss b/app/assets/stylesheets/gitlab_bootstrap/common.scss index eb3bd06f5be..aa9c421fbdf 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/common.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/common.scss @@ -29,6 +29,7 @@ .underlined_link { text-decoration: underline; } .borders { border: 1px solid #ccc; @include shade; } .hint { font-style: italic; color: #999; } +.light { color: #888 } /** PILLS & TABS**/ .nav-pills a:hover { background-color:#888; } diff --git a/app/assets/stylesheets/gitlab_bootstrap/tables.scss b/app/assets/stylesheets/gitlab_bootstrap/tables.scss index 7a3bda2bff0..549cdfee5a6 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/tables.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/tables.scss @@ -34,6 +34,11 @@ table { border-color:#f1f1f1; line-height:28px; + .s16 { + margin-top: 5px; + margin-right: 5px; + } + &:first-child { border-left:1px solid #bbb; } diff --git a/app/decorators/commit_decorator.rb b/app/decorators/commit_decorator.rb index 24723941037..652b41f62ac 100644 --- a/app/decorators/commit_decorator.rb +++ b/app/decorators/commit_decorator.rb @@ -50,7 +50,7 @@ class CommitDecorator < ApplicationDecorator # avatar: true will prepend avatar image def author_link(options) text = if options[:avatar] - avatar = h.image_tag h.gravatar_icon(author_email), class: "avatar", width: 16 + avatar = h.image_tag h.gravatar_icon(author_email), class: "avatar s16", width: 16 "#{avatar} #{author_name}" else author_name diff --git a/app/views/repositories/tags.html.haml b/app/views/repositories/tags.html.haml index 38cc3acafae..ba4692ff141 100644 --- a/app/views/repositories/tags.html.haml +++ b/app/views/repositories/tags.html.haml @@ -5,27 +5,29 @@ %tr %th Name %th Last commit - %th Updated at %th - @tags.each do |tag| - commit = Commit.new(tag.commit) - commit = CommitDecorator.decorate(commit) %tr %td - %strong= link_to tag.name, project_commits_path(@project, tag.name), class: "" + %strong + = link_to project_commits_path(@project, tag.name), class: "" do + %i.icon-tag + = tag.name + %small.light= truncate(tag.message, length: 70) %td - = link_to project_commit_path(@project, commit.id) do - %code= commit.short_id - = image_tag gravatar_icon(commit.author_email), class: "", width: 16 - = gfm escape_once(truncate(commit.title, length: 40)) - %td - %span.update-author.right + = image_tag gravatar_icon(commit.author_email), class: "avatar s16" + = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do + = commit.short_id + %span.light = time_ago_in_words(commit.committed_date) ago -   %td - if can? current_user, :download_code, @project - = link_to "Download", archive_project_repository_path(@project, ref: tag.name), class: "visible_link download_repo_link" + = link_to archive_project_repository_path(@project, ref: tag.name) do + %i.icon-download + Download - else %h3 No tags