summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-12-03 17:34:30 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-12-03 17:34:30 +0000
commit76f0054220e0ff6c37f69702e1fa5005ded1f402 (patch)
treed80de2a4393c29192b9f1e1bb67104d3b90423c5
parentd63d12a526a70f7d022eed8dbeb946feb7b88d4c (diff)
parent00ebe2239b7834fd754fa2ab8fd14b2ef6074f63 (diff)
downloadgitlab-ce-76f0054220e0ff6c37f69702e1fa5005ded1f402.tar.gz
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
-rw-r--r--app/assets/stylesheets/framework/common.scss4
-rw-r--r--app/helpers/projects_helper.rb5
-rw-r--r--app/views/projects/issues/_issue.html.haml26
-rw-r--r--app/views/projects/merge_requests/_merge_request.html.haml40
4 files changed, 40 insertions, 35 deletions
diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss
index 61ecd58e6c5..d2f491daf78 100644
--- a/app/assets/stylesheets/framework/common.scss
+++ b/app/assets/stylesheets/framework/common.scss
@@ -341,10 +341,6 @@ table {
text-align: center;
}
-.task-status {
- margin-left: 10px;
-}
-
#nprogress .spinner {
top: 15px !important;
right: 10px !important;
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index c0c51aae039..48729e5260e 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -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
diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml
index d7657ee7e40..1eb71990e55 100644
--- a/app/views/projects/issues/_issue.html.haml
+++ b/app/views/projects/issues/_issue.html.haml
@@ -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
&nbsp;
- %span
- %i.fa.fa-comments
+ = link_to issue_path(issue) + "#notes" do
+ = icon('comments')
= note_count
- else
&nbsp;
- %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} &middot;
+ opened #{time_ago_with_tooltip(issue.created_at, placement: 'bottom')}
+ by #{link_to_member(@project, issue.author, avatar: false)}
- if issue.milestone
&nbsp;
- %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?
+ &nbsp;
+ - issue.labels.each do |label|
+ = link_to_label(label, project: issue.project)
- if issue.tasks?
+ &nbsp;
%span.task-status
= issue.task_status
diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml
index 83e8ad11989..1d4c9b66c42 100644
--- a/app/views/projects/merge_requests/_merge_request.html.haml
+++ b/app/views/projects/merge_requests/_merge_request.html.haml
@@ -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
&nbsp;
- = 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
&nbsp;
- %span
- %i.fa.fa-comments
+ = link_to merge_request_path(merge_request) + "#notes" do
+ = icon('comments')
= note_count
- else
&nbsp;
- %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?
- &nbsp;
- %span
- %i.fa.fa-clock-o
- = merge_request.milestone.title
+ \##{merge_request.iid} &middot;
+ 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
&nbsp;
- %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
+ &nbsp;
+ = 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?
+ &nbsp;
+ - merge_request.labels.each do |label|
+ = link_to_label(label, project: merge_request.project)
- if merge_request.tasks?
+ &nbsp;
%span.task-status
= merge_request.task_status