Owen Leonard
693dde521d
This patch addresses template issues with the newly-added patron clubs pages. - Move Clubs tab out of second position in Circulation page tabs. - Link patron name in enrollments list to the patron record - Make page titles on some pages more specific - Correct label "for" attributes so that it matches input id - Correst style of buttons: Buttons in tables must be "btn-xs," all Bootstrap buttons must have "btn-default." - Correct "Edit" icons: Should be "fa-pencil" This patch also revises the club template editing form to make it more consistent with similar interfaces in Koha and (hopefully) make it more clear. To test, apply the patch and test adding clubs and club templates and enrolling patrons in clubs via the staff client and OPAC. Confirm that everything looks and work okay. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
97 lines
2.8 KiB
Text
97 lines
2.8 KiB
Text
[% USE KohaDates %]
|
|
|
|
[% IF enrollments %]
|
|
<h4>Clubs currently enrolled in</h4>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
<th>Date enrolled</th>
|
|
[% IF CAN_user_clubs_enroll %]<th> </th>[% END %]
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
[% FOREACH e IN enrollments %]
|
|
<tr>
|
|
<td>[% e.club.name %]</td>
|
|
<td>[% e.club.description %]</td>
|
|
<td>[% e.date_enrolled | $KohaDates %]</td>
|
|
[% IF CAN_user_clubs_enroll %]
|
|
<td>
|
|
<button class="btn btn-xs btn-default" onclick="cancelEnrollment( [% e.id %] )">
|
|
<i class="fa fa-remove"></i> Cancel
|
|
</button>
|
|
</td>
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% END %]
|
|
|
|
[% IF clubs %]
|
|
|
|
<h4>Clubs not enrolled in</h4>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
[% IF CAN_user_clubs_enroll %]<th> </th>[% END %]
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
[% FOREACH c IN clubs %]
|
|
<tr>
|
|
<td>[% c.name %]</td>
|
|
<td>[% c.description %]</td>
|
|
[% IF CAN_user_clubs_enroll %]
|
|
<td class="action">
|
|
<button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% c.id %])">
|
|
<i class="fa fa-plus"></i> Enroll
|
|
</button>
|
|
</td>
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% END %]
|
|
|
|
[% IF CAN_user_clubs_enroll %]
|
|
<script type="text/javascript">
|
|
function loadEnrollmentForm( id ) {
|
|
$("body").css("cursor", "progress");
|
|
$('#clubs-tab').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=[% borrowernumber %]&id=' + id, function() {
|
|
$("body").css("cursor", "default");
|
|
});
|
|
|
|
return false;
|
|
}
|
|
|
|
function cancelEnrollment( id ) {
|
|
$("body").css("cursor", "progress");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/cgi-bin/koha/svc/club/cancel_enrollment',
|
|
data: { id: id },
|
|
success: function( data ) {
|
|
if ( data.success ) {
|
|
$('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]', function() {
|
|
$("body").css("cursor", "default");
|
|
});
|
|
} else {
|
|
alert(_("Unable to cancel enrollment!"));
|
|
}
|
|
},
|
|
dataType: 'json'
|
|
});
|
|
return false;
|
|
}
|
|
</script>
|
|
[% END %]
|