{% extends "layout/layout.html.twig" %}
{# {% block title %}GFS - {{resource.name}}{% endblock %} #}
{% block content %}
<section class="resource-banner">
<div class="resource-banner-media">
<figure class="resource-banner-media-img">
<img src="{{resource.resource_banner}}" alt="cooking-banner">
{# {% if resource.resource_banner %}
{{ resource.resource_banner.thumbnail('1903x1070').getHTML({imgAttributes: {class:'',alt: "cooking-banner"}}) | raw }}
{% endif %} #}
</figure>
</div>
</section>
<!-- End banner -->
<!--Start Main training search-->
<section class="bread-crumbs-section resources-breadcrumb">
<div class="container container-lg">
<div class="bread-crumbs-section-box">
<div class="breadcrumb-holder">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/{{app.request.locale}}">{{'Home'|trans}}</a></li>
<li class="breadcrumb-item"><a href="/{{app.request.locale}}/resources">{{'Resources'|trans}}</a></li>
{% if resource.category is defined %}
<li class="breadcrumb-item"><a href="/{{app.request.locale}}/resources/{{resource.category.url}}">{{resource.category.name}}</a></li>
{% endif %}
<li class="breadcrumb-item">{{resource.name}}</li>
</ol>
</div>
</div>
</div>
</section>
<!--End Main training search-->
<div id ="invoice">
<!-- Start Article -->
<section class="resource-article">
<div class="container container-sm">
{% if newsletter %}
<div class="col-12 newsletterBanner-v2">
<div class="row gy-4">
<div class="col-lg-6">
<h3 class="heading">
{% if newsletter and newsletter.title is not null %}
{{newsletter.title}}
{% endif %}
</h3>
<div class="content">
<div class="imgLeft d-md-none">
{% if newsletter and newsletter.pdf is not null %}
<a href="{{newsletter.pdf}}" target="_blank">
{% if newsletter.detailImageMobile %}
<img src="{{newsletter.detailImageMobile}}" alt="Newsletter-Image-Mobile">
{% endif %}
</a>
{% endif %}
</div>
<div class="contentDesc">
<p>
{% if newsletter and newsletter.description is not null %}
{{newsletter.description}}
{% endif %}
</p>
{% set user = app.session.get('loginUserName') %}
{% if newsletterPdf %}
{% if user is not null %}
<a href="{{newsletterPdf}}" target="_blank" class="btn btn-custom btn-lg-o-yellow-white mt-md-5">
{{"Read our Newsletter" | trans}}
</a>
{% else %}
<a href="javascript:void(0);" onclick="storePdfForLater('{{ newsletterPdf }}')" class="btn btn-custom btn-lg-o-yellow-white mt-md-5">
{{"Read our Newsletter" | trans}}
</a>
{% endif %}
{% endif %}
</div>
</div>
</div>
<div class="col-lg-6 d-none d-md-block pt-4 pt-lg-0">
<div class="imgRight">
{% if newsletter and newsletter.pdf is not null %}
<a href="{{newsletter.pdf}}" class="w-100" target="_blank">
{% if newsletter.detailImage %}
<img src="{{newsletter.detailImage}}" class="w-100" alt="Newsletter-Image">
{% endif %}
</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
<div class="col-12">
<div class="row justify-content-center mb-5">
<div class="col-12 px-0 d-none">
{% if (app.request.locale =='en') %}
<a href="https://zoom.us/webinar/register/6417301077993/WN_Uy4Xiz0OT2SuJn0cCsaSUQ" class="banner-transition-update">
<img class="img-fluid w-100" src="/resourcebanner/webinar-announcement-EN.jpg" alt="webinar announcement">
</a>
{% else %}
<a href="https://zoom.us/webinar/register/6417301077993/WN_Uy4Xiz0OT2SuJn0cCsaSUQ" class="banner-transition-update">
<img class="img-fluid w-100" src="/resourcebanner/webinar-announcement-AR.jpg" alt="webinar announcement">
</a>
{% endif %}
</div>
<div class="col-12 d-none ">
<a href="https://zoom.us/webinar/register/6417301077993/WN_Uy4Xiz0OT2SuJn0cCsaSUQ" >
<img class="img-fluid w-100" src="/resourcebanner/webinar-announcement-responsive.jpg" alt="webinar announcement responsive">
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-9">
<div class="resource-article-info">
<h5>{{resource.category.name}}</h5>
<h1 class="resource-blog">{{resource.name}}</h1>
{% set user = app.session.get('loginUserName') %}
{% if user is not null %}
<ul class="list-unstyled recipe-info">
<li class="share" onclick = "loyaltyProgram(this, {{ resource.id }},'{{ resource.name }}',10,'Article','Share')"><span onclick = "sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ resource.url}}','{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}</span></li>
{% if Liked_detail_article|length == 0 %}
<li class="like article-detail" onclick = "loyaltyProgram(this, {{ resource.id }},'{{ resource.name }}',10,'Article','Like', '{{app.request.locale}}')">{{'Like'|trans}}</li>
{% else %}
<li class= 'liked'>{{'Like'|trans}}</li>
{% endif %}
<li class="download-black d-none" id ="download" onclick = "loyaltyProgram(this, {{ resource.id }},'{{ resource.name }}',10,'Article','Save')">{{'Download'|trans}}</li>
</ul>
{% else %}
<ul class="list-unstyled recipe-info">
<li class="share" onclick = "sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ resource.url}}','{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}</li>
<li class="like logged-out">{{'Like'|trans}}</li>
<li class="download-black d-none" id ="download">{{'Download'|trans}}</li>
</ul>
{% endif %}
<p class="resource-article-info-qoute">{{resource.main_description | raw}}</p>
{% for description in resource.resources %}
{% if description.localizedfields.data.getLocalizedValue('resource_heading') %}
<h2 class="resource-blog">{{description.localizedfields.data.getLocalizedValue('resource_heading')}}</h2>
{% endif %}
<p>{{description.localizedfields.data.getLocalizedValue('description')|raw}}</p>
{% if description.localizedfields.data.getLocalizedValue('resource_video') %}
<div class="media-section">
<video poster="assets/images/media-01.png">
<source src="/static/assets/videos/oceans.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<div class="control-options">
<i class="fas fa-play-circle"></i>
<i class="fas fa-pause-circle"></i>
</div>
</div>
{% endif %}
{% if description.localizedfields.data.getLocalizedValue('resource_image') %}
<div class="resource-article-info-media">
<figure class="resource-article-info-media-img">
<img src="{{description.localizedfields.data.getLocalizedValue('resource_image')}}" alt="article-img">
</figure>
</div>
{% endif %}
{% endfor %}
{% set user = app.session.get('loginUserName') %}
{% if user is not null %}
<ul class="list-unstyled recipe-info">
<li class="share" onclick = "loyaltyProgram(this,{{ resource.id }},'{{ resource.name }}',10,'Article','Share')"><span onclick = "sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ resource.url}}','{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}</span></li>
{% if Liked_detail_article|length == 0 %}
<li class="like article-detail" onclick = "loyaltyProgram(this,{{ resource.id }},'{{ resource.name }}',10,'Article','Like', '{{app.request.locale}}')">{{'Like'|trans}}</li>
{% else %}
<li class= 'liked'>{{'Like'|trans}}</li>
{% endif %}
<li class="download-black d-none" id ="download" onclick = "loyaltyProgram(this,{{ resource.id }},'{{ resource.name }}',10,'Article','Save')">{{'Download'|trans}}</li>
</ul>
{% else %}
<ul class="list-unstyled recipe-info">
<li class="share" onclick = "sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ resource.url}}','{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}</li>
<li class="like logged-out">{{'Like'|trans}}</li>
<li class="download-black d-none" id ="download">{{'Download'|trans}}</li>
</ul>
{% endif %}
{# <div class = "refrances">
{% if resource.references_links %}
<div class = "refrances-links">
<h3>{{'References'|trans}}</h3>
<ul class="list-unstyled">
{% for refrences in resource.references_links %}
<li><a href = "{{refrences.references.data}}">{{refrences.references.data}}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
</div> #}
</div>
</div>
<div class="col-xl-3">
<div class="resource-article-related">
<!--Start Featured Recipes Section-->
<section class="featured-recipes-section inner-frecipes-section all-event-section related-article-section">
<div class="container container-sm">
<h2 class="heading related-article-headingg">{{'Related Articles'|trans}}</h2>
<div class="featured-recipes">
<div class="custom-slider">
{% if resource.related_article %}
{% for article in resource.related_article %}
<div class="slide-holder">
<div class="slide-holder">
<a href="/{{app.request.locale}}/resource/{{article.url}}">
<figure class="slide-img">
<img src="{{article.image}}" alt="{{ article.name }}">
</figure><a/>
<div class="slide-content">
<div class="frecipes-box">
<a href="/{{app.request.locale}}/resource/{{article.url}}" class="text-decoration-none"><h3>{{article.name}}</h3></a>
<p>{{article.main_description}}</p>
</div>
{% set user = app.session.get('loginUserName') %}
{% if user is not null %}
<ul class="list-unstyled recipe-info">
<li class="share" onclick = "loyaltyProgram(this,{{ article.id }},'{{ article.name }}',10,'Article','Share')"><span onclick = "sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ article.url}}','{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}</span></li>
{% if article.id in Liked_related_article_Ids %}
<li class= 'liked'>{{'Like'|trans}}</li>
{% else %}
<li class="like related_article" onclick = "loyaltyProgram(this,{{ article.id }},'{{ article.name }}',10,'Article','Like', '{{app.request.locale}}')">{{'Like'|trans}}</li>
{% endif %}
<li class="download-black d-none" onclick = "loyaltyProgram(this,{{ article.id }},'{{ article.name }}',10,'Article','Save')">{{'Download'|trans}}</li>
</ul>
{% else %}
<ul class="list-unstyled recipe-info">
<li class="share" onclick = "sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ article.url}}','{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}</li>
<li class="like logged-out" >{{'Like'|trans}}</li>
<li class="download-black d-none" >{{'Download'|trans}}</li>
</ul>
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% else %}
No Related Article
{% endif %}
</div>
</div>
</div>
</section>
<!--End Featured Recipes Section-->
</div>
</div>
</div>
</div>
</section>
<!-- End Article -->
</div>
<!--Start Category Section -->
<section class="featured-categories resource-featured-categories">
<div class="container container-sm">
<div class="featured-categories-section">
<h2 class="heading">{{'More Topics'|trans}}</h2>
<div class="featured-categories-section-wrapper">
{% for topic in more_topics %}
<div class="featured-categories-section-wrapper-item">
<a href="/{{app.request.locale}}/resources/{{topic.url}}">
<figure class="featured-categories-section-wrapper-item-video">
<div class="media-section">
<video poster="{{topic.image}}" playsinline>
{% if topic.video.data is defined %}
<source src="{{ topic.video.data }}" type="video/mp4">
{% endif %}
Your browser does not support the video tag.
</video>
{# <div class="control-options">
<i class="fas fa-play-circle"></i>
<i class="fas fa-pause-circle"></i>
</div> #}
</div>
</figure></a>
<div class="featured-categories-section-wrapper-item-content">
<a href="/{{app.request.locale}}/resources/{{topic.url}}" class="featured-categories-section-wrapper-item-content-btn">
{{topic.name}}
</a>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</section>
<!--End Category Section -->
{% if (app.request.locale =='ar') %}
{% set topMenu ="/en/resource/" ~ resource.url('en') %}
{% else %}
{% set topMenu ="/ar/resource/" ~ resource.url('en') %}
{% endif %}
<script>
var _TopMenuLink = "{{ topMenu }}";
$(document).ready(function(){
//loyaltyProgram(this,{{ resource.id }},'{{ resource.name }}',50,'Article','Viewed')
});
{# document.addEventListener("DOMContentLoaded", () => {
const start = new Date().getTime();
window.addEventListener("beforeunload", () => {
const end = new Date().getTime();
const totalTime = (end - start) / 1000
console.log(totalTime)
});
}); #}
</script>
<script type="text/javascript">
// This code is Vanilla JS, you can equivalently use jQuery
// $(document).ready() or $(window).on()
let timeSpentScrolling = 0;
let isHalted = false;
let haltedStartTime, haltedEndTime;
let totalHaltedTime = 0;
const update_halt_state = () => {
if (isHalted) {
isHalted = false;
haltedEndTime = new Date().getTime()
totalHaltedTime += (haltedEndTime - haltedStartTime) / 1000
} else {
isHalted = true;
haltedStartTime = new Date().getTime()
}
}
// Listen for scroll events
window.addEventListener('scroll', () => {
timeSpentScrolling += 1.8;
update_halt_state()
});
document.addEventListener("DOMContentLoaded", () => {
const start = new Date().getTime();
// AVERAGE SCROLLING INTERVAL - 60 seconds
setInterval(() => {
if (new Date().getTime() - start > 60000) {
update_halt_state()
$(document).ready(function(){
loyaltyProgram(this,{{ resource.id }},'{{ resource.name }}',50,'Article','Viewed')
});
}
}, 39000)
window.addEventListener("beforeunload", () => {
const end = new Date().getTime();
update_halt_state()
const totalTime = ((end - start) / 1000) - (timeSpentScrolling / 1000) - totalHaltedTime
//navigator.sendBeacon("https://topapi2.free.beeceptor.com", totalTime)
});
});
</script>
<!-- Resource Listing More Topics End -->
{% endblock %}
{% block footer %}
{% include "includes/footer.html.twig" %}
{% endblock %}