list_filter = ['name', 'is_on_map']
-
class PageProductListInline(TabularDynamicInlineAdmin):
model = PageProductList
class TeamPageAdmin(PageAdmin):
- inlines = [PageImageInline, PageBlockInline, PagePlaylistInline, PageProductListInline, PageRelatedTitleAdmin, DynamicContentPageInline]
+ inlines = [PageImageInline, PageBlockInline, PagePlaylistInline,
+ PageProductListInline, PageRelatedTitleAdmin, DynamicContentPageInline]
class PersonAdminBase(BaseTranslationModelAdmin):
model = PersonActivity
fk_name = 'person'
- filter_horizontal = ['organizations', 'employers', 'teams', 'projects', 'supervisors', 'phd_directors', ]
+ filter_horizontal = ['organizations', 'employers', 'teams',
+ 'projects', 'supervisors', 'phd_directors', ]
class PersonPlaylistInline(TabularDynamicInlineAdmin):
PersonActivityInline,]
first_fields = ['last_name', 'first_name', 'title', 'gender', 'user']
search_fields = ['last_name', 'first_name']
- list_display = ['last_name', 'first_name', 'description', 'email', 'gender']
+ list_display = ['last_name', 'first_name', 'description', 'email', 'gender', 'created']
list_filter = ['person_title', 'activities__date_from', 'activities__date_to',
'activities__is_permanent', 'activities__framework', 'activities__grade',
- 'activities__function', 'activities__teams',]
+ 'activities__status', 'activities__teams', 'activities__projects',]
class PersonActivityAdmin(BaseTranslationModelAdmin):
model = PersonActivity
list_display = ['person', 'get_teams', 'status', 'date_from', 'date_to']
- filter_horizontal = ['organizations', 'employers', 'teams', 'projects', 'supervisors', 'phd_directors', ]
+ filter_horizontal = ['organizations', 'employers', 'teams', 'projects',
+ 'supervisors', 'phd_directors', ]
def get_teams(self, instance):
values = []
qs = self.mixup_querysets(qs)
return qs
+
+
+class ProjectDemoDetailView(SlugMixin, DetailView):
+
+ model = ProjectDemo
+ template_name='projects/project_demo_detail.html'
+ context_object_name = 'demo'
+
+ def get_context_data(self, **kwargs):
+ context = super(ProjectDemoDetailView, self).get_context_data(**kwargs)
+ demo = self.get_object()
+ project = demo.project
+ department = None
+
+ if project:
+ if project.lead_team:
+ if project.lead_team.department:
+ department = project.lead_team.department
+ else:
+ for team in project.teams.all():
+ if team.department:
+ department = team.department
+ break
+
+ context['department'] = department
+ if project.topic and project.topic.parent:
+ context['page'] = project.topic.parent.pages.all().first()
+ elif project.topic:
+ context['page'] = project.topic.pages.all().first()
+
+ return context
{% block page_slider %}
<div style="position: relative;">
-
<div class="map" id="network-map">
-
</div>
-
<div class="map-legend">
-
{% for type in organization_types %}
<div class="map-legend__item map-legend__item--{{ type.1 }}">{{ type.0 }}</div>
{% endfor %}
-
</div>
-
</div>
-
<div class="container">
-
<div class="row">
-
<div class="col-xs-12 col-md-10 col-md-push-1">
-
<div class="slider-network">
-
<ul class="slider-network__slider" data-slider-network>
-
{% for organization in organizations %}
-
<li class="slider-network__slide" data-marker-url="{{organization.url}}" data-marker-color="{{ organization.type.css_class }}" {% with organization.images.all|get_type:'logo' as images %}{% if images %}data-marker-image="{{ MEDIA_URL }}{{images.first.file}}"{% endif %}{% endwith %} data-marker-idx="{{forloop.counter0}}" data-marker-lat="{{ organization.lat }}" data-marker-lng="{{ organization.lon }}">
<div class="slider-network__slide-image"
-
{% with organization.images.all|get_type:'logo' as images %}
{% if images %}
style="background-image: url('{{ MEDIA_URL }}{{images.first.file}}');"
{% endif %}
{% endwith %}
-
>
</div>
<div class="slider-network__slide-title" data-marker-title>
{% endcomment %}
{% endfor %}
-
</ul>
-
</div>
-
</div>
-
</div>
-
</div>
-
{% endblock %}