Commit a9fec364c16f45e44f9f4b3e4a0698bf5803db58

Authored by Gust
1 parent b3108e39

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>
src/colab/local_settings-dev.py
... ... @@ -27,16 +27,21 @@ CONVERSEJS_BOSH_SERVICE_URL = &#39;http://localhost:5280/http-bind&#39;
27 27  
28 28 DATABASES['default']['PASSWORD'] = 'colab'
29 29 DATABASES['default']['HOST'] = 'localhost'
  30 +
  31 +TRAC_ENABLED = False
  32 +
30 33 if TRAC_ENABLED:
31 34 DATABASES['trac']['PASSWORD'] = 'colab'
32 35 DATABASES['trac']['HOST'] = 'localhost'
33 36  
34 37 HAYSTACK_CONNECTIONS['default']['URL'] = 'http://localhost:8983/solr/'
35 38  
  39 +COLAB_TRAC_URL = 'http://localhost:5000/trac/'
36 40 COLAB_CI_URL = 'http://localhost:8080/ci/'
37 41 COLAB_GITLAB_URL = 'http://localhost:8090/gitlab/'
38 42 COLAB_REDMINE_URL = 'http://localhost:9080/redmine/'
39 43  
  44 +
40 45 CONVERSEJS_ENABLED = False
41 46  
42 47 DIAZO_THEME = SITE_URL
... ...
src/proxy/search_indexes.py
... ... @@ -9,7 +9,7 @@ from haystack import indexes
9 9 from haystack.utils import log as logging
10 10  
11 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 15 logger = logging.getLogger('haystack')
... ...
src/proxy/templatetags/__init__.py 0 → 100644
src/proxy/templatetags/proxy.py 0 → 100644
... ... @@ -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 13 \ No newline at end of file
... ...
src/search/templates/search/includes/search_filters.html
1   -{% load i18n superarchives %}
  1 +{% load i18n superarchives proxy %}
2 2  
3 3 {% if filters %}
4 4 <ul class="unstyled-list">
... ...
src/super_archives/templatetags/superarchives.py
... ... @@ -32,8 +32,4 @@ def pop_from_get(context, **kwargs):
32 32 context['request'].META['PATH_INFO'],
33 33 context['request'].META['QUERY_STRING'],
34 34 **kwargs
35   - )
36   -
37   -@register.assignment_tag
38   -def is_trac_enable():
39   - return settings.TRAC_ENABLED
40 35 \ No newline at end of file
  36 + )
41 37 \ No newline at end of file
... ...
src/templates/base.html
1 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 6 <html>
4 7 <head>
5 8 {% block head %}
... ... @@ -57,34 +60,41 @@
57 60 </button>
58 61 <a class="navbar-brand" href="/"><img alt="Colab" src="/static/img/logo_nav.png"></a>
59 62 </div>
60   -
61 63 <div class="collapse navbar-collapse navbar-main">
62 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 72 <li>
67 73 <a href="{% url 'thread_list' %}">{% trans "Groups" %}</a>
68 74 </li>
69 75 <li>
70 76 <a href="{% url "feedzilla_index" %}">{% trans "Blogs" %}</a>
71 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 98 <li class="hidden-lg hidden-md">
89 99 <a href="{% url 'haystack_search' %}?q=">{% trans "Search" %}</a>
90 100 </li>
... ...