Skip to content
Snippets Groups Projects
Commit 896444af authored by weeman's avatar weeman
Browse files

Merge branch 'feat-buttons' into 'develop'

Überarbeite Buttons

Closes #580

See merge request hub/hub!1103
parents 9c8201ac 135b727f
Branches
Tags
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
csrf_input csrf_input
#} #}
{% macro fav(fav_id, fav_type, fav_is, color="transparent", next=request.get_full_path() ) -%} {% macro fav(fav_id, fav_type, fav_is, color="transparent", next=request.get_full_path(), margin=True) -%}
{% if not archive_mode %} {% if not archive_mode %}
<form action="{{ url('plainui:modify_favorites') }}" <form action="{{ url('plainui:modify_favorites') }}"
class="d-inline-block" class="d-inline-block"
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<input type="hidden" name="mode" value="remove"> <input type="hidden" name="mode" value="remove">
<button type="submit" <button type="submit"
id="fav_{{ fav_id }}" id="fav_{{ fav_id }}"
class="active me-2 btn-icon-big btn btn-{{ color }}" class="active btn-icon-big btn btn-{{ color }} {% if margin %}me-2{% endif %}"
title="{{ _('remove from favorites') }}"> title="{{ _('remove from favorites') }}">
<svg xmlns="http://www.w3.org/2000/svg" <svg xmlns="http://www.w3.org/2000/svg"
width="16" width="16"
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<input type="hidden" name="mode" value="add"> <input type="hidden" name="mode" value="add">
<button type="submit" <button type="submit"
id="fav_{{ fav_id }}" id="fav_{{ fav_id }}"
class="me-2 btn-icon-big btn btn-{{ color }}" class="btn-icon-big btn btn-{{ color }} {% if margin %}me-2{% endif %}"
title="{{ _('add to favorites') }}"> title="{{ _('add to favorites') }}">
<svg xmlns="http://www.w3.org/2000/svg" <svg xmlns="http://www.w3.org/2000/svg"
width="16" width="16"
...@@ -129,10 +129,10 @@ ...@@ -129,10 +129,10 @@
</a> </a>
{%- endmacro %} {%- endmacro %}
# #
{% macro report(report_url=none, kind=none, next=none, lookup_key=none, title=_("report this url"), color="transparent" ) -%} {% macro report(report_url=none, kind=none, next=none, lookup_key=none, title=_("report this url"), color="transparent", margin=True) -%}
{% if not archive_mode %} {% if not archive_mode %}
<a href="{{ build_report_url(request, reported_url=report_url, kind=kind, next_url=next, lookup_key=lookup_key) }}" <a href="{{ build_report_url(request, reported_url=report_url, kind=kind, next_url=next, lookup_key=lookup_key) }}"
class="me-2 btn-icon-big btn btn-{{ color }}" class="btn-icon-big btn btn-{{ color }} {% if margin %}me-2{% endif %}"
title="{{ title }}"> title="{{ title }}">
<svg width="1.25rem" <svg width="1.25rem"
height="1.25rem" height="1.25rem"
...@@ -150,10 +150,10 @@ ...@@ -150,10 +150,10 @@
{% endif %} {% endif %}
{%- endmacro %} {%- endmacro %}
{% macro edit(edit, title=_("edit this"), color="transparent" ) -%} {% macro edit(edit, title=_("edit this"), color="transparent", margin=True) -%}
{% if not archive_mode %} {% if not archive_mode %}
<a href="{{ edit }}" <a href="{{ edit }}"
class="me-2 btn-icon-big btn btn-{{ color }}" class="btn-icon-big btn btn-{{ color }} {% if margin %}me-2{% endif %}"
title="{{ title }}"> title="{{ title }}">
<svg xmlns="http://www.w3.org/2000/svg" <svg xmlns="http://www.w3.org/2000/svg"
width="16" width="16"
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
<div>{{ assembly.name }}</div> <div>{{ assembly.name }}</div>
</a> </a>
<div class="hub-grid-buttons"> <div class="hub-grid-buttons">
{{ fbtns.share('plainui:assembly', assembly_slug=assembly.slug, color=color,) }}
{{ fbtns.fav(assembly.id, "assembly", faved, color=color) }} {{ fbtns.fav(assembly.id, "assembly", faved, color=color) }}
{{ fbtns.share('plainui:assembly', assembly_slug=assembly.slug, color=color,) }}
{{ fbtns.report(link, lookup_key=assembly.slug, color=color) }} {{ fbtns.report(link, lookup_key=assembly.slug, color=color) }}
</div> </div>
{% if assembly.public_events_count or assembly.public_projects_count or assembly.tags__count %} {% if assembly.public_events_count or assembly.public_projects_count or assembly.tags__count %}
......
...@@ -114,9 +114,10 @@ ...@@ -114,9 +114,10 @@
{{ icon_public(event.is_public) }} {{ icon_public(event.is_public) }}
{{ fbtns.edit(hub_absolute('backoffice:sos-edit', pk=event.id) , color=button_color) }} {{ fbtns.edit(hub_absolute('backoffice:sos-edit', pk=event.id) , color=button_color) }}
{% endif %} {% endif %}
{% if not hide_buttons %} {% if not hide_buttons %}
{{ fbtns.share('plainui:event', event_slug=event.slug, color=button_color) }}
{{ fbtns.fav(event.id, "event", faved, color=button_color) }} {{ fbtns.fav(event.id, "event", faved, color=button_color) }}
{{ fbtns.share('plainui:event', event_slug=event.slug, color=button_color) }}
{{ fbtns.report(link, color=button_color) }} {{ fbtns.report(link, color=button_color) }}
{% endif %} {% endif %}
</div> </div>
......
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
title="{{ project.name }}" title="{{ project.name }}"
class="hub-text-list-item-title hub-grid-title">{{ project.name }}</a> class="hub-text-list-item-title hub-grid-title">{{ project.name }}</a>
<div class="hub-grid-buttons"> <div class="hub-grid-buttons">
{{ fbtns.share('plainui:project', color=color, slug=project.slug) }}
{{ fbtns.fav(project.id, "project", favorite, color=color) }} {{ fbtns.fav(project.id, "project", favorite, color=color) }}
{{ fbtns.share('plainui:project', color=color, slug=project.slug) }}
{{ fbtns.report(link, lookup_key=project.slug, color=color) }} {{ fbtns.report(link, lookup_key=project.slug, color=color) }}
</div> </div>
{% if metadata and (project.assembly or project.tags) %} {% if metadata and (project.assembly or project.tags) %}
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
</div> </div>
<div class="hub-grid-buttons"> <div class="hub-grid-buttons">
{% if room.capacity and room.capacity != None and room.capacity > 0 %} {% if room.capacity and room.capacity != None and room.capacity > 0 %}
<span class="btn-icon-big btn-transparent">{{ icon("capacity") }}</span> <span class="btn-icon-big btn-transparent me-2">{{ icon("capacity") }}</span>
<span class="me-5" title="{{ _('capacity') }}"> <span class="me-3" title="{{ _('capacity') }}">
{%- if room.occupants and room.occupants != None -%} {%- if room.occupants and room.occupants != None -%}
{{ room.occupants ~ ' / ' }} {{ room.occupants ~ ' / ' }}
{%- endif -%} {%- endif -%}
......
...@@ -129,24 +129,28 @@ ...@@ -129,24 +129,28 @@
{% if event.abstract %}<div class="hub-text">{{ event.abstract }}</div>{% endif %} {% if event.abstract %}<div class="hub-text">{{ event.abstract }}</div>{% endif %}
</div> </div>
<div> <div class="hub-hlayout">
{%- if not event.is_sos and can_manage -%} {{ fbtns.fav(event.id, "event", is_favorite, color="secondary", margin=False) }}
{{ fbtns.edit(hub_absolute('backoffice:assembly-event', assembly=assembly.id, pk=event.id) , color="secondary") }}
{%- elif event.is_sos and can_manage -%}
{{ fbtns.edit(hub_absolute('backoffice:sos-edit', pk=event.id) , color="secondary") }}
{% endif %}
{{ fbtns.fav(event.id, "event", is_favorite, color="secondary") }}
{{ fbtns.report(lookup_key=event.slug, color="primary") }}
{% if event.additional_data.get('feedback_url') and running_state == "complete" %} {% if event.additional_data.get('feedback_url') and running_state == "complete" %}
<a href=" {{ event.additional_data.get("feedback_url") }}" <a href=" {{ event.additional_data.get("feedback_url") }}"
class="btn btn-primary" class="btn btn-secondary"
target="_blank"> target="_blank"
title="{{ _('Click here to let us know how you liked this event') }}" title="{{ _('Click here to let us know how you liked this event') }}">
<i class="bi bi-hand-thumbs-up"></i> <i class="bi bi-hand-thumbs-up"></i>
<i class="bi bi-hand-thumbs-down"></i> <i class="bi bi-hand-thumbs-down"></i>
{{ _("Rate event") }} {{ _("Rate event") }}
</a> </a>
{% endif %} {% endif %}
{%- if not event.is_sos and can_manage -%}
{{ fbtns.edit(hub_absolute('backoffice:assembly-event', assembly=assembly.id, pk=event.id) ,
color="secondary", margin=False) }}
{%- elif event.is_sos and can_manage -%}
{{ fbtns.edit(hub_absolute('backoffice:sos-edit', pk=event.id) , color="secondary", margin=False) }}
{% endif %}
{{ fbtns.report(lookup_key=event.slug, color="warning") }}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -79,10 +79,10 @@ ...@@ -79,10 +79,10 @@
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<div> <div class="hub-hlayout">
{% set link = url('plainui:project', slug=project.slug) %} {% set link = url('plainui:project', slug=project.slug) %}
{{ fbtns.fav(project.id, "project", is_favorite, color="primary") }} {{ fbtns.fav(project.id, "project", is_favorite, color="secondary", margin=False) }}
{{ fbtns.report(link, color="primary") }} {{ fbtns.report(link, color="warning", margin=False) }}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -21,17 +21,23 @@ ...@@ -21,17 +21,23 @@
<div class="hub-col-remaining hub-card hub-vlayout"> <div class="hub-col-remaining hub-card hub-vlayout">
<h1 class="hub-head-main">{{ display_user.get_display_name() }}</h1> <h1 class="hub-head-main">{{ display_user.get_display_name() }}</h1>
{% if display_user.pronouns %}<div>{{ tagMacros.secondary(display_user.pronouns) }}</div>{% endif %} {% if display_user.pronouns %}<div>{{ tagMacros.secondary(display_user.pronouns) }}</div>{% endif %}
{% if description_html %} {% if description_html %}
<div class="hub-text">{{ markdownMacro.markdown_plain(markdown=description_html | safe, border=false) }}</div> <div class="hub-text">{{ markdownMacro.markdown_plain(markdown=description_html | safe, border=false) }}</div>
{% endif %} {% endif %}
<div class="hub-hlayout"> <div class="hub-hlayout">
{% if display_user != user and display_user.user_type != 'speaker' %} {% if display_user != user and display_user.user_type != 'speaker' %}
<a href="{{ url('plainui:personal_message_send_to', recipient=display_user.username) }}" <a href="{{ url('plainui:personal_message_send_to', recipient=display_user.username) }}"
class="hub-btn">{{ _("Send PN") }}</a> class="btn btn-secondary">
{{ fbtns.report(link, lookup_key=display_user.username, color='outline-secondary') }} <i class="bi bi-envelope"></i>
{{ _("Send PN") }}
</a>
{{ fbtns.report(link, lookup_key=display_user.username, color='warning', margin=False) }}
{% endif %} {% endif %}
{% if display_user == user %} {% if display_user == user %}
<a href="{{ url('plainui:userprofile') }}" class="hub-btn">{{ _("Edit your profile") }}</a> <a href="{{ url('plainui:userprofile') }}" class="btn btn-secondary">{{ _("Edit your profile") }}</a>
{% endif %} {% endif %}
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment