Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/templates/g5_hydrogen/custom/particles/ |
| [Home] [System Details] [Kill Me] |
{% extends '@nucleus/partials/particle.html.twig' %}
{% block stylesheets %}
{% if particle.particle_title_color or particle.particle_title_fontsize or
particle.title_color or particle.title_fontsize or particle.subtitle_color
or particle.subtitle_fontsize %}
<style>
{% if particle.particle_title_color or particle.particle_title_fontsize %}
#{{ id }}.g5-particle-title { {% if particle.particle_title_color %}color:
{{ particle.particle_title_color }};{% endif %}{% if
particle.particle_title_fontsize %}font-size:
{{particle.particle_title_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.title_color or particle.title_fontsize %}
#tm-calendar-{{id}} .event-item-title { {% if particle.title_color %}color:
{{particle.title_color}}; {% endif %}{% if particle.title_fontsize
%}font-size: {{particle.title_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.subtitle_color or particle.subtitle_fontsize %}
#tm-calendar-{{id}} .tm-description { {% if particle.subtitle_color
%}color: {{particle.subtitle_color}}; {% endif %}{% if
particle.subtitle_fontsize %}font-size: {{particle.subtitle_fontsize}}px;{%
endif %} }
{% endif %}
</style>
{% endif %}
{% endblock %}
{# Set Viewport Height #}
{% if particle.viewport_height == 'full' %}
{% set viewport_height = 'jl-height-viewport="offset-top:
true;"' %}
{% elseif particle.viewport_height == 'percent' %}
{% set viewport_height = 'jl-height-viewport="offset-top:
true; offset-bottom: 20;"' %}
{% elseif particle.viewport_height == 'section' %}
{% set viewport_height = 'jl-height-viewport="offset-top:
true; offset-bottom: 50;"' %}
{% elseif particle.viewport_height == 'expand' %}
{% set viewport_height = 'jl-height-viewport="expand:
true;"' %}
{% endif %}
{# Set Title/Content Text Transform #}
{% set title_text_transform = particle.title_text_transform ? '
jl-text-' ~ particle.title_text_transform|e ~ '' %}
{% set content_text_transform = particle.content_text_transform ? '
jl-text-' ~ particle.content_text_transform|e ~ '' %}
{# Set Max-Width Content Section #}
{% set container_maxwidth = particle.container_maxwidth !=
'default' ? 'jl-container jl-container-' ~
particle.container_maxwidth|e ~ '' : 'jl-container' %}
{# Set Padding #}
{% if particle.padding == 'default' %}
{% set padding = ' jl-section' %}
{% elseif particle.padding == 'none' %}
{% set padding = ' jl-section jl-padding-remove-vertical' %}
{% else %}
{% set padding = ' jl-section jl-section-' ~
particle.padding|e ~ '' %}
{% endif %}
{# Set Background color #}
{% set parallax_bg_color = particle.parallax_bg_color ?
'style="background-color: ' ~ particle.parallax_bg_color ~
';"' %}
{% set parallax_overlay = (particle.parallax_bg_overlay ? '<div
class="jl-position-cover" style="background-color: '~
particle.parallax_bg_overlay ~';"></div>') %}
{% set parallax_easing = particle.parallax_easing ? 'easing:' ~
particle.parallax_easing / 10 ~ '' %}
{# Set Max-Width Content #}
{% set content_maxwidth %}
{% if particle.g_maxwidth != 'inherit' %}
jl-width-{{particle.g_maxwidth}}{% if particle.g_maxwidth_breakpoint !=
'always' %}@{{particle.g_maxwidth_breakpoint}}{% endif %}{% if
particle.g_maxwidth_alignment == 'left' %}{% elseif
particle.g_maxwidth_alignment == 'center' %} jl-margin-auto{%
else %} jl-margin-auto-left{% endif %}{% endif %}
{% endset %}
{# Set Parallax Background #}
{% set parallaxbackground %}
{% if particle.parallax_image %}
<div data-src="{{ url(particle.parallax_image)|e }}"
class="jl-background-norepeat{{ particle.parallax_bg_overlay ? '
jl-position-relative' : '' }}{{padding}}
jl-background-{{particle.background_image_position|e}}{% if
particle.background_image_size != 'auto' %}
jl-background-{{particle.background_image_size|e}}{% endif %}{% if
particle.parallax_bg_visibility != 'always' %}
jl-background-image@{{particle.parallax_bg_visibility|e}}{% endif %}{% if
particle.vertical_alignment != 'none' %} jl-flex
jl-flex-{{particle.vertical_alignment|e}}{% endif %}{% if
particle.parallax_text_color != 'default' %}
jl-{{particle.parallax_text_color|e}}{% endif %}{% if particle.blendmode !=
'inherit' %} jl-background-blend-{{particle.blendmode|e}}{% endif
%}" {{parallax_bg_color|default('')|raw}}{% if
particle.horizontal_start or particle.horizontal_end or
particle.vertical_start or particle.vertical_end or
particle.parallax_easing %} jl-parallax="{% if
particle.horizontal_start or particle.horizontal_end %}bgx:
{{particle.horizontal_start|e}},{{particle.horizontal_end|e}};{% endif %}{%
if particle.vertical_start or particle.vertical_end %}bgy:
{{particle.vertical_start|e}},{{particle.vertical_end|e}};{% endif %}{% if
particle.parallax_bg_breakpoint != 'always' %} media:
@{{particle.parallax_bg_breakpoint|e}};{% endif %}{{parallax_easing}}"
{% endif %} jl-img {{viewport_height|raw}}>
{{parallax_overlay|raw}}
{% if particle.container_maxwidth != 'none' %}
<div class="{{container_maxwidth}}">
{% endif %}
{% endif %}
{% endset %}
{# End Parallax Background #}
{% set endparallaxbackground %}
{% if particle.parallax_image %}
{% if particle.container_maxwidth != 'none' %}
</div>
{% endif %}
</div>
{% endif %}
{% endset %}
{# Set Horizontal #}
{% set pahorizontal %}
{% if particle.pa_horizontal_start or particle.pa_horizontal_end %}x: {% if
particle.pa_horizontal_start == '' %}0{% else
%}{{particle.pa_horizontal_start }}{% endif %},{% if
particle.pa_horizontal_end == '' %}0{% else
%}{{particle.pa_horizontal_end }}{% endif %};{% endif %}
{% endset %}
{# Set Vertical #}
{% set pavertical %}
{% if particle.pa_vertical_start or particle.pa_vertical_end %}y: {% if
particle.pa_vertical_start == '' %}0{% else
%}{{particle.pa_vertical_start }}{% endif %},{% if particle.pa_vertical_end
== '' %}0{% else %}{{particle.pa_vertical_end }}{% endif %};{%
endif %}
{% endset %}
{# Set Scale #}
{% set scale %}
{% if particle.scale_start or particle.scale_end %}scale: {% if
particle.scale_start == '' %}1{% else %}{{particle.scale_start /
100 }}{% endif %},{% if particle.scale_end == '' %}1{% else %}
{{particle.scale_end / 100 }}{% endif %};{% endif %}
{% endset %}
{# Set Rotate #}
{% set rotate %}{% if particle.rotate_start or particle.rotate_end %}
rotate: {% if particle.rotate_start == '' %}0{% else
%}{{particle.rotate_start}}{% endif %},{% if particle.rotate_end ==
'' %}0{% else %}{{particle.rotate_end}}{% endif %};{% endif %}
{% endset %}
{# Set Opacity #}
{% set opacity %}
{% if particle.opacity_start or particle.opacity_end %}opacity: {% if
particle.opacity_start == '' %}1{% else
%}{{particle.opacity_start / 100 }}{% endif %},{% if particle.opacity_end
== '' %}1{% else %}{{particle.opacity_end / 100 }}{% endif %};{%
endif %}
{% endset %}
{# Set Animation #}
{% set animation %}
{% if particle.animation != 'inherit' and particle.animation !=
'parallax' %} jl-scrollspy="cls:
jl-animation-{{particle.animation|e}};{% if particle.animation_repeat ==
'enabled' %} repeat: true;{% endif %}{% if
particle.animation_delay %} delay: {{particle.animation_delay|e}};{% endif
%}"
{% elseif particle.animation == 'parallax' %}
{% if particle.pa_horizontal_start or particle.pa_horizontal_end or
particle.pa_vertical_start or particle.pa_vertical_end or
particle.scale_start or particle.scale_end or particle.rotate_start or
particle.rotate_end or particle.opacity_start or particle.opacity_end or
particle.easing or particle.pa_viewport or particle.pa_breakpoint %}
jl-parallax="{{pahorizontal}}{{pavertical}}{{scale}}{{rotate}}{{opacity}}{%
if particle.easing == '' %}{% else %}easing: {{ particle.easing /
100 }};{% endif %}{% if particle.pa_viewport != '' %}viewport:{{
particle.pa_viewport / 100 }};{% endif %}{% if particle.pa_breakpoint !=
'always' %}media: @{{particle.pa_breakpoint|e}}{% endif
%}"{% endif %}
{% endif %}
{% endset %}
{# Set Particle Alignment #}
{% set particle_alignment %}
{% if particle.align != 'inherit' %}
jl-text-{{particle.align|e}}{% if particle.breakpoint != 'always'
%}@{{particle.breakpoint|e}}{% endif %}{% endif %}{% if particle.align !=
'inherit' and particle.breakpoint != 'always' %}{% if
particle.fallback != 'inherit' %}
jl-text-{{particle.fallback|e}}{% endif %}{% endif %}
{% endset %}
{# set Particle Title Style #}
{% set particle_title_style %}
{% if particle.particle_title %}
<{{particle.particle_title_element|e}} id="{{ id }}"
class="g5-particle-title{% if particle.particle_title_align !=
'inherit' %} jl-text-{{particle.particle_title_align|e}}{% endif
%}{% if particle.particle_predefined_color != 'default' %}
jl-text-{{particle.particle_predefined_color|e}}{% endif %}{% if
particle.particle_title_style != 'default' %}
jl-{{particle.particle_title_style|e}}{% endif %}{% if
particle.particle_title_decoration != 'none' %}
jl-heading-{{particle.particle_title_decoration|e}}{% endif %}">
{% if particle.particle_title_decoration == 'line' %}
<span>{{particle.particle_title|raw}}</span>
{% else %} {{particle.particle_title|raw}}
{% endif %}
</{{particle.particle_title_element|e}}>
{% endif %}
{% endset %}
{% block particle %}
{% if particle.enabled %}
{{parallaxbackground}}
{{particle_title_style}}
<div id="tm-calendar-{{id}}" class="tm-content-wrapper
tm-calendar{{content_maxwidth}}{% if particle.class %} {{ particle.class
}}{% endif %}{{particle_alignment}}{% if particle.margin ==
'inherit' %}{% elseif particle.margin == 'default' %}
jl-margin{% else %} jl-margin-{{particle.margin|e}}{% endif %}{% if
particle.visibility == 'inherit' %}{% else %}
jl-visible@{{particle.visibility|e}}{% endif %}"{{animation}}>
<script type="text/template"
id="tm-calendar-template-{{id}}">
<div class="clndr-controls jl-light jl-tile jl-tile-secondary
jl-padding-small">
<div class="clndr-previous-button jl-link"><i
class="fa fa-angle-left fa-lg"
aria-hidden="true"></i></div>
<div class="clndr-next-button jl-link"><i
class="fa fa-angle-right fa-lg"
aria-hidden="true"></i></div>
<div class="current-month"><%= month %>
<%= year %>
</div>
</div>
<div class="jl-grid-match jl-grid-collapse" jl-grid>
<div class="jl-width-2-3@m">
<div class="clndr-grid">
<div class="days-of-the-week clearfix jl-tile
jl-tile-default jl-padding-small jl-dark">
<% _.each(daysOfTheWeek, function(day) { %>
<div class="header-day"><%= day
%></div>
<% }); %>
</div>
<div class="days">
<% _.each(days, function(day) { %>
<div class="<%= day.classes %>"
id="<%= day.id %>">
<div class="numberCircle"><span
class="day-number"><%= day.day
%></span></div>
</div>
<% }); %>
</div>
</div>
</div>
<div class="jl-width-expand@m">
<div class="event-listing jl-box-shadow-small">
<div class="event-listing-title jl-text-center
jl-tile jl-tile-primary jl-padding-small">{{
particle.event_label|raw|default('Events This
Month')}}</div>
<div class="jl-card jl-overflow-auto jl-height-medium
jl-resize">
<% _.each(eventsThisMonth, function(event) { %>
<div class="event-item jl-card-default
jl-margin">
<div class="content-inner">
<% if (event.link != "") { %>
<a class="jl-link-text jl-link-reset"
href="//<%= event.link %>">
<% } %>
<div
class="event-item-title{{title_text_transform}}"><%=
event.title %></div>
<% if (event.link != "") { %>
</a>
<% } %>
<div
class="jl-article-meta"><i class="fa
fa-calendar-check-o" aria-hidden="true"></i>
<span class="event-item-date"> <%= event.date
%></span> - {{
particle.time_label|raw|default('Time')}}: <span
class="event-item-time"> <%= event.time
%></span></div>
<div
class="tm-description{{content_text_transform}}"><%=
event.description %></div>
</div>
</div>
<% }); %>
</div>
</div>
</div>
</div>
</script>
</div>
{{endparallaxbackground}}
{% endif %}
{% endblock %}
{% block javascript_footer %}
{% do gantry.load('jquery') %}
<script src="{{
url('gantry-theme://js/underscore-min.js')
}}"></script>
<script src="{{ url('gantry-theme://js/moment.min.js')
}}"></script>
<script src="{{ url('gantry-theme://js/clndr.min.js')
}}"></script>
{% set format = particle.format %}
{% set label = particle.labels|e('js') %}
{% set labels = label|split(",")%}
<script>
jQuery(function($) {
$(".event-item.event-highlight").prependTo(".jl-card");
var events = [
{% for item in particle.items %}
{ date: moment('{{item.date}}','{{format}}') ,
time: '{{item.time|e('js')}}', title:
'{{item.title|e('js')}}', description:
'{{item.description|e('js')}}', link:
'{{item.link|raw}}' },
{% endfor %}
];
$('#tm-calendar-{{id}}').clndr({
template: $('#tm-calendar-template-{{id}}').html(),
forceSixRows: false,
events: events,
weekOffset: {{particle.start}},
daysOfTheWeek: ['{{labels[0]}}', '{{labels[1]}}',
'{{labels[2]}}', '{{labels[3]}}',
'{{labels[4]}}', '{{labels[5]}}',
'{{labels[6]}}'],
adjacentDaysChangeMonth: true,
classes: {
past: "past",
today: "today",
event: "tm-calendar-event",
selected: "selected",
inactive: "inactive",
lastMonth: "last-month",
nextMonth: "next-month",
adjacentMonth: "adjacent-month",
},
clickEvents: {
click: function(target) {
var date = target.date._i;
date = moment(date,"YYYY-MM-DD");
date = date.format('{{format}}');
$(".event-item").each(function(){
var eventdate =
$(this).find(".event-item-date").eq(0).text();
eventdate = moment(eventdate,"{{format}}");
eventdate.set("hour",0);
eventdate.set("minute",0);
eventdate.set("second",0);
eventdate = eventdate.format('{{format}}');
if (eventdate === date){
$(this).addClass('jl-card-secondary');
$(".jl-card-secondary").prependTo(".jl-card");
}else{
$(this).removeClass('jl-card-secondary');
}
});
},
},
doneRendering: function () {
var height = $("#tm-calendar-{{id}} .clndr-grid").height();
var header = $("#tm-calendar-{{id}}
.days-of-the-week").height();
height = height - header - 2;
$("#tm-calendar-{{id}}
.event-item-container").height(height);
$(".event-item-date").each(function(){
var date = $(this).text();
var now = moment(date,"x");
$(this).text(now.format('{{format}}'));
});
},
});
});
</script>
{% endblock %}