# HG changeset patch # User Sylvain Thénault # Date 1317374140 -7200 # Node ID defac26f41513d92dcc80a3615b9a2c605bee63d # Parent 0a967180794b09738dd6eaa177328e07caf08041 [book] startup views: add a note about *manage* view diff -r 0a967180794b -r defac26f4151 doc/book/en/devweb/views/startup.rst --- a/doc/book/en/devweb/views/startup.rst Thu Sep 29 15:28:41 2011 +0200 +++ b/doc/book/en/devweb/views/startup.rst Fri Sep 30 11:15:40 2011 +0200 @@ -1,15 +1,18 @@ Startup views ------------- -(:mod:`cubicweb.web.views.startup`) +Startup views are views requiring no context, from which you usually start +browsing (for instance the index page). The usual selectors are +:class:`~cubicweb.selectors.none_rset` or :class:`~cubicweb.selectors.yes`. -The usual selectors are no_rset or yes. These views don't apply to a -result set. +You'll find here a description of startup views provided by the framework. -*index* - This view defines the home page of your application. It does not require - a result set to apply to. +.. automodule:: cubicweb.web.views.startup + + +Other startup views: *schema* A view dedicated to the display of the schema of the instance +.. XXX to be continued \ No newline at end of file diff -r 0a967180794b -r defac26f4151 web/uicfg.py --- a/web/uicfg.py Thu Sep 29 15:28:41 2011 +0200 +++ b/web/uicfg.py Fri Sep 30 11:15:40 2011 +0200 @@ -30,6 +30,16 @@ * ``schema`` * ``subobject`` (not displayed by default) + By default only entities on the ``application`` category are shown. + +.. sourcecode:: python + + from cubicweb.web import uicfg + # force hiding + uicfg.indexview_etype_section['HideMe'] = 'subobject' + # force display + uicfg.indexview_etype_section['ShowMe'] = 'application' + Actions box configuration ````````````````````````` diff -r 0a967180794b -r defac26f4151 web/views/startup.py --- a/web/views/startup.py Thu Sep 29 15:28:41 2011 +0200 +++ b/web/views/startup.py Fri Sep 30 11:15:40 2011 +0200 @@ -15,8 +15,10 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -"""Set of HTML startup views. A startup view is global, e.g. doesn't apply to a -result set. +"""This module contains the default index page and management view. + +.. autoclass:: IndexView +.. autoclass:: ManageView """ __docformat__ = "restructuredtext en" @@ -32,6 +34,19 @@ from cubicweb.web import ajax_replace_url, uicfg, httpcache class ManageView(StartupView): + """:__regid__: *manage* + + The manage view, display some information about what's contained by your + site and provides access to administration stuff such as user and groups + management. + + Regarding the section displaying link to entity type, notice by default it + won't display entity types which are related to another one using a + mandatory (cardinality == 1) composite relation. + + You can still configure that behaviour manually using the + `indexview_etype_section` as explained in :mod:`cubicweb.web.uicfg`. + """ __regid__ = 'manage' title = _('manage') http_cache_manager = httpcache.EtagHTTPCacheManager @@ -149,6 +164,13 @@ class IndexView(ManageView): + """:__regid__: *index* + + The default index view, that you'll get when accessing your site's root url. + It's by default indentical to the + :class:`~cubicweb.web.views.startup.ManageView`, but you'll usually want to + customize this one. + """ __regid__ = 'index' title = _('view_index')