Skip to content
Snippets Groups Projects
Unverified Commit faadce5b authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

display once

parent 3cee4120
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ class Admin::University::AppsController < Admin::University::ApplicationControll
end
def show
@should_display_token = @app.display_token!
breadcrumb
end
......
......@@ -30,6 +30,12 @@ class University::App < ApplicationRecord
scope :ordered, -> { order(:name) }
def display_token!
return false if token_was_displayed?
update(token_was_displayed: true)
true
end
def regenerate_token!
update(token: nil, token_was_displayed: false)
end
......
<% content_for :title, @app %>
<% if @should_display_token %>
<p class="text-danger"><%= t('university.apps.token_display_notice') %></p>
<% end %>
<div class="row">
<div class="col-lg-6">
<%= osuny_label University::App.human_attribute_name('token') %>
<input type="string" value="<%= @app.token %>" class="form-control" disabled>
<input type="string" value="<%= @should_display_token ? @app.token : masked_string(@app.token) %>" class="form-control" disabled>
</div>
</div>
......
......@@ -208,7 +208,9 @@ en:
import_btn: Import cohorts
import_hint_html: "Possible values for <i>gender</i> are: m (male), f (female) and n (non binary).<br><i>Phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> and <i>zipcode</i> fields must have a text format, not numbers.<br><i>Country</i> field must contain the ISO 3166 code of the country, so 2 upcase characters (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">list</a>).<br><i>Social_twitter</i> field should have no @.<br><i>School</i> field should contain the internal school id.<br><i>Program</i> field should contain the internal program id."
title: Cohorts imports
contributing:
apps:
token_display_notice: Make sure to store your token somewhere safe. You won’t be able to see it again!
contributing:
one: contributing university
other: contributing universities
contributions_total: Contributions (total)
......
......@@ -208,7 +208,9 @@ fr:
import_btn: Importer des promotions
import_hint_html: "Les valeurs pour <i>gender</i> peuvent être m (masculin), f (féminin) et n (non binaire).<br>Les champs <i>phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> et <i>zipcode</i> doivent être au format texte, pas nombre.<br>Le champ <i>country</i> doit contenir le code ISO 3166 du pays, sur 2 caratères en majuscule (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">liste</a>)<br>Le champ <i>social_twitter</i> ne doit pas contenir d'@.<br>Le champ <i>school</i> doit contenir l'id interne de l'école.<br>Le champ <i>program</i> doit contenir l'id interne de la formation."
title: Imports de promotions
contributing:
apps:
token_display_notice: Assurez-vous de stocker votre jeton secret de manière sécurisée. Vous ne pourrez pas le revoir !
contributing:
one: université contributrice
other: universités contributrices
contributions_total: Contributions (total)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment