Owen Leonard
3eb50270b1
This patch updates three single-column course reserves templates to use the Bootstrap grid: - course-reserves.tt - The main Course Reserves page - course-details.tt - The detail view of an individual course - course.tt - Editing a course - add_items-step1.tt - Adding items to a course, step 1 (scan barcode) - add_items-step2.tt - Adding items to a course, step 2 - invalid-course.tt - The error page shown if you try to view course_reserves/course-details.pl directly without passing a course id in the URL - Also changed in this template: Error message has been wrapped in the standard "dialog alert" <div>. Each of these pages should look correct, with a single centered column with wide margins on either side. At lower browser widths the margins should disappear. Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
195 lines
9.3 KiB
Text
195 lines
9.3 KiB
Text
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Course reserves › [% IF course_name %] Edit [% course_name %] [% ELSE %] New course [% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<body id="courses_course" class="course">
|
|
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a> › [% IF course_name %] Edit <i>[% course_name %]</i> [% ELSE %] New course [% END %]</div>
|
|
|
|
[% IF ( departments ) %]
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-8 col-md-offset-2">
|
|
|
|
<form method="post" action="/cgi-bin/koha/course_reserves/mod_course.pl" class="validated">
|
|
[% IF course_id %]<input type="hidden" name="course_id" value="[% course_id %]" />[% END %]
|
|
<fieldset class="rows">
|
|
<legend>[% IF course_id %]Edit course[% ELSE %]Create course[% END %]</legend>
|
|
<ol>
|
|
<li>
|
|
<label class="required" for="department">Department:</label>
|
|
<select id="department" name="department" required="required" class="required">
|
|
<option value="">Select a department</option>
|
|
|
|
[% FOREACH d IN departments %]
|
|
[% IF d.authorised_value == department %]
|
|
<option value="[% d.authorised_value %]" selected="selected">[% d.lib %]</option>
|
|
[% ELSE %]
|
|
<option value="[% d.authorised_value %]">[% d.lib %]</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
<span class="required">Required</span>
|
|
</li>
|
|
|
|
<li>
|
|
<label class="required" for="course_number">Course number:</label>
|
|
<input id="course_number" name="course_number" type="text" value="[% course_number %]" required="required" class="required" />
|
|
<span class="required">Required</span>
|
|
</li>
|
|
|
|
<li>
|
|
<label for="section">Section:</label>
|
|
<input id="section" name="section" type="text" value="[% section %]"/>
|
|
</li>
|
|
|
|
<li>
|
|
<label class="required" for="course_name">Course name:</label>
|
|
<input id="course_name" name="course_name" type="text" value="[% course_name %]" required="required" class="required" />
|
|
<span class="required">Required</span>
|
|
</li>
|
|
|
|
<li>
|
|
[% IF terms %]
|
|
<label for="term">Term:</label>
|
|
<select id="term" name="term">
|
|
<option value=""></option>
|
|
|
|
[% FOREACH t IN terms %]
|
|
[% IF t.authorised_value == term %]
|
|
<option value="[% t.authorised_value %]" selected="selected">[% t.lib %]</option>
|
|
[% ELSE %]
|
|
<option value="[% t.authorised_value %]">[% t.lib %]</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
[% ELSE %]
|
|
<span class="label">Term: </span>
|
|
<span id="term">No TERM authorised values found! Please create one or more authorised values with the category TERM.</span>
|
|
[% END %]
|
|
</li>
|
|
|
|
<li>
|
|
<span class="label">Instructors:</span>
|
|
|
|
<fieldset id="course_instructors">
|
|
<div id="instructors">[% FOREACH i IN instructors %]<div id="borrower_[% i.cardnumber %]">[% i.surname %], [% i.firstname %] ( <a href="#" class="removeInstructor"> Remove </a> )
|
|
<input type='hidden' name='instructors' value='[% i.cardnumber %]' /></div>[% END %]</div>
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
<label for="find_instructor">Instructor search:</label>
|
|
<input autocomplete="off" id="find_instructor" type="text" style="width:150px" class="noEnterSubmit"/>
|
|
<div id="find_instructor_container"></div>
|
|
</fieldset>
|
|
<li>
|
|
<label for="staff_note">Staff note:</label>
|
|
<textarea name="staff_note" id="staff_note">[% staff_note %]</textarea>
|
|
</li>
|
|
|
|
<li>
|
|
<label for="public_note">Public note:</label>
|
|
<textarea name="public_note" id="public_note">[% public_note %]</textarea>
|
|
</li>
|
|
|
|
<li>
|
|
<label for="students_count">Number of students:</label>
|
|
<input id="students_count" name="students_count" type="text" value="[% students_count %]" />
|
|
</li>
|
|
|
|
<li>
|
|
<label for="enabled">Enabled?</label>
|
|
[% IF enabled == 'no' %]
|
|
<input type="checkbox" name="enabled" id="enabled" />
|
|
[% ELSE %]
|
|
<input type="checkbox" name="enabled" id="enabled" checked="checked" />
|
|
[% END %]
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
|
|
<fieldset class="action">
|
|
<input type="submit" value="Save" class="submit" />
|
|
|
|
[% IF course_id %]
|
|
<a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% course_id %]" class="cancel">Cancel</a>
|
|
[% ELSE %]
|
|
<a href="/cgi-bin/koha/course_reserves/course-reserves.pl" class="cancel">Cancel</a>
|
|
[% END %]
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
[% ELSE %]
|
|
|
|
<div class="dialog alert">
|
|
<p>
|
|
No DEPARTMENT authorized values found!
|
|
[% IF ( CAN_user_parameters ) %]
|
|
Please <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=DEPARTMENT">create one or more authorized values</a> with the category DEPARTMENT.
|
|
[% ELSE %]
|
|
An administrator must create one or more authorized values with the category DEPARTMENT.
|
|
[% END %]
|
|
</p>
|
|
</div>
|
|
|
|
[% END %]
|
|
|
|
[% IF ( departments ) %]
|
|
[% MACRO jsinclude BLOCK %]
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
$( "#find_instructor" ).autocomplete({
|
|
source: "/cgi-bin/koha/circ/ysearch.pl",
|
|
minLength: 3,
|
|
select: function( event, ui ) {
|
|
AddInstructor( ui.item.surname + ", " + ui.item.firstname, ui.item.cardnumber );
|
|
return false;
|
|
}
|
|
})
|
|
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
|
|
return $( "<li></li>" )
|
|
.data( "ui-autocomplete-item", item )
|
|
.append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
|
|
.appendTo( ul );
|
|
};
|
|
|
|
if ( ! $('#instructors').html() ) {
|
|
$('#course_instructors').hide();
|
|
}
|
|
|
|
$("body").on("click",".removeInstructor",function(e){
|
|
e.preventDefault();
|
|
var divid = $(this).parent().attr("id");
|
|
var cardnumber = divid.replace("borrower_","");
|
|
RemoveInstructor(cardnumber);
|
|
});
|
|
});
|
|
|
|
function AddInstructor( name, cardnumber ) {
|
|
div = "<div id='borrower_" + cardnumber + "'>" + name + " ( <a href='#' class='removeInstructor'> " + _("Remove")+ " </a> ) <input type='hidden' name='instructors' value='" + cardnumber + "' /></div>";
|
|
$('#instructors').append( div );
|
|
|
|
$('#find_instructor').val('').focus();
|
|
$('#course_instructors').show();
|
|
}
|
|
|
|
function RemoveInstructor( cardnumber ) {
|
|
$( '#borrower_' + cardnumber ).remove();
|
|
|
|
if ( ! $('#instructors').html() ) {
|
|
$('#course_instructors').hide( 800 );
|
|
}
|
|
}
|
|
</script>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|