<td>{% if script.author.username %}<a href="{% url teleforma-profile-detail script.author.username %}">{{ script.author.first_name }}</a>{% endif %}</td>
<td>{{ script.date_added }}</td>
<td>{% if script.date_marked %}{{ script.date_marked }}{% endif %}</td>
- <td>{% if script.corrector %}{{ script.corrector }}{% endif %}</td>
+ <td>
+ {% if script.corrector %}{% if profile > 0 %}{{ script.corrector }}{% else %}#{{ script.corrector.id }}{% endif %}{% endif%}
+ </td>
<td>{% if script.score %}{{ script.score|floatformat }}{% endif %}</td>
</tr>
{% endfor %}
{% get_all_correctors_with_courses as correctors %}
{% for p in correctors %}
<option value="{{ p.username }}"
- data-courses="{{ p.courses }}" {% if request.POST.correctors == p.username %}selected{% endif %}>{{ p.name }}</option>
+ data-courses="{{ p.courses }}" {% if request.POST.correctors == p.username %}selected{% endif %}>#{{ p.id }}</option>
{% endfor %}
</select>
</div>
// hide recipients fields
{#$('#id_course').parent().parent().hide();#}
+ $("#id_recipients").parent().parent().hide();
$('[name="recipient_category"]').bind('change', update_desk_messages);
$('[name="course"], [name="corrector_course"]').bind('change', update_desk_messages);
<div class="pm_message{% if message.is_pending %} pm_pending{% endif %}{% if message.is_rejected %} pm_rejected{% endif %}{% if message.sender == user and message.sender_archived or message.recipient == user and message.recipient_archived %} pm_archived{% endif %}{% if message.sender == user and message.sender_deleted_at or message.recipient == user and message.recipient_deleted_at %} pm_deleted{% endif %}{% if message.recipient == user and not message.read_at %} pm_unread{% endif %}">
<div class="pm_header">
{% if message.obfuscated_sender %}
+ {% if not message.obfuscated_sender|startswith:'#' %}
<a href="{% url telemeta-profile-detail message.obfuscated_sender %}" title="{% get_training_profile message.sender %}">
+ {% endif %}
<span class="pm_sender">{{ message.obfuscated_sender|or_me:user }}</span>
- </a>»
+ {% if not message.obfuscated_sender|startswith:'#' %}</a>{% endif %}»
{% endif %}
{% if message.obfuscated_recipient %}
+ {% if not message.obfuscated_recipient|startswith:'#' %}
<a href="{% url telemeta-profile-detail message.obfuscated_recipient %}" title="{% get_training_profile message.recipient %}">
+ {% endif %}
<span class="pm_recipient">{{ message.obfuscated_recipient|or_me:user }}</span>
- </a> |
+ {% if not message.obfuscated_recipient|startswith:'#' %}</a>{% endif %} |
{% endif %}
<span class="pm_date">{{ message.sent_at|date:"DATETIME_FORMAT"}}</span> |
<span class="pm_subject">{{ message.subject }}</span>
output += block
return output
+@register.filter('startswith')
+def startswith(text, starts):
+ if isinstance(text, basestring):
+ return text.startswith(starts)
+ return False
@register.tag
def value_from_settings(parser, token):
name = corrector.last_name + corrector.first_name
if name:
result.append({
+ 'id': corrector.id,
'username':corrector.username,
'name':corrector.last_name + " " + corrector.first_name,
'courses':json.dumps(list(correctors[corrector]))