Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
5b010af3
Commit
5b010af3
authored
Oct 24, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide registration links if it is not enabled (issue #131)
parent
f94a9e93
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
0 deletions
+10
-0
weblate/html/base.html
weblate/html/base.html
+2
-0
weblate/html/registration/login.html
weblate/html/registration/login.html
+2
-0
weblate/settings_example.py
weblate/settings_example.py
+1
-0
weblate/trans/context_processors.py
weblate/trans/context_processors.py
+5
-0
No files found.
weblate/html/base.html
View file @
5b010af3
...
...
@@ -45,7 +45,9 @@
<li><a
href=
"{% url 'profile' %}"
>
{% blocktrans with user.get_full_name as name %}Logged in as {{ name }}{% endblocktrans %}
</a></li>
<li><a
href=
"{% url 'auth_logout' %}"
>
{% trans "Logout" %}
</a></li>
{% else %}
{% if registration_open %}
<li><a
href=
"{% url 'weblate_register' %}"
>
{% trans "Register" %}
</a></li>
{% endif %}
<li><a
href=
"{% url 'auth_login' %}?next={{ current_url }}"
>
{% trans "Login" %}
</a></li>
{% endif %}
</ul>
...
...
weblate/html/registration/login.html
View file @
5b010af3
...
...
@@ -31,10 +31,12 @@
<input
type=
"hidden"
name=
"next"
value=
"{{ next }}"
/>
</form>
{% if registration_open %}
<p>
{% url 'registration.views.register' as register_url %}
{% blocktrans %}Do not have an account yet? You can
<a
href=
"{{ register_url }}"
>
register
</a>
.{% endblocktrans %}
</p>
{% endif %}
<p>
{% url 'auth_password_reset' as reset_url %}
...
...
weblate/settings_example.py
View file @
5b010af3
...
...
@@ -194,6 +194,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'weblate.trans.context_processors.date'
,
'weblate.trans.context_processors.url'
,
'weblate.trans.context_processors.mt'
,
'weblate.trans.context_processors.registration'
,
)
if
DEBUG
:
...
...
weblate/trans/context_processors.py
View file @
5b010af3
...
...
@@ -45,3 +45,8 @@ def mt(request):
'apertium_api_key'
:
settings
.
MT_APERTIUM_KEY
,
'microsoft_api_key'
:
settings
.
MT_MICROSOFT_KEY
,
}
def
registration
(
request
):
return
{
'registration_open'
:
getattr
(
settings
,
'REGISTRATION_OPEN'
,
True
),
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment