Commit a9fec364c16f45e44f9f4b3e4a0698bf5803db58
1 parent
b3108e39
Exists in
master
and in
39 other branches
Adding template tag to check if trac is enable
- Removed trac links from home Signed-off-by: Gustava Jaruga <darksshades@gmail.com> Signed-off-by: Matheus Faria <matheus.sousa.faria@gmail.com>
Showing
7 changed files
with
51 additions
and
28 deletions
Show diff stats
src/colab/local_settings-dev.py
@@ -27,16 +27,21 @@ CONVERSEJS_BOSH_SERVICE_URL = 'http://localhost:5280/http-bind' | @@ -27,16 +27,21 @@ CONVERSEJS_BOSH_SERVICE_URL = 'http://localhost:5280/http-bind' | ||
27 | 27 | ||
28 | DATABASES['default']['PASSWORD'] = 'colab' | 28 | DATABASES['default']['PASSWORD'] = 'colab' |
29 | DATABASES['default']['HOST'] = 'localhost' | 29 | DATABASES['default']['HOST'] = 'localhost' |
30 | + | ||
31 | +TRAC_ENABLED = False | ||
32 | + | ||
30 | if TRAC_ENABLED: | 33 | if TRAC_ENABLED: |
31 | DATABASES['trac']['PASSWORD'] = 'colab' | 34 | DATABASES['trac']['PASSWORD'] = 'colab' |
32 | DATABASES['trac']['HOST'] = 'localhost' | 35 | DATABASES['trac']['HOST'] = 'localhost' |
33 | 36 | ||
34 | HAYSTACK_CONNECTIONS['default']['URL'] = 'http://localhost:8983/solr/' | 37 | HAYSTACK_CONNECTIONS['default']['URL'] = 'http://localhost:8983/solr/' |
35 | 38 | ||
39 | +COLAB_TRAC_URL = 'http://localhost:5000/trac/' | ||
36 | COLAB_CI_URL = 'http://localhost:8080/ci/' | 40 | COLAB_CI_URL = 'http://localhost:8080/ci/' |
37 | COLAB_GITLAB_URL = 'http://localhost:8090/gitlab/' | 41 | COLAB_GITLAB_URL = 'http://localhost:8090/gitlab/' |
38 | COLAB_REDMINE_URL = 'http://localhost:9080/redmine/' | 42 | COLAB_REDMINE_URL = 'http://localhost:9080/redmine/' |
39 | 43 | ||
44 | + | ||
40 | CONVERSEJS_ENABLED = False | 45 | CONVERSEJS_ENABLED = False |
41 | 46 | ||
42 | DIAZO_THEME = SITE_URL | 47 | DIAZO_THEME = SITE_URL |
src/proxy/search_indexes.py
@@ -9,7 +9,7 @@ from haystack import indexes | @@ -9,7 +9,7 @@ from haystack import indexes | ||
9 | from haystack.utils import log as logging | 9 | from haystack.utils import log as logging |
10 | 10 | ||
11 | from search.base_indexes import BaseIndex | 11 | from search.base_indexes import BaseIndex |
12 | -from proxy.models import Attachment, Ticket, Wiki, Revision | 12 | +from .models import Attachment, Ticket, Wiki, Revision |
13 | 13 | ||
14 | 14 | ||
15 | logger = logging.getLogger('haystack') | 15 | logger = logging.getLogger('haystack') |
@@ -0,0 +1,12 @@ | @@ -0,0 +1,12 @@ | ||
1 | +from django import template | ||
2 | + | ||
3 | +from super_archives.utils import url | ||
4 | +from django.conf import settings | ||
5 | + | ||
6 | + | ||
7 | +register = template.Library() | ||
8 | +TEMPLATE_PATH = 'proxy/tags/' | ||
9 | + | ||
10 | +@register.assignment_tag | ||
11 | +def is_trac_enable(): | ||
12 | + return settings.TRAC_ENABLED | ||
0 | \ No newline at end of file | 13 | \ No newline at end of file |
src/search/templates/search/includes/search_filters.html
src/super_archives/templatetags/superarchives.py
@@ -32,8 +32,4 @@ def pop_from_get(context, **kwargs): | @@ -32,8 +32,4 @@ def pop_from_get(context, **kwargs): | ||
32 | context['request'].META['PATH_INFO'], | 32 | context['request'].META['PATH_INFO'], |
33 | context['request'].META['QUERY_STRING'], | 33 | context['request'].META['QUERY_STRING'], |
34 | **kwargs | 34 | **kwargs |
35 | - ) | ||
36 | - | ||
37 | -@register.assignment_tag | ||
38 | -def is_trac_enable(): | ||
39 | - return settings.TRAC_ENABLED | ||
40 | \ No newline at end of file | 35 | \ No newline at end of file |
36 | + ) | ||
41 | \ No newline at end of file | 37 | \ No newline at end of file |
src/templates/base.html
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | -{% load i18n browserid conversejs gravatar %} | 2 | +{% load i18n browserid conversejs gravatar proxy %} |
3 | + | ||
4 | +{% is_trac_enable as is_trac %} | ||
5 | + | ||
3 | <html> | 6 | <html> |
4 | <head> | 7 | <head> |
5 | {% block head %} | 8 | {% block head %} |
@@ -57,34 +60,41 @@ | @@ -57,34 +60,41 @@ | ||
57 | </button> | 60 | </button> |
58 | <a class="navbar-brand" href="/"><img alt="Colab" src="/static/img/logo_nav.png"></a> | 61 | <a class="navbar-brand" href="/"><img alt="Colab" src="/static/img/logo_nav.png"></a> |
59 | </div> | 62 | </div> |
60 | - | ||
61 | <div class="collapse navbar-collapse navbar-main"> | 63 | <div class="collapse navbar-collapse navbar-main"> |
62 | <ul class="nav navbar-nav"> | 64 | <ul class="nav navbar-nav"> |
63 | - <li> | ||
64 | - <a href="/timeline">{% trans "Timeline" %}</a></li> | ||
65 | - </li> | 65 | + |
66 | + {% if is_trac %} | ||
67 | + <li> | ||
68 | + <a href="/timeline">{% trans "Timeline" %}</a></li> | ||
69 | + </li> | ||
70 | + {% endif %} | ||
71 | + | ||
66 | <li> | 72 | <li> |
67 | <a href="{% url 'thread_list' %}">{% trans "Groups" %}</a> | 73 | <a href="{% url 'thread_list' %}">{% trans "Groups" %}</a> |
68 | </li> | 74 | </li> |
69 | <li> | 75 | <li> |
70 | <a href="{% url "feedzilla_index" %}">{% trans "Blogs" %}</a> | 76 | <a href="{% url "feedzilla_index" %}">{% trans "Blogs" %}</a> |
71 | </li> | 77 | </li> |
72 | - <li class="dropdown"> | ||
73 | - <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Contribute" %} <b class="caret"></b></a> | ||
74 | - <ul class="dropdown-menu"> | ||
75 | - <li><a href="/wiki">Wiki</a></li> | ||
76 | - {% if user.is_active %} | ||
77 | - <li><a href="/wiki/WikiNewPage">{% trans "New Wiki Page" %}</a></li> | ||
78 | - {% endif %} | ||
79 | - <li><a href="/report">{% trans "View Tickets" %}</a></li> | ||
80 | - {% if user.is_active %} | ||
81 | - <li><a href="/newticket">{% trans "New Ticket" %}</a></li> | ||
82 | - {% endif %} | ||
83 | - <li><a href="/roadmap">{% trans "Roadmap" %}</a></li> | ||
84 | - <li><a href="/browser">{% trans "Browse Source" %}</a></li> | ||
85 | - <li><a href="/ci">{% trans "Continuous Integration" %}</a></li> | ||
86 | - </ul> | ||
87 | - </li> | 78 | + |
79 | + {% if is_trac %} | ||
80 | + <li class="dropdown"> | ||
81 | + <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Contribute" %} <b class="caret"></b></a> | ||
82 | + <ul class="dropdown-menu"> | ||
83 | + <li><a href="/wiki">Wiki</a></li> | ||
84 | + {% if user.is_active %} | ||
85 | + <li><a href="/wiki/WikiNewPage">{% trans "New Wiki Page" %}</a></li> | ||
86 | + {% endif %} | ||
87 | + <li><a href="/report">{% trans "View Tickets" %}</a></li> | ||
88 | + {% if user.is_active %} | ||
89 | + <li><a href="/newticket">{% trans "New Ticket" %}</a></li> | ||
90 | + {% endif %} | ||
91 | + <li><a href="/roadmap">{% trans "Roadmap" %}</a></li> | ||
92 | + <li><a href="/browser">{% trans "Browse Source" %}</a></li> | ||
93 | + <li><a href="/ci">{% trans "Continuous Integration" %}</a></li> | ||
94 | + </ul> | ||
95 | + </li> | ||
96 | + {% endif %} | ||
97 | + | ||
88 | <li class="hidden-lg hidden-md"> | 98 | <li class="hidden-lg hidden-md"> |
89 | <a href="{% url 'haystack_search' %}?q=">{% trans "Search" %}</a> | 99 | <a href="{% url 'haystack_search' %}?q=">{% trans "Search" %}</a> |
90 | </li> | 100 | </li> |