# HG changeset patch # User Todd Larsen # Date 1224020397 0 # Node ID 2d90d49ce78a4496f9cbc0ecc578b35425774403 # Parent 275a47dd0ac8e9ff903ddcd016a6f474c4a63bef Add is_featured boolean property to the Work model, so that Works can be designated as "featured" items in various places in the UI. This will be used to allow Sponsors, Programs, and Organizations to select Documents that should be included in their sidebar menus. Perhaps featured "site" Documents, such as site-wide Terms of Service, should probably be listed below the "User (sign-out)" menu, since the User will have to read and agree to these before being allowed to use the site. A collapsable Javascript sidebar is probably going to be needed soon... Patch by: Todd Larsen Review by: to-be-reviewed diff -r 275a47dd0ac8 -r 2d90d49ce78a app/soc/models/work.py --- a/app/soc/models/work.py Tue Oct 14 21:33:57 2008 +0000 +++ b/app/soc/models/work.py Tue Oct 14 21:39:57 2008 +0000 @@ -98,3 +98,11 @@ # * anyone, even those not logged in # (and possibly others) + #: field storing whether a link to the Work should be featured in + #: the sidebar menu (and possibly elsewhere); FAQs, Terms of Service, + #: and the like are examples of "featured" Works + is_featured = db.BooleanProperty( + verbose_name=ugettext_lazy('Is Featured')) + is_featured.help_text = ugettext_lazy( + 'Field used to indicate if a Work should be featured, for example,' + ' in the sidebar menu.') diff -r 275a47dd0ac8 -r 2d90d49ce78a app/soc/templates/soc/site/docs/list/docs_heading.html --- a/app/soc/templates/soc/site/docs/list/docs_heading.html Tue Oct 14 21:33:57 2008 +0000 +++ b/app/soc/templates/soc/site/docs/list/docs_heading.html Tue Oct 14 21:39:57 2008 +0000 @@ -3,6 +3,7 @@ Title Partial Path Linkname + Featured Created Modified diff -r 275a47dd0ac8 -r 2d90d49ce78a app/soc/templates/soc/site/docs/list/docs_row.html --- a/app/soc/templates/soc/site/docs/list/docs_row.html Tue Oct 14 21:33:57 2008 +0000 +++ b/app/soc/templates/soc/site/docs/list/docs_row.html Tue Oct 14 21:39:57 2008 +0000 @@ -9,6 +9,7 @@
{{ data_element.title }}
{{ data_element.partial_path }}
+
{{ data_element.created }}
{{ data_element.modified }}
diff -r 275a47dd0ac8 -r 2d90d49ce78a app/soc/views/site/docs/edit.py --- a/app/soc/views/site/docs/edit.py Tue Oct 14 21:33:57 2008 +0000 +++ b/app/soc/views/site/docs/edit.py Tue Oct 14 21:39:57 2008 +0000 @@ -101,6 +101,7 @@ properties['abstract'] = form.cleaned_data.get('abstract') properties['content'] = form.cleaned_data.get('content') properties['user'] = models.user.logic.getFromFields(email=email) + properties['is_featured'] = form.cleaned_data.get('is_featured') doc = document.logic.updateOrCreateFromFields(properties, partial_path=partial_path, @@ -188,7 +189,7 @@ 'title': doc.title, 'partial_path': doc.partial_path, 'link_name': doc.link_name, 'short_name': doc.short_name, 'abstract': doc.abstract, 'content': doc.content, - 'user': doc.user}) + 'user': doc.user, 'is_featured': doc.is_featured}) else: if request.GET.get(profile.SUBMIT_MSG_PARAM_NAME): # redirect to aggressively remove 'Profile saved' query parameter @@ -324,4 +325,4 @@ if existing_doc: document.logic.delete(existing_doc) - return http.HttpResponseRedirect('/site/docs/list') \ No newline at end of file + return http.HttpResponseRedirect('/site/docs/list')