8000 Add citations to app manager entry template by edan-bainglass · Pull Request #227 · aiidalab/aiidalab-home · GitHub
[go: up one dir, main page]

Skip to content
8000
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 41 additions & 11 deletions home/app_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,47 @@ class AppManagerWidget(ipw.VBox):
</div>"""
)

TEMPLATE = Template(
"""<b> <div style="font-size: 30px; text-align:center;">{{ app.title }}</div></b>
<br>
<b>Authors:</b> {{ app.authors }}
<br>
<b>Description:</b> {{ app.description }}
{% if app.url and app.url.startswith("http") %}
<br>
<b>URL:</b> <a href="{{ app.url }}">{{ app.url }}</a>
{% endif %}"""
)
TEMPLATE = Template("""
<b><div style="font-size: 30px; text-align:center;">{{ app.title }}</div></b>
<br>
<b>Authors:</b> {{ app.authors }}
<br>
<b>Description:</b> {{ app.description }}
{% if app.url and app.url.startswith("http") %}
<br>
<b>URL:</b> <a href="{{ app.url }}">{{ app.url }}</a>
{% endif %}
<br>
{% if app.citations %}
<b>Citations:</b>
<br>
<ul>
{% for citation in app.citations %}
{% if citation.text %}
{% if citation.link %}
<a href="{{ citation.link }}" target="_blank" noreferrer noopener>{{ citation.text }}</a>
{% else %}
{{ citation.text }}
{% endif %}
{% else %}
{{ citation.authors | join(", ") }},
{% if citation.title %}
"{{ citation.title }}".
{% endif %}
<em>{{ citation.journal }}</em>
{% if citation.volume %}
, <b>{{ citation.volume }}</b>
{% endif %}
{% if citation.issue %}
, {{ citation.issue }}
{% endif %}
({{ citation.year }}).
<a href="https://doi.org/{{ citation.doi }}" target="_blank" noreferrer noopener>https://doi.org/{{ citation.doi }}</a>
{% endif %}
{% endfor %}
</ul>
Comment on lines +140 to +164
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same template used in the AiiDAlab app registry.

{% endif %}
""")

def __init__(self, app, minimalistic=False):
self.app = app
Expand Down
Loading
0