blob: 5e2859121d58131135b9510d61a0abea9c3fab13 [file] [log] [blame]
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{% extends g.theme.master %}
{% block title %}{{neighborhood.name}} / Award Administration{% endblock %}
{% block header %}Award Administration for {{neighborhood.name}}{% endblock %}
{% block content %}
{% if awards_count > 0 %}
<p>
<h3>Current Awards</h3>
<div id="award_list">
<table>
<thead>
<tr>
<th>Icon</th>
<th>Abbreviation</th>
<th>Description</th>
<th>Delete?</th>
</tr>
</thead>
<tbody>
{% for award in awards %}
<tr>
<td>
{% if award.icon %}
<img class="award_icon" src="awards/{{award.url()}}/icon" alt=""/>
{% endif %}
</td>
<td><a href="{{award.longurl()}}">{{award.short}}</a></td>
<td>{{award.full}}</td>
<td>
<form action="{{award.longurl()}}/delete" method="post" onsubmit="return confirm('Continue to delete this award?');">
<input type="submit" value="Delete"/>
{{lib.csrf_token()}}
</form>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</p>
{% endif %}
<h3>Create an Award</h3>
<form enctype="multipart/form-data" method="POST" action="awards/create">
<table>
<thead>
<tr>
<th>Icon</th>
<th>Abbreviation</th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="file" id="icon" name="icon" class="text" />
</td>
<td>
<input name="short" type="text"/>
</td>
<td>
<input name="full" type="text"/>
</td>
<td>
<input type="submit" value="Create"/>
</td>
</tr>
</tbody>
</table>
{{lib.csrf_token()}}
</form>
{% if awards_count > 0 %}
<p>
<h3>Grant an Award</h3>
{{ c.award_grant_form.display(action="awards/grant") }}
</p>
{% endif %}
{% if grants_count > 0 %}
<p>
<h3>Current Grants</h3>
<div id="grant_list">
<table>
<thead>
<tr>
<th>Award</th>
<th>Recipient</th>
<th>URL</th>
<th>Comment</th>
<th>Revoke?</th>
</tr>
</thead>
<tbody>
{% for grant in grants %}
<tr>
<td><a href="{{grant.award.longurl()}}">{{grant.award.short}}</a></td>
<td><a href="{{grant.granted_to_project.url()}}">{{grant.granted_to_project.shortname}}</a></td>
<td><a href="{{grant.award_url}}">{{grant.award_url}}</a></td>
<td>{{grant.comment}}</td>
<td>
<form action="{{grant.longurl()}}/revoke" method="post" onsubmit="return confirm('Continue to revoke this award?');">
<input type="submit" value="Revoke"/>
{{lib.csrf_token()}}
</form>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</p>
{% endif %}
{% endblock %}