Skip to content

Commit 635214e

Browse files
author
Jean-François Pineau
committed
personnalisation des cartes
1 parent 4783540 commit 635214e

File tree

3 files changed

+26
-95
lines changed

3 files changed

+26
-95
lines changed

README.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
Redmine Card
22
==================
33

4-
Redmine Card is plugin for Redmine to print quickly tickets to put on magnet board (Usefull for Scrum or Kanban)
5-
4+
Redmine Card is plugin for Redmine to print quickly tickets to put on sprint board
65

76
redmine-card is a redmine plugin to print tickets like flashcard or post-it.
87

9-
This plugin show grid 2*4 card that you can cut with cutter.
10-
11-
128
If you want to filter "assigned" select, you can edit groupId parameter in :
139

1410
redmine-card/assets/javascripts/card.js
1511

16-
Screenshot
17-
==================
18-
19-
Here is screenshot of Redmine Card in Redmine
20-
21-
![Interface in Redmin](https://raw.github.com/w3blogfr/redmine_card/master/doc/redmine-web.png)
22-
23-
Here is print preview
24-
25-
![Print Preview](https://raw.github.com/w3blogfr/redmine_card/master/doc/redmine-print-preview.png)
26-
27-
2812
Installation
2913
==================
3014

app/views/my_card/index.html.erb

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -76,38 +76,19 @@
7676
<a href="#" class="id"></a>
7777
<span class="subject"></span>
7878
<div class="line">
79-
Project : <a href="#" class="project"></a>
79+
Histoire : <a href="#" class="parent"></a>
8080
</div>
81-
<div class="line">
82-
Status : <span class="status"></span>
83-
</div>
84-
<div class="line">
85-
Author: <span class="author"></span>
86-
</div>
87-
<div class="line custom-field demandeur">
88-
Requester: <span></span>
89-
</div>
90-
<!--
91-
<div class="line">
92-
Category: <span class="category"></span>
81+
<div class="line custom-field anomalie">
82+
Type anomalie: <span></span>
9383
</div>
94-
-->
95-
<div class="line custom-field requestedDate">
96-
Requested Date: <span></span>
84+
<div class="line custom-field start">
85+
Condition de départ: <span></span>
9786
</div>
98-
<div class="line">
99-
Commited Date: <span class="commitedDate"></span>
87+
<div class="line custom-field finish">
88+
Condition d'acceptation: <span></span>
10089
</div>
10190
<div class="line">
102-
Estimated Hours: <span class="estimatedHour"></span>
103-
</div>
104-
<!--
105-
<div class="line">
106-
Spent Time: <span class="spendTime"></span>
107-
</div>
108-
-->
109-
<div class="line linked">
110-
Linked: <span></span>
91+
Estimation: <span class="estimation"></span>
11192
</div>
11293

11394
</div>

assets/javascripts/card.js

Lines changed: 17 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -160,68 +160,34 @@
160160
var ticketCard=ticketCardModele.clone().removeClass('ticket-modele').addClass('project'+issue.project.id).show();
161161

162162
jQuery('.id',ticketCard).html(issue.id).attr('href',relativeUrl+'/issues/'+issue.id);
163-
jQuery('.project',ticketCard).html(issue.project.name).attr('href',relativeUrl+'/projects/'+issue.project.name+'/issues');
163+
//jQuery('.project',ticketCard).html(issue.project.name).attr('href',relativeUrl+'/projects/'+issue.project.name+'/issues');
164+
jQuery('.parent',ticketCard).html(issue.parent).attr('href',relativeUrl+'/issues/'+issue.parent.id);
164165
jQuery('.subject',ticketCard).html(issue.subject);
165-
jQuery('.status',ticketCard).html(issue.status.name);
166-
jQuery('.author',ticketCard).html(issue.author.name);
167-
if(issue.category){
168-
jQuery('.category',ticketCard).html(issue.category.name);
169-
}else{
170-
jQuery('.category',ticketCard).closest('.line').hide();
171-
}
172-
173-
jQuery('.createdOn',ticketCard).html(dateFormat(new Date(issue.created_on),"yyyy-mm-dd"));
174-
175-
if(issue.due_date){
176-
jQuery('.commitedDate',ticketCard).html(dateFormat(new Date(issue.due_date),"yyyy-mm-dd"));
177-
}else{
178-
jQuery('.commitedDate',ticketCard).html();
179-
}
180-
181-
if(issue.estimated_hours){
182-
jQuery('.estimatedHour',ticketCard).html(issue.estimated_hours);
166+
167+
if(issue.story_points){
168+
jQuery('.estimation',ticketCard).html(issue.story_points);
183169
}else{
184-
jQuery('.estimatedHour',ticketCard).html();
170+
jQuery('.estimation',ticketCard).html();
185171
}
186172

187-
if (issue.spent_hours) {
188-
jQuery('.spendTime',ticketCard).html(issue.spent_hours);
189-
} else {
190-
jQuery('.spendTime',ticketCard).html();
191-
}
192-
193-
if(showLinkedTicket && issue.relations && issue.relations.length>0){
194-
console.log(JSON.stringify(issue.relations));
195-
var x_issues=new Array();
196-
for (var i=0;i<issue.relations.length;i++){
197-
var il=issue.relations[i];
198-
if(issue.id==il.issue_id) { x_issues[i]= il.issue_to_id; }
199-
else { x_issues[i]= il.issue_id; }
200-
}
201-
var text= JSON.stringify(x_issues);
202-
jQuery('.linked span',ticketCard).html(text);
203-
jQuery('.linked',ticketCard).show();
204-
} else {
205-
jQuery('.linked',ticketCard).hide();
206-
}
207173
jQuery('.line.custom-field').hide();
208174
if(issue.custom_fields){
209175
for (var i=0;i<issue.custom_fields.length;i++){
210-
if(issue.custom_fields[i].id==12){
211-
//Nom du demandeur
212-
if(issue.custom_fields[i].value=="Moi"){
213-
jQuery('.demandeur span',ticketCard).html(issue.author.name);
214-
}else{
215-
jQuery('.demandeur span',ticketCard).html(issue.custom_fields[i].value);
176+
if(issue.custom_fields[i].name== "Type d'anomalie"){
177+
jQuery('.anomalie span',ticketCard).html(issue.custom_fields[i].value);
178+
jQuery('.anomalie').show();
179+
}
180+
if(issue.custom_fields[i].name=="Conditions de d\u00e9part"){
181+
if(issue.custom_fields[i].value){
182+
jQuery('.start span',ticketCard).html(issue.custom_fields[i].value));
216183
}
217-
jQuery('.demandeur').show();
184+
jQuery('.start').show();
218185
}
219-
if(issue.custom_fields[i].id==13){
220-
//Date souhaité
186+
if(issue.custom_fields[i].name=="Conditions d'acceptation"){
221187
if(issue.custom_fields[i].value){
222-
jQuery('.requestedDate span',ticketCard).html(dateFormat(new Date(issue.custom_fields[i].value),"yyyy-mm-dd"));
188+
jQuery('.finish span',ticketCard).html(issue.custom_fields[i].value));
223189
}
224-
jQuery('.requestedDate').show();
190+
jQuery('.finish').show();
225191
}
226192
}
227193
}

0 commit comments

Comments
 (0)