core&ui: new domain_join logic

This commit is contained in:
undefined committed 2025-03-20 17:55:10 +00:00
1 parent 706a9a0928
commit 7fd01715bc
9 files changed
+81 -39

No files matched your search

+17 -2
View File
@@ -5,12 +5,25 @@
<div class="section">
<div class="section__header">
<h1 class="section__title">
{{ _('Join {0}').format(handler.domain['name']) }}
{% if joinSettings %}
{{ _('Join {0}').format(domainInfo['name']) }}
{% else %}
{{ _('You are invited to join {0}').format(domainInfo['name']) }}
{% endif %}
</h1>
</div>
<div class="section__body typo">
<p>{{ _('By clicking the button, you will become a member of the domain {0}.').format(handler.domain['name']) }}</p>
<p>{{ _('By clicking the button, you will become a member of the domain {0}.').format(domainInfo['name']) }}</p>
</div>
<div class="section__body typo">
<p>{{ _('The domain owner:') }}</p>
{{ user.render_inline(domainInfo['owner']) }}
</div>
{% if domainInfo['bulletin'] %}
<div class="section__body typo">
{{ domainInfo['bulletin']|markdown }}
</div>
{% endif %}
<div class="section__body typo">
<form method="post">
{% if joinSettings['method'] == model.domain.JOIN_METHOD_CODE %}
@@ -24,6 +37,8 @@
autofocus:true
}) }}
{% endif %}
<input type="hidden" name="target" value="{{ target }}">
<input type="hidden" name="redirect" value="{{ redirect }}">
<button type="submit" class="primary rounded button">{{ _('Join') }}</button>
</form>
</div>
@@ -25,14 +25,6 @@
<div class="section__header">
<h1 class="section__title">{{ _('Settings') }}</h1>
</div>
{% if rolesWithText.length == 1 %}
<div class="section__body typo">
<blockquote class="warn">
<p>{{ _("The 'default' role applies to ALL REGISTERED USER.")|safe }}</p>
<p>{{ _("You may want to create a new role in 'Manage Role' page.")|safe }}</p>
</blockquote>
</div>
{% endif %}
<div class="section__body">
<form method="POST">
{{ form.form_select({
@@ -5,14 +5,6 @@
<div class="section__header">
<h1 class="section__title">{{ _('{0}: Permissions').format(domain.name) }}</h1>
</div>
{% if roles.length == 3 %}
<div class="section__body typo">
<blockquote class="warn">
<p>{{ _("The 'default' role applies to ALL REGISTERED USER.")|safe }}</p>
<p>{{ _("You may want to create a new role in 'Manage Role' page.")|safe }}</p>
</blockquote>
</div>
{% endif %}
<div class="section__body no-padding domain-users">
<table class="data-table">
<colgroup>
@@ -100,7 +100,8 @@
{{ rudoc._id }}
</td>
<td class="col--user">
{{ user.render_inline(udict[rudoc._id], badge=false) }}
{{ user.render_inline(rudoc, badge=false) }}
{% if not joined[rudoc._id] %}<span class="text-orange">({{ _('Not joined yet') }})</span>{% endif %}
</td>
<td class="col--role">
{{ form.select({
@@ -17,8 +17,10 @@
{% if not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<li class="menu__item"><a class="menu__link" href="javascript:showSignInDialog();">
<span class="icon icon-add"></span> {{ _('Login to Create a Discussion') }}</a></li>
{% elif not handler.user._dudoc.join %}
<li class="menu__item"><a class="menu__link" href="javascript:joinDomain();">
<span class="icon icon-add"></span> {{ _('Join Domain to Create a Discussion') }}</a></li>
{% else %}
<li class="menu__item"><a class="menu__link disabled" href="javascript:;">
<span class="icon icon-add"></span> {{ _('No Permission to Create a Discussion') }}</a></li>
{% endif %}
{% endif %}
@@ -46,6 +48,10 @@
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'problem_submit' %} active{% endif %}" href="javascript:showSignInDialog();">
<span class="icon icon-send"></span> {{ _('Login to Submit') }}
</a></li>
{% elif not handler.user._dudoc.join %}
<li class="menu__item scratchpad--hide"><a class="menu__link disabled{% if page_name == 'problem_submit' %} active{% endif %}" href="javascript:joinDomain();">
<span class="icon icon-send"></span> {{ _('Join Domain to Submit') }}
</a></li>
{% else %}
<li class="menu__item scratchpad--hide"><a class="menu__link disabled{% if page_name == 'problem_submit' %} active{% endif %}" href="javascript:;">
<span class="icon icon-send"></span> {{ _('No Permission to Submit') }}