Merge pull request #2603 from tchak/use-helpers
Use helpers rather then view_context
This commit is contained in:
commit
bce2e53f71
6 changed files with 8 additions and 8 deletions
|
@ -45,7 +45,7 @@ class Admin::ProceduresController < AdminController
|
||||||
procedure = current_administrateur.procedures.find(params[:id])
|
procedure = current_administrateur.procedures.find(params[:id])
|
||||||
procedure.hide!
|
procedure.hide!
|
||||||
|
|
||||||
flash.notice = "Démarche supprimée, en cas d'erreur #{view_context.contact_link('contactez nous', tags: 'démarche supprimée')}"
|
flash.notice = "Démarche supprimée, en cas d'erreur #{helpers.contact_link('contactez nous', tags: 'démarche supprimée')}"
|
||||||
redirect_to admin_procedures_draft_path
|
redirect_to admin_procedures_draft_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Administrateurs::ActivateController < ApplicationController
|
||||||
@administrateur = Administrateur.find_inactive_by_token(params[:token])
|
@administrateur = Administrateur.find_inactive_by_token(params[:token])
|
||||||
|
|
||||||
if !@administrateur
|
if !@administrateur
|
||||||
flash.alert = "Le lien de validation d'administrateur a expiré, #{view_context.contact_link('contactez-nous', tags: 'lien expiré')} pour obtenir un nouveau lien."
|
flash.alert = "Le lien de validation d'administrateur a expiré, #{helpers.contact_link('contactez-nous', tags: 'lien expiré')} pour obtenir un nouveau lien."
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Gestionnaires::ActivateController < ApplicationController
|
||||||
@gestionnaire = Gestionnaire.with_reset_password_token(params[:token])
|
@gestionnaire = Gestionnaire.with_reset_password_token(params[:token])
|
||||||
|
|
||||||
if !@gestionnaire
|
if !@gestionnaire
|
||||||
flash.alert = "Le lien de validation du compte instructeur a expiré, #{view_context.contact_link('contactez-nous', tags: 'lien expiré')} pour obtenir un nouveau lien."
|
flash.alert = "Le lien de validation du compte instructeur a expiré, #{helpers.contact_link('contactez-nous', tags: 'lien expiré')} pour obtenir un nouveau lien."
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ module NewUser
|
||||||
class FeedbacksController < UserController
|
class FeedbacksController < UserController
|
||||||
def create
|
def create
|
||||||
current_user.feedbacks.create!(rating: params[:rating])
|
current_user.feedbacks.create!(rating: params[:rating])
|
||||||
flash.notice = "Merci de votre retour, si vous souhaitez nous en dire plus, n'hésitez pas à #{view_context.contact_link('nous contacter', type: Helpscout::FormAdapter::TYPE_AMELIORATION)}."
|
flash.notice = "Merci de votre retour, si vous souhaitez nous en dire plus, n'hésitez pas à #{helpers.contact_link('nous contacter', type: Helpscout::FormAdapter::TYPE_AMELIORATION)}."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ class SupportController < ApplicationController
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
else
|
else
|
||||||
setup_context
|
setup_context
|
||||||
flash.now.alert = "Une erreur est survenue. Vous pouvez nous contactez à #{view_context.mail_to(CONTACT_EMAIL)}."
|
flash.now.alert = "Une erreur est survenue. Vous pouvez nous contactez à #{helpers.mail_to(CONTACT_EMAIL)}."
|
||||||
|
|
||||||
render :index
|
render :index
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,17 +9,17 @@ class WebhookController < ActionController::Base
|
||||||
html = []
|
html = []
|
||||||
|
|
||||||
if user
|
if user
|
||||||
url = view_context.manager_user_url(user)
|
url = manager_user_url(user)
|
||||||
html << link_to_manager(user, url)
|
html << link_to_manager(user, url)
|
||||||
end
|
end
|
||||||
|
|
||||||
if gestionnaire
|
if gestionnaire
|
||||||
url = view_context.manager_gestionnaire_url(gestionnaire)
|
url = manager_gestionnaire_url(gestionnaire)
|
||||||
html << link_to_manager(gestionnaire, url)
|
html << link_to_manager(gestionnaire, url)
|
||||||
end
|
end
|
||||||
|
|
||||||
if administrateur
|
if administrateur
|
||||||
url = view_context.manager_administrateur_url(administrateur)
|
url = manager_administrateur_url(administrateur)
|
||||||
html << link_to_manager(administrateur, url)
|
html << link_to_manager(administrateur, url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue