forked from zestedesavoir/zds-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,082 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
.main .content-wrapper.shareable-link-page { | ||
h2 { | ||
color: $accent-700; | ||
border: 0; | ||
} | ||
|
||
.new-link-button { | ||
button { | ||
float: none; | ||
} | ||
} | ||
|
||
.list_of_links { | ||
list-style: none; | ||
|
||
.shareable-link-frame { | ||
border: 1px solid black; | ||
padding: $length-10; | ||
margin-bottom: $length-20; | ||
background: $true-white; | ||
border: solid $length-1 $grey-200; | ||
border-bottom: solid $length-2 $grey-200; | ||
|
||
header { | ||
display: flex; | ||
flex-wrap: wrap; | ||
min-height: $length-24; | ||
|
||
.shareable-link-description { | ||
flex-grow: 100; | ||
display: inline-block; | ||
margin: 0 0 $length-6 0; | ||
padding: 0; | ||
} | ||
|
||
.shareable-link-actions { | ||
display: flex; | ||
flex-wrap: wrap; | ||
|
||
.btn-holder { | ||
min-height: 0; | ||
height: $length-24; | ||
margin: 0 0 $length-6 $length-20; | ||
|
||
|
||
.btn-grey, .btn-cancel, .btn-submit { | ||
padding: 0 $length-6; | ||
line-height: normal; | ||
height: $length-24; | ||
} | ||
|
||
} | ||
|
||
.activation_status { | ||
display: flex; | ||
width: min-content; | ||
|
||
.btn-grey, .btn-submit, input [type="hidden"], input{ | ||
padding: 0 $length-6; | ||
line-height: normal; | ||
height: $length-24; | ||
} | ||
|
||
.status_display { | ||
display: inline-block; | ||
margin: auto; | ||
padding: 0; | ||
margin: 0 $length-6 $length-6 0; | ||
} | ||
|
||
.status_active { | ||
color:green; | ||
vertical-align: middle; | ||
} | ||
|
||
.status_active::before { | ||
content: "✓"; | ||
margin-right: $length-4; | ||
} | ||
|
||
.status_inactive { | ||
color:gray; | ||
vertical-align: middle; | ||
} | ||
|
||
.status_inactive::before { | ||
content: "✕"; | ||
margin-right: $length-4; | ||
} | ||
} | ||
} | ||
} | ||
|
||
section { | ||
.shareable-link-url { | ||
margin: $length-4 0; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.shareable-link-info { | ||
display: flex; | ||
flex-wrap: wrap; | ||
|
||
.shareable-link-info-line { | ||
margin: 0 $length-20 0 0; | ||
|
||
&.shareable-link-has-expired { | ||
color: $red-700; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{% extends "tutorialv2/base.html" %} | ||
{% load i18n %} | ||
|
||
{% block breadcrumb %} | ||
<li><a href="{{ content.get_absolute_url }}">{{ content.title }}</a></li> | ||
<li>{% trans "Liens de partage" %}</li> | ||
{% endblock %} | ||
|
||
{% block content_out %} | ||
<div class="content-wrapper shareable-link-page"> | ||
<header> | ||
<h1>{% blocktrans %} Liens de partage pour « {{ content }} » {% endblocktrans %}</h1> | ||
</header> | ||
<section> | ||
<p>{% trans "Diffusez votre contenu en partageant un simple lien accessible sans incription sur le site." %}</p> | ||
|
||
<p>{% trans "Les liens de partages offrent les fonctionnalités suivantes :" %}</p> | ||
|
||
{% blocktrans %} | ||
<ul> | ||
<li>partage de la dernière bêta ou du dernier brouillon ;</li> | ||
<li>validité temporaire ou permanente ;</li> | ||
<li>désactivation et réactivation à volonté.</li> | ||
</ul> | ||
{% endblocktrans %} | ||
|
||
<p class="new-link-button btn-holder"> | ||
<button href="#create-shareable-link" class="open-modal btn-submit"> | ||
{% trans "Nouveau lien de partage" %} | ||
</button> | ||
|
||
<form | ||
action="{% url 'content:create-shareable-link' content.pk %}" | ||
method="post" | ||
id="create-shareable-link" | ||
class="modal modal-flex"> | ||
{% csrf_token %} | ||
{{ create_form.as_p }} | ||
<button type="submit" class="btn-submit">{% trans "Créer" %}</button> | ||
</form> | ||
</p> | ||
|
||
|
||
<h2>{% trans "Liens actifs" %}</h2> | ||
|
||
<p> | ||
{% blocktrans %} | ||
Les personnes disposant d'un lien actif peuvent l'utiliser pour lire le contenu. | ||
Il est possible de désactiver un lien temporairement pour en interdire son usage, et le réactiver plus tard. | ||
{% endblocktrans %} | ||
</p> | ||
|
||
{% if not active_links_and_forms %} | ||
|
||
<p>{% trans "<em>Vous n'avez pas de liens de partage actifs.</em>" %}</p> | ||
|
||
{% else %} | ||
|
||
<ul class="list_of_links"> | ||
{% for link, edit_form in active_links_and_forms reversed %} | ||
{% include 'tutorialv2/view/list_shareable_links.part.html' with link=link edit_form=edit_form content=content section="active" %} | ||
{% endfor %} | ||
</ul> | ||
|
||
{% endif %} | ||
|
||
|
||
<h2>{% trans "Liens expirés" %}</h2> | ||
|
||
<p> | ||
{% blocktrans %} | ||
Un lien de partage expiré ne permet pas de lire le contenu. | ||
Si un lien est expiré, vous pouvez modifier sa date d'expiration pour qu'il fonctionne de nouveau. | ||
{% endblocktrans %} | ||
</p> | ||
|
||
{% if not expired_links_and_forms %} | ||
|
||
<p>{% trans "<em>Vous n'avez pas de liens de partage expirés.</em>" %}</p> | ||
|
||
{% else %} | ||
|
||
<ul class="list_of_links"> | ||
{% for link, edit_form in expired_links_and_forms reversed %} | ||
{% include 'tutorialv2/view/list_shareable_links.part.html' with link=link edit_form=edit_form content=content section="expired" %} | ||
{% endfor %} | ||
</ul> | ||
|
||
{% endif %} | ||
|
||
<h2>{% trans "Liens inactifs" %}</h2> | ||
|
||
<p> | ||
{% blocktrans %} | ||
Un lien de partage inactif ne permet pas de lire le contenu. | ||
Vous pouvez le réactiver quand vous le souhaitez pour autoriser de nouveau son usage. | ||
{% endblocktrans %} | ||
</p> | ||
|
||
{% if not inactive_links_and_forms %} | ||
|
||
<p>{% trans "<em>Vous n'avez pas de liens de partage inactifs.</em>" %}</p> | ||
|
||
{% else %} | ||
|
||
<ul class="list_of_links"> | ||
{% for link, edit_form in inactive_links_and_forms reversed %} | ||
{% include 'tutorialv2/view/list_shareable_links.part.html' with link=link edit_form=edit_form content=content section="inactive" %} | ||
{% endfor %} | ||
</ul> | ||
|
||
{% endif %} | ||
</section> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{% load i18n %} | ||
|
||
<li class="shareable-link-frame"> | ||
<header> | ||
<h3 class="shareable-link-description">{{ link.description }}</h3> | ||
|
||
<div class="shareable-link-actions"> | ||
{% if section == "active" or section == "expired" %} | ||
<div class="activation_status"> | ||
<p class="status_display"><span class="status_active">Actif</span></p> | ||
<form action="{% url 'content:deactivate-shareable-link' link.id %}" method="post"> | ||
{% csrf_token %} | ||
<button type="submit" class="btn-grey">{% trans "Désactiver" %}</button> | ||
</form> | ||
</div> | ||
{% else %} | ||
<div class="activation_status"> | ||
<p class="status_display"><span class="status_inactive">Inactif</span></p> | ||
<form action="{% url 'content:reactivate-shareable-link' link.id %}" method="post"> | ||
{% csrf_token %} | ||
<button type="submit" class="btn-submit">{% trans "Réactiver" %}</button> | ||
</form> | ||
</div> | ||
{% endif %} | ||
|
||
<div class="btn-holder"> | ||
<button href="#edit-shareable-link-{{ link.id }}" class="open-modal btn-grey"> | ||
{% trans "Modifier" %} | ||
</button> | ||
|
||
<form | ||
action="{% url 'content:edit-shareable-link' link.id %}" | ||
method="post" | ||
id="edit-shareable-link-{{ link.id }}" | ||
class="modal modal-flex"> | ||
{% csrf_token %} | ||
{{ edit_form.as_p }} | ||
<button type="submit" class="btn-submit">{% trans "Modifier" %}</button> | ||
</form> | ||
</div> | ||
|
||
<div class="btn-holder"> | ||
<button href="#delete-shareable-link-{{ link.id }}" class="open-modal btn-cancel"> | ||
{% trans "Supprimer" %} | ||
</button> | ||
|
||
<form | ||
action="{% url 'content:delete-shareable-link' link.id %}" | ||
method="post" | ||
id="delete-shareable-link-{{ link.id }}" | ||
class="modal modal-flex"> | ||
{% csrf_token %} | ||
<p> | ||
{% blocktrans %} | ||
<strong>Attention, ce lien sera supprimé définitivement.</strong> | ||
Vous ne pourrez pas le récupérer. | ||
Si vous souhaitez réutiliser ce lien plus tard, désactivez-le. | ||
{% endblocktrans %} | ||
</p> | ||
<button type="submit" class="btn-submit">{% trans "Supprimer" %}</button> | ||
</form> | ||
</div> | ||
</div> | ||
</header> | ||
|
||
<section> | ||
<div class="shareable-link-url" ><a href="{{ link.full_url }}">{{ link.full_url }}</a></div> | ||
<div class="shareable-link-info"> | ||
<p class="shareable-link-info-line"> | ||
{% if link.type == "DRAFT" %} | ||
{% trans "Lien vers <em>le dernier brouillon</em>" %} | ||
{% elif link.type == "BETA" %} | ||
{% trans "Lien vers <em>la dernière bêta</em>" %} | ||
{% else %} | ||
{% trans "Lien de <em>type inconnu</em>" %} | ||
{% endif %} | ||
</p> | ||
{% if link.valid_indefinitely %} | ||
<p class="shareable-link-info-line">{% trans "Sans date d'expiration" %}</p> | ||
{% elif link.expired %} | ||
<p class="shareable-link-info-line shareable-link-has-expired"> | ||
{% blocktrans with date=link.expiration|date:"DATE_FORMAT" %} | ||
A expiré le {{ date }} | ||
{% endblocktrans %} | ||
</p> | ||
{% else %} | ||
<p class="shareable-link-info-line"> | ||
{% blocktrans with date=link.expiration|date:"DATE_FORMAT" %} | ||
Expire le {{ date }} | ||
{% endblocktrans %} | ||
</p> | ||
{% endif %} | ||
</p> | ||
</div> | ||
</section> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.