Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_sets.tt
Jonathan Druart 7e4db79ce6
Bug 37745: Remove more duplicated class attributes
Found using `egrep 'class=[^>]+class=' **/*.tt **/*.inc`

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-09-02 16:36:16 +02:00

212 lines
9.2 KiB
Text

[% USE raw %]
[% USE Asset %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% IF ( op_new ) %]
[% t("New OAI set") | html %] &rsaquo;
[% ELSIF ( op_mod ) %]
[% tx("Modify OAI set '{oai_set}'", { oai_set = spec }) | html %] &rsaquo;
[% END %]
[% t("OAI sets") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="admin_oai_sets" class="admin">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
[% END %]
[% IF ( op_new || op_mod ) %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets</a>
[% END %]
[% END %]
[% IF ( op_new ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>New OAI set</span>
[% END %]
[% ELSIF ( op_mod ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% tx("Modify OAI set '{oai_set}'", { oai_set = spec }) | html %]
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>OAI sets</span>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
<div class="col-md-10 order-md-2 order-sm-1">
<main>
[% INCLUDE 'messages.inc' %]
[% IF ( op_new || op_mod ) %]
<form method="post" action="/cgi-bin/koha/admin/oai_sets.pl" class="validated">
[% INCLUDE 'csrf-token.inc' %]
[% IF ( op_new ) %]
<h1>New OAI set</h1>
<input type="hidden" name="op" value="cud-savenew" />
[% ELSIF ( op_mod ) %]
<h1>[% tx("Modify OAI set '{oai_set}'", { oai_set = spec }) | html %]</h1>
<input type="hidden" name="op" value="cud-savemod" />
<input type="hidden" name="id" value="[% id | html %]" />
[% END %]
<fieldset id="oaidetails" class="rows">
<ol>
<li>
<label for="spec" class="required">setSpec: </label>
[% IF ( spec == "" ) %]
<input type="text" id="spec" class="focus required" name="spec" value="[% spec | html %]" required="required" />
[% ELSE %]
<input type="text" id="spec" name="spec" value="[% spec | html %]" required="required" class="required" />
[% END %]
<span class="required">Required</span>
</li>
<li>
<label for="name" class="required">setName: </label>
<input type="text" id="name" name="name" value="[% name | html %]" required="required" class="required" />
<span class="required">Required</span>
</li>
[% FOREACH desc IN descriptions %]
<li>
<label>setDescription: </label>
<textarea style="vertical-align:middle" rows="2" cols="30" name="description">[% desc.description | html %]</textarea>
<a class="remove_description" href="#"><i class="fa fa-fw fa-trash-can"></i> Remove</a>
</li>
[% END %]
<li id="adddescription"><span class="label">&nbsp;</span><a href="#" class="add_description"><i class="fa fa-fw fa-plus"></i> Add description</a></li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" class="btn btn-primary" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
</fieldset>
</form>
[% ELSE %]
<div id="toolbar" class="btn-toolbar">
<a class="btn btn-default" id="newoaiset" href="/cgi-bin/koha/admin/oai_sets.pl?op=new"><i class="fa fa-plus"></i> New set</a>
</div>
<h1>OAI sets</h1>
[% IF sets_loop %]
<div class="page-section">
<table>
<thead>
<tr>
<th>setSpec</th>
<th>setName</th>
<th>setDescriptions</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
[% FOREACH set IN sets_loop %]
<tr>
<td>[% set.spec | html %]</td>
<td>[% set.name | html %]</td>
<td>
[% IF set.descriptions %]
<ul>
[% FOREACH desc IN set.descriptions %]
<li>[% desc.description | html %]</li>
[% END %]
</ul>
[% ELSE %]
<em>No descriptions</em>
[% END %]
</td>
<td>
<div class="btn-group dropup">
<a class="btn btn-default btn-xs dropdown-toggle" id="oaisetsactions[% set.id | html %]" role="button" data-bs-toggle="dropdown" href="#">
Actions</a>
<ul class="dropdown-menu dropdown-menu-end" role="menu" aria-labelledby="oaisetsactions[% set.id | html %]">
<li><a class="dropdown-item" href="/cgi-bin/koha/admin/oai_sets.pl?op=mod&amp;id=[% set.id | uri %]"><i class="fa-fw fa-solid fa-pencil" aria-hidden="true"></i> Edit</a></li>
<li><a class="dropdown-item delete_oai_set" data-oai-set-id="[% set.id | html %]" href="#"><i class="fa fa-fw fa-trash-can"></i> Delete</a></li>
<li><a class="dropdown-item" href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% set.id | uri %]"><i class="fa fa-fw fa-info"></i> Define mappings</a></li>
</ul>
</div>
</td>
</tr>
[% END %]
</tbody>
</table>
<form action="/cgi-bin/koha/admin/oai_sets.pl" id="oai_sets_delete" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-del" />
<input type="hidden" id="oai_sets_id" name="id" value="" />
</form>
</div> <!-- /.page-section -->
[% ELSE %]
<div class="alert alert-info"><p>There are no sets defined.</p></div>
[% END %]
[% END %]
</main>
</div> <!-- /.col-md-10.order-md-2 -->
<div class="col-md-2 order-sm-2 order-md-1">
<aside>
[% INCLUDE 'admin-menu.inc' %]
</aside>
</div> <!-- /.col-md-2.order-md-1 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/admin-menu.js") | $raw %]
<script>
function newDescField() {
$("#adddescription").before(
'<li><label>' + _("setDescription: ") + '</label>' +
'<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
'<a class="remove_description" href="#"><i class="fa fa-fw fa-trash-can"></i>' + _(" Remove") + '</a>' +
'</li>'
);
}
function delDescField(minusButton) {
var li = minusButton.parent('li');
$(li).remove();
}
$(document).ready(function() {
$(".delete_oai_set").on("click",function(e){
e.preventDefault();
if( confirm(_("Are you sure you want to delete this OAI set?")) ){
let oai_set_id = $(this).data("oai-set-id");
$("#oai_sets_id").val( oai_set_id );
$("#oai_sets_delete").submit();
}
});
$("body").on("click", ".remove_description", function(e){
e.preventDefault();
delDescField($(this));
});
$(".add_description").on("click", function(e){
e.preventDefault();
newDescField();
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]