Bug 21519: Update two-column templates with Bootstrap grid: Serials part 1
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / routing.tt
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Serials &rsaquo; [% title | html %] &rsaquo; [% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 </head>
6 <body id="ser_routing" class="ser">
7 [% INCLUDE 'header.inc' %]
8 [% INCLUDE 'serials-search.inc' %]
9
10 <div id="breadcrumbs">
11     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
12     &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
13     [% UNLESS blocking_error %]
14         &rsaquo; <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid | uri %]"><i>[% title | html %]</i></a>
15         &rsaquo; [% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %]
16     [% END %]
17 </div>
18
19 <div class="main container-fluid">
20     <div class="row">
21         <div class="col-sm-10 col-sm-push-2">
22             <main>
23 [% INCLUDE 'blocking_errors.inc' %]
24
25 [% IF ( op ) %]
26 <h1>Create routing list for <i>[% title | html %]</i></h1>
27 [% ELSE %]
28 <h1>Edit routing list for <i>[% title | html %]</i></h1>
29 [% END %]
30
31 <form method="post" action="routing.pl">
32 <input type="hidden" name="op" value="save" />
33 <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
34 <fieldset class="rows">
35         <ol>
36                 <li><label for="date_selected">Issue: </label>
37 <select name="date_selected" id="date_selected">
38 [% FOREACH date IN dates %]
39 [% IF ( date.selected ) %]<option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | html %])</option>[% ELSE %]<option value="[% date.serialseq | html %] ([% date.publisheddate | html %])">[% date.serialseq | html %] ([% date.publisheddate | html %])</option>[% END %]
40 [% END %]
41 </select> [% issue | html %]</li>
42
43 <li>
44     <span class="label">Recipients:</span>
45     [% IF memberloop %]
46         <table style="clear:none;margin:0;">
47             <tr><th>Name</th>
48                 <th>Rank</th>
49                 <th>Delete</th>
50             </tr>
51             [% USE m_loop = iterator(memberloop) %]
52             [% FOREACH member IN m_loop %]
53             <tr><td>[% member.name | html %]</td>
54                 <td>
55                     <select name="itemrank" class="itemrank" data-subscriptionid="[% subscriptionid | html %]" data-routingid="[% member.routingid | html %]">
56                     [% rankings = [1 .. m_loop.size] %]
57                     [% FOREACH r IN rankings %]
58                         [% IF r == member.ranking %]
59                           <option selected="selected" value="[% r | html %]">[% r | html %]</option>
60                         [% ELSE %]
61                           <option value="[% r | html %]">[% r | html %]</option>
62                         [% END %]
63                     [% END %]
64                     </select>
65                 </td>
66                 <td><a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?routingid=[% member.routingid | html %]&amp;subscriptionid=[% subscriptionid | html %]&amp;op=delete"><i class="fa fa-trash"></i> Delete</a></td>
67             </tr>
68             [% END %]
69         </table>
70     [% END %]
71
72     <p style="margin-left:10em;">
73         <a href="#" id="add_recipients"><i class="fa fa-plus"></i> Add recipients</a>
74         [% IF memberloop %]
75             <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid | html %]&amp;op=delete"><i class="fa fa-trash"></i> Delete all</a>
76         [% END %]
77     </p>
78 </li>
79
80         <li><label for="notes">Notes:</label><textarea name="notes" id="notes" rows="3" cols="50">[% routingnotes | html %]</textarea></li>
81         </ol>
82
83 </fieldset>
84 <fieldset class="action"><input type="submit" name="submit" value="Save" /></fieldset>
85 </form>
86
87             </main>
88         </div> <!-- /.col-sm-10.col-sm-push-2 -->
89
90         <div class="col-sm-2 col-sm-pull-10">
91             <aside>
92                 [% INCLUDE 'serials-menu.inc' %]
93             </aside>
94         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
95      </div> <!-- /.row -->
96 [% MACRO jsinclude BLOCK %]
97     <script>
98         $(document).ready(function(){
99             $("#add_recipients").on("click",function(e){
100                 e.preventDefault();
101                 userPopup();
102             });
103             $(".itemrank").on("change",function(){
104                 var subscriptionid = $(this).data("subscriptionid");
105                 var routingid = $(this).data("routingid");
106                 reorder_item( subscriptionid, routingid, $(this).val());
107             });
108         });
109         function reorder_item(sid,rid,rank){
110             var mylocation = 'reorder_members.pl?subscriptionid='+sid+'&routingid='+rid+'&rank='+rank;
111             window.location.href=mylocation;
112         }
113
114         function userPopup() {
115             window.open("/cgi-bin/koha/serials/add_user_search.pl",
116                 'PatronPopup',
117                 'width=740,height=450,location=yes,toolbar=no,'
118                 + 'scrollbars=yes,resize=yes'
119             );
120         }
121
122         function add_user(borrowernumber) {
123             var myurl = "routing.pl?subscriptionid="+[% subscriptionid | html %]+"&borrowernumber="+borrowernumber+"&op=add";
124             window.location.href = myurl;
125         }
126     </script>
127 [% END %]
128
129 [% INCLUDE 'intranet-bottom.inc' %]