Unverified Commit d4227fcc authored by Roland Denis's avatar Roland Denis
Browse files

Making tweet and twitter account clickable.

parent c2b5fc11
Pipeline #3270 passed with stages
in 15 seconds
......@@ -96,8 +96,9 @@ CATEGORY_MANDATORY_METADATA = {
'formation': {'place', 'start_date', 'end_date'},
}
# Twitter carousel configuration
TWITTER_CAROUSEL = {
'count': 3, # Number of tweets in the carousel.
'interval': 5000, # Delay before automatic cycle.
# Twitter configuration
TWITTER = {
'user': 'groupecalcul', # Twitter account name.
'carousel_count': 3, # Number of tweets in the carousel.
'carousel_interval': 5000, # Delay before automatic cycle of the carousel.
}
......@@ -117,19 +117,21 @@
</div>
<div class="container-fluid mt-4 px-0 twitter" style="display:none">
<div id="twitterCarousel" class="carousel slide" data-ride="carousel" data-interval="{{TWITTER_CAROUSEL['interval']}}">
<div id="twitterCarousel" class="carousel slide" data-ride="carousel" data-interval="{{TWITTER['carousel_interval']}}">
<ol class="carousel-indicators">
{% for tweet_id in range(TWITTER_CAROUSEL['count']) %}
{% for tweet_id in range(TWITTER['carousel_count']) %}
<li data-target="#twitterCarousel" data-slide-to="{{tweet_id}}" {% if tweet_id == 0 %}class="active"{% endif %}></li>
{% endfor %}
</ol>
<div class="carousel-inner">
{% for tweet_id in range(TWITTER_CAROUSEL['count']) %}
{% for tweet_id in range(TWITTER['carousel_count']) %}
<div class="carousel-item {% if tweet_id == 0 %}active{% endif %}">
<div class="container pb-4">
<img src="{{SITEURL}}/theme/img/twitter_comma.png" class="comma" />
<span class="share d-flex flex-row-reverse p-4"><a id="twitter-share" href="#">Partager</a></span>
<h1 class="pt-4">GroupeCalcul@twitter</h1>
<a href="https://twitter.com/{{TWITTER['user']}}" target="_blank" style="display:block">
<h1 class="pt-4">GroupeCalcul@twitter</h1>
</a>
<ul class="list-inline">
<li id="twitter-date" class="list-inline-item m-0 px-1">Date</li>
......@@ -139,7 +141,9 @@
<div class="container px-0">
<div class="container" style="width:90%;">
<p id="twitter-text">Contenu</p>
<a id="twitter-link" href="#" target="_blank" style="display:block">
<p id="twitter-text">Contenu</p>
</a>
</div>
</div>
</div>
......@@ -156,7 +160,7 @@
</a>
</div>
<div class="container pb-4">
<a class="twitter-timeline" data-width="100%" data-lang="fr" data-tweet-limit="{{ TWITTER_CAROUSEL['count'] }}" data-link-color="#000" data-theme="light" href="https://twitter.com/groupecalcul" data-chrome="noheader transparent nofooter nofooter noborders">Tweets by Groupe Calcul</a>
<a class="twitter-timeline" data-width="100%" data-lang="fr" data-tweet-limit="{{ TWITTER['carousel_count'] }}" data-link-color="#000" data-theme="light" href="https://twitter.com/{{TWITTER['user']}}" data-chrome="noheader transparent nofooter nofooter noborders">Tweets by Groupe Calcul</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<script>
jQuery('.twitter').delegate('#twitter-widget-0','DOMSubtreeModified propertychange', function() {
......@@ -174,6 +178,7 @@
output_tweet.find('#twitter-text').html(input_tweet.find('p.timeline-Tweet-text').html());
output_tweet.find('#twitter-date').html(capitalizeFirstLetter(input_tweet.find('time').attr('aria-label').substring(7)));
output_tweet.find('#twitter-share').attr('href', input_tweet.find('a.timeline-ShareMenu-option').attr('href'));
output_tweet.find('#twitter-link').attr('href', input_tweet.find('.timeline-Tweet').attr('data-click-to-open-target'));
// Hashtags
var hashtag_obj = output_tweet.find('#twitter-hashtag');
......@@ -190,7 +195,7 @@
try {
jQuery('.twitter').find('.twitter-timeline').css('display', 'none');
for (var tweet_id = 0; tweet_id < {{ TWITTER_CAROUSEL['count'] }}; ++tweet_id) {
for (var tweet_id = 0; tweet_id < {{ TWITTER['carousel_count'] }}; ++tweet_id) {
customizeTweet(tweet_id);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment