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

regenerate_token

parent faadce5b
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,11 @@ class Admin::University::AppsController < Admin::University::ApplicationControll
notice: t('admin.successfully_destroyed_html', model: @app.to_s)
end
def regenerate_token
@app.regenerate_token!
redirect_to admin_university_app_path(@app), notice: t('university.apps.token_successfully_regenerated')
end
protected
def breadcrumb
......
......@@ -11,6 +11,14 @@
</div>
</div>
<% content_for :action_bar_left do %>
<%= link_to t('university.apps.regenerate_token'),
[:regenerate_token, :admin, @app],
method: :post,
data: { confirm: t('please_confirm') },
class: 'btn btn-warning btn-xs' %>
<% end %>
<% content_for :action_bar_right do %>
<%= edit_link @app %>
<% end %>
......@@ -209,7 +209,9 @@ en:
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
apps:
regenerate_token: Regenerate token
token_display_notice: Make sure to store your token somewhere safe. You won’t be able to see it again!
token_successfully_regenerated: The token was successfully regenerated.
contributing:
one: contributing university
other: contributing universities
......
......@@ -209,7 +209,9 @@ fr:
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
apps:
regenerate_token: Regénérer le jeton
token_display_notice: Assurez-vous de stocker votre jeton secret de manière sécurisée. Vous ne pourrez pas le revoir !
token_successfully_regenerated: Le jeton a bien été regénéré.
contributing:
one: université contributrice
other: universités contributrices
......
......@@ -8,7 +8,9 @@ namespace :university do
resources :imports, only: [:index, :show, :new, :create]
end
end
resources :apps
resources :apps do
post :regenerate_token, on: :member
end
resources :alumni, only: [:index, :show] do
member do
get 'cohorts' => 'alumni/cohorts#edit'
......@@ -33,7 +35,7 @@ namespace :university do
end
end
resources :organizations do
collection do
collection do
get :search, defaults: { format: 'json' }
resources :categories, controller: 'organizations/categories', as: 'organization_categories'
end
......
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