Commit 50c54468 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[views] display latest blogpost on home page

parent 031308391b36
......@@ -24,8 +24,10 @@ from cubicweb.view import EntityView
from cubicweb.selectors import is_instance, match_user_groups, authenticated_user
from cubicweb.web.views import primary, workflow
from cubes.conference.views.startup import ConferenceIndexView
from cubes.conference.views.forms import subject_reg_open_conf_vocabulary
from cubes.shoppingcart.views import ShoppingCartPrimaryView
from cubes.shoppingcart.views import ShoppingCartEntityFormRenderer
uicfg.autoform_field_kwargs.tag_subject_of(('ShoppingCart', 'book_conf', 'Conference'),
{'choices': subject_reg_open_conf_vocabulary})
......@@ -33,13 +35,23 @@ uicfg.actionbox_appearsin_addmenu.tag_subject_of(('Conference', 'has_shoppingite
_ = unicode
from cubes.shoppingcart.views import ShoppingCartEntityFormRenderer
# this message is needed to have it appear in translation files
_('creating ShoppingCart (ShoppingCart buyer CWUser %(linkto)s)')
REPLACE_LIST = []
class CmtIndexView(ConferenceIndexView):
def call(self):
super(CmtIndexView, self).call()
rset = self._cw.execute('Any X ORDERBY CD DESC LIMIT 1 WHERE X is BlogEntry, X creation_date CD')
if rset:
for post in rset.entities():
self.w(post.view('primary'))
REPLACE_LIST.append((CmtIndexView, ConferenceIndexView))
class ConferenceRegistrationBox(box.BoxTemplate):
__regid__ = 'confregistrationbox'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment