Esempio n. 1
0
    def GET(self):
        """
        """
        if self.env["cfg"].enablePublicPages:
            page = self.env["members"]["p"] \
                    if self.env["members"].has_key("p") else 1

            view = publicFlagsTmpl(searchList=[self.tmplSearchList])

            flags = pubfc.publicFlagsCollection()
            flags.paginate(page, 25)
            flags.fetch()
            flags.format()
            flags.join(um.userORM, "userID")

            if self.env["cfg"].enableModalFlagDeletes:
                view.scripts = ["handlebars_1.0.min",
                        "jquery.json-2.4.min",
                        "adminModal.flagr",
                        "editForm.flagr",
                        "deleteFlagModal.flagr"]

            flagsTmpl = flagsListTmpl(searchList=[self.tmplSearchList])
            flagsTmpl.flags = flags

            view.flags = str(flagsTmpl)

            return view
        else:
            self._404()
Esempio n. 2
0
    def GET(self):
        if self.env["cfg"].enablePublicPages and self.env["cfg"].enablePublicSearch:
            page = self.env["members"]["p"] if self.env["members"].has_key("p") else 1
            value = self.env["members"]["s"] if self.env["members"].has_key("s") else ""

            flags = fs.flagSearch(value)

            view = searchTmpl(searchList=[self.tmplSearchList])

            if self.env["cfg"].enableModalFlagDeletes:
                view.scripts = ["handlebars_1.0.min",
                        "jquery.json-2.4.min",
                        "adminModal.flagr",
                        "editForm.flagr",
                        "deleteFlagModal.flagr"]

            flagsTmpl = flagsListTmpl(searchList=[self.tmplSearchList])
            flagsTmpl.flags = flags

            view.flagResults = str(flagsTmpl)
            view.query = value

            return view
        else:
            self._404()
Esempio n. 3
0
    def GET(self):
        """
        """
        if self.env["cfg"].enablePublicPages and self.env["cfg"].enablePublicLabels:
            page = self.env["members"]["p"] \
                    if self.env["members"].has_key("p") else 1
            baseLabel = self.env["members"][0]

            if type(baseLabel) == list:
                baseLabel = "/".join(baseLabel)

            view = labelsViewTmpl(searchList=[self.tmplSearchList])

            labelRe = re.compile(baseLabel+'(.*)')

            matchedFlags = []
            labels = []
            flags = fm.listFlagsByUserID(self.session.id)
            for flag in flags:
                for label in flag.labels:
                    if labelRe.match(label):
                        labels.append(label)
                        matchedFlags.append(flag)

            if baseLabel in labels:
                labels.pop(labels.index(baseLabel))

            if self.env["cfg"].enableModalFlagDeletes:
                view.scripts = ["handlebars_1.0.min",
                        "jquery.json-2.4.min",
                        "adminModal.flagr",
                        "editForm.flagr",
                        "deleteFlagModal.flagr"]

            flags = fm.formatFlags(matchedFlags, False)

            flagsTmpl = flagsListTmpl(searchList=[self.tmplSearchList])
            flagsTmpl.flags = flags

            view.flags = str(flagsTmpl)

            view.labels = labels
            view.baseLabel = baseLabel

            return view
        else:
            self._404()
Esempio n. 4
0
    def GET(self):
        """
        """
        page = self.env["members"]["p"] \
                if self.env["members"].has_key("p") else 1

        viewType = self.env["members"]["v"] \
                if self.env["members"].has_key("v") else "public"

        view = youFlagsTmpl(searchList=[self.tmplSearchList])

        if viewType == "public":
            flags = pubfc.userPublicFlagsCollection(self.session.id)
            flags.paginate(page, 25)
            flags.fetch()
            flags.format()

        elif viewType == "private":
            flags = fc.userFlagsCollection(self.session.id)
            flags.withoutCollection(pubfc.userPublicFlagsCollection(self.session.id))
            flags.paginate(page, 25)
            flags.fetch()
            flags.format()

        view.section = viewType

        if self.env["cfg"].enableModalFlagDeletes:
            view.scripts = ["handlebars_1.0.min",
                    "jquery.json-2.4.min",
                    "adminModal.flagr",
                    "editForm.flagr",
                    "deleteFlagModal.flagr"]

        flagsTmpl = flagsListTmpl(searchList=[self.tmplSearchList])
        flagsTmpl.flags = flags

        view.flags = str(flagsTmpl)

        return view