mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
integrations: Fix missing links to non-webhook integrations.
Apparently help_content was attached to the wrong class. Fixes #4744.
This commit is contained in:
@@ -59,6 +59,17 @@ class Integration(object):
|
|||||||
# type: (Dict[Any, Any]) -> None
|
# type: (Dict[Any, Any]) -> None
|
||||||
self.doc_context = context
|
self.doc_context = context
|
||||||
|
|
||||||
|
@property
|
||||||
|
def help_content(self):
|
||||||
|
# type: () -> Text
|
||||||
|
doc_context = self.doc_context or {}
|
||||||
|
|
||||||
|
if self.doc.endswith('.md'):
|
||||||
|
return render_markdown_path(self.doc, doc_context)
|
||||||
|
else:
|
||||||
|
template = loader.get_template(self.doc)
|
||||||
|
return mark_safe(template.render(doc_context))
|
||||||
|
|
||||||
class EmailIntegration(Integration):
|
class EmailIntegration(Integration):
|
||||||
def is_enabled(self):
|
def is_enabled(self):
|
||||||
# type: () -> bool
|
# type: () -> bool
|
||||||
@@ -104,17 +115,6 @@ class WebhookIntegration(Integration):
|
|||||||
# type: () -> LocaleRegexProvider
|
# type: () -> LocaleRegexProvider
|
||||||
return url(self.url, self.function)
|
return url(self.url, self.function)
|
||||||
|
|
||||||
@property
|
|
||||||
def help_content(self):
|
|
||||||
# type: () -> Text
|
|
||||||
doc_context = self.doc_context or {}
|
|
||||||
|
|
||||||
if self.doc.endswith('.md'):
|
|
||||||
return render_markdown_path(self.doc, doc_context)
|
|
||||||
else:
|
|
||||||
template = loader.get_template(self.doc)
|
|
||||||
return mark_safe(template.render(doc_context))
|
|
||||||
|
|
||||||
class HubotLozenge(Integration):
|
class HubotLozenge(Integration):
|
||||||
GIT_URL_TEMPLATE = "https://github.com/hubot-scripts/hubot-{}"
|
GIT_URL_TEMPLATE = "https://github.com/hubot-scripts/hubot-{}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user