Commit 76f00542 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ui/issuable-list-item' into 'master'

UI: Issuable list item tweaks

Depends on !1953

See the commits for more details, the messages mostly speak for themselves.

Before:

![Screen_Shot_2015-12-02_at_17.37.40](/uploads/00ac22d131c49ce548bccd96866cbc75/Screen_Shot_2015-12-02_at_17.37.40.png)

After:

![merge_item_after](/uploads/201d742494596c50bbdb3626f06f65a8/merge_item_after.png)

Fixes https://dev.gitlab.org/gitlab/gitlabhq/issues/2590 and https://dev.gitlab.org/gitlab/gitlabhq/issues/2589

See merge request !1962
parents d63d12a5 00ebe223
......@@ -341,10 +341,6 @@ table {
text-align: center;
}
.task-status {
margin-left: 10px;
}
#nprogress .spinner {
top: 15px !important;
right: 10px !important;
......
......@@ -21,7 +21,7 @@ module ProjectsHelper
end
def link_to_member(project, author, opts = {})
default_opts = { avatar: true, name: true, size: 16, author_class: 'author' }
default_opts = { avatar: true, name: true, size: 16, author_class: 'author', title: ":name" }
opts = default_opts.merge(opts)
return "(deleted)" unless author
......@@ -39,7 +39,8 @@ module ProjectsHelper
if opts[:name]
link_to(author_html, user_path(author), class: "author_link").html_safe
else
link_to(author_html, user_path(author), class: "author_link has_tooltip", data: { :'original-title' => sanitize(author.name) } ).html_safe
title = opts[:title].sub(":name", sanitize(author.name))
link_to(author_html, user_path(author), class: "author_link has_tooltip", data: { :'original-title' => title, container: 'body' } ).html_safe
end
end
......
......@@ -6,35 +6,39 @@
.issue-title
%span.issue-title-text
= link_to_gfm issue.title, issue_path(issue), class: "row_title"
.issue-labels
- issue.labels.each do |label|
= link_to_label(label, project: issue.project)
.pull-right.light
- if issue.closed?
%span
CLOSED
- if issue.assignee
= link_to_member(@project, issue.assignee, name: false)
= link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name")
- note_count = issue.notes.user.count
- if note_count > 0
 
%span
%i.fa.fa-comments
= link_to issue_path(issue) + "#notes" do
= icon('comments')
= note_count
- else
 
%span.issue-no-comments
%i.fa.fa-comments
= link_to issue_path(issue) + "#notes", class: "issue-no-comments" do
= icon('comments')
= 0
.issue-info
= "#{issue.to_reference} opened #{time_ago_with_tooltip(issue.created_at, placement: 'bottom')} by #{link_to_member(@project, issue.author, avatar: false)}".html_safe
#{issue.to_reference} ·
opened #{time_ago_with_tooltip(issue.created_at, placement: 'bottom')}
by #{link_to_member(@project, issue.author, avatar: false)}
- if issue.milestone
 
%span
%i.fa.fa-clock-o
= link_to namespace_project_issues_path(issue.project.namespace, issue.project, milestone_title: issue.milestone.title) do
= icon('clock-o')
= issue.milestone.title
- if issue.labels.any?
 
- issue.labels.each do |label|
= link_to_label(label, project: issue.project)
- if issue.tasks?
 
%span.task-status
= issue.task_status
......
......@@ -3,48 +3,52 @@
.merge-request-title
%span.merge-request-title-text
= link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title"
.merge-request-labels
- merge_request.labels.each do |label|
= link_to_label(label, project: merge_request.project)
.pull-right.light
- if ci_commit
= render_ci_status(ci_commit)
- if merge_request.merged?
%span
%i.fa.fa-check
= icon('check')
MERGED
- elsif merge_request.closed?
%span
%i.fa.fa-ban
= icon('ban')
CLOSED
- note_count = merge_request.mr_and_commit_notes.user.count
- if merge_request.assignee
 
= link_to_member(merge_request.source_project, merge_request.assignee, name: false)
= link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: "Assigned to :name")
- if note_count > 0
 
%span
%i.fa.fa-comments
= link_to merge_request_path(merge_request) + "#notes" do
= icon('comments')
= note_count
- else
 
%span.merge-request-no-comments
%i.fa.fa-comments
= link_to merge_request_path(merge_request) + "#notes", class: "merge-request-no-comments" do
= icon('comments')
= 0
.merge-request-info
= "##{merge_request.iid} opened #{time_ago_with_tooltip(merge_request.created_at, placement: 'bottom')} by #{link_to_member(@project, merge_request.author, avatar: false)}".html_safe
- if merge_request.milestone_id?
 
%span
%i.fa.fa-clock-o
= merge_request.milestone.title
\##{merge_request.iid} ·
opened #{time_ago_with_tooltip(merge_request.created_at, placement: 'bottom')}
by #{link_to_member(@project, merge_request.author, avatar: false)}
- if merge_request.target_project.default_branch != merge_request.target_branch
 
%span
%i.fa.fa-code-fork
= link_to namespace_project_commits_path(merge_request.project.namespace, merge_request.project, merge_request.target_branch) do
= icon('code-fork')
= merge_request.target_branch
- if merge_request.milestone
 
= link_to namespace_project_merge_requests_path(merge_request.project.namespace, merge_request.project, milestone_title: merge_request.milestone.title) do
= icon('clock-o')
= merge_request.milestone.title
- if merge_request.labels.any?
 
- merge_request.labels.each do |label|
= link_to_label(label, project: merge_request.project)
- if merge_request.tasks?
 
%span.task-status
= merge_request.task_status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment