Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sopy/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% from 'user.html' import user_display -%}
<!doctype html>
<html>
<head>
Expand Down Expand Up @@ -30,8 +31,8 @@
{% if current_user.anonymous %}
<li><a href="{{ url_for('auth.login', next=request.path) }}">Log In</a></li>
{% else %}
<li class="{% block nav_user %}{% endblock %}"><a href="#">{{ current_user.display_name }}</a></li>
<li><a href="{{ url_for('auth.logout') }}">Log Out</a></li>
<li class="{% block nav_user %}{% endblock %}"><a href="#">{{ user_display(current_user) }}</a></li>
<li><a href="{{ url_for('auth.logout') }}">Log Out</a></li>
{% endif %}
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions sopy/templates/transcript/detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends 'transcript/base.html' %}
{% from 'user.html' import user_link %}

{% block content %}
<div class="row"><div class="col-md-12">
Expand All @@ -17,8 +18,7 @@ <h2 class="page-header">{% block title %}{{ item.title }}{% endblock %}</h2>
{% for message in item.messages %}
<div class="well well-sm">
<ul class="list-inline">
<li><a href="{{ message.user.profile_link }}"><img src="{{ message.user.profile_image }}" alt="" height="24"/></a></li>
<li><a href="{{ message.user.profile_link }}">{{ message.user.display_name }}</a></li>
<li>{{ user_link(message.user) }}</li>
<li>{{ message.ts.strftime('%Y-%m-%d %H:%M') }}</li>
{% if message.stars %}<li><i class="fa fa-star"></i> {{ message.stars }}</li>{% endif %}
</ul>
Expand Down
3 changes: 2 additions & 1 deletion sopy/templates/transcript/update.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends 'transcript/base.html' %}
{% from 'user.html' import user_link %}

{% set script_ace = True %}

Expand Down Expand Up @@ -48,7 +49,7 @@ <h2 class="page-header">{% block title %}{% if item is none %}Add Transcript{% e
{% for message in item.messages %}
<tr>
<td><input type="checkbox" name="remove-{{ message.id }}"/></td>
<td>{{ message.user.display_name }}</td>
<td>{{ user_link(message.user) }}</td>
<td>{% if message.rendered %}{{ message.content|safe }}{% else %}<pre>{{ message.content }}</pre>{% endif %}</td>
</tr>
{% endfor %}
Expand Down
10 changes: 10 additions & 0 deletions sopy/templates/user.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% macro user_display(user, height=16) %}
<span title="{{ user.display_name }} ({{ user.id }})">
<img src="{{ user.profile_image }}" height="{{ height }}">
{{ user.display_name }}
</span>
{% endmacro %}

{% macro user_link(user, height=24) -%}
<a href="{{ user.profile_link }}">{{ user_display(user, height) }}</a>
{%- endmacro %}
3 changes: 2 additions & 1 deletion sopy/templates/wiki/detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends 'wiki/base.html' %}
{% from 'user.html' import user_link %}

{% block content %}
<div class="row"><div class="col-md-12">
Expand All @@ -8,7 +9,7 @@ <h2 class="page-header">{% block title %}{{ page.title }}{% endblock %}</h2>
{% if page.community %}<div class="alert alert-info">This page is in community mode. Any user with 100 rep may edit it.</div>{% endif %}

<ul class="list-inline pull-right">
<li><small><i>Last edited on {{ page.updated|datetimeformat }} by {{ page.author.display_name }}</i></small></li>
<li><small><i>Last edited on {{ page.updated|datetimeformat }} by {{ user_link(page.author) }}</i></small></li>
{% if has_group('editor') or page.draft or page.community %}<li><a href="{{ page.update_url }}" class="btn btn-success btn-sm"><i class="fa fa-edit"></i> Edit</a></li>{% endif %}
{% if has_group('editor') %}<li><a href="{{ page.delete_url }}" class="btn btn-danger btn-sm"><i class="fa fa-minus"></i> Remove</a></li>{% endif %}
</ul>
Expand Down