mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
Stripping www from blurblogs.
This commit is contained in:
parent
144470feb4
commit
fbb908174a
3 changed files with 5 additions and 4 deletions
|
@ -26,7 +26,6 @@
|
|||
{{ signup_form.password }}
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="NB-signup-optional">Optional</div>
|
||||
{{ signup_form.email.label_tag }}
|
||||
{{ signup_form.email }}
|
||||
</div>
|
||||
|
|
|
@ -103,13 +103,13 @@
|
|||
Blurblogs
|
||||
</div>
|
||||
</a>
|
||||
<a class="NB-header-tab NB-following-tab {% if current_tab == "global" %}NB-active{% endif %}" href="//popular.global.{% current_domain %}">
|
||||
<a class="NB-header-tab NB-following-tab {% if current_tab == "global" %}NB-active{% endif %}" href="//popular.global.{% current_domain strip_www=True %}">
|
||||
<div class="NB-tab-inner">
|
||||
<span class="NB-icon"></span>
|
||||
Global
|
||||
</div>
|
||||
</a>
|
||||
<a class="NB-header-tab NB-trending-tab {% if current_tab == "popular" %}NB-active{% endif %}" href="//popular.{% current_domain %}">
|
||||
<a class="NB-header-tab NB-trending-tab {% if current_tab == "popular" %}NB-active{% endif %}" href="//popular.{% current_domain strip_www=True %}">
|
||||
<div class="NB-tab-inner">
|
||||
<span class="NB-icon"></span>
|
||||
Popular
|
||||
|
|
|
@ -11,11 +11,13 @@ from utils.user_functions import get_user
|
|||
register = template.Library()
|
||||
|
||||
@register.simple_tag
|
||||
def current_domain(dev=False):
|
||||
def current_domain(dev=False, strip_www=False):
|
||||
current_site = Site.objects.get_current()
|
||||
domain = current_site and current_site.domain
|
||||
if dev and settings.SERVER_NAME in ["dev"] and domain:
|
||||
domain = domain.replace("www", "dev")
|
||||
if strip_www:
|
||||
domain = domain.replace("www.", "")
|
||||
return domain
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue