Commit 2bdd3a0c authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Integrated the messages framework into ream templates

parent 0384aef9
......@@ -94,30 +94,38 @@ $("#delrealmSubmit").click(function(){
<h4>Realms</h4>
<hr>
<div><a href="{% url edit-realms %}" class="btn btn-primary">Add new realm</a></div>
<div class="span10"></div>
{% if realms %}
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table">
<thead>
<tr>
<th>Realm</th>
<th>Server(s)</th>
<th style="text-align: center;">Action</th>
</tr>
</thead>
{% if messages %}
<table class="table table-condensed">
<tbody>
{% for realm in realms %}
<tr class="GradeC">
<td>{{realm.realm}}</td>
<td>{{realm.get_servers}}</td>
<td style="text-align: center;"><a href="{% url edit-realms realm.pk %}" class="btn btn-small">edit</a> <a href="#" id="del_realm_{{realm.pk}}" data-realmname="{{realm.realm}}" class="btn btn-small btn-warning">delete</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div>No realms defined yet (<a href="{% url edit-realms %}">add</a>)</div>
{% for message in messages %}
<tr {% if message.tags %} class="{{ message.tags }}"{% endif %}><td>{{ message }}<td></tr>
{% endfor %}
</table>
{% endif %}
<div>{% if instdets.ertype == 1 or instdets.ertype == 3 %}<a href="{% url edit-realms %}" class="btn btn-primary">Add new realm</a>{% endif %}</div>
<div class="span10"></div>
{% if instdets.ertype == 1 or instdets.ertype == 3 %}
{% if realms %}
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table">
<thead>
<tr>
<th>Realm</th>
<th>Server(s)</th>
<th style="text-align: center;">Action</th>
</tr>
</thead>
<tbody>
{% for realm in realms %}
<tr class="GradeC">
<td>{{realm.realm}}</td>
<td>{{realm.get_servers}}</td>
<td style="text-align: center;"><a href="{% url edit-realms realm.pk %}" class="btn btn-small">edit</a> <a href="#" id="del_realm_{{realm.pk}}" data-realmname="{{realm.realm}}" class="btn btn-small btn-warning">delete</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endif %}
<div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
......
......@@ -16,8 +16,16 @@
{% block homeactive %}{% endblock %}
{% block realmsactive %}class="active"{% endblock %}
{% block subcontent %} <h4>{% if edit %}{{form.instance.realm}} (edit){% else %}Add Realm{% endif %}</h4>
{% block subcontent %}<h4>{% if edit %}{{form.instance.realm}} (edit){% else %}Add Realm{% endif %}</h4>
<hr>
{% if messages %}
<table class="table table-condensed">
{% for message in messages %}
<tr {% if message.tags %} class="{{ message.tags }}"{% endif %}><td>{{ message }}<td></tr>
{% endfor %}
</table>
{% endif %}
{% if instdets.ertype == 1 or instdets.ertype == 3 %}
<form method="POST" class="form-horizontal">
{% csrf_token %}
{% if form.non_field_errors %}
......@@ -51,5 +59,6 @@
</div>
</div>
</form>
{% endif %}
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment