mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-23 21:21:57 +00:00
frontpage data
first draft designing the frontpage with recent uploads and segment for contact us.
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 TUGRAZ.
|
||||||
|
* Copyright (C) 2020 mojib wali.
|
||||||
|
*
|
||||||
|
* invenio-theme-tugraz is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the MIT License; see LICENSE file for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
h4{
|
||||||
|
display: block;
|
||||||
|
margin-block-start: 1.33em;
|
||||||
|
margin-block-end: 1.33em;
|
||||||
|
margin-inline-start: 0px;
|
||||||
|
margin-inline-end: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2{
|
||||||
|
margin-block-start: 0.83em;
|
||||||
|
margin-block-end: 0.83em;
|
||||||
|
margin-inline-start: 0px;
|
||||||
|
margin-inline-end: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p{
|
||||||
|
display: block;
|
||||||
|
margin-block-start: 1em;
|
||||||
|
margin-block-end: 1em;
|
||||||
|
margin-inline-start: 0px;
|
||||||
|
margin-inline-end: 0px;
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
@import "header";
|
@import "header";
|
||||||
@import "footer";
|
@import "footer";
|
||||||
@import "overrides";
|
@import "overrides";
|
||||||
|
@import "frontpage";
|
||||||
@import (css)
|
@import (css)
|
||||||
url("https://fonts.googleapis.com/css?family=Source+Sans+Pro&display=swap");
|
url("https://fonts.googleapis.com/css?family=Source+Sans+Pro&display=swap");
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ THEME_FOOTER_TEMPLATE = 'invenio_theme_tugraz/footer.html'
|
|||||||
THEME_FRONTPAGE_TITLE = _('Frontpage Title')
|
THEME_FRONTPAGE_TITLE = _('Frontpage Title')
|
||||||
"""Frontpage title."""
|
"""Frontpage title."""
|
||||||
|
|
||||||
THEME_SITENAME = _('Application Name')
|
THEME_SITENAME = _('Repository')
|
||||||
"""Site name."""
|
"""Site name."""
|
||||||
|
|
||||||
# Invenio-accounts
|
# Invenio-accounts
|
||||||
|
|||||||
30
invenio_theme_tugraz/search.py
Normal file
30
invenio_theme_tugraz/search.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020 TU Graz.
|
||||||
|
# Copyright (C) 2020 mojib wali.
|
||||||
|
#
|
||||||
|
# invenio-theme-tugraz is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the MIT License; see LICENSE file for more
|
||||||
|
# details.
|
||||||
|
|
||||||
|
"""Frontpage records."""
|
||||||
|
|
||||||
|
from __future__ import absolute_import, print_function
|
||||||
|
|
||||||
|
from elasticsearch_dsl.query import Q
|
||||||
|
from invenio_search.api import RecordsSearch
|
||||||
|
|
||||||
|
|
||||||
|
class FrontpageRecordsSearch(RecordsSearch):
|
||||||
|
"""Search class for records that goes on the frontpage."""
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
"""Default index and filter for frontpage search."""
|
||||||
|
|
||||||
|
index = 'records'
|
||||||
|
default_filter = Q(
|
||||||
|
'query_string',
|
||||||
|
query=(
|
||||||
|
'access_right:open '
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -9,122 +9,103 @@
|
|||||||
|
|
||||||
{%- extends config.INVENIO_THEME_TUGRAZ_BASE_TEMPLATE %}
|
{%- extends config.INVENIO_THEME_TUGRAZ_BASE_TEMPLATE %}
|
||||||
|
|
||||||
|
{%- from "invenio_theme_tugraz/macros/authors.html" import authors -%}
|
||||||
|
|
||||||
|
|
||||||
{%- block page_body %}
|
{%- block page_body %}
|
||||||
|
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
|
|
||||||
{{_('Welcome to %(module_name)s', module_name=module_name)}}
|
<div class="ui stackable grid">
|
||||||
|
|
||||||
<h2 class="ui center aligned icon header">
|
<div class="ten wide column">
|
||||||
<i class="list icon"></i>
|
<h2>{{_('Recent uploads')}}</h2>
|
||||||
Features
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div style="margin-bottom: 30px;"></div>
|
{%- for r in records %}
|
||||||
|
{%- set creation_date = r._created|from_isodatetime -%}
|
||||||
|
{%- set record_url = url_for('invenio_records_ui.recid', pid_value=r['recid']) %}
|
||||||
|
|
||||||
<div class="ui two column divided grid">
|
<!--btn view-->
|
||||||
<div class="row">
|
<a href="{{ record_url }}" class="ui right floated button">{{_('View')}}</a>
|
||||||
<div class="column">
|
<!--TODO:
|
||||||
<h3>Research-Data</h3>
|
something with doi
|
||||||
<p>
|
-->
|
||||||
Research data can take many forms. It might be:
|
<div class="left floated left aligned column">
|
||||||
documents, spreadsheets
|
|
||||||
laboratory notebooks, field notebooks, diaries
|
<!--Publication date badge-->
|
||||||
questionnaires, transcripts, codebooks
|
<span class="ui label teal" title="{{_('Publication date')}}">{{ r.publication_date }}
|
||||||
audiotapes, videotapes
|
{{ (' | ' ~ r.version ~ '') if r.version else ' | Version' }}</span>
|
||||||
photographs, films
|
|
||||||
test responses
|
<!--Resource type badge-->
|
||||||
slides, artefacts, specimens, samples
|
<span class="ui label grey" title="{{_('Resource type')}}">{{r.resource_type.type}}</span>
|
||||||
collections of digital outputs
|
<span class="label record-version">
|
||||||
data files
|
<!--TODO: add subtype---></span>
|
||||||
database contents (video, audio, text, images)
|
|
||||||
models, algorithms, scripts
|
<!--Access right badge-->
|
||||||
contents of an application (input, output, logfiles for analysis software, simulation software, schemas)
|
<span class="ui label green">{{_('Open Access')}}</span>
|
||||||
methodologies and workflows
|
|
||||||
standard operating procedures and protocols
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="column">
|
|
||||||
<h3>Open educational resources (OER) </h3>
|
|
||||||
<p>Open educational resources (OER) are freely accessible, openly licensed text, media, and other digital assets
|
|
||||||
that are useful for teaching, learning, and assessing as well as for research purposes.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="column">
|
|
||||||
<h3>Thesis</h3>
|
|
||||||
<p>A thesis statement focuses your ideas into one or two sentences. It should present the topic of your paper
|
|
||||||
and also make a comment about your position in relation to the topic. Your thesis statement should tell your
|
|
||||||
reader what the paper is about and also help guide your writing and keep your argument focused.</p>
|
|
||||||
</div>
|
|
||||||
<div class="column">
|
|
||||||
<h3>Publications</h3>
|
|
||||||
<p>To publish is to make content available to the general public. While specific use of the term may vary among
|
|
||||||
countries, it is usually applied to text, images, or other audio-visual content, including paper. The word
|
|
||||||
publication means the act of publishing, and also refers to any printed copies.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-bottom: 30px;"></div>
|
<h4><a href="{{ record_url }}">{{r.titles[0].title}}</a></h4>
|
||||||
|
<p>{{ authors(r.creators) }}</p>
|
||||||
|
|
||||||
|
<p class="hidden-xs"><a href="{{record_url}}">{{ r.descriptions[0].description|striptags|truncate(300) }}</a></p>
|
||||||
|
|
||||||
|
<div class="ui tiny header">{% trans user=userprofile, date=creation_date|dateformat('long') %}Uploaded on
|
||||||
|
{{date}}{% endtrans %}</div>
|
||||||
|
|
||||||
|
{%- if not loop.last %}
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
{%- else%}
|
||||||
|
<a href="{{url_for('invenio_search_ui.search')}}" class="ui right floated button">{{_('More')}}</a>
|
||||||
<h2 class="ui center aligned icon header">
|
{%- endif %}
|
||||||
<i class="chart line icon"></i>
|
{%- endfor %}
|
||||||
Statistic
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
|
|
||||||
<div style="margin-bottom: 50px;"></div>
|
|
||||||
|
|
||||||
<div class="ui two statistics">
|
|
||||||
<div class="statistic">
|
|
||||||
<div class="value">
|
|
||||||
<i class="file alternate card icon"></i> 15000
|
|
||||||
</div>
|
</div>
|
||||||
<div class="label">
|
<!--- END Recent uploads-->
|
||||||
Recorda
|
|
||||||
|
<!---contact form-->
|
||||||
|
<div class="six wide column">
|
||||||
|
|
||||||
|
<!--contact us-->
|
||||||
|
<div class="ui segment" style="padding-bottom: 10px;">
|
||||||
|
<h4>Need help?</h4>
|
||||||
|
<div style="padding-bottom: 10px;">
|
||||||
|
<a href="{{ url_for('invenio_theme_tugraz.index')}}" class="fluid ui button">Contact us</a>
|
||||||
</div>
|
</div>
|
||||||
|
<p>{{config.THEME_SITENAME}} prioritizes all requested related to the COVID-19 outbreak.</p>
|
||||||
|
<p>We can help with:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Uploading your research data, software, preprints, etc.</li>
|
||||||
|
<li>One-on-one with {{config.THEME_SITENAME}} supporters.</li>
|
||||||
|
<li>Quota increases beyond our default policy.</li>
|
||||||
|
<li>Scripts for automated uploading of larger datasets.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="ui segment" style="padding-bottom: 10px;">
|
||||||
<div class="statistic">
|
<h4>Why use {{config.THEME_SITENAME}}?</h4>
|
||||||
<div class="value">
|
<ul>
|
||||||
<i class="users icon"></i> 30
|
<li><strong>Safe</strong> — your research is stored safely for the future in CERN’s Data Centre for as long as
|
||||||
</div>
|
CERN exists.</li>
|
||||||
<div class="label">
|
<li><strong>Trusted</strong> — built and operated by CERN and OpenAIRE to ensure that everyone can join in
|
||||||
Communities
|
Open Science.</li>
|
||||||
</div>
|
<li><strong>Citeable</strong> — every upload is assigned a Digital Object Identifier (DOI), to make them
|
||||||
</div>
|
citable and trackable.</li>
|
||||||
|
<li><strong>No waiting time</strong> — Uploads are made available online as soon as you hit publish, and your
|
||||||
<div class="statistic">
|
DOI is registered within seconds.</li>
|
||||||
<div class="value">
|
<li><strong>Open or closed</strong> — Share e.g. anonymized clinical trial data with only medical
|
||||||
<i class="user icon"></i> 500
|
professionals via our restricted access mode.</li>
|
||||||
</div>
|
<li><strong>Versioning</strong> — Easily update your dataset with our versioning feature.</li>
|
||||||
<div class="label">
|
<li><strong>Usage statisics</strong> — All uploads display standards compliant usage statistics</li>
|
||||||
Users
|
</ul>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="statistic">
|
|
||||||
<div class="value">
|
|
||||||
<i class="address card icon"></i> 50
|
|
||||||
</div>
|
|
||||||
<div class="label">
|
|
||||||
Members
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div style="margin-bottom: 50px;"></div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{%- endblock %}
|
</div>
|
||||||
|
|
||||||
|
{%- endblock %}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{#
|
||||||
|
Copyright (C) 2020 Zenodo
|
||||||
|
Copyright (C) 2020 TUGRAZ
|
||||||
|
Copyright (C) 2020 mojib wali.
|
||||||
|
|
||||||
|
invenio-theme-tugraz is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the MIT License; see LICENSE file for more
|
||||||
|
details.
|
||||||
|
#}
|
||||||
|
|
||||||
|
{%- macro authors(authors_list) %}
|
||||||
|
{%- for author in authors_list %}
|
||||||
|
{%- if author.orcid %}
|
||||||
|
<a href="{{author.orcid|pid_url('orcid')}}"><img class="inline-orcid" src="{{ url_for('static', filename='extra/orcid.png')}}" /></a>
|
||||||
|
{%- endif %}
|
||||||
|
<span class="text-muted" {% if author.affiliation %}data-toggle="tooltip" title="{{author.affiliation}}"{% endif %}>{{author.name}}</span>{% if not loop.last %}; {% endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
|
||||||
|
{%- macro contributors(contributors_list) %}
|
||||||
|
{%- for group in contributors_list|groupby('type')%}
|
||||||
|
<h5>{{group.grouper|contributortype_title}}(s)</h5>
|
||||||
|
{{authors(group.list)}}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endmacro %}
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
from flask import Blueprint, render_template
|
from flask import Blueprint, render_template
|
||||||
from flask_babelex import gettext as _
|
from flask_babelex import gettext as _
|
||||||
|
|
||||||
|
from .search import FrontpageRecordsSearch
|
||||||
|
|
||||||
blueprint = Blueprint(
|
blueprint = Blueprint(
|
||||||
'invenio_theme_tugraz',
|
'invenio_theme_tugraz',
|
||||||
__name__,
|
__name__,
|
||||||
@@ -24,7 +26,8 @@ blueprint = Blueprint(
|
|||||||
|
|
||||||
@blueprint.route("/")
|
@blueprint.route("/")
|
||||||
def index():
|
def index():
|
||||||
"""Render a basic view."""
|
"""Render frontpage view."""
|
||||||
return render_template(
|
return render_template(
|
||||||
"invenio_theme_tugraz/index.html",
|
"invenio_theme_tugraz/index.html",
|
||||||
module_name=_('invenio-theme-tugraz'))
|
module_name=_('invenio-theme-tugraz'),
|
||||||
|
records=FrontpageRecordsSearch()[:10].sort('-_created').execute(),)
|
||||||
|
|||||||
12
setup.py
12
setup.py
@@ -29,6 +29,15 @@ extras_require = {
|
|||||||
'docs': [
|
'docs': [
|
||||||
'Sphinx>=1.5.1',
|
'Sphinx>=1.5.1',
|
||||||
],
|
],
|
||||||
|
'mysql': [
|
||||||
|
'invenio-db[mysql]>=1.0.0',
|
||||||
|
],
|
||||||
|
'postgresql': [
|
||||||
|
'invenio-db[postgresql]>=1.0.0',
|
||||||
|
],
|
||||||
|
'sqlite': [
|
||||||
|
'invenio-db>=1.0.0',
|
||||||
|
],
|
||||||
'tests': tests_require,
|
'tests': tests_require,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,6 +55,9 @@ install_requires = [
|
|||||||
'Flask-WebpackExt>=1.0.0',
|
'Flask-WebpackExt>=1.0.0',
|
||||||
'invenio-assets>=1.2.0,<1.3.0',
|
'invenio-assets>=1.2.0,<1.3.0',
|
||||||
'invenio-i18n>=1.2.0',
|
'invenio-i18n>=1.2.0',
|
||||||
|
'elasticsearch_dsl>=7.2.1',
|
||||||
|
'invenio_search>=1.3.1',
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
packages = find_packages()
|
packages = find_packages()
|
||||||
|
|||||||
Reference in New Issue
Block a user