|
157 | 157 | function getDivPostIssue(issue){ |
158 | 158 |
|
159 | 159 | // CHOICE OF THE TEMPLATE |
160 | | - var ticketCardModele=jQuery('.ticket-modele'); |
| 160 | + //var ticketCardModele=jQuery('.ticket-modele'); |
161 | 161 |
|
162 | 162 | console.log("getDivPostIssue(issue="+JSON.stringify(issue)+")"); |
163 | | - var ticketCard=ticketCardModele.clone().removeClass('ticket-modele').addClass('project'+issue.project.id).show(); |
| 163 | + //var ticketCard=ticketCardModele.clone().removeClass('ticket-modele').addClass('project'+issue.project.id).show(); |
164 | 164 |
|
165 | | - jQuery('.id',ticketCard).html(issue.id).attr('href',relativeUrl+'/issues/'+issue.id); |
166 | | - //jQuery('.project',ticketCard).html(issue.project.name).attr('href',relativeUrl+'/projects/'+issue.project.name+'/issues'); |
167 | | - if (issue.parent != undefined) { |
168 | | - console.log ("found parent:" + issue.parent); |
169 | | - jQuery('.parent',ticketCard).html(issue.parent.id).attr('href',relativeUrl+'/issues/'+issue.parent.id); |
170 | | - } else { |
171 | | - console.log ("not found parent:" + issue.parent); |
172 | | - jQuery('.histoire',ticketCard).hide(); |
173 | | - } |
174 | | - jQuery('.subject',ticketCard).html(issue.subject); |
| 165 | + //jQuery('.id',ticketCard).html(issue.id).attr('href',relativeUrl+'/issues/'+issue.id); |
| 166 | + issue.idhref = relativeUrl+'/issues/'+issue.id; |
| 167 | + |
| 168 | + //if (issue.parent != undefined) { |
| 169 | + // jQuery('.parent',ticketCard).html(issue.parent.id).attr('href',relativeUrl+'/issues/'+issue.parent.id); |
| 170 | + //} else { |
| 171 | + // jQuery('.histoire',ticketCard).hide(); |
| 172 | + //} |
| 173 | + issue.parenthref = relativeUrl+'/issues/'+issue.parent.id; |
175 | 174 |
|
176 | | - if(issue.story_points != null){ |
| 175 | + //jQuery('.subject',ticketCard).html(issue.subject); |
| 176 | + |
| 177 | + /*if(issue.story_points != null){ |
177 | 178 | jQuery('.estimation',ticketCard).html(issue.story_points); |
178 | 179 | }else{ |
179 | 180 | jQuery('.estimation',ticketCard).hide(); |
180 | | - } |
| 181 | + }*/ |
181 | 182 |
|
182 | | - jQuery('.line.custom-field.anomalie',ticketCard).hide(); |
183 | | - var displayDescription = true; |
| 183 | +// jQuery('.line.custom-field.anomalie',ticketCard).hide(); |
| 184 | +// var displayDescription = true; |
184 | 185 | if(issue.custom_fields){ |
185 | 186 | for (var i=0;i<issue.custom_fields.length;i++){ |
186 | 187 | if(issue.custom_fields[i].name === "Type d'anomalie"){ |
187 | | - jQuery('.anomalie span',ticketCard).html(issue.custom_fields[i].value[0]); |
188 | | - jQuery('.line.custom-field.anomalie',ticketCard).show(); |
| 188 | + //jQuery('.anomalie span',ticketCard).html(issue.custom_fields[i].value[0]); |
| 189 | + //jQuery('.line.custom-field.anomalie',ticketCard).show(); |
| 190 | + issue.anomalie = issue.custom_fields[i].value[0]; |
189 | 191 | } |
190 | 192 | if(issue.custom_fields[i].name==="Conditions de d\u00e9part"){ |
191 | | - displayDescription=false; |
| 193 | + /*displayDescription=false; |
192 | 194 | if(issue.custom_fields[i].value){ |
193 | 195 | jQuery('.start span',ticketCard).html(issue.custom_fields[i].value); |
194 | | - } |
| 196 | + }*/ |
| 197 | + issue.start = issue.custom_fields[i].value; |
195 | 198 | } |
196 | 199 | if(issue.custom_fields[i].name==="Conditions d'acceptation"){ |
197 | | - displayDescription=false; |
| 200 | + /*displayDescription=false; |
198 | 201 | if(issue.custom_fields[i].value){ |
199 | 202 | jQuery('.finish span',ticketCard).html(issue.custom_fields[i].value); |
200 | | - } |
| 203 | + }*/ |
| 204 | + issue.finish = issue.custom_fields[i].value; |
201 | 205 | } |
202 | 206 | } |
203 | 207 | } |
204 | | - if (displayDescription) { |
| 208 | + /*if (displayDescription) { |
205 | 209 | jQuery('.description span',ticketCard).html(issue.description); |
206 | 210 | jQuery('.start',ticketCard).hide(); |
207 | 211 | jQuery('.finish',ticketCard).hide(); |
208 | 212 | } else { |
209 | 213 | jQuery('.description',ticketCard).hide(); |
210 | 214 | jQuery('.start',ticketCard).show(); |
211 | 215 | jQuery('.finish',ticketCard).show(); |
212 | | - } |
| 216 | + }*/ |
| 217 | + |
| 218 | + //ticketCard.addClass("priority"+issue.priority.id); |
213 | 219 |
|
214 | | - ticketCard.addClass("priority"+issue.priority.id); |
| 220 | + // CHOICE OF THE TEMPLATE |
| 221 | + var ticketCard; |
| 222 | + if (issue.project.name === "Precovision-interne") { |
| 223 | + ticketCard = jQuery("#ticket-modele").tmpl(issue); |
| 224 | + } else { |
| 225 | + ticketCard = jQuery("#ticket-default").tmpl(issue); |
| 226 | + } |
215 | 227 | return ticketCard; |
216 | 228 | } |
217 | 229 |
|
|
0 commit comments