add option to override default look of followups - this is work in progress.

This commit is contained in:
Andreas Kotowicz 2011-11-21 20:04:05 +01:00
parent 2cee519d1c
commit f897d5bcb4
3 changed files with 41 additions and 12 deletions

View File

@ -52,6 +52,10 @@ HELPDESK_TRANSLATE_TICKET_COMMENTS = getattr(settings, 'HELPDESK_TRANSLATE_TICKE
# list of languages to offer. if set to false, all default google translate languages will be shown. # list of languages to offer. if set to false, all default google translate languages will be shown.
HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG = getattr(settings, 'HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG', ["en", "de", "fr", "ru"]) HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG = getattr(settings, 'HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG', ["en", "de", "fr", "ru"])
# allow user to override default layout for 'followups' - work in progress.
HELPDESK_FOLLOWUP_MOD = getattr(settings, 'HELPDESK_FOLLOWUP_MOD', False)
''' options for public pages ''' ''' options for public pages '''
# show 'view a ticket' section on public page? # show 'view a ticket' section on public page?

View File

@ -153,22 +153,34 @@ td {
background-color: #bcd4ec; background-color: #bcd4ec;
} }
div.followup { div.followup, div.followup_mod {
width: 100%; width: 100%;
border-top: solid #666 1px; border-top: solid #666 1px;
padding:0 0 2px; padding:0 0 2px;
} }
div.followup .title { div.followup_mod {
border: solid #666 1px;
padding: 5px;
margin: 0px 0px 10px;
}
div.followup .title, div.followup_mod .title {
font-weight: bold; font-weight: bold;
font-size: 10pt; font-size: 10pt;
} }
div.followup .title span { div.followup .title span, div.followup_mod .title span {
color: #aaa; color: #aaa;
font-weight: normal; font-weight: normal;
} }
div.followup_mod small {
float: right;
font-weight: bold;
font-style: italic;
}
span.private { span.private {
color: #aaa; color: #aaa;
font-style: italic; font-style: italic;

View File

@ -52,15 +52,28 @@
<h3>{% trans "Follow-Ups" %}</h3> <h3>{% trans "Follow-Ups" %}</h3>
{% load ticket_to_link %} {% load ticket_to_link %}
{% for followup in ticket.followup_set.all %} {% for followup in ticket.followup_set.all %}
<div class='followup'> {% if helpdesk_settings.HELPDESK_FOLLOWUP_MOD %}
<div class='title'> <div class='followup_mod'>
<div class='title'>
<span class='byline'>{{ followup.user.get_full_name }}&nbsp;&nbsp;&nbsp;&nbsp;{{ followup.date }} ({{ followup.date|timesince }} ago)</span> <small>{{ followup.title }}</small>
{% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}
{% if helpdesk_settings.HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP %}
{% if followup.user and request.user == followup.user and not followup.ticketchange_set.all %}
<a href="{% url helpdesk_followup_edit ticket.id followup.id %}" class='followup-edit'><img width="60" height="15" title="Edit" alt="Edit" src="{{ STATIC_URL }}helpdesk/buttons/edit.png"></a>
{% endif %}
{% endif %}
</div>
{% else %}
<div class='followup'>
<div class='title'>
{{ followup.title }} <span class='byline'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|timesince }} ago</span>{% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}</span> {{ followup.title }} <span class='byline'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|timesince }} ago</span>{% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}</span>
{% if helpdesk_settings.HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP %} {% if helpdesk_settings.HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP %}
{% if followup.user and request.user == followup.user and not followup.ticketchange_set.all %} {% if followup.user and request.user == followup.user and not followup.ticketchange_set.all %}
<a href="{% url helpdesk_followup_edit ticket.id followup.id %}" class='followup-edit'><img width="60" height="15" title="Edit" alt="Edit" src="{{ STATIC_URL }}helpdesk/buttons/edit.png"></a> <a href="{% url helpdesk_followup_edit ticket.id followup.id %}" class='followup-edit'><img width="60" height="15" title="Edit" alt="Edit" src="{{ STATIC_URL }}helpdesk/buttons/edit.png"></a>
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
{% endif %}
<span class='followup-desc'>{% if followup.comment %}{{ followup.comment|force_escape|urlizetrunc:50|num_to_link|linebreaksbr }}{% endif %}</span> <span class='followup-desc'>{% if followup.comment %}{{ followup.comment|force_escape|urlizetrunc:50|num_to_link|linebreaksbr }}{% endif %}</span>
{% for change in followup.ticketchange_set.all %} {% for change in followup.ticketchange_set.all %}
{% if forloop.first %}<div class='changes'><ul>{% endif %} {% if forloop.first %}<div class='changes'><ul>{% endif %}