root / templates / edumanage / realms.html @ 25028c1d
History | View | Annotate | Download (5.1 kB)
1 | 04df82f7 | Leonidas Poulopoulos | {% extends "edumanage/welcome.html"%} |
---|---|---|---|
2 | 25028c1d | Leonidas Poulopoulos | {% load i18n %} |
3 | 04df82f7 | Leonidas Poulopoulos | {% block crumbs %} |
4 | 25028c1d | Leonidas Poulopoulos | <li><a href="{% url manage %}">{% trans "Home" %}</a><span class="divider">/</span></li> |
5 | 25028c1d | Leonidas Poulopoulos | <li class="active">{% trans "Realms" %}</li> |
6 | 04df82f7 | Leonidas Poulopoulos | {% endblock %} |
7 | 04df82f7 | Leonidas Poulopoulos | {% load i18n %} |
8 | 04df82f7 | Leonidas Poulopoulos | {% block extrahead %} |
9 | 04df82f7 | Leonidas Poulopoulos | <script type="text/javascript" src="/static/js/jquery.dataTables.min.js"></script> |
10 | 04df82f7 | Leonidas Poulopoulos | <script type="text/javascript" src="/static/js/datatables_bootstrap.js"></script> |
11 | 04df82f7 | Leonidas Poulopoulos | <script type="text/javascript"> |
12 | 04df82f7 | Leonidas Poulopoulos | $(document).ready(function(){
|
13 | 04df82f7 | Leonidas Poulopoulos | {% if realms %}
|
14 | 04df82f7 | Leonidas Poulopoulos | var oTable = $('#table').dataTable({
|
15 | 04df82f7 | Leonidas Poulopoulos | "sPaginationType": "bootstrap",
|
16 | 04df82f7 | Leonidas Poulopoulos | "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
17 | 04df82f7 | Leonidas Poulopoulos | "aoColumns": [{
|
18 | 04df82f7 | Leonidas Poulopoulos | "bSearchable": true,
|
19 | 04df82f7 | Leonidas Poulopoulos | "bSortable": true
|
20 | 04df82f7 | Leonidas Poulopoulos | }, {
|
21 | 04df82f7 | Leonidas Poulopoulos | "bSearchable": true,
|
22 | 04df82f7 | Leonidas Poulopoulos | "bSortable": true
|
23 | 04df82f7 | Leonidas Poulopoulos | }, {
|
24 | 04df82f7 | Leonidas Poulopoulos | "bVisible": true,
|
25 | 04df82f7 | Leonidas Poulopoulos | "bSearchable": false,
|
26 | 04df82f7 | Leonidas Poulopoulos | "bSortable": false
|
27 | 04df82f7 | Leonidas Poulopoulos | }],
|
28 | 04df82f7 | Leonidas Poulopoulos | "aaSorting": [[0, 'desc']],
|
29 | 04df82f7 | Leonidas Poulopoulos | "iDisplayLength": 25,
|
30 | 04df82f7 | Leonidas Poulopoulos | "oSearch": {"bSmart": false, "bRegex":true},
|
31 | 04df82f7 | Leonidas Poulopoulos | "oLanguage": {
|
32 | 04df82f7 | Leonidas Poulopoulos | "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "realms" %}',
|
33 | 04df82f7 | Leonidas Poulopoulos | "sProcessing": "Processing...",
|
34 | 04df82f7 | Leonidas Poulopoulos | "sZeroRecords": '{% trans "No records to display" %}',
|
35 | 04df82f7 | Leonidas Poulopoulos | "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
|
36 | 04df82f7 | Leonidas Poulopoulos | "sInfoEmpty": "{% trans "Showing 0 to 0 of 0 entries" %}",
|
37 | 04df82f7 | Leonidas Poulopoulos | "sInfoFiltered": "(filtered from _MAX_ total entries)",
|
38 | 04df82f7 | Leonidas Poulopoulos | "sInfoPostFix": "",
|
39 | 04df82f7 | Leonidas Poulopoulos | "sSearch": '{% trans "Search:" %}',
|
40 | 04df82f7 | Leonidas Poulopoulos | "sUrl": "",
|
41 | 04df82f7 | Leonidas Poulopoulos | "oPaginate": {
|
42 | 04df82f7 | Leonidas Poulopoulos | "sFirst": '{% trans "First" %}',
|
43 | 04df82f7 | Leonidas Poulopoulos | "sPrevious": '{% trans "Previous" %}',
|
44 | 04df82f7 | Leonidas Poulopoulos | "sNext": '{% trans "Next" %}',
|
45 | 04df82f7 | Leonidas Poulopoulos | "sLast": '{% trans "Last" %}'
|
46 | 04df82f7 | Leonidas Poulopoulos | }
|
47 | 04df82f7 | Leonidas Poulopoulos | }
|
48 | 04df82f7 | Leonidas Poulopoulos | });
|
49 | 04df82f7 | Leonidas Poulopoulos | |
50 | 04df82f7 | Leonidas Poulopoulos | oTable.fnDraw();
|
51 | 04df82f7 | Leonidas Poulopoulos | |
52 | 04df82f7 | Leonidas Poulopoulos | $('[id^=del_realm_]').click(function(){
|
53 | 04df82f7 | Leonidas Poulopoulos | realm_id = (this.id).replace("del_realm_", '');
|
54 | 04df82f7 | Leonidas Poulopoulos | name = this.getAttribute("data-realmname");
|
55 | 04df82f7 | Leonidas Poulopoulos | $("#mymodalbody").html("You are about to delete realm: <b>"+name+"</b><br>Press Delete to proceed or Cancel to cancel deletion");
|
56 | 04df82f7 | Leonidas Poulopoulos | $("#myModalLabel").html("Delete Realm "+name);
|
57 | 04df82f7 | Leonidas Poulopoulos | $('#myModal').modal('show');
|
58 | 04df82f7 | Leonidas Poulopoulos | $(".modal-footer").show();
|
59 | 04df82f7 | Leonidas Poulopoulos | $("#realm_name_del").html(name)
|
60 | 04df82f7 | Leonidas Poulopoulos | return false;
|
61 | 04df82f7 | Leonidas Poulopoulos | });
|
62 | 04df82f7 | Leonidas Poulopoulos | |
63 | 04df82f7 | Leonidas Poulopoulos | $("#delrealmSubmit").click(function(){
|
64 | 04df82f7 | Leonidas Poulopoulos | $.ajax({
|
65 | 04df82f7 | Leonidas Poulopoulos | url:"{% url del-realm %}/?realm_pk="+realm_id,
|
66 | 04df82f7 | Leonidas Poulopoulos | type: "GET",
|
67 | 04df82f7 | Leonidas Poulopoulos | success: function(data){
|
68 | 04df82f7 | Leonidas Poulopoulos | if (data.error){
|
69 | 04df82f7 | Leonidas Poulopoulos | $(".modal-footer").hide();
|
70 | 04df82f7 | Leonidas Poulopoulos | $("#mymodalbody").html("<font style='color:#B94A48'>"+data.error+"</font>");
|
71 | 04df82f7 | Leonidas Poulopoulos | }
|
72 | 04df82f7 | Leonidas Poulopoulos | if (data.success){
|
73 | 04df82f7 | Leonidas Poulopoulos | $(".modal-footer").hide();
|
74 | 04df82f7 | Leonidas Poulopoulos | $("#mymodalbody").html("Realm "+name+" successfully deleted");
|
75 | 04df82f7 | Leonidas Poulopoulos | window.setTimeout('location.reload()', 1000);
|
76 | 04df82f7 | Leonidas Poulopoulos |
|
77 | 04df82f7 | Leonidas Poulopoulos | }
|
78 | 04df82f7 | Leonidas Poulopoulos | }
|
79 | 04df82f7 | Leonidas Poulopoulos | });
|
80 | 04df82f7 | Leonidas Poulopoulos | });
|
81 | 04df82f7 | Leonidas Poulopoulos | |
82 | 04df82f7 | Leonidas Poulopoulos | {% endif %}
|
83 | 04df82f7 | Leonidas Poulopoulos | });
|
84 | 04df82f7 | Leonidas Poulopoulos | </script>
|
85 | 04df82f7 | Leonidas Poulopoulos | {% endblock %} |
86 | 04df82f7 | Leonidas Poulopoulos | |
87 | 04df82f7 | Leonidas Poulopoulos | {% block navbar %} |
88 | 04df82f7 | Leonidas Poulopoulos | |
89 | 04df82f7 | Leonidas Poulopoulos | {% endblock %} |
90 | 04df82f7 | Leonidas Poulopoulos | |
91 | 04df82f7 | Leonidas Poulopoulos | {% block homeactive %}{% endblock %} |
92 | 04df82f7 | Leonidas Poulopoulos | {% block realmsactive %}class="active"{% endblock %} |
93 | 04df82f7 | Leonidas Poulopoulos | {% block subcontent %} |
94 | 04df82f7 | Leonidas Poulopoulos | |
95 | 04df82f7 | Leonidas Poulopoulos | |
96 | 04df82f7 | Leonidas Poulopoulos | <h4>Realms</h4> |
97 | 04df82f7 | Leonidas Poulopoulos | <hr>
|
98 | 2bdd3a0c | Leonidas Poulopoulos | {% if messages %} |
99 | 2bdd3a0c | Leonidas Poulopoulos | <table class="table table-condensed"> |
100 | 04df82f7 | Leonidas Poulopoulos | |
101 | 2bdd3a0c | Leonidas Poulopoulos | {% for message in messages %} |
102 | 2bdd3a0c | Leonidas Poulopoulos | <tr {% if %} class="{{ message.tags }}"{% endif %}><td>{{ message }}<td></tr> |
103 | 2bdd3a0c | Leonidas Poulopoulos | {% endfor %} |
104 | 2bdd3a0c | Leonidas Poulopoulos | </table>
|
105 | 2bdd3a0c | Leonidas Poulopoulos | {% endif %} |
106 | 25028c1d | Leonidas Poulopoulos | <div>{% if instdets.ertype == 1 or instdets.ertype == 3 %}<a href="{% url edit-realms %}" class="btn btn-primary">{% trans "Add new realm" %}</a>{% endif %}</div> |
107 | 2bdd3a0c | Leonidas Poulopoulos | <div class="span10"></div> |
108 | 2bdd3a0c | Leonidas Poulopoulos | {% if instdets.ertype == 1 or instdets.ertype == 3 %} |
109 | 2bdd3a0c | Leonidas Poulopoulos | {% if realms %} |
110 | 2bdd3a0c | Leonidas Poulopoulos | <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="table"> |
111 | 2bdd3a0c | Leonidas Poulopoulos | <thead>
|
112 | 2bdd3a0c | Leonidas Poulopoulos | <tr>
|
113 | 2bdd3a0c | Leonidas Poulopoulos | <th>Realm</th> |
114 | 2bdd3a0c | Leonidas Poulopoulos | <th>Server(s)</th> |
115 | 25028c1d | Leonidas Poulopoulos | <th style="text-align: center;">{% trans "Action" %}</th> |
116 | 2bdd3a0c | Leonidas Poulopoulos | </tr>
|
117 | 2bdd3a0c | Leonidas Poulopoulos | </thead>
|
118 | 2bdd3a0c | Leonidas Poulopoulos | |
119 | 2bdd3a0c | Leonidas Poulopoulos | <tbody>
|
120 | 2bdd3a0c | Leonidas Poulopoulos | {% for realm in realms %} |
121 | 2bdd3a0c | Leonidas Poulopoulos | <tr class="GradeC"> |
122 | 2bdd3a0c | Leonidas Poulopoulos | <td>{{realm.realm}}</td> |
123 | 2bdd3a0c | Leonidas Poulopoulos | <td>{{realm.get_servers}}</td> |
124 | 25028c1d | Leonidas Poulopoulos | <td style="text-align: center;"><a href="{% url edit-realms realm.pk %}" class="btn btn-small">{% trans "edit" %}</a> <a href="#" id="del_realm_{{realm.pk}}" data-realmname="{{realm.realm}}" class="btn btn-small btn-warning">{% trans "delete" %}</a></td> |
125 | 2bdd3a0c | Leonidas Poulopoulos | </tr>
|
126 | 2bdd3a0c | Leonidas Poulopoulos | {% endfor %} |
127 | 2bdd3a0c | Leonidas Poulopoulos | </tbody>
|
128 | 2bdd3a0c | Leonidas Poulopoulos | </table>
|
129 | 2bdd3a0c | Leonidas Poulopoulos | {% endif %} |
130 | 04df82f7 | Leonidas Poulopoulos | {% endif %} |
131 | 04df82f7 | Leonidas Poulopoulos | <div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
132 | 04df82f7 | Leonidas Poulopoulos | <div class="modal-header"> |
133 | 04df82f7 | Leonidas Poulopoulos | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
134 | 25028c1d | Leonidas Poulopoulos | <h3 id="myModalLabel">{% trans "Delete Realm" %}</h3> |
135 | 04df82f7 | Leonidas Poulopoulos | </div>
|
136 | 04df82f7 | Leonidas Poulopoulos | <div class="modal-body" id="mymodalbody"> |
137 | 04df82f7 | Leonidas Poulopoulos | |
138 | 04df82f7 | Leonidas Poulopoulos | </div>
|
139 | 04df82f7 | Leonidas Poulopoulos | <div class="modal-footer"> |
140 | 25028c1d | Leonidas Poulopoulos | <button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Cancel" %}</button> |
141 | 25028c1d | Leonidas Poulopoulos | <a class="btn btn-warning" id="delrealmSubmit" href="#">{% trans "Delete" %}</a> |
142 | 04df82f7 | Leonidas Poulopoulos | </div>
|
143 | 04df82f7 | Leonidas Poulopoulos | </div>
|
144 | 04df82f7 | Leonidas Poulopoulos | {% endblock %} |