author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Fri, 27 Aug 2010 13:44:55 +0200 | |
branch | stable |
changeset 6165 | 7da7c270bbbd |
parent 5424 | 8ecbcbff9777 |
child 6420 | 4c14be06e557 |
permissions | -rw-r--r-- |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
1 |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
3 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
4 |
# This file is part of CubicWeb. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
5 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
9 |
# any later version. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
10 |
# |
5424
8ecbcbff9777
replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5421
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
14 |
# details. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
15 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4466
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
0 | 18 |
"""inline help system, using ReST file in products `wdoc` directory |
19 |
||
20 |
""" |
|
21 |
__docformat__ = "restructuredtext en" |
|
22 |
||
23 |
from itertools import chain |
|
24 |
from os.path import join |
|
25 |
from bisect import bisect_right |
|
1016
26387b836099
use datetime instead of mx.DateTime
sylvain.thenault@logilab.fr
parents:
984
diff
changeset
|
26 |
from datetime import date |
0 | 27 |
|
28 |
from logilab.common.changelog import ChangeLog |
|
4466
8b0ca7904820
moved generic datetime manipulation function to lgc
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
29 |
from logilab.common.date import strptime, todate |
0 | 30 |
from logilab.mtconverter import CHARSET_DECL_RGX |
31 |
||
3495
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
32 |
from cubicweb.selectors import match_form_params, yes |
984 | 33 |
from cubicweb.view import StartupView |
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4004
diff
changeset
|
34 |
from cubicweb.uilib import rest_publish |
3495
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
35 |
from cubicweb.web import NotFound, action |
0 | 36 |
_ = unicode |
37 |
||
38 |
# table of content management ################################################# |
|
39 |
||
40 |
try: |
|
41 |
from xml.etree.ElementTree import parse |
|
42 |
except ImportError: |
|
43 |
from elementtree.ElementTree import parse |
|
44 |
||
45 |
def build_toc_index(node, index): |
|
46 |
try: |
|
47 |
nodeidx = node.attrib['resource'] |
|
48 |
assert not nodeidx in index, nodeidx |
|
49 |
index[nodeidx] = node |
|
50 |
except KeyError: |
|
51 |
pass |
|
52 |
for child in node: |
|
53 |
build_toc_index(child, index) |
|
54 |
child.parent = node |
|
55 |
||
56 |
def get_insertion_point(section, index): |
|
57 |
if section.attrib.get('insertafter'): |
|
58 |
snode = index[section.attrib['insertafter']] |
|
59 |
node = snode.parent |
|
60 |
idx = node.getchildren().index(snode) + 1 |
|
61 |
elif section.attrib.get('insertbefore'): |
|
62 |
snode = index[section.attrib['insertbefore']] |
|
63 |
node = snode.parent |
|
64 |
idx = node.getchildren().index(snode) |
|
65 |
else: |
|
66 |
node = index[section.attrib['appendto']] |
|
67 |
idx = None |
|
68 |
return node, idx |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
69 |
|
0 | 70 |
def build_toc(config): |
71 |
alltocfiles = reversed(tuple(config.locate_all_files('toc.xml'))) |
|
72 |
maintoc = parse(alltocfiles.next()).getroot() |
|
73 |
maintoc.parent = None |
|
74 |
index = {} |
|
75 |
build_toc_index(maintoc, index) |
|
76 |
# insert component documentation into the tree according to their toc.xml |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
77 |
# file |
0 | 78 |
for fpath in alltocfiles: |
79 |
toc = parse(fpath).getroot() |
|
80 |
for section in toc: |
|
81 |
node, idx = get_insertion_point(section, index) |
|
82 |
if idx is None: |
|
83 |
node.append(section) |
|
84 |
else: |
|
85 |
node.insert(idx, section) |
|
86 |
section.parent = node |
|
87 |
build_toc_index(section, index) |
|
88 |
return index |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
89 |
|
1149 | 90 |
def title_for_lang(node, lang): |
0 | 91 |
for title in node.findall('title'): |
92 |
if title.attrib['{http://www.w3.org/XML/1998/namespace}lang'] == lang: |
|
93 |
return unicode(title.text) |
|
94 |
||
95 |
def subsections(node): |
|
96 |
return [child for child in node if child.tag == 'section'] |
|
97 |
||
98 |
# help views ################################################################## |
|
99 |
||
100 |
class InlineHelpView(StartupView): |
|
731
ac4a94e50b60
some more s/__selectors__/__select__ but still more to come
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
692
diff
changeset
|
101 |
__select__ = match_form_params('fid') |
3377
dd9d292b6a6d
use __regid__ instead of id on appobject classes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
102 |
__regid__ = 'wdoc' |
0 | 103 |
title = _('site documentation') |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
104 |
|
0 | 105 |
def call(self): |
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
106 |
fid = self._cw.form['fid'] |
3733
c3feb6a33f58
remove some warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3655
diff
changeset
|
107 |
vreg = self._cw.vreg |
c3feb6a33f58
remove some warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3655
diff
changeset
|
108 |
for lang in chain((self._cw.lang, vreg.property_value('ui.language')), |
c3feb6a33f58
remove some warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3655
diff
changeset
|
109 |
vreg.config.available_languages()): |
0 | 110 |
rid = '%s_%s.rst' % (fid, lang) |
3733
c3feb6a33f58
remove some warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3655
diff
changeset
|
111 |
resourcedir = vreg.config.locate_doc_file(rid) |
0 | 112 |
if resourcedir: |
113 |
break |
|
114 |
else: |
|
115 |
raise NotFound |
|
3733
c3feb6a33f58
remove some warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3655
diff
changeset
|
116 |
self.tocindex = build_toc(vreg.config) |
0 | 117 |
try: |
118 |
node = self.tocindex[fid] |
|
119 |
except KeyError: |
|
120 |
node = None |
|
121 |
else: |
|
122 |
self.navigation_links(node) |
|
123 |
self.w(u'<div class="hr"></div>') |
|
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
124 |
self.w(u'<h1>%s</h1>' % (title_for_lang(node, self._cw.lang))) |
0 | 125 |
data = open(join(resourcedir, rid)).read() |
126 |
self.w(rest_publish(self, data)) |
|
127 |
if node is not None: |
|
128 |
self.subsections_links(node) |
|
129 |
self.w(u'<div class="hr"></div>') |
|
130 |
self.navigation_links(node) |
|
131 |
||
132 |
def navigation_links(self, node): |
|
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
133 |
req = self._cw |
0 | 134 |
parent = node.parent |
135 |
if parent is None: |
|
136 |
return |
|
137 |
brothers = subsections(parent) |
|
138 |
self.w(u'<div class="docnav">\n') |
|
139 |
previousidx = brothers.index(node) - 1 |
|
140 |
if previousidx >= 0: |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
141 |
self.navsection(brothers[previousidx], 'prev') |
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
142 |
self.navsection(parent, 'up') |
0 | 143 |
nextidx = brothers.index(node) + 1 |
144 |
if nextidx < len(brothers): |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
145 |
self.navsection(brothers[nextidx], 'next') |
0 | 146 |
self.w(u'</div>\n') |
147 |
||
148 |
navinfo = {'prev': ('', 'data/previous.png', _('i18nprevnext_previous')), |
|
149 |
'next': ('', 'data/next.png', _('i18nprevnext_next')), |
|
150 |
'up': ('', 'data/up.png', _('i18nprevnext_up'))} |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
151 |
|
0 | 152 |
def navsection(self, node, navtype): |
153 |
htmlclass, imgpath, msgid = self.navinfo[navtype] |
|
154 |
self.w(u'<span class="%s">' % htmlclass) |
|
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
155 |
self.w(u'%s : ' % self._cw._(msgid)) |
0 | 156 |
self.w(u'<a href="%s">%s</a>' % ( |
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
157 |
self._cw.build_url('doc/'+node.attrib['resource']), |
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
158 |
title_for_lang(node, self._cw.lang))) |
0 | 159 |
self.w(u'</span>\n') |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
160 |
|
0 | 161 |
def subsections_links(self, node, first=True): |
162 |
sub = subsections(node) |
|
163 |
if not sub: |
|
164 |
return |
|
165 |
if first: |
|
166 |
self.w(u'<div class="hr"></div>') |
|
167 |
self.w(u'<ul class="docsum">') |
|
168 |
for child in sub: |
|
169 |
self.w(u'<li><a href="%s">%s</a>' % ( |
|
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
170 |
self._cw.build_url('doc/'+child.attrib['resource']), |
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
171 |
title_for_lang(child, self._cw.lang))) |
0 | 172 |
self.subsections_links(child, False) |
173 |
self.w(u'</li>') |
|
174 |
self.w(u'</ul>\n') |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
175 |
|
0 | 176 |
|
177 |
||
178 |
class InlineHelpImageView(StartupView): |
|
3377
dd9d292b6a6d
use __regid__ instead of id on appobject classes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
179 |
__regid__ = 'wdocimages' |
731
ac4a94e50b60
some more s/__selectors__/__select__ but still more to come
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
692
diff
changeset
|
180 |
__select__ = match_form_params('fid') |
0 | 181 |
binary = True |
182 |
templatable = False |
|
183 |
content_type = 'image/png' |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
184 |
|
0 | 185 |
def call(self): |
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
186 |
fid = self._cw.form['fid'] |
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
187 |
for lang in chain((self._cw.lang, self._cw.vreg.property_value('ui.language')), |
4087 | 188 |
self._cw.vreg.config.available_languages()): |
0 | 189 |
rid = join('images', '%s_%s.png' % (fid, lang)) |
4087 | 190 |
resourcedir = self._cw.vreg.config.locate_doc_file(rid) |
0 | 191 |
if resourcedir: |
192 |
break |
|
193 |
else: |
|
194 |
raise NotFound |
|
195 |
self.w(open(join(resourcedir, rid)).read()) |
|
196 |
||
197 |
||
198 |
class ChangeLogView(StartupView): |
|
3377
dd9d292b6a6d
use __regid__ instead of id on appobject classes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
199 |
__regid__ = 'changelog' |
0 | 200 |
title = _('What\'s new?') |
201 |
maxentries = 25 |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1364
diff
changeset
|
202 |
|
0 | 203 |
def call(self): |
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
204 |
rid = 'ChangeLog_%s' % (self._cw.lang) |
0 | 205 |
allentries = [] |
3451
6b46d73823f5
[api] work in progress, use __regid__, cw_*, etc.
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3377
diff
changeset
|
206 |
title = self._cw._(self.title) |
0 | 207 |
restdata = ['.. -*- coding: utf-8 -*-', '', title, '='*len(title), ''] |
208 |
w = restdata.append |
|
1364
3acc823121b6
can't compare date and datetime
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
209 |
today = date.today() |
4089
ff92c7d692bf
typos, api update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4087
diff
changeset
|
210 |
for fpath in self._cw.vreg.config.locate_all_files(rid): |
0 | 211 |
cl = ChangeLog(fpath) |
212 |
encoding = 'utf-8' |
|
213 |
# additional content may be found in title |
|
214 |
for line in (cl.title + cl.additional_content).splitlines(): |
|
215 |
m = CHARSET_DECL_RGX.search(line) |
|
216 |
if m is not None: |
|
217 |
encoding = m.group(1) |
|
218 |
continue |
|
219 |
elif line.startswith('.. '): |
|
220 |
w(unicode(line, encoding)) |
|
221 |
for entry in cl.entries: |
|
222 |
if entry.date: |
|
1364
3acc823121b6
can't compare date and datetime
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
223 |
edate = todate(strptime(entry.date, '%Y-%m-%d')) |
0 | 224 |
else: |
1364
3acc823121b6
can't compare date and datetime
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
225 |
edate = today |
0 | 226 |
messages = [] |
227 |
for msglines, submsgs in entry.messages: |
|
228 |
msgstr = unicode(' '.join(l.strip() for l in msglines), encoding) |
|
229 |
msgstr += u'\n\n' |
|
230 |
for submsglines in submsgs: |
|
231 |
msgstr += ' - ' + unicode(' '.join(l.strip() for l in submsglines), encoding) |
|
232 |
msgstr += u'\n' |
|
233 |
messages.append(msgstr) |
|
1132 | 234 |
entry = (edate, messages) |
0 | 235 |
allentries.insert(bisect_right(allentries, entry), entry) |
236 |
latestdate = None |
|
237 |
i = 0 |
|
1132 | 238 |
for edate, messages in reversed(allentries): |
239 |
if latestdate != edate: |
|
3460
e4843535db25
[api] some more _cw / __regid__, automatic tests now pass again
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3451
diff
changeset
|
240 |
fdate = self._cw.format_date(edate) |
0 | 241 |
w(u'\n%s' % fdate) |
1132 | 242 |
w('~' * len(fdate)) |
1364
3acc823121b6
can't compare date and datetime
sylvain.thenault@logilab.fr
parents:
1149
diff
changeset
|
243 |
latestdate = edate |
0 | 244 |
for msg in messages: |
245 |
w(u'* %s' % msg) |
|
246 |
i += 1 |
|
247 |
if i > self.maxentries: |
|
248 |
break |
|
249 |
w('') # blank line |
|
250 |
self.w(rest_publish(self, '\n'.join(restdata))) |
|
3495
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
251 |
|
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
252 |
|
3818
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
253 |
class HelpAction(action.Action): |
4004
c52619c738a5
api renaming update
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
3890
diff
changeset
|
254 |
__regid__ = 'help' |
3818
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
255 |
__select__ = yes() |
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
256 |
|
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
257 |
category = 'footer' |
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
258 |
order = 0 |
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
259 |
title = _('Help') |
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
260 |
|
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
261 |
def url(self): |
4045
f4a52abb6f4f
cw 3.6 api update
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
4023
diff
changeset
|
262 |
return self._cw.build_url('doc/main') |
3818
9522e51d8644
[web ui] move help from header to footer
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
3495
diff
changeset
|
263 |
|
3495
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
264 |
class ChangeLogAction(action.Action): |
3655
af86ab65a282
3.6 updates
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3503
diff
changeset
|
265 |
__regid__ = 'changelog' |
3495
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
266 |
__select__ = yes() |
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
267 |
|
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
268 |
category = 'footer' |
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
269 |
order = 1 |
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
270 |
title = ChangeLogView.title |
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
271 |
|
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
272 |
def url(self): |
3655
af86ab65a282
3.6 updates
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3503
diff
changeset
|
273 |
return self._cw.build_url('changelog') |
3495
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
274 |
|
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
275 |
|
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
276 |
class AboutAction(action.Action): |
3655
af86ab65a282
3.6 updates
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3503
diff
changeset
|
277 |
__regid__ = 'about' |
3495
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
278 |
__select__ = yes() |
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
279 |
|
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
280 |
category = 'footer' |
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
281 |
order = 2 |
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
282 |
title = _('about this site') |
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
283 |
|
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
284 |
def url(self): |
3655
af86ab65a282
3.6 updates
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3503
diff
changeset
|
285 |
return self._cw.build_url('doc/about') |
3495
438576c5b1d1
[ui] turn footer items into actions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
286 |