Skip to content

Commit

Permalink
editor: compact the presentation
Browse files Browse the repository at this point in the history
* Improves editor appearance.
* Improves js package manager: use yarn instead of npm.
* Save vertical space by putting add item in menu

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
  • Loading branch information
jma committed Aug 29, 2019
1 parent 359340a commit 5277bf9
Show file tree
Hide file tree
Showing 32 changed files with 10,589 additions and 15,860 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ recursive-include ui *.py

# added by check_manifest.py
include *.json
include ui/yarn.lock

# added by check_manifest.py
recursive-include rero_ils *.ico
Expand Down
21 changes: 20 additions & 1 deletion rero_ils/modules/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

"""Admin views and actions."""

from flask import url_for
from flask_admin import BaseView, expose
from flask_babelex import gettext as _
from invenio_admin.permissions import \
Expand Down Expand Up @@ -57,6 +58,24 @@ def is_accessible(self):
return (can_edit() or default_admin_permission_factory(self).can())


class DocumentCreateILSManager(ILSManager):
"""Flask-Admin Library view."""

def get_url(self, endpoint, **kwargs):
"""Generate URL for the endpoint.
If you want to customize URL generation
logic (persist some query string argument, for example), this is
right place to do it.
:param endpoint:
Flask endpoint name
:param kwargs:
Arguments for `url_for`
"""
kwargs.update({'go_to_detailed': 'true'})
return url_for(endpoint, **kwargs)

circulation = {
'view_class': ILSManager,
'kwargs': dict(name=_('Circulation'),
Expand Down Expand Up @@ -177,7 +196,7 @@ def is_accessible(self):
}

documents_create = {
'view_class': ILSManager,
'view_class': DocumentCreateILSManager,
'kwargs': dict(
name=_('Create a bibliographic record'),
category=_('Catalogue'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"description": "Language from which a resource is translated.",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"minLength": 2,
Expand All @@ -120,7 +121,7 @@
"title": "Authors",
"description": "Author(s) of the resource. Can be either persons or organisations.",
"type": "array",
"minItems": 0,
"minItems": 1,
"items": {
"type": "object",
"required": [
Expand Down Expand Up @@ -378,6 +379,7 @@
"minItems": 1,
"items": {
"type": "string",
"description": "Subject of the resource.",
"minLength": 1
}
},
Expand Down
Loading

0 comments on commit 5277bf9

Please sign in to comment.