示例#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
示例#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
示例#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
示例#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
示例#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)
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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)
示例#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
示例#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
示例#19
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'source'
     return ArticleMixin.get_context_data(self, **kwargs)
示例#20
0
 def get_context_data(self, **kwargs):
     kwargs.update(ArticleMixin.get_context_data(self, **kwargs))
     return ListView.get_context_data(self, **kwargs)
示例#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)
示例#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)
示例#23
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'source'
     return ArticleMixin.get_context_data(self, **kwargs)
示例#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
示例#25
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'attachments'
     return ArticleMixin.get_context_data(self, **kwargs)
示例#26
0
 def get_context_data(self, **kwargs):
     kwargs.update(ArticleMixin.get_context_data(self, **kwargs))
     return ListView.get_context_data(self, **kwargs)
示例#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)
示例#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)
示例#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)
示例#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)
示例#31
0
 def get_context_data(self, **kwargs):
     kwargs['selected_tab'] = 'attachments'
     return ArticleMixin.get_context_data(self, **kwargs)
示例#32
0
 def get_context_data(self, **kwargs):
     kwargs["selected_tab"] = "attachments"
     return ArticleMixin.get_context_data(self, **kwargs)
示例#33
0
 def get_context_data(self, **kwargs):
     kwargs["selected_tab"] = "view"
     return ArticleMixin.get_context_data(self, **kwargs)
示例#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)
示例#35
0
 def get_context_data(self, **kwargs):
     kwargs["selected_tab"] = "view"
     return ArticleMixin.get_context_data(self, **kwargs)
示例#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)
示例#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
示例#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)
示例#39
0
 def get_context_data(self, **kwargs):
     kwargs['path'] = ''
     return ArticleMixin.get_context_data(self, **kwargs)