예제 #1
0
 def _handle(self, req):
     module_names = self._reload_modules(req)
     content = lcg.coerce((
         lcg.p(_("The following modules were successfully reloaded:")),
         lcg.p(", ".join(module_names)),
     ))
     return wiking.Document(_("Reload"), lcg.coerce(content))
예제 #2
0
파일: export.py 프로젝트: brailcom/wiking
 def _footer(self, context):
     g = self._generator
     content = context.application.footer_content(context.req())
     if content:
         return g.hr() + lcg.coerce(content).export(context)
     else:
         return None
예제 #3
0
 def help(cls):
     sections = [lcg.Section(title=title, id=section_id, content=lcg.coerce(content))
                 for title, section_id, content in
                 ((_("Instructions"), 'intro', cls._EXERCISE_CLASS.help_intro()),
                  (_("Shortcut Keys"), 'keys', cls._help_keys()),
                  (_("Indicators"), 'indicators', cls._help_indicators()),
                  (_("Control Panel"), 'panel', cls._help_panel()))
                 if content is not None]
     return lcg.Container(sections)
예제 #4
0
 def body(self):
     content_1 = lcg.coerce('xxx')
     content_2 = lcg.VSpace(lcg.UMm(500))
     return pytis.output.Document(
         lcg.Container((
             content_1,
             content_2,
             content_1,
         )))
예제 #5
0
파일: exercises_html.py 프로젝트: dusek/lcg
 def help(cls):
     sections = [lcg.Section(title=title, id=section_id, content=lcg.coerce(content))
                 for title, section_id, content in
                 ((_("Instructions"), 'intro', cls._EXERCISE_CLASS.help_intro()),
                  (_("Shortcut Keys"), 'keys', cls._help_keys()),
                  (_("Indicators"), 'indicators', cls._help_indicators()),
                  (_("Control Panel"), 'panel', cls._help_panel()))
                 if content is not None]
     return lcg.Container(sections)
예제 #6
0
 def _bottom_bar(self, context):
     req = context.req()
     left = context.application.bottom_bar_left_content(req)
     right = context.application.bottom_bar_right_content(req)
     if left or right:
         g = self._generator
         result = [g.hr()]
         if left:
             content = lcg.coerce(left)
             if right:
                 result.append(g.span(content.export(context), cls="left"))
             else:
                 result.append(g.div(content.export(context), cls="left"))
         if right:
             content = lcg.coerce(right)
             result.append(g.span(content.export(context), cls="right"))
         return result
     else:
         return None
예제 #7
0
파일: export.py 프로젝트: brailcom/wiking
 def _bottom_bar(self, context):
     req = context.req()
     left = context.application.bottom_bar_left_content(req)
     right = context.application.bottom_bar_right_content(req)
     if left or right:
         g = self._generator
         result = [g.hr()]
         if left:
             content = lcg.coerce(left)
             if right:
                 result.append(g.span(content.export(context), cls="left"))
             else:
                 result.append(g.div(content.export(context), cls="left"))
         if right:
             if left:
                 result.append(self._hidden(" | "))
             content = lcg.coerce(right)
             result.append(g.span(content.export(context)))
         return result
     else:
         return None
예제 #8
0
    def _content(self, lang):
        import wiking
        import wiking.cms

        def descr(option):
            content = [lcg.em(option.description())]
            doc = option.documentation()
            if doc:
                content.append(lcg.p(doc))
            content.append(lcg.p("*Default value:*", formatted=True))
            content.append(lcg.PreformattedText(option.default_string()))
            return content

        import lcg
        # Initial text is taken from configuration module docstring.
        intro = lcg.Parser().parse(lcg.unindent_docstring(wiking.cfg.__doc__))
        # Construct sections according to module and subsections with the config options
        sections = [
            lcg.Section(title=title,
                        content=[
                            lcg.Section(title="Option '%s'" % o.name(),
                                        id=o.name(),
                                        descr=o.description(),
                                        content=descr(o))
                            for o in cfg.options(sort=True) if o.visible()
                        ])
            for title, cfg in (("Wiking Configuration Options", wiking.cfg),
                               ("Wiking CMS Configuration Options",
                                wiking.cms.cfg))
        ]
        overview = [
            lcg.Section(title=section.title() + " Overview",
                        content=lcg.ul(
                            lcg.coerce((lcg.link(s, s.id()), ": ", s.descr()))
                            for s in section.sections()))
            for section in sections
        ]
        return dict(content=intro + overview + sections)
예제 #9
0
 def _footer(self, context):
     content = context.application.footer_content(context.req())
     if content:
         return lcg.coerce(content).export(context)
     else:
         return None
예제 #10
0
 def _top_controls(self, context):
     return lcg.coerce(context.application.top_controls(context.req())).export(context)
예제 #11
0
파일: export.py 프로젝트: brailcom/wiking
 def _top_controls(self, context):
     return lcg.coerce(context.application.top_controls(context.req())).export(context)
예제 #12
0
파일: export.py 프로젝트: brailcom/wiking
 def _top_content(self, context):
     content = context.application.top_content(context.req())
     if content:
         return lcg.coerce(content).export(context)
     else:
         return None
예제 #13
0
파일: misc.py 프로젝트: cerha/pytis
 def page_footer(self):
     return lcg.coerce('Footer Text')
예제 #14
0
파일: misc.py 프로젝트: cerha/pytis
 def page_header(self):
     return lcg.coerce('Header Text')
예제 #15
0
파일: modules.py 프로젝트: dusek/wiking
 def _handle(self, req):
     module_names = self._reload_modules(req)
     content = lcg.coerce((lcg.p(_("The following modules were successfully reloaded:")),
                           lcg.p(", ".join(module_names)),))
     return wiking.Document(_("Reload"), lcg.coerce(content))