Applications: improved manager index
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
import datetime
|
import datetime
|
||||||
|
from sqlalchemy import desc
|
||||||
|
|
||||||
from application import db
|
from application import db
|
||||||
from application.forms import CommentForm
|
from application.forms import CommentForm
|
||||||
from application.models.users import *
|
from application.models.users import *
|
||||||
@@ -9,6 +11,7 @@ from flask.ext.security import login_required, roles_accepted
|
|||||||
from flask.ext.security.core import current_user
|
from flask.ext.security.core import current_user
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
applications = Blueprint('applications', __name__)
|
applications = Blueprint('applications', __name__)
|
||||||
|
|
||||||
@applications.route('/')
|
@applications.route('/')
|
||||||
@@ -16,7 +19,7 @@ applications = Blueprint('applications', __name__)
|
|||||||
def index():
|
def index():
|
||||||
return render_template('applications/index.html',
|
return render_template('applications/index.html',
|
||||||
title='applications',
|
title='applications',
|
||||||
applications=Application.query.all())
|
applications=Application.query.order_by(desc('submission_date')).all())
|
||||||
|
|
||||||
@applications.route('/view/<int:id>')
|
@applications.route('/view/<int:id>')
|
||||||
@login_required
|
@login_required
|
||||||
|
@@ -14,16 +14,14 @@
|
|||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th class="content-align-center">Voted</th>
|
<th class="content-align-center">Voted</th>
|
||||||
<th class="content-align-center">Approvals</th>
|
<th class="content-align-center">Approvals</th>
|
||||||
<th></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for application in applications %}
|
{% for application in applications %}
|
||||||
<tr class="{% if not application.is_reviewed() %}danger{% endif %}">
|
<tr class="{% if not application.is_reviewed() %}danger{% endif %} table-row-link" link="{{url_for('applications.view', id=application.id)}}">
|
||||||
<td class="relative content-align-center">{{ application.id }}</td>
|
<td class="relative content-align-center">{{ application.id }}</td>
|
||||||
<td><a href="{{url_for('applications.view', id=application.id)}}" >
|
<td>
|
||||||
{{application.user.first_name}} {{application.user.last_name}}
|
{{application.user.first_name}} {{application.user.last_name}}
|
||||||
</a>
|
|
||||||
</td>
|
</td>
|
||||||
<td>{{application.city_country}}</td>
|
<td>{{application.city_country}}</td>
|
||||||
<td>{{application.submission_date.strftime('%d %B, %Y')}}</td>
|
<td>{{application.submission_date.strftime('%d %B, %Y')}}</td>
|
||||||
@@ -54,11 +52,6 @@
|
|||||||
/
|
/
|
||||||
{{application.approve + application.reject}}
|
{{application.approve + application.reject}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<a href="{{url_for('applications.view', id=application.id)}}" >
|
|
||||||
View <i class="fa fa-angle-double-right"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% if loop.last %}
|
{% if loop.last %}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -73,3 +66,13 @@
|
|||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block footer_scripts %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(".table-row-link").on("click", function() {
|
||||||
|
window.location.href = $(this).attr('link');
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
Reference in New Issue
Block a user