From b0d2dffc0dcaec59973afc87432935b0df320aeb Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Wed, 9 Nov 2016 01:02:06 -0500 Subject: [PATCH] Move ItemIssueComponent template to component JS file --- .../components/item_issue_component.js.es6 | 37 ++++++++++++++++++- .../projects/cycle_analytics/show.html.haml | 24 ------------ 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/app/assets/javascripts/cycle_analytics/components/item_issue_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/item_issue_component.js.es6 index f4c3d92bd56..14542dbb958 100644 --- a/app/assets/javascripts/cycle_analytics/components/item_issue_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/item_issue_component.js.es6 @@ -18,6 +18,41 @@ template: '#item-issue-component', props: { issue: Object, - } + }, + template: ` +
+ +
+ + {{ issue.title }} + +
+ + #{{issue.id}} + + + Opened + + {{ issue.datetime }} + + + + by + + {{ issue.author }} + + +
+
+ + {{ issue.totalTime.hours }} + hr + + + {{ issue.totalTime.minutes }} + mins + +
+ `, }); })(window.gl || (window.gl = {})); diff --git a/app/views/projects/cycle_analytics/show.html.haml b/app/views/projects/cycle_analytics/show.html.haml index 06a6e24ac49..aa72a801938 100644 --- a/app/views/projects/cycle_analytics/show.html.haml +++ b/app/views/projects/cycle_analytics/show.html.haml @@ -152,30 +152,6 @@ %li{ "v-for" => "issue in items" } %item-issue-component{ ":issue" => "issue" } -%script{ type: 'text/x-template', id: 'item-issue-component' } - .item-details - %img.avatar{:src => "https://secure.gravatar.com/avatar/3731e7dd4f2b4fa8ae184c0a7519dd58?s=64&d=identicon"}/ - %h5.item-title - %a{ :href => "issue.url" } - {{ issue.title }} - %a{ :href => "issue.url" } - = '#{{issue.id}}' - %span - Opened - %a{:href => "issue.url"} - {{ issue.datetime }} - %span - by - %a{:href => "issue.profile"} - {{ issue.author }} - .item-time - %span.hours{ "v-if" => "issue.totalTime.hours"} - {{ issue.totalTime.hours }} - %abbr{:title => "Hours"} hr - %span.minutes{ "v-if" => "issue.totalTime.minutes" } - {{ issue.totalTime.minutes }} - %abbr{:title => "Minutes"} mins - %script{ type: 'text/x-template', id: 'item-commit-component' } %div %p