Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

request header: move header below actions, add back-button to communi… #1846

Merged
merged 1 commit into from
Aug 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
{%- block request_header %}
{% if is_user_dashboard %}
{% set back_button_url = url_for("invenio_app_rdm_users.requests") %}
{% else %}
{% set back_button_url = url_for("invenio_communities.communities_requests", pid_value=community.id) %}
{% endif %}
{{ submission_request_header(
request=invenio_request, record=record, draft_is_accepted=draft_is_accepted, back_button_url=back_button_url) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,28 @@

{% macro invitation_request_header(back_button_url=None, back_button_text=None, request=None, accepted=False) %}
<div class="flex wrap space-between">
<div class="flex wrap rel-mt-1 rel-mb-1">
{% if back_button_url and back_button_text %}
<div class="rel-mt-1 rel-mb-1">
<a href="{{ back_button_url }}"
class="ui button labeled icon rel-mr-1">
<i class="ui icon left arrow" aria-hidden="true"></i>
{{ back_button_text }}
</a>
</div>
{% endif %}
<div class="flex align-items-center rel-mt-1 rel-mb-1">
<h2 class="ui header">{{ request.title }}</h2>
{% if back_button_url and back_button_text %}
<div class="mb-10">
<a href="{{ back_button_url }}"
class="ui small button labeled icon rel-mr-1">
<i class="ui icon left arrow" aria-hidden="true"></i>
{{ back_button_text }}
</a>
</div>
</div>
<div id="request-actions" class="flex align-items-center ml-auto">
{% endif %}

<div id="request-actions" class="flex align-items-center ml-auto mb-10">
{% if accepted %}
<a href="{{ url_for("invenio_app_rdm_communities.communities_detail", pid_value=request.topic.community) }}"
class="ui button">
class="ui small button">
{{ _("View Community") }}
</a>
{% endif %}
</div>
</div>

<h2 class="ui header">{{ request.title }}</h2>

<div class="ui divider"></div>
{% endmacro %}

Expand All @@ -35,40 +33,35 @@ <h2 class="ui header">{{ request.title }}</h2>

{% macro submission_request_header(back_button_url=None, request=None, record=None, draft_is_accepted=False) %}
<div class="flex wrap space-between rel-mt-2">
<div class="flex wrap">
{% if back_button_url %}
<div class="rel-mt-1 rel-mb-1">
<a href="{{ back_button_url }}"
class="ui button labeled icon rel-mr-1">
<i class="ui icon left arrow" aria-hidden="true"></i>
{{ _("Back to requests") }}
</a>
</div>
{% endif %}
<div class="flex align-items-center rel-mt-1 rel-mb-1">
<div>
<h2 class="ui header request-header">{{ request.title }}
</h2>
{% if record %}
<dl class="creatibutors" aria-label="{{ _('Creators list') }}">
{{ show_creatibutors(record.metadata.creators) }}
</dl>
{% endif %}
</div>
{% if back_button_url %}
<div class="mb-10">
<a href="{{ back_button_url }}"
class="ui small button labeled icon rel-mr-1">
<i class="ui icon left arrow" aria-hidden="true"></i>
{{ _("Back to requests") }}
</a>
</div>
</div>
{% endif %}

<div id="request-actions" class="flex align-items-start ml-auto rel-mt-1 ">
<div id="request-actions" class="flex align-items-start ml-auto mb-10">
{% if draft_is_accepted %}
<a href="{{ url_for('invenio_app_rdm_records.record_detail', pid_value=request.topic.record) }}"
class="ui button"
class="ui small button"
rel="noopener noreferrer" target="_blank"
title="{{ _('Opens in new tab') }}"
>
{{ _("View record") }}
</a>
{% endif %}
</div>
</div>

<div class="rel-mt-2">
<h2 class="ui header request-header">{{ request.title }}</h2>
{% if record %}
<dl class="creatibutors" aria-label="{{ _('Creators list') }}">
{{ show_creatibutors(record.metadata.creators) }}
</dl>
{% endif %}
</div>
{% endmacro %}