Skip to content
Snippets Groups Projects
Commit 2cc61cbd authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Better filtering of message list

parent b32b4eec
No related branches found
No related tags found
No related merge requests found
Showing
with 146 additions and 54 deletions
No preview for this file type
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: VIPS\n" "Project-Id-Version: VIPS\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-13 13:36+0100\n" "POT-Creation-Date: 2016-07-06 15:21+0200\n"
"PO-Revision-Date: 2015-02-13 11:14+0100\n" "PO-Revision-Date: 2015-02-13 11:14+0100\n"
"Last-Translator: Vjekoslav vujica <wvjeko@gmail.com>\n" "Last-Translator: Vjekoslav vujica <wvjeko@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
...@@ -15,11 +15,11 @@ msgstr "" ...@@ -15,11 +15,11 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 1.7.4\n" "X-Generator: Poedit 1.7.4\n"
#: templates/organisms/index.html:3 #: templates/organisms/index.html:3 templates/organisms/index.html.py:5
#: templates/organisms/index.html.py:5
msgid "Organisms" msgid "Organisms"
msgstr "Organizama" msgstr "Organizama"
...@@ -30,4 +30,3 @@ msgstr "Usjevi " ...@@ -30,4 +30,3 @@ msgstr "Usjevi "
#: templates/organisms/index.html:6 #: templates/organisms/index.html:6
msgid "Crop" msgid "Crop"
msgstr "Usjevi " msgstr "Usjevi "
No preview for this file type
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-13 13:36+0100\n" "POT-Creation-Date: 2016-07-06 15:21+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -28,7 +28,6 @@ msgid "Crops" ...@@ -28,7 +28,6 @@ msgid "Crops"
msgstr "Kulturer" msgstr "Kulturer"
#: templates/organisms/index.html:6 #: templates/organisms/index.html:6
#, fuzzy
msgid "Crop" msgid "Crop"
msgstr "Kultur" msgstr "Kultur"
No preview for this file type
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-27 13:40+0200\n" "POT-Creation-Date: 2016-07-06 15:21+0200\n"
"PO-Revision-Date: 2016-06-01 11:48+0200\n" "PO-Revision-Date: 2016-06-01 11:48+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n" "Language: zh_CN\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Last-Translator: \n"
"Language-Team: \n"
"X-Generator: Poedit 1.8.7\n" "X-Generator: Poedit 1.8.7\n"
#: templates/organisms/index.html:3 templates/organisms/index.html.py:5 #: templates/organisms/index.html:3 templates/organisms/index.html.py:5
......
No preview for this file type
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-21 15:44+0200\n" "POT-Creation-Date: 2016-07-06 15:22+0200\n"
"PO-Revision-Date: 2014-05-14 09:25+0200\n" "PO-Revision-Date: 2014-05-14 09:25+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -18,6 +18,22 @@ msgstr "" ...@@ -18,6 +18,22 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.5\n" "X-Generator: Poedit 1.6.5\n"
#: models.py:196 templates/messages/index.html:49
msgid "Headline"
msgstr "Заглавие"
#: models.py:198
msgid "Date published"
msgstr ""
#: models.py:199
msgid "Date expired"
msgstr ""
#: models.py:200
msgid "Illustration"
msgstr ""
#: templates/messages/index.html:3 templates/messages/index.html.py:9 #: templates/messages/index.html:3 templates/messages/index.html.py:9
msgid "Messages" msgid "Messages"
msgstr "Съобщения" msgstr "Съобщения"
...@@ -27,7 +43,7 @@ msgid "Text search" ...@@ -27,7 +43,7 @@ msgid "Text search"
msgstr "" msgstr ""
#: templates/messages/index.html:20 #: templates/messages/index.html:20
msgid "All crops" msgid "All crop categories"
msgstr "" msgstr ""
#: templates/messages/index.html:31 #: templates/messages/index.html:31
...@@ -47,10 +63,10 @@ msgid "Publish date" ...@@ -47,10 +63,10 @@ msgid "Publish date"
msgstr "Дата на издаване" msgstr "Дата на издаване"
#: templates/messages/index.html:48 #: templates/messages/index.html:48
msgid "Headline" msgid "Crop group(s)"
msgstr "Заглавие" msgstr ""
#: templates/messages/index.html:49 #: templates/messages/index.html:50
msgid "Author" msgid "Author"
msgstr "Автор" msgstr "Автор"
......
No preview for this file type
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: VIPS\n" "Project-Id-Version: VIPS\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-21 15:44+0200\n" "POT-Creation-Date: 2016-07-06 15:22+0200\n"
"PO-Revision-Date: 2015-02-13 11:13+0100\n" "PO-Revision-Date: 2015-02-13 11:13+0100\n"
"Last-Translator: Vjekoslav vujica <wvjeko@gmail.com>\n" "Last-Translator: Vjekoslav vujica <wvjeko@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
...@@ -19,6 +19,22 @@ msgstr "" ...@@ -19,6 +19,22 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 1.7.4\n" "X-Generator: Poedit 1.7.4\n"
#: models.py:196 templates/messages/index.html:49
msgid "Headline"
msgstr "Naslov "
#: models.py:198
msgid "Date published"
msgstr ""
#: models.py:199
msgid "Date expired"
msgstr ""
#: models.py:200
msgid "Illustration"
msgstr ""
#: templates/messages/index.html:3 templates/messages/index.html.py:9 #: templates/messages/index.html:3 templates/messages/index.html.py:9
msgid "Messages" msgid "Messages"
msgstr "Poruke " msgstr "Poruke "
...@@ -28,7 +44,7 @@ msgid "Text search" ...@@ -28,7 +44,7 @@ msgid "Text search"
msgstr "" msgstr ""
#: templates/messages/index.html:20 #: templates/messages/index.html:20
msgid "All crops" msgid "All crop categories"
msgstr "" msgstr ""
#: templates/messages/index.html:31 #: templates/messages/index.html:31
...@@ -48,10 +64,10 @@ msgid "Publish date" ...@@ -48,10 +64,10 @@ msgid "Publish date"
msgstr "Datum objave " msgstr "Datum objave "
#: templates/messages/index.html:48 #: templates/messages/index.html:48
msgid "Headline" msgid "Crop group(s)"
msgstr "Naslov " msgstr ""
#: templates/messages/index.html:49 #: templates/messages/index.html:50
msgid "Author" msgid "Author"
msgstr "Autor " msgstr "Autor "
......
No preview for this file type
...@@ -20,7 +20,7 @@ msgid "" ...@@ -20,7 +20,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-21 15:44+0200\n" "POT-Creation-Date: 2016-07-06 15:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -30,6 +30,23 @@ msgstr "" ...@@ -30,6 +30,23 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: models.py:196
#: templates/messages/index.html:49
msgid "Headline"
msgstr "Overskrift"
#: models.py:198
msgid "Date published"
msgstr "Dato publisert"
#: models.py:199
msgid "Date expired"
msgstr "Dato utløpt"
#: models.py:200
msgid "Illustration"
msgstr "Illustrasjon"
#: templates/messages/index.html:3 #: templates/messages/index.html:3
#: templates/messages/index.html.py:9 #: templates/messages/index.html.py:9
msgid "Messages" msgid "Messages"
...@@ -40,8 +57,8 @@ msgid "Text search" ...@@ -40,8 +57,8 @@ msgid "Text search"
msgstr "Fritekstsøk" msgstr "Fritekstsøk"
#: templates/messages/index.html:20 #: templates/messages/index.html:20
msgid "All crops" msgid "All crop categories"
msgstr "Alle kulturer" msgstr "Alle kulturgrupper"
#: templates/messages/index.html:31 #: templates/messages/index.html:31
msgid "From" msgid "From"
...@@ -60,10 +77,10 @@ msgid "Publish date" ...@@ -60,10 +77,10 @@ msgid "Publish date"
msgstr "Publiseringsdato" msgstr "Publiseringsdato"
#: templates/messages/index.html:48 #: templates/messages/index.html:48
msgid "Headline" msgid "Crop group(s)"
msgstr "Overskrift" msgstr "Kulturgruppe(r)"
#: templates/messages/index.html:49 #: templates/messages/index.html:50
msgid "Author" msgid "Author"
msgstr "Forfatter" msgstr "Forfatter"
No preview for this file type
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-09 09:57+0100\n" "POT-Creation-Date: 2016-07-06 15:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -18,6 +18,22 @@ msgstr "" ...@@ -18,6 +18,22 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
#: models.py:196 templates/messages/index.html:49
msgid "Headline"
msgstr ""
#: models.py:198
msgid "Date published"
msgstr ""
#: models.py:199
msgid "Date expired"
msgstr ""
#: models.py:200
msgid "Illustration"
msgstr ""
#: templates/messages/index.html:3 templates/messages/index.html.py:9 #: templates/messages/index.html:3 templates/messages/index.html.py:9
msgid "Messages" msgid "Messages"
msgstr "" msgstr ""
...@@ -27,7 +43,7 @@ msgid "Text search" ...@@ -27,7 +43,7 @@ msgid "Text search"
msgstr "" msgstr ""
#: templates/messages/index.html:20 #: templates/messages/index.html:20
msgid "All crops" msgid "All crop categories"
msgstr "" msgstr ""
#: templates/messages/index.html:31 #: templates/messages/index.html:31
...@@ -47,9 +63,9 @@ msgid "Publish date" ...@@ -47,9 +63,9 @@ msgid "Publish date"
msgstr "" msgstr ""
#: templates/messages/index.html:48 #: templates/messages/index.html:48
msgid "Headline" msgid "Crop group(s)"
msgstr "" msgstr ""
#: templates/messages/index.html:49 #: templates/messages/index.html:50
msgid "Author" msgid "Author"
msgstr "" msgstr ""
No preview for this file type
...@@ -7,18 +7,17 @@ msgid "" ...@@ -7,18 +7,17 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-27 13:40+0200\n" "POT-Creation-Date: 2016-07-06 15:22+0200\n"
"PO-Revision-Date: 2016-06-01 11:50+0200\n" "PO-Revision-Date: 2016-06-01 11:50+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: zh_CN\n" "Language: zh_CN\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Last-Translator: \n"
"Language-Team: \n"
"X-Generator: Poedit 1.8.7\n" "X-Generator: Poedit 1.8.7\n"
#: models.py:196 #: models.py:196 templates/messages/index.html:49
#: templates/messages/index.html:48
msgid "Headline" msgid "Headline"
msgstr "标题" msgstr "标题"
...@@ -34,8 +33,7 @@ msgstr "过期日期" ...@@ -34,8 +33,7 @@ msgstr "过期日期"
msgid "Illustration" msgid "Illustration"
msgstr "图" msgstr "图"
#: templates/messages/index.html:3 #: templates/messages/index.html:3 templates/messages/index.html.py:9
#: templates/messages/index.html.py:9
msgid "Messages" msgid "Messages"
msgstr "新闻" msgstr "新闻"
...@@ -44,7 +42,9 @@ msgid "Text search" ...@@ -44,7 +42,9 @@ msgid "Text search"
msgstr "搜索文本" msgstr "搜索文本"
#: templates/messages/index.html:20 #: templates/messages/index.html:20
msgid "All crops" #, fuzzy
#| msgid "All crops"
msgid "All crop categories"
msgstr "所有作物" msgstr "所有作物"
#: templates/messages/index.html:31 #: templates/messages/index.html:31
...@@ -63,7 +63,10 @@ msgstr "搜索日期" ...@@ -63,7 +63,10 @@ msgstr "搜索日期"
msgid "Publish date" msgid "Publish date"
msgstr "发布日期" msgstr "发布日期"
#: templates/messages/index.html:49 #: templates/messages/index.html:48
msgid "Crop group(s)"
msgstr ""
#: templates/messages/index.html:50
msgid "Author" msgid "Author"
msgstr "作者" msgstr "作者"
...@@ -75,7 +75,7 @@ class Message: ...@@ -75,7 +75,7 @@ class Message:
illustration_file_name, illustration_file_name,
illustration_caption, illustration_caption,
created_by, created_by,
message_crop_organism_ids crop_category_ids
): ):
self.message_id = message_id self.message_id = message_id
self.organization_id = organization_id self.organization_id = organization_id
...@@ -87,7 +87,7 @@ class Message: ...@@ -87,7 +87,7 @@ class Message:
self.illustration_file_name = illustration_file_name self.illustration_file_name = illustration_file_name
self.illustration_caption = illustration_caption self.illustration_caption = illustration_caption
self.created_by = created_by self.created_by = created_by
self.message_crop_organism_ids = message_crop_organism_ids self.crop_category_ids = crop_category_ids
def get_illustration_url(self): def get_illustration_url(self):
return "http://%s/static/images/messages/%s/%s" % (settings.VIPSLOGIC_SERVER_NAME,self.organization_id,self.illustration_file_name) return "http://%s/static/images/messages/%s/%s" % (settings.VIPSLOGIC_SERVER_NAME,self.organization_id,self.illustration_file_name)
...@@ -159,7 +159,7 @@ class Message: ...@@ -159,7 +159,7 @@ class Message:
message_illustration.get("file_name", None), message_illustration.get("file_name", None),
message_illustration.get("caption", None), message_illustration.get("caption", None),
created_by, created_by,
the_dict.get("messageCropOrganismIds",[]) the_dict.get("cropCategoryIds",[])
) )
@staticmethod @staticmethod
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
</div> </div>
<div class="col-xs-3"> <div class="col-xs-3">
<div class="form-group"> <div class="form-group">
<select name="cropOrganismIds" class="form-control chosen-select" onchange="cropFilter(this);"> <select name="cropCategoryIds" class="form-control chosen-select" onchange="cropCategoryFilter(this);">
<option value="-1">{% trans "All crops" %}</option> <option value="-1">{% trans "All crop categories" %}</option>
{% for crop in crops %} {% for crop_category in crop_categories %}
<option value="{{crop.organism_id}}">{{crop.local_name}} ({{crop.latin_name}})</option> <option value="{{crop_category.crop_category_id}}">{{crop_category.name}}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<thead> <thead>
<tr> <tr>
<th>{% trans "Publish date" %}</th> <th>{% trans "Publish date" %}</th>
<th>{% trans "Crop group(s)" %}</th>
<th>{% trans "Headline" %}</th> <th>{% trans "Headline" %}</th>
<th>{% trans "Author" %}</th> <th>{% trans "Author" %}</th>
</tr> </tr>
...@@ -72,11 +73,22 @@ ...@@ -72,11 +73,22 @@
body: "{{ message.body | escapejs }}", body: "{{ message.body | escapejs }}",
createdBy:"{{ message.created_by }}", createdBy:"{{ message.created_by }}",
url:"{% url 'vips_messages:detail' message.message_id %}", url:"{% url 'vips_messages:detail' message.message_id %}",
messageCropOrganismIds:{{message.message_crop_organism_ids}} cropCategoryIds:{{message.crop_category_ids}}
} {% if not forloop.last %},{% endif %} } {% if not forloop.last %},{% endif %}
{% endfor %} {% endfor %}
]; ];
var cropCategories = [
{% for crop_category in crop_categories %}
{
cropCategoryId: {{ crop_category.crop_category_id }},
name: "{{ crop_category.name }}",
cropIds: {{ crop_category.crop_ids }}
}
{% if not forloop.last %},{% endif %}
{% endfor %}
];
var messageListSubset; var messageListSubset;
/** /**
...@@ -92,9 +104,22 @@ ...@@ -92,9 +104,22 @@
for(var i in messageListSubset) for(var i in messageListSubset)
{ {
var listItem = messageListSubset[i]; var listItem = messageListSubset[i];
// Get the crop groups
var cropGroupNames = [];
for(var j in listItem.cropCategoryIds)
{
for(var k in cropCategories)
{
if(cropCategories[k].cropCategoryId == listItem.cropCategoryIds[j])
{
cropGroupNames.push(cropCategories[k].name);
}
}
}
HTML += [ HTML += [
'<tr>', '<tr>',
'<td>',listItem.datePub,'</td>', '<td>',listItem.datePub,'</td>',
'<td>', cropGroupNames.join(", "),'</td>',
'<td><a href="',listItem.url,'">',listItem.heading,'</a></td>', '<td><a href="',listItem.url,'">',listItem.heading,'</a></td>',
'<td>',listItem.createdBy,'</td>', '<td>',listItem.createdBy,'</td>',
'</tr>'] '</tr>']
...@@ -132,12 +157,12 @@ ...@@ -132,12 +157,12 @@
/** /**
* Filters messages based on selected crops. Resets the text search * Filters messages based on selected crops. Resets the text search
*/ */
function cropFilter(cropSelectList) function cropCategoryFilter(cropCategorySelectList)
{ {
// Reset text search field // Reset text search field
document.getElementById("textSearchField").value=""; document.getElementById("textSearchField").value="";
var selectedCropOrganismId = parseInt(cropSelectList.options[cropSelectList.selectedIndex].value); var selectedCropCategoryId = parseInt(cropCategorySelectList.options[cropCategorySelectList.selectedIndex].value);
if(selectedCropOrganismId == -1) if(selectedCropCategoryId == -1)
{ {
messageListSubset = messageList; messageListSubset = messageList;
} }
...@@ -147,9 +172,9 @@ ...@@ -147,9 +172,9 @@
for(var i in messageList) for(var i in messageList)
{ {
var message = messageList[i]; var message = messageList[i];
for(var j in message.messageCropOrganismIds) for(var j in message.cropCategoryIds)
{ {
if(message.messageCropOrganismIds[j] == selectedCropOrganismId) if(message.cropCategoryIds[j] == selectedCropCategoryId)
{ {
messageListSubset.push(message); messageListSubset.push(message);
break; break;
......
...@@ -24,7 +24,7 @@ from django.http import HttpResponse ...@@ -24,7 +24,7 @@ from django.http import HttpResponse
from vips_messages.models import Message from vips_messages.models import Message
from vips_messages.forms import MessagePublishedDateFilterForm from vips_messages.forms import MessagePublishedDateFilterForm
from organisms.models import Organism from organisms.models import Organism, CropCategory
def index(request): def index(request):
messages = None messages = None
...@@ -47,6 +47,7 @@ def index(request): ...@@ -47,6 +47,7 @@ def index(request):
context = { context = {
'messages' : messages, 'messages' : messages,
'crop_categories': CropCategory.get_crop_categories(translation.get_language()),
'form' : form, 'form' : form,
'crops' : crops 'crops' : crops
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment