예제 #1
0
파일: add.py 프로젝트: stefaneutu/Jelly-Bot
    def get(self, request, *args, **kwargs):
        root_uid = get_root_oid(request)

        return render_template(
            request, _("Add an Auto-Reply module"), "ar/add.html", {
                "max_responses":
                AutoReply.MaxResponses,
                "max_length":
                AutoReply.MaxContentLength,
                "platform_list":
                list(Platform),
                "contenttype_list_kw": [
                    t for t in list(AutoReplyContentType)
                    if t != AutoReplyContentType.IMAGE
                ],
                "contenttype_list_rep":
                list(AutoReplyContentType),
                "tag_splitter":
                AutoReply.TagSplitter,
                "user_ch_list":
                ProfileManager.get_user_channel_profiles(
                    root_uid, inside_only=True, accessbible_only=True),
                "root_uid_str":
                str(root_uid),
                "perm_pin_access":
                ProfilePermission.AR_ACCESS_PINNED_MODULE.code,
                "oid_key":
                OID_KEY
            })
예제 #2
0
    def get(self, request, *args, **kwargs):
        root_uid = get_root_oid(request)

        return render_template(
            request, _("Auto-Reply ranking channel list"), "ar/rk-chlist.html",
            {
                "channel_list": ProfileManager.get_user_channel_profiles(
                    root_uid, inside_only=True, accessbible_only=True)
            }, nav_param=kwargs)
예제 #3
0
    def get(self, request, *args, **kwargs):
        root_oid = get_root_oid(request)

        access_ok = []
        access_no = []
        for channel_conn in ProfileManager.get_user_channel_profiles(root_oid, accessbible_only=False):
            if channel_conn.channel_data.bot_accessible:
                access_ok.append(channel_conn)
            else:
                access_no.append(channel_conn)

        return render_template(
            self.request, _("Channel List"), "account/channel/list.html", {
                "conn_access_ok": access_ok,
                "conn_access_no": access_no,
                "bot_cmd_info_code": cmd_id.main_cmd_code
            })