Bug 2093: (follow-up) Add OPAC dashboard for logged-in users
authorOwen Leonard <oleonard@myacpl.org>
Sat, 29 Apr 2017 04:57:42 +0000 (04:57 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 27 Oct 2017 17:09:04 +0000 (14:09 -0300)
This patch adds some additional markup for applying styles to and the
corresponding CSS.

Also modified: Links to opac-user.pl should now open the correct tab.

To test, apply the patch and compile the modified LESS file. Clear your
browser cache if necessary. Follow the original test plan and confirm
that the revised links work correctly.

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt
koha-tmpl/opac-tmpl/bootstrap/less/opac.less

index e60087b..817dad6 100644 (file)
                     [% ELSE %]
                         [% IF Koha.Preference('OPACUserSummary') %]
                             <div id="user_summary">
-                                <h1>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></h1>
+                                <h3>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></h3>
                                 <ul id="user_summary_shortcuts">
                                     [% IF checkouts && checkouts > 0 %]
-                                        <li><a href="/cgi-bin/koha/opac-user.pl">[% checkouts %] checkout(s)</a></li>
+                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts"><span class="user_checkouts_count count_label">[% checkouts %]</span> Checkout(s)</a></li>
                                     [% END %]
                                     [% IF overdues && overdues > 0 %]
-                                        <li><a href="/cgi-bin/koha/opac-user.pl">[% overdues %] overdue(s)</a></li>
+                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-overdues"><span class="user_overdues_count count_label">[% overdues %]</span> Overdue(s)</a></li>
                                     [% END %]
                                     [% IF holds_pending && holds_pending > 0 %]
-                                        <li><a href="/cgi-bin/koha/opac-user.pl">[% holds_pending %] hold(s) pending</a></li>
+                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_pending_count count_label">[% holds_pending %]</span> Hold(s) pending</a></li>
                                     [% END %]
                                     [% IF holds_waiting && holds_waiting > 0 %]
-                                        <li><a href="/cgi-bin/koha/opac-user.pl">[% holds_waiting %] hold(s) waiting</a></li>
+                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_waiting_count count_label">[% holds_waiting %]</span> Hold(s) waiting</a></li>
                                     [% END %]
                                     [% IF total_owing && total_owing > 0 %]
-                                        <li><a href="/cgi-bin/koha/opac-account.pl">[% total_owing | $Price %] due</a></li>
+                                        <li><a href="/cgi-bin/koha/opac-account.pl"><span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span> Due</a></li>
                                     [% END %]
                                 </ul>
                             </div>
index 63961e8..159174f 100644 (file)
@@ -2526,4 +2526,74 @@ a.reviewlink:visited {
     color: white !important;
 }
 
+.count_label {
+    @base: #369;
+    background-color: @base;
+    border-radius: 5px;
+    color: #FFF;
+    display: inline-block;
+    font-weight: bold;
+    min-width: 1.5em;
+    padding: .2em;
+    text-align: center;
+    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+
+    &:hover {
+        background-color: lighten( @base, 20% );
+    }
+}
+
+.user_checkouts_count {
+
+}
+
+.user_overdues_count,
+.user_fines_count {
+    background-color: #990000;
+    &:hover {
+        background-color: lighten( #990000, 10% );
+    }
+}
+
+.user_holds_pending_count {
+
+}
+
+.user_holds_waiting_count {
+    background-color: #538200;
+    &:hover {
+        background-color: lighten( #538200, 10% );
+    }
+}
+
+#user_summary {
+    border: 1px solid #EAEAE6;
+    border-radius: 7px;
+    margin-bottom: 1em;
+    padding-bottom: .5em;
+
+    h3 {
+        background-color: #EAEAE6;
+        border-top-left-radius: 6px;
+        border-top-right-radius: 6px;
+        box-shadow: 0 1px 1px 0 rgba(0,0,0,0.2);
+        margin-top: 0;
+        padding: .2em 0;
+        text-align: center;
+    }
+
+    ul {
+        list-style-type: none;
+        margin: 0 0 .2em 0;
+
+        a {
+            display: block;
+            font-weight: bold;
+            padding: .2em 1em;
+        }
+    }
+}
+
+
+
 @import "responsive.less";