diff --git a/priv/templates/avatar/avatar.tpl b/priv/templates/avatar/avatar.tpl new file mode 100644 index 0000000000000000000000000000000000000000..7ab61f16d14a9d8c91295607c9b33a119dd0d236 --- /dev/null +++ b/priv/templates/avatar/avatar.tpl @@ -0,0 +1,17 @@ +{% extends "depiction/with_depiction.tpl" %} + +{% block with_depiction %} + + {% with + image_class|default:"avatar__image" + as + image_class + %} + + {% if dep_rsc %} + {% image dep_rsc.id mediaclass="avatar" alt=dep_rsc.title class=image_class %} + {% endif %} + + {% endwith %} + +{% endblock %} diff --git a/priv/templates/content-group-nav/content-group-nav-banner.tpl b/priv/templates/content-group-nav/content-group-nav-banner.tpl new file mode 100644 index 0000000000000000000000000000000000000000..ab8cbcc24e1b3485afa5bb42124a9514fe57cf06 --- /dev/null +++ b/priv/templates/content-group-nav/content-group-nav-banner.tpl @@ -0,0 +1,8 @@ +<a href="#" class="content-group-nav__banner"> + {% if content_group.o.hasbanner %} + {% with content_group.o.hasbanner.depiction as banner_dep %} + <div class="content-group-nav__banner__bg" style="background-image: url('{% image_url banner_dep mediaclass='content-group-banner' %}');"></div> + {% endwith %} + {% endif %} + <h2 class="content-group-nav__banner__title" data-id="{{ content_group.id }}">{% if content_group.short_title %}{{ content_group.short_title }}{% else %}{{ content_group.title }}{% endif %}</h2> +</a> diff --git a/priv/templates/content-group-nav/content-group-nav-subnav.tpl b/priv/templates/content-group-nav/content-group-nav-subnav.tpl new file mode 100644 index 0000000000000000000000000000000000000000..c355b6fc3a556251175982535fa4168fd25149f5 --- /dev/null +++ b/priv/templates/content-group-nav/content-group-nav-subnav.tpl @@ -0,0 +1,27 @@ +{% with + class|default:"content-group-nav__menu" +as + class +%} + {% if content_group.o.hassubnav %} + {% with content_group.o.hassubnav as subnav_ids %} + <nav class="{{ class }}"> + <ul> + {% for subnav_id in subnav_ids %} + {% if m.rsc[subnav_id].is_a.collection %} + {% for part_id in m.rsc[subnav_id].o.haspart %} + <li><a class="{% if id == part_id %} is-active {% endif %}" href="{{ m.rsc[part_id].page_url }}"> + {% if m.rsc[part_id].short_title %}{{ m.rsc[part_id].short_title }}{% else %}{{ m.rsc[part_id].title }}{% endif %} + </a></li> + {% endfor %} + {% else %} + <li><a class="{% if id == subnav_id %} is-active {% endif %}" href="{{ m.rsc[subnav_id].page_url }}"> + {% if m.rsc[subnav_id].short_title %}{{ m.rsc[subnav_id].short_title }}{% else %}{{ m.rsc[subnav_id].title }}{% endif %} + </a></li> + {% endif %} + {% endfor %} + </ul> + </nav> + {% endwith %} + {% endif %} +{% endwith %} diff --git a/priv/templates/content-group-nav/content-group-nav.tpl b/priv/templates/content-group-nav/content-group-nav.tpl new file mode 100644 index 0000000000000000000000000000000000000000..9f61206bbc29b2ae71acf0b10a65299319bc0771 --- /dev/null +++ b/priv/templates/content-group-nav/content-group-nav.tpl @@ -0,0 +1,24 @@ + +{% with m.rsc[id.content_group_id] as content_group %} +{% with content_group!=undefined and content_group.name!="system_content_group" and content_group.name!="default_content_group" as has_cg %} + +{% if has_cg %} + + <div class="content-group-nav {{ extraClasses }} do_content_group_nav"> + + {% block banner %} + {% if content_group.o.hassubnav %} + {% include "content-group-nav/content-group-nav-banner.tpl" %} + {% endif %} + {% endblock %} + + {% block subnav %} + {% include "content-group-nav/content-group-nav-subnav.tpl" %} + {% endblock %} + + </div> + +{% endif %} + +{% endwith %} +{% endwith %} diff --git a/priv/templates/depiction/with_depiction.tpl b/priv/templates/depiction/with_depiction.tpl new file mode 100644 index 0000000000000000000000000000000000000000..f0aa6627bc74a2e012aff6543a24717956f68308 --- /dev/null +++ b/priv/templates/depiction/with_depiction.tpl @@ -0,0 +1,28 @@ +{% with + id, + fallback_rsc_id +as + id, + fallback_rsc_id +%} + + {% with id.depiction.id as depiction_id %} + {% with id.media|without_embedded_media:id.id as media_without_embedded %} + {% with media_without_embedded[1] as first_media_id %} + {% with id.o.hasicon[1] as icon_id %} + {% with id.o.header[1] as header_id %} + {% with id.o.hasbanner[1] as banner_id %} + {% with fallback_rsc_id|default:m.rsc.fallback.id as fallback_id %} + + {% with m.rsc[first_media_id]|default:m.rsc[icon_id]|default:m.rsc[header_id]|default:m.rsc[banner_id]|default:m.rsc[depiction_id]|default:m.rsc[fallback_id] as dep_rsc %} + {% block with_depiction %}{% endblock %} + {% endwith %} + + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} +{% endwith %} diff --git a/priv/templates/dialog-profile/button-profile-live.tpl b/priv/templates/dialog-profile/button-profile-live.tpl new file mode 100644 index 0000000000000000000000000000000000000000..09db9df00c1161501c75ec83f00e7deaa8142834 --- /dev/null +++ b/priv/templates/dialog-profile/button-profile-live.tpl @@ -0,0 +1,23 @@ +{% if m.acl.user %} + {% with #profile as profile_wire_id %} + + <a href="#" id="{{ profile_wire_id }}" class="{{ class }}"> + {% include "avatar/avatar.tpl" + id=m.rsc[m.acl.user] + fallback_rsc_id=m.rsc.custom_avatar_fallback.id + %} + + <span>{{ title }}</span> + </a> + + {% endwith %} + + {% wire + id=#profile + action={ + dialog_open + title=_"Profile" + template="dialog-profile/dialog-profile.tpl" + } + %} +{% endif %} diff --git a/priv/templates/dialog-profile/dialog-profile.tpl b/priv/templates/dialog-profile/dialog-profile.tpl new file mode 100644 index 0000000000000000000000000000000000000000..0ed72b75a2e413d467eb8de3311951bd356e2bd1 --- /dev/null +++ b/priv/templates/dialog-profile/dialog-profile.tpl @@ -0,0 +1,33 @@ +{% if m.acl.user %} + + {% with m.rsc[m.acl.user] as user %} + + {% block logged_in_as %} + <p class="dialog-profile__logged-in-as" >{_ Logged in as _}:</p> + {% endblock %} + + {% block avatar %} + <a class="dialog-profile__avatar" href="{{ user.page_url }}"> + {% include + "avatar/avatar.tpl" + id=m.rsc[m.acl.user] + fallback_rsc_id=m.rsc.custom_avatar_fallback.id + %} + </a> + {% endblock %} + + {% block title %} + <a class="dialog-profile__usertitle" href="{{ user.page_url }}"> + {{ user.title }} + </a> + {% endblock %} + + {% block log_off %} + <div class="dialog-profile__log-off"> + <a href="{% url logoff %}">{{ logoff_label|if_undefined:_"Sign out" }} <i class="#"></i> </a> + </div> + {% endblock %} + + {% endwith %} + +{% endif %} diff --git a/priv/templates/list/list-items.tpl b/priv/templates/list/list-items.tpl new file mode 100644 index 0000000000000000000000000000000000000000..1b2cda1f0ac8c73f0caadf04a06f58409c409a23 --- /dev/null +++ b/priv/templates/list/list-items.tpl @@ -0,0 +1,12 @@ +{% for i in result %} + {% with i|is_list|if:(i|element:1):i as item %} + {% block item %} + {% if item|is_number %} + {# A resource #} + {% if item|is_visible %} + {% catinclude list_item_template item %} + {% endif %} + {% endif %} + {% endblock %} + {% endwith %} +{% endfor %}