Exemple #1
0
def add_integrations_context(context):
    # type: (Dict[str, Any]) -> None
    alphabetical_sorted_categories = OrderedDict(sorted(CATEGORIES.items()))
    alphabetical_sorted_integration = OrderedDict(sorted(INTEGRATIONS.items()))
    alphabetical_sorted_hubot_lozenges = OrderedDict(
        sorted(HUBOT_LOZENGES.items()))
    context['categories_dict'] = alphabetical_sorted_categories
    context['integrations_dict'] = alphabetical_sorted_integration
    context['hubot_lozenges_dict'] = alphabetical_sorted_hubot_lozenges

    if "html_settings_links" in context and context["html_settings_links"]:
        settings_html = '<a href="../../#settings">Zulip settings page</a>'
        subscriptions_html = '<a target="_blank" href="../../#streams">streams page</a>'
    else:
        settings_html = 'Zulip settings page'
        subscriptions_html = 'streams page'

    context['settings_html'] = settings_html
    context['subscriptions_html'] = subscriptions_html

    for name in alphabetical_sorted_integration:
        alphabetical_sorted_integration[name].add_doc_context(context)

    for name in alphabetical_sorted_hubot_lozenges:
        alphabetical_sorted_hubot_lozenges[name].add_doc_context(context)
Exemple #2
0
def add_integrations_context(context):
    # type: (Dict[str, Any]) -> None
    alphabetical_sorted_integration = OrderedDict(sorted(INTEGRATIONS.items()))
    alphabetical_sorted_hubot_lozenges = OrderedDict(sorted(HUBOT_LOZENGES.items()))
    context['integrations_dict'] = alphabetical_sorted_integration
    context['hubot_lozenges_dict'] = alphabetical_sorted_hubot_lozenges

    if context["html_settings_links"]:
        settings_html = '<a href="../#settings">Zulip settings page</a>'
        subscriptions_html = '<a target="_blank" href="../#streams">streams page</a>'
    else:
        settings_html = 'Zulip settings page'
        subscriptions_html = 'streams page'

    context['settings_html'] = settings_html
    context['subscriptions_html'] = subscriptions_html
Exemple #3
0
def add_integrations_context(context):
    # type: (Dict[str, Any]) -> None
    alphabetical_sorted_integration = OrderedDict(sorted(INTEGRATIONS.items()))
    alphabetical_sorted_hubot_lozenges = OrderedDict(
        sorted(HUBOT_LOZENGES.items()))
    context['integrations_dict'] = alphabetical_sorted_integration
    context['hubot_lozenges_dict'] = alphabetical_sorted_hubot_lozenges

    if context["html_settings_links"]:
        settings_html = '<a href="../#settings">Zulip settings page</a>'
        subscriptions_html = '<a target="_blank" href="../#subscriptions">subscriptions page</a>'
    else:
        settings_html = 'Zulip settings page'
        subscriptions_html = 'subscriptions page'

    context['settings_html'] = settings_html
    context['subscriptions_html'] = subscriptions_html
Exemple #4
0
    def get_context_data(self, **kwargs):
        # type: (Optional[Dict[str, Any]]) -> Dict[str, Any]
        context = super(IntegrationView, self).get_context_data(**kwargs)  # type: Dict[str, Any]
        alphabetical_sorted_integration = OrderedDict(sorted(INTEGRATIONS.items()))
        alphabetical_sorted_hubot_lozenges = OrderedDict(sorted(HUBOT_LOZENGES.items()))
        context['integrations_dict'] = alphabetical_sorted_integration
        context['hubot_lozenges_dict'] = alphabetical_sorted_hubot_lozenges

        if context["html_settings_links"]:
            settings_html = '<a href="../#settings">Zulip settings page</a>'
            subscriptions_html = '<a target="_blank" href="../#subscriptions">subscriptions page</a>'
        else:
            settings_html = 'Zulip settings page'
            subscriptions_html = 'subscriptions page'

        context['settings_html'] = settings_html
        context['subscriptions_html'] = subscriptions_html

        return context
Exemple #5
0
    def get_context_data(self, **kwargs):
        # type: (**Any) -> Dict[str, Any]
        context = super(IntegrationView, self).get_context_data(**kwargs)  # type: Dict[str, Any]
        alphabetical_sorted_integration = OrderedDict(sorted(INTEGRATIONS.items()))
        alphabetical_sorted_hubot_lozenges = OrderedDict(sorted(HUBOT_LOZENGES.items()))
        context['integrations_dict'] = alphabetical_sorted_integration
        context['hubot_lozenges_dict'] = alphabetical_sorted_hubot_lozenges

        if context["html_settings_links"]:
            settings_html = '<a href="../#settings">Zulip settings page</a>'
            subscriptions_html = '<a target="_blank" href="../#subscriptions">subscriptions page</a>'
        else:
            settings_html = 'Zulip settings page'
            subscriptions_html = 'subscriptions page'

        context['settings_html'] = settings_html
        context['subscriptions_html'] = subscriptions_html

        return context
Exemple #6
0
 def test_check_if_every_hubot_lozenges_has_logo_that_exists(self):
     # type: () -> None
     for integration in HUBOT_LOZENGES.values():
         self.assertTrue(os.path.isfile(os.path.join(DEPLOY_ROOT, integration.logo)))
Exemple #7
0
 def test_check_if_every_hubot_lozenges_has_logo_that_exists(self):
     # type: () -> None
     for integration in HUBOT_LOZENGES.values():
         self.assertTrue(
             os.path.isfile(os.path.join(DEPLOY_ROOT, integration.logo)))