Skip to content
Snippets Groups Projects
Commit 840c3c06 authored by Eirik Morland's avatar Eirik Morland
Browse files

Issue #3440493 by eiriksm: Allow the invite part for regular users as well

parent d0cd0572
No related branches found
No related tags found
1 merge request!45Redo the template and naming
Pipeline #144939 passed with warnings
......@@ -37,7 +37,7 @@ final class MembersController extends ControllerBase {
$build['invite'] = [
'#theme' => 'violinist_teams_invite_link_wrapper',
'#link_element' => [
'#theme' => 'violinist_teams_invite_link_or_access_notice',
'#theme' => 'violinist_teams_invite_link',
'#link_href' => Url::fromRoute('violinist_teams.team_members_invite', ['team' => $team->id()])->toString(),
'#invite_access' => $team->isAdmin($this->currentUser),
],
......
{% if access %}
<a href="{{ link }}"
class="btn use-ajax flex items-center justify-center px-4 py-2 text-sm font-medium" data-dialog-type="modal">
<svg xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5 mr-2 -ml-1" viewBox="0 0 20 20" fill="currentColor"
aria-hidden="true">
<path
d="M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"/>
</svg>
Invite users via link
</a>
{% else %}
<button disabled="disabled"
class="w-full opacity-50 btn hover:bg-gray-400 btn bg-gray-400 flex items-center justify-center px-4 py-2 text-sm font-medium cursor-not-allowed">
<svg xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5 mr-2 -ml-1" viewBox="0 0 20 20" fill="currentColor"
aria-hidden="true">
<path
d="M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"/>
</svg>
Invite users via link
</button>
<p>
<span class="text-red-900">You don't have permission to invite users. Please contact an admin of the team.</span>
</p>
{% endif %}
<a href="{{ link_href }}"
class="btn invite-link use-ajax flex items-center justify-center px-4 py-2 text-sm font-medium" data-dialog-type="modal">
<svg xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5 mr-2 -ml-1" viewBox="0 0 20 20" fill="currentColor"
aria-hidden="true">
<path
d="M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"/>
</svg>
Invite users via link
</a>
......@@ -19,10 +19,9 @@ function violinist_teams_theme($existing, $type, $theme, $path) {
'link_element' => '',
],
],
'violinist_teams_invite_link_or_access_notice' => [
'violinist_teams_invite_link' => [
'variables' => [
'link_href' => '',
'invite_access' => FALSE,
],
],
'violinist_teams_invite_link_textfield' => [
......
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