Exemplo n.º 1
0
 def get_context_data(self, **kwargs):
     c = ArticleMixin.get_context_data(self, **kwargs)
     c['parent_urlpath'] = self.urlpath
     c['parent_article'] = self.article
     c['create_form'] = kwargs.pop('form', None)
     c['editor'] = editors.getEditor()
     return c
Exemplo n.º 2
0
 def get_context_data(self, **kwargs):
     c = ArticleMixin.get_context_data(self, **kwargs)
     c["parent_urlpath"] = self.urlpath
     c["parent_article"] = self.article
     c["create_form"] = kwargs.pop("form", None)
     c["editor"] = editors.getEditor()
     return c
Exemplo n.º 3
0
 def get_context_data(self, **kwargs):
     # Needed since Django 1.9 because get_context_data is no longer called
     # with the form instance
     if 'form' not in kwargs:
         kwargs['form'] = self.get_form()
     kwargs = ArticleMixin.get_context_data(self, **kwargs)
     kwargs.update(FormView.get_context_data(self, **kwargs))
     return kwargs
Exemplo n.º 4
0
 def get_context_data(self, **kwargs):
     # Is this a bit of a hack? Use better inheritance?
     kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
     kwargs_listview = ListView.get_context_data(self, **kwargs)
     kwargs.update(kwargs_article)
     kwargs.update(kwargs_listview)
     kwargs['selected_tab'] = 'history'
     return kwargs
Exemplo n.º 5
0
 def get_context_data(self, **kwargs):
     kwargs['title'] = _(
         'Preview Template: %s'
     ) % self.title
     kwargs['revision'] = None
     kwargs['content'] = self.template_content
     kwargs['preview'] = self.preview
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 6
0
 def get_context_data(self, **kwargs):
     # Is this a bit of a hack? Use better inheritance?
     kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
     kwargs_listview = ListView.get_context_data(self, **kwargs)
     kwargs["search_form"] = forms.SearchForm(self.request.GET)
     kwargs["query"] = self.query
     kwargs.update(kwargs_article)
     kwargs.update(kwargs_listview)
     kwargs["selected_tab"] = "attachments"
     return kwargs
Exemplo n.º 7
0
 def get_context_data(self, **kwargs):
     # Is this a bit of a hack? Use better inheritance?
     kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
     kwargs_listview = ListView.get_context_data(self, **kwargs)
     kwargs['search_form'] = forms.SearchForm(self.request.GET)
     kwargs['query'] = self.query
     kwargs.update(kwargs_article)
     kwargs.update(kwargs_listview)
     kwargs['selected_tab'] = 'template'
     return kwargs
Exemplo n.º 8
0
 def get_context_data(self, **kwargs):
     # Is this a bit of a hack? Use better inheritance?
     kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
     kwargs_listview = ListView.get_context_data(self, **kwargs)
     kwargs.update(kwargs_article)
     kwargs.update(kwargs_listview)
     kwargs['selected_tab'] = 'history'
     if hasattr(site_settings,'PRIVATE_WIKI') and site_settings.PRIVATE_WIKI and self.request.user.is_anonymous():
         raise Http404()
     return kwargs
Exemplo n.º 9
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     context['selected_tab'] = 'view'
     article_context = ArticleMixin.get_context_data(self, **kwargs)
     descendants = article_context['urlpath'].root().get_descendants()
     descendants = [
         descendant for descendant in descendants
         if descendant.article.can_read(self.request.user)
     ]
     article_context['descendants'] = descendants
     return article_context
Exemplo n.º 10
0
 def get_context_data(self, **kwargs):
     c = ArticleMixin.get_context_data(self, **kwargs)
     # Needed since Django 1.9 because get_context_data is no longer called
     # with the form instance
     if 'form' not in c:
         c['form'] = self.get_form()
     c['parent_urlpath'] = self.urlpath
     c['parent_article'] = self.article
     c['create_form'] = c.pop('form', None)
     c['editor'] = editors.getEditor()
     return c
Exemplo n.º 11
0
 def get_context_data(self, **kwargs):
     c = ArticleMixin.get_context_data(self, **kwargs)
     # Needed since Django 1.9 because get_context_data is no longer called
     # with the form instance
     if 'form' not in c:
         c['form'] = self.get_form()
     c['parent_urlpath'] = self.urlpath
     c['parent_article'] = self.article
     c['create_form'] = c.pop('form', None)
     c['editor'] = editors.getEditor()
     return c
Exemplo n.º 12
0
 def get_context_data(self, **kwargs):
     c = ArticleMixin.get_context_data(self, **kwargs)
     # Needed since Django 1.9 because get_context_data is no longer called
     # with the form instance
     if "form" not in c:
         c["form"] = self.get_form()
     c["parent_urlpath"] = self.urlpath
     c["parent_article"] = self.article
     c["create_form"] = c.pop("form", None)
     c["editor"] = editors.getEditor()
     return c
Exemplo n.º 13
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     context["selected_tab"] = "view"
     article_context = ArticleMixin.get_context_data(self, **kwargs)
     descendants = article_context["urlpath"].root().get_descendants()
     descendants = [
         descendant for descendant in descendants
         if descendant.article.can_read(self.request.user)
     ]
     article_context["descendants"] = descendants
     return article_context
Exemplo n.º 14
0
 def get_context_data(self, **kwargs):
     # Is this a bit of a hack? Use better inheritance?
     kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
     kwargs_listview = ListView.get_context_data(self, **kwargs)
     kwargs.update(kwargs_article)
     kwargs.update(kwargs_listview)
     kwargs['selected_tab'] = 'history'
     # try:  # TODO: remove
     #     kwargs['metadataRevisions'] = SupersenseRevision.objects.all()
     # except:
     #     pass
     return kwargs
Exemplo n.º 15
0
 def get_context_data(self, **kwargs):
     # Is this a bit of a hack? Use better inheritance?
     kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
     kwargs_listview = ListView.get_context_data(self, **kwargs)
     kwargs['search_form'] = forms.SearchForm(self.request.GET)
     kwargs['query'] = self.query
     kwargs.update(kwargs_article)
     kwargs.update(kwargs_listview)
     kwargs['selected_tab'] = 'attachments'
     if 'form' not in kwargs:
         kwargs['form'] = self.get_form()
     return kwargs
Exemplo n.º 16
0
    def get_context_data(self, **kwargs):
        try:
            models.SimpleMetadata.objects.get(article=Article.objects.get(
                urlpath=URLPath.objects.get(slug='supersenses')))
            models.SimpleMetadata.objects.get(article=Article.objects.get(
                urlpath=URLPath.objects.get(slug='construals')))
            kwargs['install'] = ''
        except (URLPath.DoesNotExist, Article.DoesNotExist,
                models.SimpleMetadata.DoesNotExist):
            kwargs['install'] = mark_safe(
                '<h2><a href="installmetadata">Install metadata</a></h2>')

        return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 17
0
    def get_context_data(self, **kwargs):
        kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
        kwargs_listview = ListView.get_context_data(self, **kwargs)
        kwargs.update(kwargs_article)
        kwargs.update(kwargs_listview)
        kwargs['filter_query'] = self.query
        kwargs['filter_form'] = self.filter_form

        # Update each child's ancestor cache so the lookups don't have
        # to be repeated.
        updated_children = kwargs[self.context_object_name]
        for child in updated_children:
            child.set_cached_ancestors_from_parent(self.urlpath)
        kwargs[self.context_object_name] = updated_children

        return kwargs
Exemplo n.º 18
0
    def get_context_data(self, **kwargs):
        kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
        kwargs_listview = ListView.get_context_data(self, **kwargs)
        kwargs.update(kwargs_article)
        kwargs.update(kwargs_listview)
        kwargs['filter_query'] = self.query
        kwargs['filter_form'] = self.filter_form

        # Update each child's ancestor cache so the lookups don't have
        # to be repeated.
        updated_children = kwargs[self.context_object_name]
        for child in updated_children:
            child.set_cached_ancestors_from_parent(self.urlpath)
        kwargs[self.context_object_name] = updated_children

        return kwargs
Exemplo n.º 19
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'source'
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 20
0
 def get_context_data(self, **kwargs):
     kwargs.update(ArticleMixin.get_context_data(self, **kwargs))
     return ListView.get_context_data(self, **kwargs)
Exemplo n.º 21
0
 def get_context_data(self, **kwargs):
     kwargs["title"] = self.title
     kwargs["revision"] = self.revision
     kwargs["content"] = self.content
     kwargs["preview"] = self.preview
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 22
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'source'
     if hasattr(site_settings,'PRIVATE_WIKI') and site_settings.PRIVATE_WIKI and self.request.user.is_anonymous():
         return ''
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 23
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'source'
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 24
0
 def get_context_data(self, **kwargs):
     kwargs = ArticleMixin.get_context_data(self, **kwargs)
     kwargs.update(FormView.get_context_data(self, **kwargs))
     return kwargs
Exemplo n.º 25
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'attachments'
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 26
0
 def get_context_data(self, **kwargs):
     kwargs.update(ArticleMixin.get_context_data(self, **kwargs))
     return ListView.get_context_data(self, **kwargs)
Exemplo n.º 27
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'attachments'
     if 'form' not in kwargs:
         kwargs['form'] = self.get_form()
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 28
0
 def get_context_data(self, **kwargs):
     kwargs["selected_tab"] = "attachments"
     if "form" not in kwargs:
         kwargs["form"] = self.get_form()
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 29
0
 def get_context_data(self, **kwargs):
     kwargs["title"] = self.title
     kwargs["revision"] = self.revision
     kwargs["content"] = self.content
     kwargs["preview"] = self.preview
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 30
0
 def get_context_data(self, **kwargs):
     kwargs['title'] = self.title
     kwargs['revision'] = self.revision
     kwargs['content'] = self.content
     kwargs['preview'] = self.preview
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 31
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'attachments'
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 32
0
 def get_context_data(self, **kwargs):
     kwargs["selected_tab"] = "attachments"
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 33
0
 def get_context_data(self, **kwargs):
     kwargs["selected_tab"] = "view"
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 34
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'view'
     kwargs_article = ArticleMixin.get_context_data(self, **kwargs)
     kwargs.update(kwargs_article)
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 35
0
 def get_context_data(self, **kwargs):
     kwargs["selected_tab"] = "view"
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 36
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'attachments'
     if 'form' not in kwargs:
         kwargs['form'] = self.get_form()
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 37
0
 def get_context_data(self, **kwargs):
     kwargs = ArticleMixin.get_context_data(self, **kwargs)
     kwargs.update(FormView.get_context_data(self, **kwargs))
     return kwargs
Exemplo n.º 38
0
 def get_context_data(self, **kwargs):
     kwargs['title'] = self.title
     kwargs['revision'] = self.revision
     kwargs['content'] = self.content
     kwargs['preview'] = self.preview
     return ArticleMixin.get_context_data(self, **kwargs)
Exemplo n.º 39
0
 def get_context_data(self, **kwargs):
     kwargs['path'] = ''
     return ArticleMixin.get_context_data(self, **kwargs)