Bug 17398: Enhance circulation messages UI
authorJosef Moravec <josef.moravec@gmail.com>
Tue, 4 Oct 2016 12:55:51 +0000 (14:55 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 23 Dec 2016 11:45:00 +0000 (11:45 +0000)
Test plan:
1) Apply patch
2) Add same circulation messages, note that both buttons are in bootstrap style and the whole form is a bit cleaner
3) Confirm that adding works as expected
4) Try to delete some of your messages, note the delete link is also button now
5) Confirm that deleting works as expected

Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index ba6c8fb..ff8e6b6 100644 (file)
@@ -2786,3 +2786,15 @@ div[class$="_table_controls"] {
 #borrower_message {
     margin-top: 10px;
 }
+
+.form-group {
+   margin-bottom: 10px;
+}
+
+.form-group label {
+    font-weight: bold;
+}
+
+.modal-textarea {
+    width: 98%;
+}
index bb8b68d..503d6e6 100644 (file)
@@ -214,42 +214,40 @@ function searchToHold(){
 
 <!-- Modal -->
 <div id="add_message_form" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true">
-    <div class="modal-body">
-        <form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
-        <fieldset id="borrower_messages" class="brief">
-            <legend>Leave a message</legend>
-            <ol>
-                <li>
-                    <label for="message_type">Add a message for:</label>
-                    <select name="message_type" id="message_type">
-                        <option value="L">Staff - Internal note</option>
-                        <option value="B">OPAC - [% firstname | html %] [% surname | html %]</option>
-                    </select>
-                </li>
-                [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
-                [% IF bor_notes %]
-                    <li>
-                        <label for="select_patron_messages">Predefined notes: </label>
-                        <select name="type" id="select_patron_messages">
-                            <option value="">Select note</option>
-                            [% FOREACH bor_note IN bor_notes %]
-                                <option value="[% bor_note.lib %]">[% bor_note.lib %]</option>
-                            [% END %]
-                        </select>
-                    </li>
-                [% END %]
-                <li>
-                    <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea>
-                </li>
-            </ol>
+    <form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
+        <div class="modal-header">
+            <h3>Leave a message</h3>
+        </div>
+        <div class="modal-body">
+            <div class="form-group">
+                <label for="message_type">Add a message for:</label>
+                <select name="message_type" id="message_type">
+                    <option value="L">Staff - Internal note</option>
+                    <option value="B">OPAC - [% firstname | html %] [% surname | html %]</option>
+                </select>
+            </div>
+            [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
+            [% IF bor_notes %]
+            <div class="form-group">
+                <label for="select_patron_messages">Predefined notes: </label>
+                <select name="type" id="select_patron_messages">
+                    <option value="">Select note</option>
+                    [% FOREACH bor_note IN bor_notes %]
+                        <option value="[% bor_note.lib %]">[% bor_note.lib %]</option>
+                    [% END %]
+                </select>
+            </div>
+            [% END %]
+            <div class="form-group">
+                <textarea rows="3" class="modal-textarea" name="borrower_message" id="borrower_message" ></textarea>
+            </div>
             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
             <input type="hidden" name="batch" value="[% batch %]" />
             <input type="hidden" name="branchcode" value="[% LoginBranchcode %]" />
-        </fieldset>
-    </div>
-    <div class="modal-footer">
-        <fieldset class="action">
-            <input type="submit" value="Save" /> </form><a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
-        </fieldset>
-    </div>
+        </div>
+        <div class="modal-footer">
+            <button class="btn approve" type="submit"><i class="fa fa-check"></i> Save</button>
+            <button class="btn deny" href="#" class="cancel" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Cancel</button>
+        </div>
+    </form>
 </div>
index 6ab6985..1444f2d 100644 (file)
@@ -856,7 +856,7 @@ No patron matched <span class="ex">[% message | html %]</span>
                         <span class="circ-hlt">
                     [% ELSE %]
                         <span>
-                    [% END %]>
+                    [% END %]
                         [% message.message_date | $KohaDates %]
                         [% Branches.GetName( message.branchcode ) %]
                         [% IF message.manager_id %]
@@ -865,7 +865,7 @@ No patron matched <span class="ex">[% message | html %]</span>
                         <i>"[% message.message %]"</i>
                     </span>
                     [% IF message.branchcode == branch OR Koha.Preference('AllowAllMessageDeletion') %]
-                        [<a href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id %]&amp;borrowernumber=[% message.borrowernumber %]" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a>]
+                        <a class="btn-small" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id %]&amp;borrowernumber=[% message.borrowernumber %]" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a>
                     [% END %]
                 </li>
             [% END %]