Skip to content

Commit 38a14ce

Browse files
Igor Milhitrerowep
Igor Milhit
andcommitted
User interface: header menu
* FIX: correct implementation of autohide * FIX: translate header menu * BETTER: display user name instead of My Account Co-Authored-by: Igor Milhit <[email protected]> Co-Authored-by: Peter Weber <[email protected]> Signed-off-by: Igor Milhit <[email protected]>
1 parent ca15dae commit 38a14ce

File tree

11 files changed

+490
-551
lines changed

11 files changed

+490
-551
lines changed

rero_ils/bundles.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def catalog(domain):
7070
npm={
7171
'almond': '~0.3.1',
7272
'angular': '~1.4.9',
73-
'bootstrap-sass': '~3.3.5',
7473
'bootstrap-autohide-navbar': '~1.0.0',
74+
'bootstrap-sass': '~3.3.5',
7575
'angular-gettext': '~2.3.8',
7676
'jquery': '~1.9.1',
7777
},
@@ -84,7 +84,6 @@ def catalog(domain):
8484
'js/rero_ils/invenio_config.js',
8585
'js/rero_ils/translations.js',
8686
'js/rero_ils/documents_items.js',
87-
'js/rero_ils/navbar-autohide.js',
8887
'js/rero_ils/persons.js',
8988
'js/rero_ils/thumbnail.js',
9089
'js/rero_ils/search_app.js',

rero_ils/modules/patrons/api.py

+23
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,26 @@ def organisation(self):
215215
return OrganisationWithLibraries.get_organisation_by_libraryid(
216216
self.library.id
217217
)
218+
219+
@property
220+
def name(self):
221+
"""Return the full name of the patron."""
222+
my_name = '{first_name} {last_name}'.format(
223+
first_name=self['first_name'],
224+
last_name=self['last_name']
225+
)
226+
return my_name
227+
228+
@property
229+
def initial(self):
230+
"""Return the initials of the patron first name."""
231+
initial = ''
232+
firsts = self['first_name'].split(' ')
233+
for first in firsts:
234+
initial += first[0]
235+
lasts = self['last_name'].split(' ')
236+
for last in lasts:
237+
if last[0].isupper():
238+
initial += last[0]
239+
240+
return initial

rero_ils/static/js/rero_ils/navbar-autohide.js

-39
This file was deleted.

rero_ils/static/js/rero_ils/rero_ils.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,17 @@ require([
2727
// });
2828
$(document).ready(function(){
2929
$('[data-toggle="tooltip"]').tooltip();
30+
/* Enable the sticky autohide header */
31+
32+
$(function () {
33+
'use strict';
34+
35+
$('.navbar').bootstrapAutoHideNavbar({
36+
disableAutoHide: false,
37+
delta: 5,
38+
duration: 250,
39+
shadow: false
40+
});
41+
});
42+
});
3043
});
31-
});

0 commit comments

Comments
 (0)