Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

documents: remove organisation tag #779

Merged
merged 1 commit into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
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
18 changes: 13 additions & 5 deletions sonar/modules/documents/templates/documents/record.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,26 @@ <h5 class="my-4">{{ _('document_type_' + record.documentType) }}</h5>
</div>
<div class="col">
<h1 class="text-primary">{{ title | nl2br | safe }}</h1>
{% set infoOrgSub = true %}
{%- if view != config.SONAR_APP_DEFAULT_ORGANISATION %}
{% set infoOrgSub = false if record.get('subdivisions', [])|length == 0 else true %}
{%- endif %}
{%- if infoOrgSub %}
<h4 class="m-0">
{%- for organisation in record.get('organisation', []) -%}
<span class="badge badge-secondary text-light mr-1 font-weight-normal">
{{ organisation.name }}
</span>
{%- endfor -%}
{%- if view == config.SONAR_APP_DEFAULT_ORGANISATION %}
{%- for organisation in record.get('organisation', []) -%}
<span class="badge badge-secondary text-light mr-1 font-weight-normal">
{{ organisation.name }}
</span>
{%- endfor -%}
{%- endif %}
{%- for subdivision in record.get('subdivisions', []) -%}
<span class="badge badge-secondary text-light mr-1 font-weight-normal">
{{ subdivision.name | language_value }}
</span>
{%- endfor -%}
</h4>
{%- endif %}

<!-- CONTRIBUTORS-->
{% set contributors = record | contributors %}
Expand Down
4 changes: 3 additions & 1 deletion sonar/modules/documents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def search(view):
collection = CollectionRecord.get_record_by_pid(
request.args['collection_view'])

return render_template('sonar/search.html', collection=collection)
return render_template('sonar/search.html',
collection=collection, view=view)


def detail(pid, record, template=None, **kwargs):
Expand Down Expand Up @@ -107,6 +108,7 @@ def detail(pid, record, template=None, **kwargs):
return render_template(template,
pid=pid,
record=record,
view=kwargs.get('view'),
schema_org_data=schema_org_data,
google_scholar_data=google_scholar_data)

Expand Down
5 changes: 4 additions & 1 deletion sonar/theme/templates/sonar/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@

<!DOCTYPE html>
<html {% if html_css_classes %} class="{{ html_css_classes|join(' ') }}" {% endif %}
lang="{{ current_i18n.locale.language|safe }}" dir="{{ current_i18n.locale.text_direction }}">
lang="{{ current_i18n.locale.language|safe }}" dir="{{ current_i18n.locale.text_direction }}"
{%- block view %}{%- endblock %}
>


<head>
{% include config.THEME_TRACKINGCODE_TEMPLATE %}
Expand Down
1 change: 1 addition & 0 deletions sonar/theme/templates/sonar/search.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends 'sonar/page.html' %}

{%- block view %} data-view="{{ view }}"{%- endblock %}
{%- block body %}
{% if collection %}
{% include 'collections/item.html' %}
Expand Down