This repository has been archived by the owner on Dec 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples: print record details addition
* Modifies the example app to show the record inside a template. Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
- Loading branch information
Leonardo Rossi
committed
Feb 24, 2016
1 parent
8e49481
commit 72681c6
Showing
8 changed files
with
260 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
h1.title{ | ||
background-color: #7775f5; | ||
color: #ebebeb; | ||
text-align: center; | ||
} | ||
.container{ | ||
display: inline-block; | ||
width: 100%; | ||
margin-bottom: 1em; | ||
} | ||
h2 small{ | ||
color: #9f9393; | ||
} | ||
.panel{ | ||
border-top: 1px solid; | ||
color: #a69e9e; | ||
} | ||
.extra-info{ | ||
float: right; | ||
background-image: linear-gradient(to bottom, #e8e8e8 0px, #f5f5f5 100%); | ||
line-height: 1.5em; | ||
padding: 1em; | ||
margin: 1.5em 1em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of Invenio. | ||
# Copyright (C) 2016 CERN. | ||
# | ||
# Invenio is free software; you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 2 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Invenio is distributed in the hope that it will be | ||
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Invenio; if not, write to the | ||
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
# MA 02111-1307, USA. | ||
# | ||
# In applying this license, CERN does not | ||
# waive the privileges and immunities granted to it by virtue of its status | ||
# as an Intergovernmental Organization or submit itself to any jurisdiction. | ||
-#} | ||
|
||
<link rel="stylesheet" href="/static/app/css/app.css"></link> | ||
|
||
<h1 class=title>{{ title }}</h1> | ||
|
||
{%- extends "app/detail_base.html" -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of Invenio. | ||
# Copyright (C) 2016 CERN. | ||
# | ||
# Invenio is free software; you can redistribute it | ||
# and/or modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 2 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Invenio is distributed in the hope that it will be | ||
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Invenio; if not, write to the | ||
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
# MA 02111-1307, USA. | ||
# | ||
# In applying this license, CERN does not | ||
# waive the privileges and immunities granted to it by virtue of its status | ||
# as an Intergovernmental Organization or submit itself to any jurisdiction. | ||
-#} | ||
|
||
{%- macro record_content(data) %} | ||
{% for key, value in data.items() recursive %} | ||
<li class="list-group-item"> | ||
{% if value is mapping %} | ||
<strong>{{ key }}:</strong> | ||
<ul class="list-group">{{ loop(value.items()) }}</ul> | ||
{% elif value is iterable and value is not string %} | ||
<strong>{{ key }}:</strong> | ||
<ol> | ||
{% for item in value %} | ||
<li> | ||
{% if item is mapping %} | ||
<ul class="list-group"> | ||
{{ record_content(item) }} | ||
</ul> | ||
{% else %} | ||
{{ item }} | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
{% else %} | ||
<strong>{{ key }}:</strong> {{ value }} | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
{%- endmacro %} | ||
|
||
{%- block page_body %} | ||
<div class="container"> | ||
<div class="extra-info"> | ||
{%- if pid %} | ||
{%- block record_control_number %} | ||
<b>{{ _('control number:') }}</b> | ||
{{ pid.pid_type }} {{pid.pid_value}} | ||
{%- endblock %} | ||
{% endif %} | ||
</br> | ||
{%- if 'publication_distribution_imprint' in record %} | ||
{%- block record_publication_date %} | ||
<b>{{ _('Publication date:') }}</b> | ||
{{ record['publication_distribution_imprint'][0]['date_of_publication_distribution'][0] }} | ||
{%- endblock %} | ||
{% endif %} | ||
</br> | ||
{%- if 'other_standard_identifier' in record %} | ||
{%- block record_other_standard_identifier %} | ||
<b>{{ _('OAI Id:') }}</b> | ||
{{ record['other_standard_identifier'][0]['standard_number_or_code'] }} | ||
{%- endblock %} | ||
{% endif %} | ||
</div> | ||
<div class="body"> | ||
{%- if 'title_statement' in record %} | ||
{%- block record_title %} | ||
<h2>{{ record['title_statement']['title'] }} <br> | ||
</h2> | ||
{%- endblock %} | ||
{% endif %} | ||
{%- if 'main_entry_personal_name' in record %} | ||
{%- block record_author %} | ||
<p><i> | ||
{{ record['main_entry_personal_name']['personal_name'] }} | ||
{%- if 'added_entry_personal_name' in record %} | ||
{{ record['added_entry_personal_name'] | ||
| map(attribute='personal_name') | join(', ') }} | ||
{% endif %} | ||
</i></p> | ||
{%- endblock %} | ||
{% endif %} | ||
{%- if 'summary' in record %} | ||
{%- block record_summary %} | ||
<p>{{ record['summary'][0]['summary'] }}</p> | ||
{%- endblock %} | ||
{%- endif %} | ||
</div> | ||
</div> | ||
<div class="raw"> | ||
{%- block record_raw %} | ||
{% if record %} | ||
<div class="panel panel-default"> | ||
<p>Record:</p> | ||
<ul class="list-group"> | ||
{{ record_content(record) }} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{%- endblock %} | ||
</div> | ||
{%- endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters