View | Details | Raw Unified | Return to bug 40418
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt (-4 / +1 lines)
Lines 194-202 Link Here
194
                        <label for="description" class="required">Description: </label>
194
                        <label for="description" class="required">Description: </label>
195
                        <input type="text" id="description" name="description" size="48" value="[% itemtype.description | html %]" required="required" /> <span class="required">Required</span>
195
                        <input type="text" id="description" name="description" size="48" value="[% itemtype.description | html %]" required="required" /> <span class="required">Required</span>
196
                        [% IF can_be_translated %]
196
                        [% IF can_be_translated %]
197
                            <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype | uri %]" title="Translate item type [% itemtype.itemtype | html %]" rel="gb_page_center[600,500]"
197
                            <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype | uri %]"> <i class="fa-solid fa-pencil" aria-hidden="true"></i> Translate into other languages </a>
198
                                ><i class="fa-solid fa-pencil" aria-hidden="true"></i> Translate into other languages</a
199
                            >
200
                        [% END %]
198
                        [% END %]
201
                    </li>
199
                    </li>
202
                    <li>
200
                    <li>
Lines 532-538 Link Here
532
530
533
[% MACRO jsinclude BLOCK %]
531
[% MACRO jsinclude BLOCK %]
534
    [% Asset.js("js/admin-menu.js") | $raw %]
532
    [% Asset.js("js/admin-menu.js") | $raw %]
535
    [% INCLUDE 'greybox.inc' %]
536
    [% INCLUDE 'datatables.inc' %]
533
    [% INCLUDE 'datatables.inc' %]
537
    [% INCLUDE 'select2.inc' %]
534
    [% INCLUDE 'select2.inc' %]
538
    <script>
535
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt (-91 / +123 lines)
Lines 3-14 Link Here
3
[% PROCESS 'i18n.inc' %]
3
[% PROCESS 'i18n.inc' %]
4
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title
6
<title>
7
    >[% FILTER collapse %]
7
    [% FILTER collapse %]
8
        [% t("Localization") | html %]
8
        [% SWITCH entity %]
9
        [% CASE "itemtypes" %]
10
            [% tx("Add translations for item type '{code}'", { code = code }) | html %]
11
            &rsaquo; [% t("Item types") | html %] &rsaquo; [% t("Administration") | html %]
12
        [% CASE %]
13
            [% tx("Add translations for '{code}'", { code = code }) | html %]
14
        [% END %]
9
        &rsaquo; [% t("Koha") | html %]
15
        &rsaquo; [% t("Koha") | html %]
10
    [% END %]</title
16
    [% END %]
11
>
17
</title>
12
[% INCLUDE 'doc-head-close.inc' popup => 1 %]
18
[% INCLUDE 'doc-head-close.inc' popup => 1 %]
13
<style>
19
<style>
14
    #localization {
20
    #localization {
Lines 18-110 Link Here
18
</head>
24
</head>
19
25
20
<body id="admin_localization" class="admin">
26
<body id="admin_localization" class="admin">
21
<div class="main container-fluid">
27
[% WRAPPER 'header.inc' %]
22
    <div class="row">
28
    [% INCLUDE 'cat-search.inc' %]
23
        <div class="col-sm-12">
29
[% END %]
24
            <h1>Localization</h1>
30
[% WRAPPER 'sub-header.inc' %]
25
            <form id="add_translation" method="get">
31
    [% WRAPPER breadcrumbs %]
26
                [% INCLUDE 'csrf-token.inc' %]
32
        [% SWITCH entity %]
27
                <input type="hidden" name="entity" value="[% entity | html %]" />
33
        [% CASE "itemtypes" %]
28
                <input type="hidden" name="code" value="[% code | html %]" />
34
            [% WRAPPER breadcrumb_item %]
29
                <input type="hidden" name="interface" value="[% interface_side | html %]" />
35
                <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
30
                <fieldset class="rows clearfix">
36
            [% END %]
31
                    <ol>
37
            [% WRAPPER breadcrumb_item %]
32
                        <li>
38
                <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
33
                            <span class="label">Authorized value:</span>
39
            [% END %]
34
                            [% code | html %]
40
            [% WRAPPER breadcrumb_item %]
35
                        </li>
41
                <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% code | uri %]"> [% tx("Modify item type '{code}'", { code = code }) | html %] </a>
36
                        <li>
42
            [% END %]
37
                            <label for="lang">Language:</label>
43
            [% WRAPPER breadcrumb_item bc_active= 1 %]
38
                            <select name="lang" id="lang">
44
                <span>Add translations</span>
39
                                [% FOR language IN languages %]
45
            [% END %]
40
                                    [% FOR sublanguage IN language.sublanguages_loop %]
46
        [% CASE %]
41
                                        [% IF language.plural %]
47
            [% WRAPPER breadcrumb_item bc_active= 1 %]
42
                                            <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
48
                [% tx("Add translations for '{code}'", { code = code }) | html %]
43
                                        [% ELSE %]
49
            [% END %]
44
                                            <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
50
        [% END %]
45
                                        [% END %]
51
    [% END #/ WRAPPER breadcrumbs %]
46
                                    [% END %]
52
[% END #/ WRAPPER sub-header.inc %]
47
                                [% END %]
48
                            </select>
49
                        </li>
50
                        <li>
51
                            <label for="translation">Translation:</label>
52
                            <input type="text" size="40" name="translation" id="translation" />
53
                        </li>
54
                        <li>
55
                            <span class="label">&nbsp;</span>
56
                            <input type="submit" class="btn btn-primary" value="Add" />
57
                        </li>
58
                    </ol>
59
                </fieldset>
60
            </form>
61
        </div>
62
        <!-- /.col-sm-12 -->
63
    </div>
64
    <!-- /.row -->
65
53
66
    <div class="row">
54
[% WRAPPER 'main-container.inc' %]
67
        <div class="col-sm-12">
55
    [% SWITCH entity %]
68
            <div id="messages"></div>
56
    [% CASE "itemtypes" %]
69
        </div>
57
        <h1>[% tx("Add translations for item type '{code}'", { code = code }) | html %]</h1>
70
        <!-- /.col-sm-12 -->
58
    [% CASE %]
71
    </div>
59
        <h1>[% tx("Add translations for '{code}'", { code = code }) | html %]</h1>
72
    <!-- /.row -->
60
    [% END %]
73
61
74
    <div class="row">
62
    <form id="add_translation" method="get">
75
        <div class="col-sm-12">
63
        [% INCLUDE 'csrf-token.inc' %]
76
            <table id="localization">
64
        <input type="hidden" name="entity" value="[% entity | html %]" />
77
                <thead>
65
        <input type="hidden" name="code" value="[% code | html %]" />
78
                    <tr>
66
        <input type="hidden" name="interface" value="[% interface_side | html %]" />
79
                        <th>Id</th>
67
        <fieldset class="rows clearfix">
80
                        <th>Entity</th>
68
            <ol>
81
                        <th>Code</th>
69
                <li>
82
                        <th>Language</th>
70
                    <span class="label">Authorized value:</span>
83
                        <th>Translation</th>
71
                    [% code | html %]
84
                        <th class="no-sort">&nbsp;</th>
72
                </li>
73
                <li>
74
                    <label for="lang">Language:</label>
75
                    <select name="lang" id="lang">
76
                        [% FOR language IN languages %]
77
                            [% FOR sublanguage IN language.sublanguages_loop %]
78
                                [% IF language.plural %]
79
                                    <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
80
                                [% ELSE %]
81
                                    <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
82
                                [% END %]
83
                            [% END %]
84
                        [% END %]
85
                    </select>
86
                </li>
87
                <li>
88
                    <label for="translation">Translation:</label>
89
                    <input type="text" size="40" name="translation" id="translation" />
90
                </li>
91
                <li>
92
                    <span class="label">&nbsp;</span>
93
                    <input type="submit" class="btn btn-primary" value="Add" />
94
                </li>
95
            </ol>
96
        </fieldset>
97
    </form>
98
    <div id="messages"></div>
99
    <div class="page-section">
100
        <table id="localization">
101
            <thead>
102
                <tr>
103
                    <th>Id</th>
104
                    <th>Entity</th>
105
                    <th>Code</th>
106
                    <th>Language</th>
107
                    <th>Translation</th>
108
                    <th class="no-sort">&nbsp;</th>
109
                </tr>
110
            </thead>
111
            <tbody>
112
                [% FOR t IN translations %]
113
                    <tr id="row_id_[% t.id | html %]" data-id="[% t.id | html %]">
114
                        <td>[% t.id | html %]</td>
115
                        <td>
116
                            [% SWITCH entity %]
117
                            [% CASE "itemtypes" %]
118
                                Item type
119
                            [% CASE %]
120
                                [% t.entity | html %]
121
                            [% END %]
122
                        </td>
123
                        <td>[% t.code | html %]</td>
124
                        <td class="lang">[% t.lang | html %]</td>
125
                        <td class="translation" contenteditable="true">[% t.translation | html %]</td>
126
                        <td class="actions"
127
                            ><a href="#" class="btn btn-xs btn-default delete"><i class="fa fa-trash-can"></i> Delete</a></td
128
                        >
85
                    </tr>
129
                    </tr>
86
                </thead>
130
                [% END %]
87
                <tbody>
131
            </tbody>
88
                    [% FOR t IN translations %]
132
        </table>
89
                        <tr id="row_id_[% t.id | html %]" data-id="[% t.id | html %]">
90
                            <td>[% t.id | html %]</td>
91
                            <td>[% t.entity | html %]</td>
92
                            <td>[% t.code | html %]</td>
93
                            <td class="lang">[% t.lang | html %]</td>
94
                            <td class="translation" contenteditable="true">[% t.translation | html %]</td>
95
                            <td class="actions"
96
                                ><a href="#" class="delete"><i class="fa fa-trash-can"></i> Delete</a></td
97
                            >
98
                        </tr>
99
                    [% END %]
100
                </tbody>
101
            </table>
102
        </div>
103
        <!-- /.col-sm-12 -->
104
    </div>
133
    </div>
105
    <!-- /.row -->
134
    [% SWITCH entity %]
106
</div>
135
    [% CASE "itemtypes" %]
107
<!-- /.main.container-fluid -->
136
        <fieldset class="action">
137
            <a class="btn btn-default" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% code | uri %]"> [% tx("Return to item type '{code}'", { code = code }) | html %] </a>
138
        </fieldset>
139
    [% END %]
140
[% END %]
108
141
109
[% MACRO jsinclude BLOCK %]
142
[% MACRO jsinclude BLOCK %]
110
    [% INCLUDE 'datatables.inc' %]
143
    [% INCLUDE 'datatables.inc' %]
Lines 276-282 Link Here
276
                        if ( success.error ) {
309
                        if ( success.error ) {
277
                            show_message({ type: 'error_on_insert', data: success });
310
                            show_message({ type: 'error_on_insert', data: success });
278
                        } else {
311
                        } else {
279
                            var new_row = table_dt.row.add( [ success.id, success.entity, success.code, success.lang, success.translation, "<a href=\"#\" class=\"delete\"><i class=\"fa fa-trash-can\"></i> Delete</a>" ] ).draw().node();
312
                            var new_row = table_dt.row.add( [ success.id, success.entity, success.code, success.lang, success.translation, "<a href=\"#\" class=\"btn btn-default btn-xs delete\"><i class=\"fa fa-trash-can\"></i> Delete</a>" ] ).draw().node();
280
                            $( new_row ).attr("id", "row_id_" + success.id ).data("id", success.id );
313
                            $( new_row ).attr("id", "row_id_" + success.id ).data("id", success.id );
281
                            show_message({ type: 'success_on_insert', data: success });
314
                            show_message({ type: 'success_on_insert', data: success });
282
                        }
315
                        }
Lines 291-294 Link Here
291
         });
324
         });
292
    </script>
325
    </script>
293
[% END %]
326
[% END %]
294
[% INCLUDE 'popup-bottom.inc' %]
327
[% INCLUDE 'intranet-bottom.inc' %]
295
- 

Return to bug 40418