web/views/wdoc.py
branchtls-sprint
changeset 692 800592b8d39b
parent 431 18b4dd650ef8
child 731 ac4a94e50b60
equal deleted inserted replaced
691:35133d86970b 692:800592b8d39b
    13 from mx.DateTime import strptime, today
    13 from mx.DateTime import strptime, today
    14 
    14 
    15 from logilab.common.changelog import ChangeLog
    15 from logilab.common.changelog import ChangeLog
    16 from logilab.mtconverter import CHARSET_DECL_RGX
    16 from logilab.mtconverter import CHARSET_DECL_RGX
    17 
    17 
    18 from cubicweb.common.selectors import match_form_params
    18 from cubicweb.selectors import match_form_params
    19 from cubicweb.common.view import StartupView
    19 from cubicweb.common.view import StartupView
    20 from cubicweb.common.uilib import rest_publish
    20 from cubicweb.common.uilib import rest_publish
    21 from cubicweb.web import NotFound
    21 from cubicweb.web import NotFound
    22 
    22 
    23 _ = unicode
    23 _ = unicode
    83     return [child for child in node if child.tag == 'section']
    83     return [child for child in node if child.tag == 'section']
    84 
    84 
    85 # help views ##################################################################
    85 # help views ##################################################################
    86 
    86 
    87 class InlineHelpView(StartupView):
    87 class InlineHelpView(StartupView):
    88     __selectors__ = (match_form_params,)
    88     __selectors__ = match_form_params('fid')
    89     form_params = ('fid',)
       
    90     id = 'wdoc'
    89     id = 'wdoc'
    91     title = _('site documentation')
    90     title = _('site documentation')
    92     
    91     
    93     def call(self):
    92     def call(self):
    94         fid = self.req.form['fid']
    93         fid = self.req.form['fid']
   161         self.w(u'</ul>\n')
   160         self.w(u'</ul>\n')
   162         
   161         
   163 
   162 
   164 
   163 
   165 class InlineHelpImageView(StartupView):
   164 class InlineHelpImageView(StartupView):
   166     __selectors__ = (match_form_params,)
       
   167     form_params = ('fid',)
       
   168     id = 'wdocimages'
   165     id = 'wdocimages'
       
   166     __selectors__ = match_form_params('fid')
   169     binary = True
   167     binary = True
   170     templatable = False
   168     templatable = False
   171     content_type = 'image/png'
   169     content_type = 'image/png'
   172     
   170     
   173     def call(self):
   171     def call(self):