157 lines
4.6 KiB
HTML
157 lines
4.6 KiB
HTML
{% extends 'sstreasury/base.html' %}
|
|
|
|
{#
|
|
Society Self-Service
|
|
Copyright © 2018 Yingtong Li (RunasSudo)
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
#}
|
|
|
|
{% block title %}{{ revision.name }}{% endblock %}
|
|
|
|
{% block maincontent %}
|
|
<h1>{{ revision.name }}</h1>
|
|
|
|
{% if is_latest %}
|
|
<a class="ui mini labeled icon button" href="{{ url('budget_edit', kwargs={'id': revision.budget.id}) }}"><i class="edit icon"></i> Edit</a>
|
|
{% else %}
|
|
<div class="ui warning message">
|
|
<p>You are viewing an older version of this budget. To make any changes, <a href="{{ url('budget_view', kwargs={'id': revision.budget.id}) }}">click here</a> to return to the current version.</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<table class="ui definition table">
|
|
<tbody>
|
|
<tr>
|
|
<td class="three wide">ID</td>
|
|
<td class="thirteen wide">{{ revision.budget.id }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>{{ revision.name }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Due date</td>
|
|
<td>{{ revision.date or '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Contributors</td>
|
|
<td>
|
|
<div class="ui list">
|
|
{% for contributor in revision.contributors.all() %}
|
|
<div class="item">
|
|
<i class="user circle icon"></i>
|
|
<div class="content"><a href="mailto:{{ contributor.email }}">
|
|
{% if contributor.first_name %}
|
|
{{ contributor.first_name }} {{ contributor.last_name }}
|
|
{% else %}
|
|
{{ contributor.email }}
|
|
{% endif %}
|
|
</a></div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Comments</td>
|
|
<td>{{ revision.comments }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Revenue</td>
|
|
<td>
|
|
<div>{{ revision.revenue }}</div>
|
|
{% if revision.revenue_comments %}
|
|
<div class="ui accordion">
|
|
<div class="active title">
|
|
<i class="dropdown icon"></i>
|
|
Revenue comments
|
|
</div>
|
|
<div class="content">
|
|
{{ revision.revenue_comments }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Expenses</td>
|
|
<td>
|
|
<div>{{ revision.expense }}</div>
|
|
{% if revision.expense_comments %}
|
|
<div class="ui accordion">
|
|
<div class="active title">
|
|
<i class="dropdown icon"></i>
|
|
Expense comments
|
|
</div>
|
|
<div class="content">
|
|
{{ revision.expense_comments }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
{% if is_latest %}
|
|
<form class="ui form" action="{{ url('budget_action', kwargs={'id': revision.budget.id}) }}" method="POST">
|
|
<div class="required field">
|
|
<textarea rows="4" name="comment"></textarea>
|
|
</div>
|
|
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
|
<input class="ui primary button" type="submit" name="action" value="Comment">
|
|
</form>
|
|
|
|
<div class="ui feed">
|
|
{% for item in history %}
|
|
{% if item.__class__.__name__ == 'BudgetComment' %}
|
|
<div class="event">
|
|
<div class="label">
|
|
<i class="comment alternate outline icon"></i>
|
|
</div>
|
|
<div class="content">
|
|
<div class="summary">
|
|
<i class="user circle icon"></i>
|
|
<a href="mailto:{{ item.author.email }}">{{ item.author.first_name }} {{ item.author.last_name}}</a> commented
|
|
<div class="date">
|
|
{{ localtime(item.time) }}
|
|
</div>
|
|
</div>
|
|
<div class="extra text">
|
|
{{ item.content }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% elif item.__class__.__name__ == 'BudgetRevision' %}
|
|
<div class="event">
|
|
<div class="label">
|
|
<i class="edit icon"></i>
|
|
</div>
|
|
<div class="content">
|
|
<div class="summary">
|
|
<i class="user circle icon"></i>
|
|
<a href="mailto:{{ item.author.email }}">{{ item.author.first_name }} {{ item.author.last_name}}</a> edited the budget <a href="{{ url('budget_view', kwargs={'id': revision.budget.id}) }}?revision={{ item.id }}">(view)</a>
|
|
<div class="date">
|
|
{{ localtime(item.time) }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|