Merge branch 'facebook-button' into 'master'

Add facebook button

See merge request !112
This commit is contained in:
Skia 2017-09-17 15:18:07 +02:00
commit 3e769195e3
5 changed files with 122 additions and 65 deletions

View File

@ -81,6 +81,9 @@ class News(models.Model):
def get_absolute_url(self):
return reverse('com:news_detail', kwargs={'news_id': self.id})
def get_full_url(self):
return "https://%s%s" % (settings.SITH_URL, self.get_absolute_url())
def __str__(self):
return "%s: %s" % (self.type, self.title)

View File

@ -1,5 +1,5 @@
{% extends "core/base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %}
{% from 'core/macros.jinja' import user_profile_link, facebook_share, tweet %}
{% block title %}
{% trans %}News{% endtrans %} -
@ -29,6 +29,9 @@
{% if user.can_edit(news) %}
<p> <a href="{{ url('com:news_edit', news_id=news.id) }}">{% trans %}Edit (will be remoderated){% endtrans %}</a></p>
{% endif %}
</br>
{{ facebook_share(news) }}
{{ tweet(news) }}
</section>
{% endblock %}

View File

@ -23,6 +23,8 @@ $secondary-neutral-dark-color: hsl(40, 57.6%, 17%);
$white-color: hsl(219.6, 20.8%, 98%);
$black-color: hsl(40.0, 0%, 17%);
$faceblue: #3B5998;
$twitblue: #55acee;
@ -399,6 +401,38 @@ header {
}
}
.fb-share-button {
background: $faceblue;
border: none;
color: white;
padding: 0.5em 1em;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 2px;
}
.fb-share-button:hover {
color: lightgrey;
}
.twitter-share-button {
background: $twitblue;
border: none;
color: white;
padding: 0.5em 1em;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 2px;
}
.twitter-share-button:hover {
color: lightgrey;
}
.helptext {
display: block;
}

View File

@ -12,6 +12,14 @@
</a>
{%- endmacro %}
{% macro facebook_share(news) -%}
<a rel="nofollow" target="#" class="fb-share-button" href="https://www.facebook.com/sharer/sharer.php?u={{ news.get_full_url() }}">{% trans %}Share on Facebook{% endtrans %}</a>
{%- endmacro %}
{% macro tweet(news) -%}
<a rel="nofollow" target="#" class="twitter-share-button" href="https://twitter.com/intent/tweet?text={{ news.get_full_url() }}">{% trans %}Tweet{% endtrans %}</a>
{%- endmacro %}
{% macro user_mini_profile(user) %}
<div id="user_profile">

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-06 13:18+0200\n"
"POT-Creation-Date: 2017-09-17 15:00+0200\n"
"PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n"
@ -66,7 +66,7 @@ msgid "account number"
msgstr "numero de compte"
#: accounting/models.py:113 accounting/models.py:139 club/models.py:189
#: com/models.py:67 com/models.py:175 counter/models.py:148
#: com/models.py:67 com/models.py:178 counter/models.py:148
#: counter/models.py:184 trombi/models.py:149
msgid "club"
msgstr "club"
@ -357,8 +357,8 @@ msgstr "Compte en banque : "
#: core/templates/core/file_detail.jinja:25
#: core/templates/core/file_detail.jinja:62
#: core/templates/core/file_moderation.jinja:24
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:53
#: core/templates/core/macros.jinja:72
#: core/templates/core/group_list.jinja:13 core/templates/core/macros.jinja:61
#: core/templates/core/macros.jinja:80
#: core/templates/core/pagerev_edit.jinja:28
#: core/templates/core/user_account_detail.jinja:38
#: core/templates/core/user_edit.jinja:19
@ -1261,7 +1261,7 @@ msgstr "Hebdomadaire"
msgid "Call"
msgstr "Appel"
#: com/models.py:63 com/models.py:124 com/models.py:172 election/models.py:12
#: com/models.py:63 com/models.py:127 com/models.py:175 election/models.py:12
#: election/models.py:92 election/models.py:128 forum/models.py:189
#: forum/models.py:237
msgid "title"
@ -1271,7 +1271,7 @@ msgstr "titre"
msgid "summary"
msgstr "résumé"
#: com/models.py:65 com/models.py:173 trombi/models.py:135
#: com/models.py:65 com/models.py:176 trombi/models.py:135
msgid "content"
msgstr "contenu"
@ -1281,47 +1281,47 @@ msgstr "contenu"
msgid "type"
msgstr "type"
#: com/models.py:68 com/models.py:174 trombi/models.py:133
#: com/models.py:68 com/models.py:177 trombi/models.py:133
msgid "author"
msgstr "auteur"
#: com/models.py:112
#: com/models.py:115
msgid "news_date"
msgstr "date de la nouvelle"
#: com/models.py:113
#: com/models.py:116
msgid "start_date"
msgstr "date de début"
#: com/models.py:114
#: com/models.py:117
msgid "end_date"
msgstr "date de fin"
#: com/models.py:125
#: com/models.py:128
msgid "intro"
msgstr "intro"
#: com/models.py:126
#: com/models.py:129
msgid "joke"
msgstr "blague"
#: com/models.py:127
#: com/models.py:130
msgid "protip"
msgstr "astuce"
#: com/models.py:128
#: com/models.py:131
msgid "conclusion"
msgstr "conclusion"
#: com/models.py:129
#: com/models.py:132
msgid "sent"
msgstr "envoyé"
#: com/models.py:171
#: com/models.py:174
msgid "weekmail"
msgstr "weekmail"
#: com/models.py:176
#: com/models.py:179
msgid "rank"
msgstr "rang"
@ -1934,7 +1934,7 @@ msgstr "profil visible par les cotisants"
msgid "A user with that username already exists"
msgstr "Un utilisateur de ce nom d'utilisateur existe déjà"
#: core/models.py:493 core/templates/core/macros.jinja:21
#: core/models.py:493 core/templates/core/macros.jinja:29
#: core/templates/core/user_detail.jinja:14
#: core/templates/core/user_detail.jinja:16
#: core/templates/core/user_edit.jinja:17
@ -2430,41 +2430,49 @@ msgstr "login"
msgid "Lost password?"
msgstr "Mot de passe perdu ?"
#: core/templates/core/macros.jinja:31 core/templates/core/user_detail.jinja:27
#: core/templates/core/macros.jinja:16
msgid "Share on Facebook"
msgstr "Partager sur Facebook"
#: core/templates/core/macros.jinja:20
msgid "Tweet"
msgstr "Tweeter"
#: core/templates/core/macros.jinja:39 core/templates/core/user_detail.jinja:27
msgid "Born: "
msgstr "Né le : "
#: core/templates/core/macros.jinja:35 core/templates/core/user_detail.jinja:48
#: core/templates/core/macros.jinja:43 core/templates/core/user_detail.jinja:48
msgid "Promo: "
msgstr "Promo : "
#: core/templates/core/macros.jinja:42
#: core/templates/core/macros.jinja:50
#, python-format
msgid "Subscribed until %(subscription_end)s"
msgstr "Cotisant jusqu'au %(subscription_end)s"
#: core/templates/core/macros.jinja:43 core/templates/core/user_edit.jinja:40
#: core/templates/core/macros.jinja:51 core/templates/core/user_edit.jinja:40
msgid "Account number: "
msgstr "Numero de compte : "
#: core/templates/core/macros.jinja:48 launderette/models.py:155
#: core/templates/core/macros.jinja:56 launderette/models.py:155
msgid "Slot"
msgstr "Créneau"
#: core/templates/core/macros.jinja:61
#: core/templates/core/macros.jinja:69
#: launderette/templates/launderette/launderette_admin.jinja:20
msgid "Tokens"
msgstr "Jetons"
#: core/templates/core/macros.jinja:78 core/templates/core/macros.jinja:80
#: core/templates/core/macros.jinja:86 core/templates/core/macros.jinja:88
msgid "Previous"
msgstr "Précédent"
#: core/templates/core/macros.jinja:84
#: core/templates/core/macros.jinja:92
msgid "current"
msgstr "actuel"
#: core/templates/core/macros.jinja:90 core/templates/core/macros.jinja:92
#: core/templates/core/macros.jinja:98 core/templates/core/macros.jinja:100
msgid "Next"
msgstr "Suivant"
@ -4119,12 +4127,12 @@ msgid "Washing and drying"
msgstr "Lavage et séchage"
#: launderette/templates/launderette/launderette_book.jinja:27
#: sith/settings.py:546
#: sith/settings.py:549
msgid "Washing"
msgstr "Lavage"
#: launderette/templates/launderette/launderette_book.jinja:31
#: sith/settings.py:546
#: sith/settings.py:549
msgid "Drying"
msgstr "Séchage"
@ -4383,145 +4391,146 @@ msgstr "Sevenans"
msgid "Montbéliard"
msgstr "Montbéliard"
#: sith/settings.py:428
#: sith/settings.py:431
msgid "One semester"
msgstr "Un semestre, 15 €"
#: sith/settings.py:433
#: sith/settings.py:436
msgid "Two semesters"
msgstr "Deux semestres, 28 €"
#: sith/settings.py:438
#: sith/settings.py:441
msgid "Common core cursus"
msgstr "Cursus tronc commun, 45 €"
#: sith/settings.py:443
#: sith/settings.py:446
msgid "Branch cursus"
msgstr "Cursus branche, 45 €"
#: sith/settings.py:448
#: sith/settings.py:451
msgid "Alternating cursus"
msgstr "Cursus alternant, 30 €"
#: sith/settings.py:453
#: sith/settings.py:456
msgid "Honorary member"
msgstr "Membre honoraire, 0 €"
#: sith/settings.py:458
#: sith/settings.py:461
msgid "Assidu member"
msgstr "Membre d'Assidu, 0 €"
#: sith/settings.py:463
#: sith/settings.py:466
msgid "Amicale/DOCEO member"
msgstr "Membre de l'Amicale/DOCEO, 0 €"
#: sith/settings.py:468
#: sith/settings.py:471
msgid "UT network member"
msgstr "Cotisant du réseau UT, 0 €"
#: sith/settings.py:473
#: sith/settings.py:476
msgid "CROUS member"
msgstr "Membres du CROUS, 0 €"
#: sith/settings.py:478
#: sith/settings.py:481
msgid "Sbarro/ESTA member"
msgstr "Membre de Sbarro ou de l'ESTA, 15 €"
#: sith/settings.py:483
#: sith/settings.py:486
msgid "One semester Welcome Week"
msgstr "Un semestre Welcome Week"
#: sith/settings.py:488
#: sith/settings.py:491
msgid "Two month for free"
msgstr "Deux mois gratuits"
#: sith/settings.py:510
#: sith/settings.py:513
msgid "President"
msgstr "Président"
#: sith/settings.py:511
#: sith/settings.py:514
msgid "Vice-President"
msgstr "Vice-Président"
#: sith/settings.py:512
#: sith/settings.py:515
msgid "Treasurer"
msgstr "Trésorier"
#: sith/settings.py:513
#: sith/settings.py:516
msgid "Communication supervisor"
msgstr "Responsable communication"
#: sith/settings.py:514
#: sith/settings.py:517
msgid "Secretary"
msgstr "Secrétaire"
#: sith/settings.py:515
#: sith/settings.py:518
msgid "IT supervisor"
msgstr "Responsable info"
#: sith/settings.py:516
#: sith/settings.py:519
msgid "Board member"
msgstr "Membre du bureau"
#: sith/settings.py:517
#: sith/settings.py:520
msgid "Active member"
msgstr "Membre actif"
#: sith/settings.py:518
#: sith/settings.py:521
msgid "Curious"
msgstr "Curieux"
#: sith/settings.py:553
#: sith/settings.py:556
msgid "A new mailing list needs to be moderated"
msgstr "Une nouvelle mailing list a besoin d'être modérée"
#: sith/settings.py:554
#: sith/settings.py:557
#, python-format
msgid "There are %s fresh news to be moderated"
msgstr "Il y a %s nouvelles toutes fraîches à modérer"
#: sith/settings.py:555
#: sith/settings.py:558
msgid "New files to be moderated"
msgstr "Nouveaux fichiers à modérer"
#: sith/settings.py:556
#: sith/settings.py:559
msgid "New pictures/album to be moderated in the SAS"
msgstr "Nouvelles photos/albums à modérer dans le SAS"
#: sith/settings.py:557
#: sith/settings.py:560
msgid "You've been identified on some pictures"
msgstr "Vous avez été identifié sur des photos"
#: sith/settings.py:558
#: sith/settings.py:561
#, python-format
msgid "You just refilled of %s €"
msgstr "Vous avez rechargé votre compte de %s€"
#: sith/settings.py:559
#: sith/settings.py:562
#, python-format
msgid "You just bought %s"
msgstr "Vous avez acheté %s"
#: sith/settings.py:560
#: sith/settings.py:563
msgid "You have a notification"
msgstr "Vous avez une notification"
#: sith/settings.py:571
#: sith/settings.py:574
msgid "Success!"
msgstr "Succès !"
#: sith/settings.py:572
#: sith/settings.py:575
msgid "Fail!"
msgstr "Échec !"
#: sith/settings.py:573
#: sith/settings.py:576
msgid "You successfully posted an article in the Weekmail"
msgstr "Article posté avec succès dans le Weekmail"
#: sith/settings.py:574
#: sith/settings.py:577
msgid "You successfully edited an article in the Weekmail"
msgstr "Article édité avec succès dans le Weekmail"
#: sith/settings.py:575
#: sith/settings.py:578
msgid "You successfully sent the Weekmail"
msgstr "Weekmail envoyé avec succès"