integrations: Add integrations/doc/assembla.

Significantly modified by tabbott and rishig to be more maintainable.

Fixes #4542.
This commit is contained in:
Aastha Gupta
2017-10-07 16:00:49 +05:30
committed by Tim Abbott
parent 85844107fd
commit 3b53c692a4
3 changed files with 27 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
Get Zulip notifications from {{ integration_display_name }} via Hubot!
{!create-stream.md!}
Next, [install Hubot](hubot), and test it to make sure it is working.
Finally, [follow these instructions]({{ hubot_docs_url }}) to set up
the integration with {{ integration_display_name }}!

View File

@@ -205,10 +205,14 @@ class HubotLozenge(Integration):
if git_url is None: if git_url is None:
git_url = self.GIT_URL_TEMPLATE.format(name) git_url = self.GIT_URL_TEMPLATE.format(name)
self.git_url = git_url self.hubot_docs_url = git_url
super().__init__( super().__init__(
name, name, categories, name, name, categories,
logo=logo, display_name=display_name, logo=logo, display_name=display_name,
# HACK: This isn't actually used. We'll rewrite this to
# `hubot_common.md` in `app_filters.py`
doc = 'zerver/integrations/%s.md' % (name,),
legacy=legacy legacy=legacy
) )
@@ -456,7 +460,6 @@ BOT_INTEGRATIONS = [
# Note: These are not actually displayed anywhere; we're keeping them # Note: These are not actually displayed anywhere; we're keeping them
# around so they can be migrated into the newer HUBOT_INTEGRATIONS # around so they can be migrated into the newer HUBOT_INTEGRATIONS
HUBOT_LOZENGES_LEGACY = { HUBOT_LOZENGES_LEGACY = {
'assembla': HubotLozenge('assembla', ['project-management', 'version-control']),
'bonusly': HubotLozenge('bonusly', ['hr']), 'bonusly': HubotLozenge('bonusly', ['hr']),
'chartbeat': HubotLozenge('chartbeat', ['marketing']), 'chartbeat': HubotLozenge('chartbeat', ['marketing']),
'darksky': HubotLozenge('darksky', ['misc'], display_name='Dark Sky', logo_alt='Dark Sky logo'), 'darksky': HubotLozenge('darksky', ['misc'], display_name='Dark Sky', logo_alt='Dark Sky logo'),
@@ -470,8 +473,16 @@ HUBOT_LOZENGES_LEGACY = {
'youtube': HubotLozenge('youtube', ['misc'], display_name='YouTube', logo_alt='YouTube logo') 'youtube': HubotLozenge('youtube', ['misc'], display_name='YouTube', logo_alt='YouTube logo')
} }
for integration in WEBHOOK_INTEGRATIONS: HUBOT_INTEGRATIONS = {
INTEGRATIONS[integration.name] = integration HubotLozenge('assembla', ['version-control', 'project-management'],
display_name='Assembla', logo_alt='Assembla'),
}
for hubot_integration in HUBOT_INTEGRATIONS:
INTEGRATIONS[hubot_integration.name] = hubot_integration
for webhook_integration in WEBHOOK_INTEGRATIONS:
INTEGRATIONS[webhook_integration.name] = webhook_integration
for bot_integration in BOT_INTEGRATIONS: for bot_integration in BOT_INTEGRATIONS:
INTEGRATIONS[bot_integration.name] = bot_integration INTEGRATIONS[bot_integration.name] = bot_integration

View File

@@ -98,6 +98,10 @@ def render_markdown_path(markdown_file_path, context=None):
context['recommended_stream_name'] = integration.stream_name context['recommended_stream_name'] = integration.stream_name
if hasattr(integration, 'url'): if hasattr(integration, 'url'):
context['integration_url'] = integration.url[3:] context['integration_url'] = integration.url[3:]
if hasattr(integration, 'hubot_docs_url'):
context['hubot_docs_url'] = integration.hubot_docs_url
# HACK: The actual file doesn't exist; we rewrite it here.
markdown_file_path = 'zerver/integrations/hubot_common.md'
jinja = engines['Jinja2'] jinja = engines['Jinja2']
markdown_string = jinja.env.loader.get_source(jinja.env, markdown_file_path)[0] markdown_string = jinja.env.loader.get_source(jinja.env, markdown_file_path)[0]