Skip to content

Commit

Permalink
Simplified settings, made format of more dates and times configurable…
Browse files Browse the repository at this point in the history
…, some small fixes
  • Loading branch information
pikim committed Jan 15, 2020
1 parent 1f6f6d7 commit d43a4cd
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 67 deletions.
10 changes: 5 additions & 5 deletions assets/events.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -291,22 +291,22 @@ html {
margin-right: 0;
}

.events-container .events-listing .event-article .event .event-left-column .event-date {
.events-container .events-listing .event-article .event .event-left-column .event-datetime {
color: #555;
display: block;
margin: 0.5rem 1rem 0 0;
text-align: right;
}

.events-container .events-listing .event-article .event .event-left-column .event-date .event-day {
.events-container .events-listing .event-article .event .event-left-column .event-datetime .event-day {
display: block;
font-size: 1.75rem;
font-weight: bold;
line-height: 1;
margin: 0;
}

.events-container .events-listing .event-article .event .event-left-column .event-date .event-month {
.events-container .events-listing .event-article .event .event-left-column .event-datetime .event-month {
display: block;
font-size: 1rem;
font-weight: bold;
Expand All @@ -315,14 +315,14 @@ html {
text-transform: uppercase;
}

.events-container .events-listing .event-article .event .event-left-column .event-date .event-time {
.events-container .events-listing .event-article .event .event-left-column .event-datetime .event-time {
display: block;
font-size: 0.95rem;
line-height: 1;
margin-top: 0.75rem;
}

.events-container .events-listing .event-article .event .event-left-column .event-date .event-year {
.events-container .events-listing .event-article .event .event-left-column .event-datetime .event-year {
display: none;
}

Expand Down
53 changes: 22 additions & 31 deletions blueprints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,10 @@ form:
validate:
min: 0
max: 20
calendar.month:
calendar.header:
type: text
label: Month Display
default: F
calendar.year:
type: text
label: Year Display
default: Y
label: Header
default: F Y
calendar.anchor_title:
type: text
label: Anchor Title
Expand All @@ -143,40 +139,25 @@ form:
label: Details Time of Day
default: g:ia

events:
type: section
title: Events
underline: true
events.enable_categories:
type: toggle
label: Enable Event Categories
highlight: 1
default: 0
options:
1: Enabled
0: Disabled
validate:
type: bool

event_item:
type: section
title: Event Item
underline: true
event_item.date:
type: text
label: Event Date
default: l, F j, Y
event_item.day:
type: text
label: Date Box Day
label: Events Date Box Day
default: d
event_item.month:
type: text
label: Date Box Month
label: Events Date Box Month
default: M
event_item.start_time:
type: text
label: Date Box Start Time
default: g:ia
event_item.end_time:
event_item.time:
type: text
label: Date Box End Time
label: Events Date Box Time
default: g:ia

event_meta:
Expand All @@ -192,10 +173,20 @@ form:
type: section
title: Event Sidebar
underline: true
event_sidebar.enable_categories:
type: toggle
label: Enable Event Categories
highlight: 1
default: 0
options:
1: Enabled
0: Disabled
validate:
type: bool
event_sidebar.header:
type: text
label: Header
default: l, F d
default: l, F j
event_sidebar.time:
type: text
label: Time
Expand Down
2 changes: 1 addition & 1 deletion scss/events.scss
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ $event-border-radius: 4px !default;
.event-left-column {
@include span-columns(2);

.event-date {
.event-datetime {
color: #555;
display: block;
margin: 0.5rem 1rem 0 0;
Expand Down
22 changes: 5 additions & 17 deletions templates/calendar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
{% set nextMonthUrl = page.url ~ '/year:' ~ calendar.next.date|date('Y') ~ '/month:' ~ calendar.next.date|date('m') %}
{% set currMonthUrl = page.url ~ '/year:' ~ now|date('Y') ~ '/month:' ~ now|date('m') %}

{% set prevYearTitle = calendar.prevYear|dateTranslate('F') ~ calendar.prevYear|date(' Y') %}
{% set nextYearTitle = calendar.nextYear|dateTranslate('F') ~ calendar.nextYear|date(' Y') %}
{% set prevMonthTitle = calendar.prev.date|dateTranslate('F') ~ calendar.prev.date|date(' Y') %}
{% set nextMonthTitle = calendar.next.date|dateTranslate('F') ~ calendar.next.date|date(' Y') %}
{% set prevYearTitle = calendar.prevYear|dateTranslate(config.plugins.events.calendar.header) %}
{% set nextYearTitle = calendar.nextYear|dateTranslate(config.plugins.events.calendar.header) %}
{% set prevMonthTitle = calendar.prev.date|dateTranslate(config.plugins.events.calendar.header) %}
{% set nextMonthTitle = calendar.next.date|dateTranslate(config.plugins.events.calendar.header) %}

<section class="calendar-table">
<table class="calendar">
Expand All @@ -33,7 +33,7 @@
</th>
<th colspan="3" class="calendar-title">
<a href="{{ currMonthUrl }}" title="{{ 'PLUGIN_EVENTS.CALENDAR.TODAY'|t }}">
{{ calendar.date|dateTranslate('F') ~ calendar.date|date(' Y') }}
{{ calendar.date|dateTranslate(config.plugins.events.calendar.header) }}
</a>
</th>
<th class="calendar-buttons">
Expand All @@ -43,18 +43,6 @@
<a href="{{ nextYearUrl }}" class="calendar-button" title="{{ nextYearTitle }}">&raquo;</a>
</th>
</tr>
<!-- <tr class="calendar-controls">
<th class="calendar-buttons" colspan="4">
<a href="{{ prevMonthUrl }}" class="calendar-button" title="{{ prevMonthTitle }}">&lsaquo;</a>
{{ calendar.date|dateTranslate('F') }}
<a href="{{ nextMonthUrl }}" class="calendar-button" title="{{ nextMonthTitle }}">&rsaquo;</a>
</th>
<th class="calendar-buttons" colspan="3">
<a href="{{ prevYearUrl }}" class="calendar-button" title="{{ prevYearTitle }}">&laquo;</a>
{{ calendar.date|date(' Y') }}
<a href="{{ nextYearUrl }}" class="calendar-button" title="{{ nextYearTitle }}">&raquo;</a>
</th>
</tr>-->
<tr class="calendar-headings">
{% set fdowOffset = config.plugins.events.calendar.first_dow %}
{% set dayChar = config.plugins.events.calendar.day_char %}
Expand Down
2 changes: 0 additions & 2 deletions templates/event.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
{% include 'partials/breadcrumbs.html.twig' %}
{% endif %}

{{ page.content|raw }}

<div class="event-container">
<section class="event-listing">
{% include 'partials/event_item.html.twig' with { 'event': page.parent, 'truncate': false, 'single': true } %}
Expand Down
17 changes: 7 additions & 10 deletions templates/partials/event_item.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,21 @@

<section class="event">
<div class="event-left-column">
<time class="event-date" datetime="{{ page.date|date("c") }}">
<time class="event-datetime" datetime="{{ page.date|date("c") }}">
{% if single == true %}{# individual content page #}
<span class="event-day">{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.day) }}.</span>
<span class="event-month">{{ page.header.event.start|dateTranslate('m') }}</span>
<span class="event-year">{{ page.header.event.start|date("Y") }},</span>
<span class="event-date">{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.date) }},</span>
<span class="event-time">
{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.start_time) }}
{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.time) }}
{% if page.header.event.end %}
&ndash;{{ page.header.event.end|dateTranslate(config.plugins.events.event_item.end_time) }}
&ndash; {{ page.header.event.end|dateTranslate(config.plugins.events.event_item.time) }}
{% endif %}
</span>

{% else %}{# main listing page #}
<span class="event-day">{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.day) }}</span>
<span class="event-month">{{ page.header.event.start|dateTranslate('M') }}</span>
<!--<span class="event-month">{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.month) }}</span>-->
<span class="event-month">{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.month) }}</span>
<span class="event-time">
{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.start_time) }}&ndash;{{ page.header.event.end|dateTranslate(config.plugins.events.event_item.end_time) }}
{{ page.header.event.start|dateTranslate(config.plugins.events.event_item.time) }}&ndash;{{ page.header.event.end|dateTranslate(config.plugins.events.event_item.time) }}
</span>
<span class="event-year">{{ page.header.event.start|date("Y") }}</span>
{% endif %}
Expand All @@ -45,7 +42,7 @@
</div>
{% endif %}

{% if page.taxonomy.category and config.plugins.events.events.enable_categories %}
{% if page.taxonomy.category and config.plugins.events.event_sidebar.enable_categories %}
<div class="event-categories">
<span class="event-tags">
{% for category in page.taxonomy.category %}
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/events_sidebar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
%}

<aside class="events-sidebar">
{% if config.plugins.events.events.enable_categories %}
{% if config.plugins.events.event_sidebar.enable_categories %}
<h3 class="events-title">{{ "PLUGIN_EVENTS.EVENTS.BY_CATEGORY"|t }}</h3>
<ul class="event-tags">
{% for category in eventCategories %}
Expand Down

0 comments on commit d43a4cd

Please sign in to comment.