Change language from Reject to Deny

This commit is contained in:
2022-02-11 13:37:55 +00:00
parent da89a688b9
commit 016f7489c4
13 changed files with 83 additions and 80 deletions

View File

@@ -47,14 +47,14 @@ function attachOrganisationForm() {
} }
/** /**
* Approve/Reject organisation * Approve/Deny organisation registration
*/ */
function approveOrganisation(slug, approve, options) { function approveOrganisationRegistration(slug, approve, options) {
var data = {}; var data = {};
data[site.csrf.keys.name] = site.csrf.name; data[site.csrf.keys.name] = site.csrf.name;
data[site.csrf.keys.value] = site.csrf.value; data[site.csrf.keys.value] = site.csrf.value;
var url = site.uri.public + '/api/organisations/o/' + slug + '/registration/' + (approve ? 'approve' : 'reject'); var url = site.uri.public + '/api/organisations/o/' + slug + '/registration/' + (approve ? 'approve' : 'deny');
var debugAjax = (typeof site !== "undefined") && site.debug.ajax; var debugAjax = (typeof site !== "undefined") && site.debug.ajax;
return $.ajax({ return $.ajax({
@@ -270,14 +270,14 @@ function bindOrganisationButtons(el, options) {
el.find('.js-organisation-approveRegistration').click(function(e) { el.find('.js-organisation-approveRegistration').click(function(e) {
e.preventDefault(); e.preventDefault();
approveOrganisation($(this).data('slug'), true, options); approveOrganisationRegistration($(this).data('slug'), true, options);
}); });
// Cancel a registration request // Cancel a registration request
el.find('.js-organisation-rejectRegistration').click(function(e) { el.find('.js-organisation-denyRegistration').click(function(e) {
e.preventDefault(); e.preventDefault();
approveOrganisation($(this).data('slug'), false, options); approveOrganisationRegistration($(this).data('slug'), false, options);
}); });
// Delete organisation button // Delete organisation button

View File

@@ -42,14 +42,6 @@ return [
'DELETE_YES' => 'Yes, delete organisation', 'DELETE_YES' => 'Yes, delete organisation',
'DELETION_SUCCESSFUL' => 'Successfully deleted organisation <strong>{{name}}</strong>', 'DELETION_SUCCESSFUL' => 'Successfully deleted organisation <strong>{{name}}</strong>',
'REGISTER' => 'Register organisation',
'REGISTRATION_SUCCESSFUL' => 'Successfully registered organisation <strong>{{name}}</strong>',
'CANCEL_REGISTRATION' => 'Cancel organisation registration',
'CANCEL_REGISTRATION_CONFIRM' => 'Are you sure you want to cancel the registration request for organisation <strong>{{name}}</strong>?',
'CANCEL_REGISTRATION_YES' => 'Yes, cancel organisation registration',
'CANCEL_REGISTRATION_SUCCESSFUL' => 'Successfully cancelled registration of organisation <strong>{{name}}</strong>',
'MEMBER_COUNT' => '# Members <sub>(excl admins)</sub>', 'MEMBER_COUNT' => '# Members <sub>(excl admins)</sub>',
'ADMIN_COUNT' => '# Admins', 'ADMIN_COUNT' => '# Admins',
@@ -74,13 +66,21 @@ return [
'SLUG' => [ 'SLUG' => [
'IN_USE' => 'Organisation slug <strong>{{slug}}</strong> is already in use.', 'IN_USE' => 'Organisation slug <strong>{{slug}}</strong> is already in use.',
], ],
'APPROVAL' => [ 'REGISTRATION' => [
'REGISTER' => 'Register organisation',
'SUCCESSFUL' => 'Successfully registered organisation <strong>{{name}}</strong>',
'CANCEL' => 'Cancel organisation registration',
'CANCEL_CONFIRM' => 'Are you sure you want to cancel the registration request for organisation <strong>{{name}}</strong>?',
'CANCEL_YES' => 'Yes, cancel organisation registration',
'CANCEL_SUCCESSFUL' => 'Successfully cancelled registration of organisation <strong>{{name}}</strong>',
'PENDING' => 'This organisation is pending approval!', 'PENDING' => 'This organisation is pending approval!',
'TOKEN_NOT_FOUND' => 'Approval token does not exist / Organisation is already approved/rejected.', 'TOKEN_NOT_FOUND' => 'Approval token does not exist / Organisation registration has already been approved/denied.',
'APPROVED' => 'You have successfully approved the organisation <strong>{{name}}</strong>.', 'APPROVED' => 'You have successfully approved the registration of organisation <strong>{{name}}</strong>.',
'REJECTED' => 'You have successfully rejected the organisation <strong>{{name}}</strong>.', 'DENIED' => 'You have successfully denied the registration of organisation <strong>{{name}}</strong>.',
'APPROVE' => 'Approve organisation', 'APPROVE' => 'Approve organisation registration',
'REJECT' => 'Reject organisation', 'DENY' => 'Deny organisation registration',
], ],
], ],
@@ -106,7 +106,7 @@ return [
'APPROVED' => 'Approved', 'APPROVED' => 'Approved',
'PENDING' => 'Pending', 'PENDING' => 'Pending',
'APPROVE' => 'Approve', 'APPROVE' => 'Approve',
'REJECT' => 'Reject', 'DENY' => 'Deny',
'VIEW_DELETED' => 'View deleted', 'VIEW_DELETED' => 'View deleted',
'DELETED' => 'Deleted', 'DELETED' => 'Deleted',

View File

@@ -14,16 +14,16 @@ use UserFrosting\Sprinkle\Core\Util\NoCache;
*/ */
$app->group('/organisations/registration', function () { $app->group('/organisations/registration', function () {
$this->get('/approve', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:approveToken'); $this->get('/approve', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:approveToken');
$this->get('/reject', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:rejectToken'); $this->get('/deny', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:denyToken');
})->add('authGuard')->add(new NoCache()); })->add('authGuard')->add(new NoCache());
$app->group('/api/organisations', function () { $app->group('/api/organisations', function () {
$this->post('/registeration', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:register'); $this->post('/registration', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:register');
})->add('authGuard')->add(new NoCache()); })->add('authGuard')->add(new NoCache());
$app->group('/api/organisations/o/{slug}/registration', function () { $app->group('/api/organisations/o/{slug}/registration', function () {
$this->put('/approve', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:approve'); $this->put('/approve', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:approve');
$this->put('/reject', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:reject'); $this->put('/deny', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:deny');
$this->delete('', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:cancel'); $this->delete('', 'UserFrosting\Sprinkle\Organisations\Controller\OrganisationRegistrationController:cancel');
})->add('authGuard')->add(new NoCache()); })->add('authGuard')->add(new NoCache());

View File

@@ -27,7 +27,7 @@ use UserFrosting\Sprinkle\Core\Mail\TwigMailMessage;
use UserFrosting\Sprinkle\Core\Mail\EmailRecipient; use UserFrosting\Sprinkle\Core\Mail\EmailRecipient;
/** /**
* Controller class for organisation registration-related requests, including registering, approving, rejecting, etc. * Controller class for organisation registration-related requests, including registering, approving, denying, etc.
* *
* @author Craig Williams (https://avsdev.uk) * @author Craig Williams (https://avsdev.uk)
*/ */
@@ -143,7 +143,7 @@ class OrganisationRegistrationController extends SimpleController
$this->sendApprovalEmail($currentUser, $organisation, $approval->getToken()); $this->sendApprovalEmail($currentUser, $organisation, $approval->getToken());
} }
$ms->addMessageTranslated('success', 'ORGANISATION.REGISTRATION_SUCCESSFUL', $data); $ms->addMessageTranslated('success', 'ORGANISATION.REGISTRATION.SUCCESSFUL', $data);
}); });
return $response->withJson([], 200); return $response->withJson([], 200);
@@ -217,7 +217,7 @@ class OrganisationRegistrationController extends SimpleController
/** @var \UserFrosting\Sprinkle\Core\Alert\AlertStream $ms */ /** @var \UserFrosting\Sprinkle\Core\Alert\AlertStream $ms */
$ms = $this->ci->alerts; $ms = $this->ci->alerts;
$ms->addMessageTranslated('success', 'ORGANISATION.CANCEL_REGISTRATION_SUCCESSFUL', [ $ms->addMessageTranslated('success', 'ORGANISATION.REGISTRATION.CANCEL_SUCCESSFUL', [
'name' => $organisationName, 'name' => $organisationName,
]); ]);
@@ -281,7 +281,7 @@ class OrganisationRegistrationController extends SimpleController
'user_id' => $currentUser->id, 'user_id' => $currentUser->id,
]); ]);
$ms->addMessageTranslated('success', 'ORGANISATION.APPROVAL.APPROVED', [ $ms->addMessageTranslated('success', 'ORGANISATION.REGISTRATION.APPROVED', [
'name' => $organisation->name 'name' => $organisation->name
]); ]);
@@ -348,7 +348,7 @@ class OrganisationRegistrationController extends SimpleController
$verification = $this->ci->repoOrganisationApproval->complete($data['token'], $currentUser, ['approved' => true]); $verification = $this->ci->repoOrganisationApproval->complete($data['token'], $currentUser, ['approved' => true]);
if (!$verification) { if (!$verification) {
$ms->addMessageTranslated('danger', 'ORGANISATION.APPROVAL.TOKEN_NOT_FOUND'); $ms->addMessageTranslated('danger', 'ORGANISATION.REGISTRATION.TOKEN_NOT_FOUND');
return $response->withRedirect($this->ci->router->pathFor('dashboard')); return $response->withRedirect($this->ci->router->pathFor('dashboard'));
} }
@@ -362,7 +362,7 @@ class OrganisationRegistrationController extends SimpleController
'user_id' => $currentUser->id, 'user_id' => $currentUser->id,
]); ]);
$ms->addMessageTranslated('success', 'ORGANISATION.APPROVAL.APPROVED', [ $ms->addMessageTranslated('success', 'ORGANISATION.REGISTRATION.APPROVED', [
'name' => $organisation->name 'name' => $organisation->name
]); ]);
@@ -371,7 +371,7 @@ class OrganisationRegistrationController extends SimpleController
} }
/** /**
* Rejects an organisation registration request. * Denies an organisation registration request.
* *
* Processes the request from the email verification link that was emailed to the organisation administrators, checking that: * Processes the request from the email verification link that was emailed to the organisation administrators, checking that:
* 1. The token provided matches an organisation in the database; * 1. The token provided matches an organisation in the database;
@@ -379,7 +379,7 @@ class OrganisationRegistrationController extends SimpleController
* This route requires authorization. * This route requires authorization.
* *
* AuthGuard: true * AuthGuard: true
* Route: /organisations/o/{slug}/reject * Route: /organisations/o/{slug}/deny
* Route Name: {none} * Route Name: {none}
* Request type: GET * Request type: GET
* *
@@ -387,7 +387,7 @@ class OrganisationRegistrationController extends SimpleController
* @param Response $response * @param Response $response
* @param array $args * @param array $args
*/ */
public function reject(Request $request, Response $response, $args) public function deny(Request $request, Response $response, $args)
{ {
/** @var \UserFrosting\Sprinkle\Core\Alert\AlertStream $ms */ /** @var \UserFrosting\Sprinkle\Core\Alert\AlertStream $ms */
$ms = $this->ci->alerts; $ms = $this->ci->alerts;
@@ -420,16 +420,16 @@ class OrganisationRegistrationController extends SimpleController
$requester = $classMapper->getClassMapping('user')::find($verification->requester_id); $requester = $classMapper->getClassMapping('user')::find($verification->requester_id);
$this->sendRejectedEmail($organisation, $requester); $this->sendDeniedEmail($organisation, $requester);
$organisation->delete(); $organisation->delete();
$this->ci->userActivityLogger->info("User {$currentUser->user_name} rejected the registration request for organisation {$organisation->name}.", [ $this->ci->userActivityLogger->info("User {$currentUser->user_name} denied the registration request for organisation {$organisation->name}.", [
'type' => 'organisation_rejected', 'type' => 'organisation_approval',
'user_id' => $currentUser->id, 'user_id' => $currentUser->id,
]); ]);
$ms->addMessageTranslated('success', 'ORGANISATION.APPROVAL.REJECTED', [ $ms->addMessageTranslated('success', 'ORGANISATION.REGISTRATION.DENIED', [
'name' => $organisation->name 'name' => $organisation->name
]); ]);
@@ -437,7 +437,7 @@ class OrganisationRegistrationController extends SimpleController
} }
/** /**
* Rejects an organisation registration request. * Denies an organisation registration request.
* *
* Processes the request from the email verification link that was emailed to the organisation administrators, checking that: * Processes the request from the email verification link that was emailed to the organisation administrators, checking that:
* 1. The token provided matches an organisation in the database; * 1. The token provided matches an organisation in the database;
@@ -445,7 +445,7 @@ class OrganisationRegistrationController extends SimpleController
* This route requires authorization. * This route requires authorization.
* *
* AuthGuard: true * AuthGuard: true
* Route: /organisations/o/{slug}/reject * Route: /organisations/o/{slug}/deny
* Route Name: {none} * Route Name: {none}
* Request type: GET * Request type: GET
* *
@@ -453,7 +453,7 @@ class OrganisationRegistrationController extends SimpleController
* @param Response $response * @param Response $response
* @param array $args * @param array $args
*/ */
public function rejectToken(Request $request, Response $response, $args) public function denyToken(Request $request, Response $response, $args)
{ {
/** @var \UserFrosting\Sprinkle\Core\Alert\AlertStream $ms */ /** @var \UserFrosting\Sprinkle\Core\Alert\AlertStream $ms */
$ms = $this->ci->alerts; $ms = $this->ci->alerts;
@@ -499,7 +499,7 @@ class OrganisationRegistrationController extends SimpleController
$verification = $this->ci->repoOrganisationApproval->complete($data['token'], $currentUser, ['approved' => false]); $verification = $this->ci->repoOrganisationApproval->complete($data['token'], $currentUser, ['approved' => false]);
if ($verification === false) { if ($verification === false) {
$ms->addMessageTranslated('danger', 'ORGANISATION.APPROVAL.TOKEN_NOT_FOUND'); $ms->addMessageTranslated('danger', 'ORGANISATION.REGISTRATION.TOKEN_NOT_FOUND');
return $response->withRedirect($dashboardPage); return $response->withRedirect($dashboardPage);
} }
@@ -507,14 +507,14 @@ class OrganisationRegistrationController extends SimpleController
$organisation = $classMapper->getClassMapping('organisation')::find($verification->organisation_id); $organisation = $classMapper->getClassMapping('organisation')::find($verification->organisation_id);
$requester = $classMapper->getClassMapping('user')::find($verification->requester_id); $requester = $classMapper->getClassMapping('user')::find($verification->requester_id);
$this->sendRejectedEmail($organisation, $requester); $this->sendDeniedEmail($organisation, $requester);
$this->ci->userActivityLogger->info("User {$currentUser->user_name} rejected the registration request for organisation {$organisation->name}.", [ $this->ci->userActivityLogger->info("User {$currentUser->user_name} denied the registration request for organisation {$organisation->name}.", [
'type' => 'organisation_rejected', 'type' => 'organisation_approval',
'user_id' => $currentUser->id, 'user_id' => $currentUser->id,
]); ]);
$ms->addMessageTranslated('success', 'ORGANISATION.APPROVAL.REJECTED', [ $ms->addMessageTranslated('success', 'ORGANISATION.REGISTRATION.DENIED', [
'name' => $organisation->name 'name' => $organisation->name
]); ]);
@@ -572,7 +572,7 @@ class OrganisationRegistrationController extends SimpleController
return $this->ci->view->render($response, 'modals/organisation.html.twig', [ return $this->ci->view->render($response, 'modals/organisation.html.twig', [
'organisation' => $organisation, 'organisation' => $organisation,
'form' => [ 'form' => [
'action' => 'api/organisations/registeration', 'action' => 'api/organisations/registration',
'method' => 'POST', 'method' => 'POST',
'fields' => $fields, 'fields' => $fields,
'submit_text' => $translator->translate('REGISTER'), 'submit_text' => $translator->translate('REGISTER'),
@@ -694,14 +694,14 @@ class OrganisationRegistrationController extends SimpleController
} }
/** /**
* Send rejected email for specified organisation. * Send denied email for specified organisation.
* *
* @param UserInterface $requester The user to send the rejection notice to * @param UserInterface $requester The user to send the denial notice to
* @param UserInterface $organisation The organisation to send the email for * @param UserInterface $organisation The organisation to send the email for
*/ */
protected function sendRejectedEmail(OrganisationInterface $organisation, UserInterface $requester) protected function sendDeniedEmail(OrganisationInterface $organisation, UserInterface $requester)
{ {
$message = new TwigMailMessage($this->ci->view, 'mail/organisation-approval-rejected.html.twig'); $message = new TwigMailMessage($this->ci->view, 'mail/organisation-approval-denied.html.twig');
$message->from($this->ci->config['address_book.admin']) $message->from($this->ci->config['address_book.admin'])
->addParams([ ->addParams([

View File

@@ -97,7 +97,7 @@ class BaseOrganisationApproval extends Model
} }
/** /**
* Get the user associated with this approval or rejection of this request. * Get the user associated with this approval or denial of this request.
* *
* @return \Illuminate\Database\Eloquent\Relations\belongsTo * @return \Illuminate\Database\Eloquent\Relations\belongsTo
*/ */

View File

@@ -95,9 +95,9 @@ class OrganisationPermissions extends BaseSeed
]), ]),
'approve_organisation' => new Permission([ 'approve_organisation' => new Permission([
'slug' => 'approve_organisation', 'slug' => 'approve_organisation',
'name' => 'Approve/Reject organisation', 'name' => 'Approve/Deny organisation registration',
'conditions' => 'always()', 'conditions' => 'always()',
'description' => 'Approve/Reject organisation registation request.', 'description' => 'Approve/Deny organisation registation request.',
]), ]),
'merge_organisations' => new Permission([ 'merge_organisations' => new Permission([
'slug' => 'merge_organisations', 'slug' => 'merge_organisations',

View File

@@ -39,7 +39,8 @@ class OrganisationApprovalRepository extends TokenRepository
$hash = hash($this->algorithm, $token); $hash = hash($this->algorithm, $token);
// Find an unexpired, incomplete token for the specified hash // Find an unexpired, incomplete token for the specified hash
$model = $this->classMapper->getClassMapping($this->modelIdentifier)::where('hash', $hash) $model = $this->classMapper->getClassMapping($this->modelIdentifier)::query()
->where('hash', $hash)
->where('completed', false) ->where('completed', false)
->where(function($query) { ->where(function($query) {
return $query->where('expires_at', '>', Carbon::now())->orWhereNull('expires_at'); return $query->where('expires_at', '>', Carbon::now())->orWhereNull('expires_at');
@@ -80,7 +81,8 @@ class OrganisationApprovalRepository extends TokenRepository
*/ */
public function completeWithoutToken(OrganisationInterface $organisation, UserInterface $approver, $params = []) public function completeWithoutToken(OrganisationInterface $organisation, UserInterface $approver, $params = [])
{ {
$model = $this->classMapper->getClassMapping($this->modelIdentifier)::where('organisation_id', $organisation->id) $model = $this->classMapper->getClassMapping($this->modelIdentifier)::query()
->where('organisation_id', $organisation->id)
->where('completed', false) ->where('completed', false)
->first(); ->first();
@@ -132,14 +134,13 @@ class OrganisationApprovalRepository extends TokenRepository
$hash = hash($this->algorithm, $model->getToken()); $hash = hash($this->algorithm, $model->getToken());
$model->fill([ $model->fill([
'organisation_id' => $organisation->id,
'requester_id' => $requester->id,
'hash' => $hash, 'hash' => $hash,
'completed' => false, 'completed' => false,
'expires_at' => ($timeout >= 0 ? $expiresAt : null), 'expires_at' => ($timeout >= 0 ? $expiresAt : null),
]); ]);
$model->organisation_id = $organisation->id;
$model->requester_id = $requester->id;
$model->save(); $model->save();
return $model; return $model;
@@ -150,7 +151,8 @@ class OrganisationApprovalRepository extends TokenRepository
*/ */
public function exists(OrganisationInterface $organisation, UserInterface $requester = null, $token = null) public function exists(OrganisationInterface $organisation, UserInterface $requester = null, $token = null)
{ {
$model = $this->classMapper->getClassMapping($this->modelIdentifier)::where('organisation_id', $organisation->id) $model = $this->classMapper->getClassMapping($this->modelIdentifier)::query()
->where('organisation_id', $organisation->id)
->where('completed', false) ->where('completed', false)
->where(function($query) { ->where(function($query) {
return $query->where('expires_at', '>', Carbon::now())->orWhereNull('expires_at'); return $query->where('expires_at', '>', Carbon::now())->orWhereNull('expires_at');
@@ -174,7 +176,8 @@ class OrganisationApprovalRepository extends TokenRepository
*/ */
protected function removeExisting(OrganisationInterface $organisation, UserInterface $requester = null) protected function removeExisting(OrganisationInterface $organisation, UserInterface $requester = null)
{ {
$model = $this->classMapper->getClassMapping($this->modelIdentifier)::where('organisation_id', $organisation->id); $model = $this->classMapper->getClassMapping($this->modelIdentifier)::query()
->where('organisation_id', $organisation->id);
if ($requester) { if ($requester) {
$model->where('requester_id', $requester->id); $model->where('requester_id', $requester->id);

View File

@@ -1,5 +1,5 @@
{% block subject %} {% block subject %}
{{site.title}} - organisation registration rejected {{site.title}} - organisation registration denied
{% endblock %} {% endblock %}
{% block body %} {% block body %}
@@ -7,7 +7,7 @@
Dear {{recipient.first_name}}, Dear {{recipient.first_name}},
</p> </p>
<p> <p>
The organisation registration request you submitted at {{site.title}} ({{site.uri.public}}) has been rejected. The organisation registration request you submitted at {{site.title}} ({{site.uri.public}}) has been denied.
</p> </p>
<p> <p>
With regards,<br> With regards,<br>

View File

@@ -26,17 +26,17 @@
</p> </p>
<p> <p>
You may verify or reject this organisation via the control dashboard (<a href="{{site.uri.public}}/organisations">{{site.uri.public}}/organisations</a>). You may approve or deny this organisation via the control dashboard (<a href="{{site.uri.public}}/organisations">{{site.uri.public}}/organisations</a>).
</p> </p>
<p> <p>
To verify this organisation immediately you may do so by visiting: <a href="{{site.uri.public}}/organisations/registration/approve?token={{token}}">{{site.uri.public}}/organisations/approve?token={{token}}</a>. To approve this organisation immediately you may do so by visiting: <a href="{{site.uri.public}}/organisations/registration/approve?token={{token}}">{{site.uri.public}}/organisations/approve?token={{token}}</a>.
</p> </p>
<p> <p>
To reject this organisation immediately you may do so by visiting: <a href="{{site.uri.public}}/organisations/registration/reject?token={{token}}">{{site.uri.public}}/organisations/reject?token={{token}}</a>. To deny this organisation immediately you may do so by visiting: <a href="{{site.uri.public}}/organisations/registration/deny?token={{token}}">{{site.uri.public}}/organisations/deny?token={{token}}</a>.
</p> </p>
{% if approval_expiration %} {% if approval_expiration %}
<p> <p>
The approcal period for this organisation will expire in {{approval_expiration}} at which point the organisation will be automatically rejected. The approcal period for this organisation will expire in {{approval_expiration}} at which point the organisation registration will be automatically denied.
</p> </p>
{% endif %} {% endif %}
<p> <p>

View File

@@ -1,16 +1,16 @@
{% extends "modals/modal.html.twig" %} {% extends "modals/modal.html.twig" %}
{% block modal_title %}{{translate("ORGANISATION.CANCEL_REGISTRATION")}}{% endblock %} {% block modal_title %}{{translate("ORGANISATION.REGISTRATION.CANCEL")}}{% endblock %}
{% block modal_body %} {% block modal_body %}
<form class="js-form" method="delete" action="{{site.uri.public}}/{{form.action}}"> <form class="js-form" method="delete" action="{{site.uri.public}}/{{form.action}}">
{% include "forms/csrf.html.twig" %} {% include "forms/csrf.html.twig" %}
<div class="js-form-alerts"> <div class="js-form-alerts">
</div> </div>
<h4>{{translate("ORGANISATION.CANCEL_REGISTRATION_CONFIRM", {name: organisation.name})}}{% if delete_hard %}<br><small>{{translate("DELETE_CANNOT_UNDONE")}}</small>{% endif %}</h4> <h4>{{translate("ORGANISATION.REGISTRATION.CANCEL_CONFIRM", {name: organisation.name})}}{% if delete_hard %}<br><small>{{translate("ACTION_CANNOT_UNDONE")}}</small>{% endif %}</h4>
<br> <br>
<div class="btn-group-action"> <div class="btn-group-action">
<button type="submit" class="btn btn-danger btn-lg btn-block">{{translate("ORGANISATION.CANCEL_REGISTRATION_YES")}}</button> <button type="submit" class="btn btn-danger btn-lg btn-block">{{translate("ORGANISATION.REGISTRATION.CANCEL_YES")}}</button>
<button type="button" class="btn btn-default btn-lg btn-block" data-dismiss="modal">{{translate("CANCEL")}}</button> <button type="button" class="btn btn-default btn-lg btn-block" data-dismiss="modal">{{translate("CANCEL")}}</button>
</div> </div>
</form> </form>

View File

@@ -46,8 +46,8 @@
</a> </a>
</li> </li>
<li> <li>
<a href="#" class="js-organisation-rejectRegistration" data-slug="{{organisation.slug}}"> <a href="#" class="js-organisation-denyRegistration" data-slug="{{organisation.slug}}">
<i class="fas fa-thumbs-down fa-fw"></i> {{translate('REJECT')}} <i class="fas fa-thumbs-down fa-fw"></i> {{translate('DENY')}}
</a> </a>
</li> </li>
{% endif %} {% endif %}
@@ -75,12 +75,12 @@
{% if organisation.flag_approved != 1 %} {% if organisation.flag_approved != 1 %}
<hr> <hr>
<h4 class="text-danger text-center"> <h4 class="text-danger text-center">
{{ translate('ORGANISATION.APPROVAL.PENDING') }} {{ translate('ORGANISATION.REGISTRATION.PENDING') }}
</h4> </h4>
<div class="text-center"> <div class="text-center">
{% if checkAccess('approve_organisation') %} {% if checkAccess('approve_organisation') %}
<button type="button" class="btn btn-success js-organisation-approveRegistration" data-slug="{{organisation.slug}}">{{translate('APPROVE')}}</button> <button type="button" class="btn btn-success js-organisation-approveRegistration" data-slug="{{organisation.slug}}">{{translate('APPROVE')}}</button>
<button type="button" class="btn btn-danger js-organisation-rejectRegistration" data-slug="{{organisation.slug}}">{{translate('REJECT')}}</button> <button type="button" class="btn btn-danger js-organisation-denyRegistration" data-slug="{{organisation.slug}}">{{translate('DENY')}}</button>
{% elseif isOrganisationAdmin(organisation) %} {% elseif isOrganisationAdmin(organisation) %}
<button type="button" class="btn btn-danger js-organisation-cancelRegistration" data-slug="{{organisation.slug}}">{{translate('CANCEL_REGISTRATION')}}</button> <button type="button" class="btn btn-danger js-organisation-cancelRegistration" data-slug="{{organisation.slug}}">{{translate('CANCEL_REGISTRATION')}}</button>
{% endif %} {% endif %}

View File

@@ -36,7 +36,7 @@
</button> </button>
{% elseif checkAccess('register_organisation') %} {% elseif checkAccess('register_organisation') %}
<button type="button" class="btn btn-success js-organisation-register"> <button type="button" class="btn btn-success js-organisation-register">
<i class="fas fa-plus-square"></i> {{translate("ORGANISATION.REGISTER")}} <i class="fas fa-plus-square"></i> {{translate("ORGANISATION.REGISTRATION.REGISTER")}}
</button> </button>
{% endif %} {% endif %}
</div> </div>

View File

@@ -116,12 +116,12 @@
{{#ifx row.flag_approved '==' 0 }} {{#ifx row.flag_approved '==' 0 }}
<li> <li>
<a href="#" data-slug="{{row.slug}}" class="js-organisation-approveRegistration"> <a href="#" data-slug="{{row.slug}}" class="js-organisation-approveRegistration">
<i class="fas fa-thumbs-up"></i> {% endverbatim %}{{translate("ORGANISATION.APPROVAL.APPROVE")}}{% verbatim %} <i class="fas fa-thumbs-up"></i> {% endverbatim %}{{translate("ORGANISATION.REGISTRATION.APPROVE")}}{% verbatim %}
</a> </a>
</li> </li>
<li> <li>
<a href="#" data-slug="{{row.slug}}" class="js-organisation-rejectRegistration"> <a href="#" data-slug="{{row.slug}}" class="js-organisation-denyRegistration">
<i class="fas fa-thumbs-down"></i> {% endverbatim %}{{translate("ORGANISATION.APPROVAL.REJECT")}}{% verbatim %} <i class="fas fa-thumbs-down"></i> {% endverbatim %}{{translate("ORGANISATION.REGISTRATION.DENY")}}{% verbatim %}
</a> </a>
</li> </li>
{{/ifx }} {{/ifx }}