weight = 50 label = _('Export Excel') def is_effective(self, module): module_app = module.phases[0].content().app return (module_app == 'a4_candy_ideas' and not module.project.is_draft) def get_progress(self, module): return 0, 0 def get_base_url(self, module): return reverse('a4dashboard:idea-export-module', kwargs={ 'organisation_slug': module.project.organisation.slug, 'module_slug': module.slug, }) def get_urls(self): return [ (r'^modules/(?P<module_slug>[-\w_]+)/export/idea/$', views.IdeaDashboardExportView.as_view(), 'idea-export-module'), (r'^modules/(?P<module_slug>[-\w_]+)/export/idea/ideas/$', exports.IdeaExportView.as_view(), 'idea-export'), (r'^modules/(?P<module_slug>[-\w_]+)/export/idea/comments/$', exports.IdeaCommentExportView.as_view(), 'idea-comment-export'), ] components.register_module(ExportIdeaComponent())
(r'^subjects/module/(?P<module_slug>[-\w_]+)/$', views.SubjectListDashboardView.as_view(component=self), 'subject-list'), (r'^subjects/create/module/(?P<module_slug>[-\w_]+)/$', views.SubjectCreateView.as_view(component=self), 'subject-create'), (r'^subjects/(?P<year>\d{4})-(?P<pk>\d+)/update/$', views.SubjectUpdateView.as_view(component=self), 'subject-update'), (r'^subjects/(?P<year>\d{4})-(?P<pk>\d+)/delete/$', views.SubjectDeleteView.as_view(component=self), 'subject-delete') ] components.register_module(SubjectEditComponent()) class ExportSubjectComponent(DashboardComponent): identifier = 'subject_export' weight = 50 label = _('Export Excel') def is_effective(self, module): module_app = module.phases[0].content().app return (module_app == 'a4_candy_debate' and not module.project.is_draft) def get_progress(self, module): return 0, 0
'dashboard-moderators-edit')] components.register_project(ModeratorsComponent()) class ExportQuestionsComponent(DashboardComponent): identifier = 'questions_export' weight = 30 label = _('Export Excel') def is_effective(self, module): return True def get_base_url(self, module): return reverse('a4dashboard:dashboard-questions-export', kwargs={'module_slug': module.slug}) def get_urls(self): return [ (r'^modules/(?P<module_slug>[-\w_]+)/export/$', views.QuestionsDashboardExportView.as_view(), 'dashboard-questions-export'), (r'^modules/(?P<module_slug>[-\w_]+)/export/questions/$', exports.QuestionsDashboardExportView.as_view(), 'project-questions-export'), ] components.register_module(ExportQuestionsComponent())
def get_base_url(self, module): return reverse('a4dashboard:poll-dashboard', kwargs={ 'organisation_slug': module.project.organisation.slug, 'module_slug': module.slug }) def get_urls(self): return [(r'^modules/(?P<module_slug>[-\w_]+)/poll/$', views.PollDashboardView.as_view(component=self), 'poll-dashboard')] components.register_module(PollComponent()) class ExportPollComponent(DashboardComponent): identifier = 'poll_export' weight = 50 label = _('Export Excel') def is_effective(self, module): module_app = module.phases[0].content().app return (module_app == 'a4_candy_polls' and not module.project.is_draft) def get_progress(self, module): return 0, 0 def get_base_url(self, module):
def get_base_url(self, module): return reverse('a4dashboard:dashboard-document-settings', kwargs={ 'organisation_slug': module.project.organisation.slug, 'module_slug': module.slug }) def get_urls(self): return [(r'^modules/(?P<module_slug>[-\w_]+)/document/$', views.DocumentDashboardView.as_view(component=self), 'dashboard-document-settings')] components.register_module(DocumentComponent()) class ExportDocumentComponent(DashboardComponent): identifier = 'document_export' weight = 50 label = _('Export Excel') def is_effective(self, module): module_app = module.phases[0].content().app return (module_app == 'a4_candy_documents' and not module.project.is_draft) def get_progress(self, module): return 0, 0
from django.conf import settings from django.utils.translation import ugettext_lazy as _ from adhocracy4.dashboard import ModuleFormSetComponent from adhocracy4.dashboard import components from . import forms class ModuleLabelsComponent(ModuleFormSetComponent): identifier = 'labels' weight = 14 label = _('Labels') form_title = _('Edit labels') form_class = forms.LabelsFormSet form_template_name = 'a4labels/includes/module_labels_form.html' def is_effective(self, module): module_app = module.phases[0].content().app for app, name in settings.A4_LABELS_ADDABLE: if app == module_app: return True return False components.register_module(ModuleLabelsComponent())
label = _('Export Excel') def is_effective(self, module): module_app = module.phases[0].content().app return (module_app == 'meinberlin_kiezkasse' and not module.project.is_draft) def get_progress(self, module): return 0, 0 def get_base_url(self, module): return reverse('a4dashboard:kiezkasse-export-module', kwargs={ 'module_slug': module.slug, }) def get_urls(self): return [ (r'^modules/(?P<module_slug>[-\w_]+)/export/kiezkasse/$', views.ProposalDashboardExportView.as_view(), 'kiezkasse-export-module'), (r'^modules/(?P<module_slug>[-\w_]+)/export/kiezkasse/ideas/$', exports.ProposalExportView.as_view(), 'kiezkasse-export'), (r'^modules/(?P<module_slug>[-\w_]+)/export/kiezkasse/comments/$', exports.ProposalCommentExportView.as_view(), 'kiezkasse-comment-export'), ] components.register_module(ExportKiezkasseComponent())
from django.conf import settings from django.utils.translation import ugettext_lazy as _ from adhocracy4.dashboard import ModuleFormSetComponent from adhocracy4.dashboard import components from . import forms class ModuleCategoriesComponent(ModuleFormSetComponent): identifier = 'categories' weight = 13 label = _('Categories') form_title = _('Edit categories') form_class = forms.CategoryFormSet form_template_name = 'a4categories/includes/module_categories_form.html' def is_effective(self, module): module_app = module.phases[0].content().app for app, name in settings.A4_CATEGORIZABLE: if app == module_app: return True return False components.register_module(ModuleCategoriesComponent())
components) from . import forms class ProjectBasicComponent(ProjectFormComponent): identifier = 'speakup-basic' weight = 10 label = _('Basic settings') form_title = _('Edit basic settings') form_class = forms.ProjectBasicForm form_template_name = 'a4dashboard/includes/project_basic_form.html' def is_effective(self, project): return True class ModulePhasesComponent(ModuleFormSetComponent): identifier = 'speakup-phases' weight = 11 label = _('Time Period') form_title = _('Edit time period') form_class = forms.SpeakupPhaseFormSet form_template_name = 'a4dashboard/includes/module_phases_form.html' components.register_project(ProjectBasicComponent()) components.register_module(ModulePhasesComponent())
class ActivityComponent(DashboardComponent): identifier = 'facetoface' weight = 20 label = _('Face-to-Face Information') def is_effective(self, module): module_app = module.phases[0].content().app return module_app == 'a4_candy_activities' def get_progress(self, module): if models.Activity.objects.filter(module=module).exists(): return 1, 1 return 0, 1 def get_base_url(self, module): return reverse('a4dashboard:activities-dashboard', kwargs={ 'organisation_slug': module.project.organisation.slug, 'module_slug': module.slug }) def get_urls(self): return [(r'^modules/(?P<module_slug>[-\w_]+)/activities/$', views.ActivityDashboardView.as_view(component=self), 'activities-dashboard')] components.register_module(ActivityComponent())
def get_urls(self): return [(r'^maptopics/module/(?P<module_slug>[-\w_]+)/$', views.MapTopicListDashboardView.as_view(component=self), 'maptopic-list'), (r'^maptopics/create/module/(?P<module_slug>[-\w_]+)/$', views.MapTopicCreateView.as_view(component=self), 'maptopic-create'), (r'^maptopics/(?P<year>\d{4})-(?P<pk>\d+)/update/$', views.MapTopicUpdateView.as_view(component=self), 'maptopic-update'), (r'^maptopics/(?P<year>\d{4})-(?P<pk>\d+)/delete/$', views.MapTopicDeleteView.as_view(component=self), 'maptopic-delete')] components.register_module(MapTopicEditComponent()) class ExportMapTopicComponent(DashboardComponent): identifier = 'maptopic_export' weight = 50 label = _('Export Excel') def is_effective(self, module): module_app = module.phases[0].content().app return (module_app == 'meinberlin_maptopicprio' and not module.project.is_draft) def get_progress(self, module): return 0, 0
}) def get_urls(self): return [(r'^modules/(?P<module_slug>[-\w_]+)/media/$', views.ExtraFieldsDashboardView.as_view(component=self), 'interactiveevents-media')] class ModuleAffiliationsComponent(ModuleFormSetComponent): identifier = 'affiliations' weight = 13 label = _('Affiliations') form_title = _('Edit affiliations') form_class = forms.AffiliationFormSet form_template_name = \ 'a4_candy_interactive_events/includes/module_affiliations_form.html' def get_progress(self, module): if category_models.Category.objects.filter(module=module).exists(): return 1, 1 return 0, 1 def is_effective(self, module): module_app = module.phases[0].content().app return module_app == 'a4_candy_interactive_events' components.register_module(MediaComponent()) components.register_module(ModuleAffiliationsComponent())
def is_effective(self, module): module_app = module.phases[0].content().app return (module_app == 'a4_candy_budgeting' and not module.project.is_draft) def get_progress(self, module): return 0, 0 def get_base_url(self, module): return reverse('a4dashboard:budgeting-export-module', kwargs={ 'organisation_slug': module.project.organisation.slug, 'module_slug': module.slug, }) def get_urls(self): return [ (r'^modules/(?P<module_slug>[-\w_]+)/export/budgeting/$', views.ProposalDashboardExportView.as_view(), 'budgeting-export-module'), (r'^modules/(?P<module_slug>[-\w_]+)/export/budgeting/ideas/$', exports.ProposalExportView.as_view(), 'budgeting-export'), (r'^modules/(?P<module_slug>[-\w_]+)/export/budgeting/comments/$', exports.ProposalCommentExportView.as_view(), 'budgeting-comment-export'), ] components.register_module(ExportBudgetingComponent())