allura
修订版 | cf12fe05528f87acbdafe55ab1e9aec05719a6fb (tree) |
---|---|
时间 | 2010-10-13 01:58:50 |
作者 | Jenny Steele <jsteele@geek...> |
Commiter | Jenny Steele |
Fix for labels
@@ -1,3 +1,3 @@ | ||
1 | 1 | <div> |
2 | - <input id="{{name}}" name="{{name}}" type="text" value="{{value or ''}}" class="label_edit {{className}}" /> | |
2 | + <input id="{{name}}" name="{{name}}" type="text" value="{{value and ','.join(value) or ''}}" class="label_edit {{className}}" /> | |
3 | 3 | </div> |
@@ -353,10 +353,10 @@ class Ticket(VersionedArtifact): | ||
353 | 353 | |
354 | 354 | def update(self,ticket_form): |
355 | 355 | self.globals.invalidate_bin_counts() |
356 | - tags = (ticket_form.pop('tags', None) or '').split(',') | |
356 | + tags = (ticket_form.pop('tags', None) or '') | |
357 | 357 | if tags == ['']: |
358 | 358 | tags = [] |
359 | - labels = (ticket_form.pop('labels', None) or '').split(',') | |
359 | + labels = (ticket_form.pop('labels', None) or '') | |
360 | 360 | if labels == ['']: |
361 | 361 | labels = [] |
362 | 362 | self.labels = labels |
@@ -114,8 +114,7 @@ class TestFunctionalController(TestController): | ||
114 | 114 | 'status':'ccc', |
115 | 115 | 'milestone':'', |
116 | 116 | 'assigned_to':'', |
117 | - 'labels-0':'yellow', | |
118 | - 'labels-1':'green', | |
117 | + 'labels':'yellow,green', | |
119 | 118 | 'labels_old':'yellow,green' |
120 | 119 | }) |
121 | 120 | response = self.app.get('/bugs/1/') |
@@ -127,7 +126,7 @@ class TestFunctionalController(TestController): | ||
127 | 126 | 'status':'ccc', |
128 | 127 | 'milestone':'', |
129 | 128 | 'assigned_to':'', |
130 | - 'labels-0':'yellow', | |
129 | + 'labels':'yellow', | |
131 | 130 | 'labels_old':'yellow' |
132 | 131 | }) |
133 | 132 | response = self.app.get('/bugs/1/') |
@@ -699,6 +699,10 @@ class TicketController(BaseController): | ||
699 | 699 | flash('You must provide a Name') |
700 | 700 | redirect('.') |
701 | 701 | c.app.globals.invalidate_bin_counts() |
702 | + if 'labels' in post_data: | |
703 | + post_data['labels'] = post_data['labels'].split(',') | |
704 | + else: | |
705 | + post_data['labels'] = [] | |
702 | 706 | self._update_ticket(post_data) |
703 | 707 | |
704 | 708 | @expose() |