-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OEL-2767: Override templates to provide styling for subscriptions pag…
…es and links.
- Loading branch information
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{# | ||
/** | ||
* @file | ||
* Default theme implementation for flag links. | ||
* | ||
* Available functions: | ||
* - flagcount(flag, flaggable) gets the number of flaggings for the given flag and flaggable. | ||
* | ||
* Available variables: | ||
* - attributes: HTML attributes for the link element. | ||
* - title: The flag link title. | ||
* - action: 'flag' or 'unflag' | ||
* - flag: The flag object. | ||
* - flaggable: The flaggable entity. | ||
*/ | ||
#} | ||
{% apply spaceless %} | ||
{# Attach the flag CSS library.#} | ||
{{ attach_library('flag/flag.link') }} | ||
|
||
{# Depending on the flag action, set the appropriate action class. #} | ||
{% if action == 'unflag' %} | ||
{% set action_class = 'action-unflag' %} | ||
{% else %} | ||
{% set action_class = 'action-flag' %} | ||
{% endif %} | ||
|
||
{# Set the remaining Flag CSS classes. #} | ||
{% | ||
set classes = [ | ||
'flag', | ||
'flag-' ~ flag.id()|clean_class, | ||
'js-flag-' ~ flag.id()|clean_class ~ '-' ~ flaggable.id(), | ||
action_class | ||
] | ||
%} | ||
|
||
{# Set nofollow to prevent search bots from crawling anonymous flag links #} | ||
{% set attributes = attributes.setAttribute('rel', 'nofollow').addClass(['w-auto', 'btn', 'btn-outline-primary', 'btn-md']) %} | ||
|
||
<span class="{{classes|join(' ')}}"><a{{ attributes }}>{{ title }}</a></span> | ||
{% endapply %} |
11 changes: 11 additions & 0 deletions
11
templates/subscriptions/oe-subscriptions-anonymous-link.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{# | ||
/** | ||
* @file | ||
* Template override for the anonymous subscribe link. | ||
* Available variables: | ||
* - link: The link text. | ||
* - url: The link destination. | ||
* - attributes: associative array containing the properties of the element. | ||
*/ | ||
#} | ||
{{ link(title, url, attributes.addClass(['btn', 'btn-outline-primary', 'btn-md'])) }} |
15 changes: 15 additions & 0 deletions
15
templates/subscriptions/oe-subscriptions-user-subscriptions-page.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{# | ||
/** | ||
* @file | ||
* Template override for for user subscriptions page. | ||
* Available variables: | ||
* - introduction: The page introduction. | ||
* - elements: Other elements that compose the page. Usually it will contain the form. | ||
*/ | ||
#} | ||
{{ pattern('content_banner', { | ||
'background': 'gray', | ||
'title': page_title, | ||
'content': introduction, | ||
}) }} | ||
{{ elements }} |