Merge pull request #5876 from edx/cdodge/catalog-visibility

Add new course_module field which describes what the catalog visibility ...
This commit is contained in:
chrisndodge
2014-11-09 21:02:49 -05:00
10 changed files with 379 additions and 24 deletions

View File

@@ -24,6 +24,9 @@ _ = lambda text: text
DEFAULT_START_DATE = datetime(2030, 1, 1, tzinfo=UTC())
CATALOG_VISIBILITY_CATALOG_AND_ABOUT = "both"
CATALOG_VISIBILITY_ABOUT = "about"
CATALOG_VISIBILITY_NONE = "none"
class StringOrDate(Date):
def from_json(self, value):
@@ -575,6 +578,17 @@ class CourseFields(object):
deprecated=True
)
catalog_visibility = String(
display_name=_("Course Visibility In Catalog"),
help=_("Defines the access permissions for showing the course in the course catalog. This can be set to one of three values: 'both' (show in catalog and allow access to about page), 'about' (only allow access to about page), 'none' (do not show in catalog and do not allow access to an about page)."),
default=CATALOG_VISIBILITY_CATALOG_AND_ABOUT,
scope=Scope.settings,
values=[
{"display_name": _("Both"), "value": CATALOG_VISIBILITY_CATALOG_AND_ABOUT},
{"display_name": _("About"), "value": CATALOG_VISIBILITY_ABOUT},
{"display_name": _("None"), "value": CATALOG_VISIBILITY_NONE}]
)
class CourseDescriptor(CourseFields, SequenceDescriptor):
module_class = SequenceModule