Merged in [7935] from liudapeng@chinamobile.com:

Add brief_display function in Constraint class to display both WG conflict and person conflict. Fixes issue #1384.
 - Legacy-Id: 7938
Note: SVN reference [7935] has been migrated to Git commit 425f88cad70f7a473c6f5bf58bbde581a85ccb39
This commit is contained in:
Henrik Levkowetz 2014-06-26 19:56:34 +00:00
parent df77742b93
commit 6e3bb37ecb
2 changed files with 11 additions and 1 deletions

View file

@ -723,6 +723,16 @@ class Constraint(models.Model):
def __unicode__(self):
return u"%s %s target=%s person=%s" % (self.source, self.name.name.lower(), self.target, self.person)
def brief_display(self):
if self.target and self.person:
return u"%s ; %s" % (self.target.acronym, self.person)
elif self.target and not self.person:
return u"%s " % (self.target.acronym)
elif not self.target and self.person:
return u"%s " % (self.person)
@property
def person_conflicted(self):
if self.person is None:

View file

@ -55,7 +55,7 @@ th { text-align: right; vertical-align: text-top; }
<td valign="top">
{% if session.group.ad %}<a href="mailto:{{session.group.ad.email_address}}">{{session.group.ad}}</a> {%endif%}
</td>
<td width="30%" valign="top">{%if session.requested_duration%}<span>{% for constraint in session.constraints %}{%ifchanged%}</span><span class="{{constraint.name.slug}}">{%endifchanged%} {{constraint.target.acronym}}{% if constraint.target.parent.id == constraint.source.parent.id%} ({{constraint.target.parent.acronym}}){%endif%}{%if not forloop.last %},{%endif%} {% endfor %}</span>{%endif%}</td>
<td width="30%" valign="top">{%if session.requested_duration%}<span>{% for constraint in session.constraints %}{%ifchanged%}</span><span class="{{constraint.name.slug}}">{%endifchanged%} {% if constraint %} {% if not forloop.first %}, {%endif%}{{constraint.brief_display}}{% if constraint.target.parent.id == constraint.source.parent.id%} ({{constraint.target.parent.acronym}}){%endif%} {% endif %} {% endfor %}</span>{%endif%}</td>
<td width="30%" valign="top">{% if session.comments %}<i><font color="#800000">{{session.comments|linebreaksbr}}</font></i>{% endif %}</td>
</tr>
{% endif %}