From 2009747c0eeb794d774eae2c09b67afb6d56d9b7 Mon Sep 17 00:00:00 2001 From: keepcosmos Date: Tue, 27 Dec 2016 21:29:50 +0900 Subject: [PATCH] update issue detail view --- lib/terjira/presenters/common_presenter.rb | 2 +- lib/terjira/presenters/issue_presenter.rb | 27 +++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/terjira/presenters/common_presenter.rb b/lib/terjira/presenters/common_presenter.rb index 7776774..8b6198c 100644 --- a/lib/terjira/presenters/common_presenter.rb +++ b/lib/terjira/presenters/common_presenter.rb @@ -34,7 +34,7 @@ def username(user) if user.nil? dim_none else - "#{user.name}, #{user.displayName}" + "#{user.displayName}(#{user.name})" end end diff --git a/lib/terjira/presenters/issue_presenter.rb b/lib/terjira/presenters/issue_presenter.rb index be42a82..b460cc7 100644 --- a/lib/terjira/presenters/issue_presenter.rb +++ b/lib/terjira/presenters/issue_presenter.rb @@ -62,32 +62,31 @@ def summarise_issue(issue) def issue_detail_template %{<%= bold(issue.key) + ' in ' + issue.project.name %> - <%= pastel.underline.bold(issue.summary) %> + <%= bold(issue.summary) %> - <%= bold('Type') %>: <%= colorize_issue_type(issue.issuetype) %>\s\s\s<%= bold('Status') %>: <%= colorize_issue_stastus(issue.status) %>\s\s\s<%= bold('Priority') %>: <%= colorize_priority(issue.priority, title: true) %> + Type: <%= colorize_issue_type(issue.issuetype) %>\s\sStatus: <%= colorize_issue_stastus(issue.status) %>\s\sPriority: <%= colorize_priority(issue.priority, title: true) %> <% if issue.parent.nil? -%> - <%= bold('Epic Link') %>: <%= issue.try(:epic).try(:key) %> <%= issue.try(:epic).try(:name) || dim_none %> + Epic: <%= issue.try(:epic).try(:key) %> <%= issue.try(:epic).try(:name) || dim_none %> <% end -%> <% if issue.try(:parent) && issue.epic.nil? -%> - <%= bold('Parent') %>: <%= issue.parent.key %> + Parent: <%= issue.parent.key %> <% end %> <% if issue.try(:sprint) -%> - <%= bold('Sprint') %>: <%= colorize_sprint_state(issue.try(:sprint).try(:state)) %> <%= issue.try(:sprint).try(:id) %>. <%= issue.try(:sprint).try(:name) %> + Sprint: <%= colorize_sprint_state(issue.try(:sprint).try(:state)) %> <%= issue.try(:sprint).try(:id) %>. <%= issue.try(:sprint).try(:name) %> <% end -%> <% if estimate = issue_estimate(issue) -%> <%= estimate[0] %>: <%= estimate[1] %> <% end -%> - <%= bold('Assignee') %>: <%= username(issue.assignee) %> - <%= bold('Reporter') %>: <%= username(issue.reporter) %> + Assignee: <%= username(issue.assignee) %> + Reporter: <%= username(issue.reporter) %> - <%= bold('Description') %> - <%= issue.description || dim_none %> + <%= issue.description || dim("No description") %> <% if issue.try(:environment) -%> - <%= bold('Environment') %> + <%= Environment %>: <%= issue.environment %> <% end -%> <% if issue.try(:attachment).present? -%> @@ -116,7 +115,7 @@ def comments_template """ <% remain_comments = issue.comments -%> <% visiable_comments = remain_comments.pop(COMMENTS_SIZE) -%> - <%= bold('Comments') %> + Comments: <% if visiable_comments.empty? -%> <%= dim_none %> <% elsif remain_comments.size != 0 -%> @@ -185,15 +184,15 @@ def colorize_priority(priority, opts = {}) def issue_estimate(issue) field = Client::Field.story_points story_points = issue.try(field.key) if field.respond_to? :key - return [bold('Story Points'), story_points] if story_points + return ['Story Points', story_points] if story_points return unless issue.try(:timetracking).is_a? Hash if origin = issue.timetracking['originalEstimate'] remain = issue.timetracking['remainingEstimate'] - [bold('Estimate'), "#{remain} / #{origin}"] + ['Estimate', "#{remain} / #{origin}"] else - [bold('Estimate'), dim_none] + ['Estimate', dim_none] end end