Skip to content

Commit d78e671

Browse files
abhinavk96niranjan94
authored andcommitted
Fixes #3145: Adds correct links to orders dashboard
1 parent b248134 commit d78e671

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

app/templates/gentelella/users/events/tickets/attendees.html

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,29 @@
4545
{% block inner_content %}
4646
<div id="toolbar-holder" style="display: none;">
4747
<div class="btn-group pull-left" data-toggle="buttons">
48-
<label class="btn btn-default active btn-responsive">
48+
<label id="completed" class="btn btn-default btn-responsive">
4949
<input type="radio" name="show_state" autocomplete="off" value="Completed" checked> {{ _("Completed") }}
5050
</label>
51-
<label class="btn btn-default btn-responsive">
51+
<label id="placed" class="btn btn-default btn-responsive">
5252
<input type="radio" name="show_state" autocomplete="off" value="Placed"> {{ _("Placed") }}
5353
</label>
54-
<label class="btn btn-default btn-responsive">
54+
<label id="pending" class="btn btn-default btn-responsive">
5555
<input type="radio" name="show_state" autocomplete="off" value="Pending"> {{ _("Pending") }}
5656
</label>
57-
<label class="btn btn-default btn-responsive">
57+
<label id="expired" class="btn btn-default btn-responsive">
5858
<input type="radio" name="show_state" autocomplete="off" value="Expired"> {{ _("Expired") }}
5959
</label>
60-
<label class="btn btn-default btn-responsive">
60+
<label id="cancelled" class="btn btn-default btn-responsive">
6161
<input type="radio" name="show_state" autocomplete="off" value="Cancelled"> {{ _("Cancelled") }}
6262
</label>
63-
<label class="btn btn-default btn-responsive">
63+
<label id="checked-in" class="btn btn-default btn-responsive">
6464
<input type="radio" name="show_state" autocomplete="off" value="checked_in"> {{ _("Checked In") }}
6565
</label>
66-
<label class="btn btn-default btn-responsive">
66+
<label id="not-checked-in" class="btn btn-default btn-responsive">
6767
<input type="radio" name="show_state" autocomplete="off"
6868
value="not_checked_in"> {{ _("Not Checked In") }}
6969
</label>
70-
<label class="btn btn-default btn-responsive">
70+
<label id="all" class="btn btn-default btn-responsive">
7171
<input type="radio" name="show_state" autocomplete="off" value="all"> {{ _("All") }}
7272
</label>
7373

@@ -169,7 +169,7 @@ <h3>{{ _("View Attendees") }}</h3>
169169
<script src="{{ url_for('static', filename='vendor/datatables.net/js/jquery.dataTables.min.js') }}"></script>
170170
<script src="{{ url_for('static', filename='vendor/datatables.net-bs/js/dataTables.bootstrap.min.js') }}"></script>
171171
<script type="text/javascript">
172-
172+
var options = ['#completed', '#placed', '#pending', '#expired', '#cancelled', '#all'];
173173
$.fn.dataTable.ext.search.push(
174174
function (settings, data, dataIndex) {
175175
var user_option = $("input[name=show_state]:checked").val();
@@ -203,11 +203,20 @@ <h3>{{ _("View Attendees") }}</h3>
203203
"order": [[1, 'asc']],
204204
"scrollX": true
205205
});
206-
207-
$("div.toolbar").prepend($("#toolbar-holder").html());
208-
206+
if ($.inArray(window.location.hash, options) != -1)
207+
{
208+
$(window.location.hash).button('toggle');
209+
$("div.toolbar").prepend($("#toolbar-holder").html());
210+
}
211+
else
212+
{
213+
$('#Completed').button('toggle');
214+
$("div.toolbar").prepend($("#toolbar-holder").html());
215+
}
209216
$("input[name=show_state]").change(function () {
210217
table.draw();
218+
window.location.hash = $("input[name=show_state]:checked").val();
219+
211220
});
212221

213222
table.on('draw', function () {

app/templates/gentelella/users/events/tickets/orders.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@
4040
{% block inner_content %}
4141
<div id="toolbar-holder" style="display: none;">
4242
<div class="btn-group pull-left" data-toggle="buttons">
43-
<label id="Completed" class="btn btn-default btn-responsive">
43+
<label id="completed" class="btn btn-default btn-responsive">
4444
<input type="radio" name="show_state" autocomplete="off" value="Completed"> {{ _("Completed") }}
4545
</label>
46-
<label id="Placed" class="btn btn-default btn-responsive">
46+
<label id="placed" class="btn btn-default btn-responsive">
4747
<input type="radio" name="show_state" autocomplete="off" value="Placed"> {{ _("Placed") }}
4848
</label>
49-
<label id="Pending" class="btn btn-default btn-responsive">
49+
<label id="pending" class="btn btn-default btn-responsive">
5050
<input type="radio" name="show_state" autocomplete="off" value="Pending"> {{ _("Pending") }}
5151
</label>
52-
<label id="Expired" class="btn btn-default btn-responsive">
52+
<label id="expired" class="btn btn-default btn-responsive">
5353
<input type="radio" name="show_state" autocomplete="off" value="Expired"> {{ _("Expired") }}
5454
</label>
55-
<label id="Cancelled" class="btn btn-default btn-responsive">
55+
<label id="cancelled" class="btn btn-default btn-responsive">
5656
<input type="radio" name="show_state" autocomplete="off" value="Cancelled"> {{ _("Cancelled") }}
5757
</label>
5858
<label id="all" class="btn btn-default btn-responsive">
@@ -186,7 +186,7 @@ <h4 class="modal-title">{{ _("Are you sure you want to delete the ticket") }}</h
186186
<script src="{{ url_for('static', filename='vendor/datatables.net/js/jquery.dataTables.min.js') }}"></script>
187187
<script src="{{ url_for('static', filename='vendor/datatables.net-bs/js/dataTables.bootstrap.min.js') }}"></script>
188188
<script type="text/javascript">
189-
var options = ['#Completed', '#Placed', '#Pending', '#Expired', '#Cancelled', '#all'];
189+
var options = ['#completed', '#placed', '#pending', '#expired', '#cancelled', '#all'];
190190

191191
$.fn.dataTable.ext.search.push(
192192
function (settings, data, dataIndex) {

app/templates/gentelella/users/events/tickets/tickets.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ <h3>{{ _("Orders Summary") }}
140140
{% if name!='deleted' %}
141141
<tr>
142142
<th>
143-
<a href="{{ url_for('event_ticket_sales.display_orders',event_id=event_id) + '#' + (name | capitalize) }}">
143+
<a href="{{ url_for('event_ticket_sales.display_orders',event_id=event_id) + '#' + (name) }}">
144144
<span class="label label-{{ item.class }}">{{ name | capitalize }}</span>
145145
</a>
146146
</th>
@@ -154,8 +154,8 @@ <h3>{{ _("Orders Summary") }}
154154
{{ event.payment_currency | currency_symbol }}{{ item.total_sales | money }}
155155
</td>
156156
<td>
157-
<a href="./orders">{{ _("View orders") }}</a> / <a
158-
href="./attendees">{{ _("View attendees") }}</a>
157+
<a href="./orders#{{ name }}">{{ _("View orders") }}</a> / <a
158+
href="./attendees#{{ name }}">{{ _("View attendees") }}</a>
159159
</td>
160160
</tr>
161161
{% endif %}

0 commit comments

Comments
 (0)