Commit 711f9da1b523e48f35ef887b40b48e8062491f5c

Authored by Luan
1 parent 50b80dba

Adding open-data page

src/colab/urls.py
... ... @@ -12,6 +12,8 @@ admin.autodiscover()
12 12  
13 13 urlpatterns = patterns('',
14 14 url(r'^$', 'home.views.index', name='home'),
  15 + url(r'open-data/$', TemplateView.as_view(template_name='open-data.html'),
  16 + name='opendata'),
15 17  
16 18 url(r'^search/', include('search.urls')),
17 19 url(r'^archives/', include('super_archives.urls')),
... ...
src/templates/base.html
... ... @@ -164,16 +164,17 @@
164 164 <div class="row">&nbsp;</div>
165 165  
166 166 {% block footer %}
167   - <p class="col-lg-12 text-center">{% trans "Last email imported at" %} {{ last_imported_message.received_time|date:'DATETIME_FORMAT' }}</p>
168 167 <div class="row">
169   - </div>
170   - <div class="row">
171   - <p class="col-lg-12 text-center">
172   - {% trans "The contents of this site is published under license" %}
173   - <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/br/">
174   - {% trans "Creative Commons - attribution, non-commercial" %}
175   - </a>
176   - </p>
  168 + <p class="col-lg-12 text-center">
  169 + <a href="{% url 'opendata' %}"><img src="{{ STATIC_URL }}img/opendata3.png"/></a>
  170 + </p>
  171 + <p class="col-lg-12 text-center">{% trans "Last email imported at" %} {{ last_imported_message.received_time|date:'DATETIME_FORMAT' }}</p>
  172 + <p class="col-lg-12 text-center">
  173 + {% trans "The contents of this site is published under license" %}
  174 + <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/br/">
  175 + {% trans "Creative Commons - attribution, non-commercial" %}
  176 + </a>
  177 + </p>
177 178 </div>
178 179 {% endblock %}
179 180  
... ...
src/templates/open-data.html 0 → 100644
... ... @@ -0,0 +1,58 @@
  1 +{% extends "base.html" %}
  2 +{% load i18n %}
  3 +
  4 +{% block main-content %}
  5 + <div class="col-lg-12">
  6 + <h2>{% trans "OpenData - Communities Interlegis" %}</h2>
  7 + <p>{% trans "If you are interested in integrating your system with the Colab environment and requires no other data provided by this API, please contact us via the ticketing system (you must be registered in order to create a ticket)." %}</p>
  8 +
  9 + <h3>{% trans "Retrieving data via API" %}</h3>
  10 + <p>{% trans "Colab API works through an HTTP/REST always returning JSON objects." %}</p>
  11 + <p>
  12 + {% trans "The base API URL is" %}:
  13 + {% with "/api/colab/" as BASE_API_URL %}
  14 + <a href="{{ BASE_API_URL }}">http://colab.interlegis.leg.br{{ BASE_API_URL }}</a>
  15 + </p>
  16 +
  17 + <ul class="list-unstyled">
  18 + <li>
  19 + <p>{% trans "Each model listed below has a resource_uri field available, which is the object's data URI." %}</p>
  20 + <p>{% trans "The following list contains the available models to retrieve data" %}:</p>
  21 + <ul>
  22 + <li>
  23 + <strong><a href="{{ BASE_API_URL }}message/">message</a></strong>:
  24 + {% trans "Retrieve messages with body, id, received_time and subject" %}
  25 + </li>
  26 + <li>
  27 + <strong><a href="{{ BASE_API_URL }}revision/">revision</a></strong>:
  28 + {% trans "Retrieve revisions with author, created, key, message and repository_name" %}
  29 + </li>
  30 + <li>
  31 + <strong><a href="{{ BASE_API_URL }}ticket/">ticket</a></strong>:
  32 + {% trans "Retrieve tickets with author, component, created, description, id, keywords, milestone, modified, modified_by, priority, reporter, severity, status, summary and version" %}
  33 + </li>
  34 + <li>
  35 + <strong><a href="{{ BASE_API_URL }}wiki/">wiki</a></strong>:
  36 + {% trans "Retrieve wikis with author, created, modified, modified_by, name and wiki_text" %}
  37 + </li>
  38 + {% endwith %}
  39 + </ul>
  40 + </li>
  41 + </ul>
  42 + <ul class="list-unstyled">
  43 + <li><h3>{% trans 'Parameters' %}:</h3></li>
  44 + <li class="divider"></li>
  45 + <li>
  46 + <h4><i>limit</i> - {% trans "Results per page" %}</h4>
  47 + {% trans "Number of results to be displayed per page." %}
  48 + <i>{% trans "Default: 20" %}</i>.
  49 + </li>
  50 + <li class="divider"></li>
  51 + <li>
  52 + <h4><i>offset</i> - {% trans "Starts of n element" %}</h4>
  53 + {% trans "Where n is the index of the first result to appear in the page." %}
  54 + <i>{% trans "Default: 0" %}</i>.
  55 + </li>
  56 + </ul>
  57 + </div>
  58 +{% endblock %}
... ...