LP1849212: Use a set list of roles for course users
[Evergreen.git] / Open-ILS / src / templates / opac / parts / course / body.tt2
1 <div id='canvas_main' class='canvas'>
2   <div class="course_details">
3     <div>
4       <h1>
5         [% l(ctx.course.name) %] ([% ctx.course.course_number %])
6         [% IF ctx.course.is_archived == 't' %]
7         <span class="archived_course">
8           This course is inactive.
9         </span>
10         [% END %]
11       </h1>
12       [% IF ctx.instructors.size %]
13       <div class="course_instructors_div">
14         <strong>Course Instructors:</strong>
15         [%- FOR instructor IN ctx.instructors;
16           instructorString = '';
17           IF instructor.pref_family_name;
18             instructorString = instructorString _ instructor.pref_family_name _ ', ';
19           ELSE;
20             instructorString = instructorString _ instructor.family_name _ ', ';
21           END;
22           IF instructor.pref_first_given_name;
23             instructorString = instructorString _ instructor.pref_first_given_name;
24           ELSE;
25             instructorString = instructorString _ instructor.first_given_name;
26           END;
27           instructorString = instructorString _ ' (' _ l(instructor.usr_role.name) _ ')'; %]
28           <span class="course-instructor-div">[% instructorString %].</span>
29         [% END %]
30       </div>
31       [% END %]
32
33       <div class="course_details_div">
34         <h2>[% l('Course Details') %]</h2>
35         <div>
36           <span><strong>[% l('Course Title') %]: </strong></span>
37           <span>[% ctx.course.name %]</span>
38         </div>
39         <div>
40           <span><strong>[% l('Course Number') %]: </strong></span>
41           <span>[% ctx.course.course_number %]</span>
42         <div>
43         </div>
44           <span><strong>[% l('Section Number') %]: </strong></span>
45           <span>[% ctx.course.section_number %]</span>
46         </div>
47         <div>
48           [%
49             owning_lib = ctx.get_aou(ctx.course.owning_lib);
50             lib_url = ctx.get_org_setting(owning_lib.id, 'lib.info_url');
51             prefer_external_url = ctx.get_org_setting(owning_lib.id, 'lib.prefer_external_url');
52             UNLESS lib_url && prefer_external_url;
53               lib_url = mkurl(ctx.opac_root _ '/library/' _ owning_lib.shortname, {}, 1);
54              END;
55           %]
56           <span><strong>[% l('Owning Library') %]: </strong></span>
57           <span><a href="[% lib_url %]">[% owning_lib.name %]</a></span>
58         </div>
59       </div>
60
61       [%- UNLESS ctx.course.is_archived == 't' %]
62       <div>
63         <span><h2>[% l('Course Materials') %]</h2></span>
64         <table class="table_no_border_space table_no_cell_pad table_no_border" width="100%" id="course_material_table">
65           <thead>
66             <tr>
67               <th scope="col">Location</th>
68               <th scope="col">Call Number</th>
69               <th scope="col">Title</th>
70               <th scope="col">Barcode</th>
71               <th scope="col">Relationship</th>
72               <th scope="col">Status</th>
73               <th scope="col">Shelving Location</th>
74             </tr>
75           </thead>
76           <tbody>
77             [% FOREACH material IN ctx.course_materials %]
78               <tr>
79                 <td>
80                   [% IF material.item %]
81                     [%- fleshed_ou = material.item.circ_lib -%]
82                     [%- INCLUDE "opac/parts/library_name_link_from_ou.tt2"; -%]
83                   [% ELSE %]
84                     [% l('Online') %]
85                   [% END %]
86                   <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
87                   <meta property="price" content="0.00">
88                 </td>
89                 <td>
90                   [% IF material.item %]
91                     [% material.item.call_number.label %]
92                   [% END %]
93                 </td>
94                 <td>
95                   <a href="[% mkurl(ctx.opac_root _ '/record/' _ material.record.id) %]">
96                     [% material.record.wide_display_entry.title %]
97                   </a>
98                 </td>
99                 <td>
100                   [% IF material.item %]
101                     [% material.item.barcode %]
102                   [% END %]
103                 </td>
104                 <td> [% material.relationship %] </td>
105                 <td>
106                   [% IF material.item %]
107                     [% material.item.status.name %]
108                   [% END %]
109                 </td>
110                 <td>
111                   [% IF material.item %]
112                     [% material.item.location.name %]
113                   [% END %]
114                 </td>
115               </tr>
116             [% END %]
117           </tbody>
118         </table>
119       </div>
120       [% END %]
121     </div>
122   </div>
123 </div>