forked from geosolutions-it/geonode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
group categories GeoNode#3067 GeoNode#3083
model, api views, regular views translate strings update tests for group categories
- Loading branch information
Showing
64 changed files
with
43,168 additions
and
35,541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('groups', '24_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='GroupCategory', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('slug', models.SlugField(unique=True, max_length=255)), | ||
('name', models.CharField(unique=True, max_length=255)), | ||
('name_en', models.CharField(max_length=255, unique=True, null=True)), | ||
], | ||
options={ | ||
'verbose_name_plural': 'Group Categories', | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='groupprofile', | ||
name='description_en', | ||
field=models.TextField(null=True, verbose_name='Description'), | ||
), | ||
migrations.AddField( | ||
model_name='groupprofile', | ||
name='title_en', | ||
field=models.CharField(max_length=50, null=True, verbose_name='Title'), | ||
), | ||
migrations.AddField( | ||
model_name='groupprofile', | ||
name='categories', | ||
field=models.ManyToManyField(related_name='groups', to='groups.GroupCategory', blank=True), | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
geonode/groups/migrations/0026_group_category_description.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('groups', '0025_group_categories'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='groupcategory', | ||
name='description', | ||
field=models.TextField(default=None, null=True, blank=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% extends "groups/group_base.html" %} | ||
{% load i18n %} | ||
{% load staticfiles %} | ||
|
||
{% block title %} {% trans "Explore Group Categories" %} - {{ block.super }} {% endblock %} | ||
|
||
{% block body_class %}groups explore{% endblock %} | ||
|
||
{% block body %} | ||
<div class="page-header"> | ||
{% if user.is_authenticated %} | ||
<a href="{% url "group_category_create" %}" class="btn btn-primary pull-right">{% trans "Create a New Group Category" %}</a> | ||
{% endif %} | ||
<h2>{% trans "Explore Group Categories" %}</h2> | ||
</div> | ||
|
||
{% with include_type_filter='true' %} | ||
{% with facet_type='groupcategories' %} | ||
{% include "search/_search_user_content.html" %} | ||
{% endwith %} | ||
{% endwith %} | ||
{% include "_bulk_permissions_form.html" %} | ||
{% endblock %} | ||
|
||
{% block extra_script %} | ||
{{ block.super }} | ||
<script type="text/javascript"> | ||
SEARCH_URL = '{% url 'api_dispatch_list' api_name='api' resource_name='groupcategory' %}' | ||
</script> | ||
{% with include_spatial='false' %} | ||
{% include 'search/search_scripts.html' %} | ||
{% endwith %} | ||
{% endblock extra_script %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{% extends "groups/group_detail.html" %} | ||
{% load i18n %} | ||
|
||
|
||
{% block title %}{{ object.name|default:object.slug }} — {{ block.super.super }}{% endblock %} | ||
|
||
{% block body_outer %} | ||
<div class="page-header"> | ||
<h2 class="page-title">{{ object.name|default:object.slug }}</h2> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-8 group-details"> | ||
<div class="row"> | ||
<div class="col-xs-12 col-md-12 group-details"> | ||
<p class="group-desc">{{ object.description|default_if_none:'' }}</p> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="col-md-4"> | ||
<ul class="list-group"> | ||
{% if request.user.is_staff %} | ||
<li class="list-group-item"><a href="{% url "group_category_update" object.slug %}">{% trans "Edit Group Category Details" %}</a></li> | ||
{% endif %} | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h4>{% trans "Groups" %}</h4> | ||
<div class="tab-content paginate paginate-auto" id="search-content"> | ||
{% include 'groups/_group_list_item.html' %} | ||
</div> | ||
</div> | ||
{% include 'search/_pagination.html' %} | ||
</div> | ||
{% endblock %} | ||
|
||
|
||
{% block extra_script %} | ||
{{ block.super.super }} | ||
<script type="text/javascript"> | ||
SEARCH_URL = '{% url 'api_dispatch_list' api_name='api' resource_name='groups' %}'+ '?categories__slug='+ '{{ object.slug }}'; | ||
</script> | ||
{% with include_spatial='false' %} | ||
{% include 'search/search_scripts.html' %} | ||
{% endwith %} | ||
{% endblock extra_script %} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% extends "groups/group_create.html" %} | ||
{% load i18n %} | ||
|
||
{% block head_title %}{% trans "Create Group Category" %}{% endblock %} | ||
|
||
{% block body_page_title %}{% trans "Create a Group Category" %}{% endblock %} |
8 changes: 8 additions & 0 deletions
8
geonode/groups/templates/groups/groupcategory_update_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% extends "groups/group_create.html" %} | ||
{% load i18n %} | ||
|
||
{% block head_title %}{% trans "Edit Group Category" %} {{ object.name }}{% endblock %} | ||
|
||
{% block body_page_title %}{% trans "Edit Group Category" %} {{ object.name }}{% endblock %} | ||
|
||
{% block form_button %}{% trans "Save" %}{% endblock %} |
Oops, something went wrong.