Skip to content

Commit

Permalink
fix: avoid calling to undefined variables in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Dec 13, 2023
1 parent c27e193 commit c9c717a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
4 changes: 0 additions & 4 deletions web/b3desk/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,8 @@ def welcome():
max_meetings_per_user=current_app.config["MAX_MEETINGS_PER_USER"],
mailto=current_app.config["MAILTO_LINKS"],
quick_meeting=current_app.config["QUICK_MEETING"],
shorty=current_app.config["SHORTY"],
file_sharing=current_app.config["FILE_SHARING"],
clipboard=current_app.config["CLIPBOARD"],
recording=current_app.config["RECORDING"],
)


Expand Down Expand Up @@ -481,8 +479,6 @@ def edit_meeting_files(meeting_id):
"meeting/filesform.html",
meeting=meeting,
form=form,
fqdn=current_app.config["SERVER_FQDN"],
beta=current_app.config["BETA"],
)
flash(_("Vous ne pouvez pas modifier cet élément"), "warning")
return redirect(url_for("routes.welcome"))
Expand Down
2 changes: 1 addition & 1 deletion web/b3desk/templates/brand.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!-- Webinaire de l'État -->
<p class="fr-header__service-title">
{% trans %}{{ service_title }}{% endtrans %}
{% if beta %}
{% if config.get("BETA") %}
<span class="fr-badge fr-badge--sm fr-badge--green-emeraude">BETA</span>
{% endif %}
</p>
Expand Down
6 changes: 3 additions & 3 deletions web/b3desk/templates/jumbotron.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<div class="fr-container">
<div class="fr-mt-4w fr-grid-row fr-grid-row--center">
<div class="fr-col-sm-8 fr-col-md-6 fr-col-lg-4 connected">
{% if quick_meeting == true %}
{% if quick_meeting is defined and quick_meeting %}
<h1 class="fr-h2">{% trans %}Lancer {{ a_meeting }}{% endtrans %}</h1>
<a class="fr-btn fr-btn--lg" href="{{ url_for("routes.quick_meeting") }}" target="_blank" rel="noopener" title="{% trans %}Lancer {{ the_meeting }} - nouvelle fenêtre{% endtrans %}">{% trans %}Démarrer {{ a_meeting }} immédiatement{% endtrans %}</a>
<p class="fr-mt-2w">{{ welcome_page_subtitle }}</p>
{% endif %}
</div>
</div>
{% if stats %}
{% if stats is defined and stats %}
<div class="fr-mt-4w fr-grid-row fr-grid-row--center fr-grid-row--gutters stats-info-container">
<div class="fr-col-sm-10 fr-col-md-8">
<p class="stats-info">
Expand Down Expand Up @@ -43,7 +43,7 @@ <h1 class="fr-text--lead fr-text--bold">{% trans %}Vous organisez régulièremen
<p class="fr-text">{% trans %}Vous êtes agent de l’État, créez un compte pour organiser et conserver vos {{ some_meetings }}.{% endtrans %}</p>
<p><a class="fr-btn" target="_blank" rel="noopener" href="{{ url_for("routes.welcome") }}">{% trans %}Se connecter ou créer un compte{% endtrans %}</a></p>
<p></p>
{% if stats %}
{% if stats is defined and stats %}
<p>
<small>
{% trans trimmed count=stats["runningCount"]%}
Expand Down
2 changes: 1 addition & 1 deletion web/b3desk/templates/meeting/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ <h1 id="delete-file-{{ file.id }}-title" class="fr-modal__title">
<button data-fr-opened="false" aria-controls="delete-file-{{file.id}}" class="fr-btn fr-fi-delete-line" title="Supprimer"></button>
</td>
<td>
<a href="{{ fqdn }}/meeting/files/{{ meeting.id }}/{{ file.id }}">
<a href="{{ config.get("SERVER_FQDN") }}/meeting/files/{{ meeting.id }}/{{ file.id }}">
<button class="fr-btn fr-icon-download-fill" title="Télécharger"></button>
</a>
</td>
Expand Down
2 changes: 1 addition & 1 deletion web/b3desk/templates/meeting/js_script.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
const nc_login = "{{ user.nc_login }}";
const nc_token = "{{ user.nc_token }}";
const meeting_id = "{{ meeting.id }}";
const fqdn = "{{ fqdn }}";
const fqdn = "{{ config.get("SERVER_FQDN") }}";
let ncfilepicker = null;

if (!nc_locator || !nc_login || !nc_token) {
Expand Down
8 changes: 4 additions & 4 deletions web/b3desk/templates/meeting/row.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="fr-grid-row fr-grid-row--gutters fr-pt-1-5v">
{% if shorty %}
{% if config.get("SHORTY") %}
<div class="fr-col-4">
<span class="fr-fi-user-line"></span>
<a href="{{ url_for("routes.join_meeting_as_role", meeting_id=meeting.id, role="moderator") }}" target="_blank" rel="noopener" class="fr-tag" title="{% trans meeting_name=meeting.name %}Lancer {{ meeting_name }} - nouvelle fenêtre{% endtrans %}"><span class="fr-fi-play-line"></span></a>
Expand All @@ -18,7 +18,7 @@
</div>
<div class="rf-col">
<a href="{{ url_for("routes.edit_meeting", meeting_id=meeting.id) }}" class="rf-tag" title="{% trans meeting_name=meeting.name %}Modifier {{ meeting_name }}{% endtrans %}" aria-label="{% trans meeting_name=meeting.name %}Modifier {{ meeting_name }}{% endtrans %}"><span class="rf-fi-edit-line"></span></a>
{% if file_sharing %}
{% if config.get("FILE_SHARING") %}
<a href="{{ url_for("routes.edit_meeting_files", meeting_id=meeting.id) }}" class="rf-tag" title="Fichiers associés à {{ meeting.name }}" aria-label="Fichiers associés à {{ meeting.name }}"><span class="rf-fi-file-pdf-line"></span></a>
{% endif %}
<a href="#"
Expand All @@ -44,13 +44,13 @@
</button>
</div>
<div class="fr-col-xs-6 fr-col-sm-6 fr-col-lg-6 btn-actions">
{% if recording %}
{% if config.get("RECORDING") %}
<a href="{{ url_for("routes.show_meeting_recording", meeting_id=meeting.id) }}" class="fr-btn fr-btn--secondary" title="{% trans meeting_name=meeting.name %}Voir les enregistrements de {{ meeting_name }}{% endtrans %}" aria-label="{% trans meeting_name=meeting.name %}Voir les enregistrements de {{ meeting_name }}{% endtrans %}">
<span class="fr-icon-play-line" aria-hidden="true"></span>
</a>
{% endif %}
<a href="{{ url_for("routes.edit_meeting", meeting_id=meeting.id) }}" class="fr-btn fr-btn--secondary" title="{% trans meeting_name=meeting.name %}Modifier {{ meeting_name }}{% endtrans %}" aria-label="{% trans meeting_name=meeting.name %}Modifier {{ meeting_name }}{% endtrans %}"><span class="fr-icon-edit-line"></span></a>
{% if file_sharing %}
{% if config.get("FILE_SHARING") %}
<a href="{{ url_for("routes.edit_meeting_files", meeting_id=meeting.id) }}" class="fr-btn fr-btn--secondary" title="Fichiers associés à {{ meeting.name }}" aria-label="Fichiers associés à {{ meeting.name }}"><span class="fr-icon-file-pdf-line"></span></a>
{% endif %}
<a href="javascript: void()"
Expand Down

0 comments on commit c9c717a

Please sign in to comment.