richie 3.1.2__py2.py3-none-any.whl → 3.1.3.dev2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of richie might be problematic. Click here for more details.

@@ -71,7 +71,10 @@ class Category(EsIdMixin, BasePageExtension):
71
71
  """
72
72
  return self.get_reverse_related_page_extensions(
73
73
  "course", language=language, include_descendants=include_descendants
74
- ).filter(extended_object__node__parent__cms_pages__course__isnull=True)
74
+ ).filter(
75
+ extended_object__node__parent__cms_pages__course__isnull=True,
76
+ is_listed=True,
77
+ )
75
78
 
76
79
  def get_blogposts(self, language=None, include_descendants=True):
77
80
  """
@@ -180,7 +180,7 @@ class Course(EsIdMixin, BasePageExtension):
180
180
  is_listed = models.BooleanField(
181
181
  default=True,
182
182
  verbose_name=_("is listed"),
183
- help_text=_("Tick if you want the course to be visible on the search page."),
183
+ help_text=_("Tick if you want the course to be visible."),
184
184
  )
185
185
 
186
186
  is_self_paced = models.BooleanField(
@@ -147,7 +147,10 @@ class Organization(EsIdMixin, BasePageExtension):
147
147
  """
148
148
  return self.get_reverse_related_page_extensions(
149
149
  "course", language=language
150
- ).filter(extended_object__node__parent__cms_pages__course__isnull=True)
150
+ ).filter(
151
+ extended_object__node__parent__cms_pages__course__isnull=True,
152
+ is_listed=True,
153
+ )
151
154
 
152
155
  def get_persons(self, language=None):
153
156
  """
@@ -50,7 +50,10 @@ class Person(EsIdMixin, BasePageExtension):
50
50
  """
51
51
  return self.get_reverse_related_page_extensions(
52
52
  "course", language=language
53
- ).filter(extended_object__node__parent__cms_pages__course__isnull=True)
53
+ ).filter(
54
+ extended_object__node__parent__cms_pages__course__isnull=True,
55
+ is_listed=True,
56
+ )
54
57
 
55
58
  def get_blogposts(self, language=None):
56
59
  """
@@ -14,6 +14,7 @@ from ...core.fields.duration import CompositeDurationField
14
14
  from ...core.models import BasePageExtension
15
15
  from .. import defaults
16
16
  from .category import Category, CategoryPluginModel
17
+ from .course import Course, CoursePluginModel
17
18
  from .organization import Organization, OrganizationPluginModel
18
19
  from .person import Person, PersonPluginModel
19
20
 
@@ -114,6 +115,19 @@ class Program(BasePageExtension):
114
115
  Person, PersonPluginModel, language=language
115
116
  )
116
117
 
118
+ def get_courses(self, language=None):
119
+ """
120
+ Return the courses linked to the program via a course plugin in any of the
121
+ placeholders on the program detail page, ranked by their `path` to respect
122
+ the order in the courses tree.
123
+ The courses are filtered to only include those that are listed and published.
124
+ """
125
+ courses = self.get_direct_related_page_extensions(
126
+ Course, CoursePluginModel, language=language
127
+ ).filter(is_listed=True)
128
+
129
+ return [course for course in courses if course.check_publication(language)]
130
+
117
131
  def save(self, *args, **kwargs):
118
132
  """
119
133
  Enforce validation each time an instance is saved
@@ -191,7 +191,7 @@
191
191
  </div>
192
192
  {% endif %}
193
193
 
194
- {% if current_page.publisher_is_draft or not current_page|is_empty_placeholder:"program_courses" %}
194
+ {% if current_page.publisher_is_draft or not current_page|is_empty_placeholder:"program_courses" or current_page.program.get_courses|length > 0 %}
195
195
  <div class="program-detail__courses program-detail__block">
196
196
  <div class="program-detail__row">
197
197
  <section class="course-glimpse-list">
@@ -199,7 +199,13 @@
199
199
  <h2 class="program-detail__title">{% trans "Related courses" %}</h2>
200
200
  </div>
201
201
  <div class="course-glimpse-list__content">
202
- {% placeholder "program_courses" %}
202
+ {% if request.toolbar.edit_mode_active %}
203
+ {% placeholder "program_courses" %}
204
+ {% else %}
205
+ {% for course in current_page.program.get_courses %}
206
+ {% include "courses/cms/fragment_course_glimpse.html" with course=course header_level=3 %}
207
+ {% endfor %}
208
+ {% endif %}
203
209
  </div>
204
210
  </section>
205
211
  </div>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: richie
3
- Version: 3.1.2
3
+ Version: 3.1.3.dev2
4
4
  Summary: A CMS to build learning portals for open education
5
5
  Author-email: "Open FUN (France Université Numérique)" <fun.dev@fun-mooc.fr>
6
6
  License: MIT License
@@ -1009,12 +1009,12 @@ richie/apps/courses/migrations/0039_program_duration_program_effort_program_pric
1009
1009
  richie/apps/courses/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1010
1010
  richie/apps/courses/models/__init__.py,sha256=TKx_JE0qeWMcDmHjk_NfDb_8CKIxXPgxMHzD7k6IMeA,323
1011
1011
  richie/apps/courses/models/blog.py,sha256=q7AHQDYWB2uHeoGJ1nePKjZoPWeLg2bPSrmhudAupcc,3450
1012
- richie/apps/courses/models/category.py,sha256=M24o2trqM1ikDiD11igu2n2cdKzARsP6MsOXr2Z3jQQ,7305
1013
- richie/apps/courses/models/course.py,sha256=USgfHPg2v_J0iRsEPh3dG1MOp9vTI10eh-9BOSewkps,47018
1012
+ richie/apps/courses/models/category.py,sha256=OIqqvGOwQlgE7oI6sUPNBD4X6iRNjd7yfXtoGnxh7fI,7356
1013
+ richie/apps/courses/models/course.py,sha256=xmZ13_9Sbr_kt6ey5JA8jAuW5PJrtrgmjt6RHfur2Yo,46999
1014
1014
  richie/apps/courses/models/menuentry.py,sha256=ABF8wEhyZ9T45YXhBCUDcK7Up8N5HZ9XB8R824EUSoI,1393
1015
- richie/apps/courses/models/organization.py,sha256=EToxJop9DRxx_grXw8OruSxq_hNOVeJPmt2wbRwZvJs,8664
1016
- richie/apps/courses/models/person.py,sha256=_tQ3tMCwetvWwu4vwOOUOjQ_kED0FC27pP4ziU16lE4,2945
1017
- richie/apps/courses/models/program.py,sha256=SYDZ7A5838huLILo8I93I3t5115PI6O7b9aRG_xlB3U,4487
1015
+ richie/apps/courses/models/organization.py,sha256=slRhrk_LBE4sMF3LQ9tuzbKmPnDhXaas7YvUsFWE5qU,8715
1016
+ richie/apps/courses/models/person.py,sha256=tjKShF35iQlsESODWFDwMs22a7-Lyawzz6xBs5u5nGQ,2996
1017
+ richie/apps/courses/models/program.py,sha256=JdG51Xnw0jHCBNFzPclT-YTFOhh0ZdGgijlp-kBDOFI,5125
1018
1018
  richie/apps/courses/models/role.py,sha256=BWUhE-nE22nqaN0tdiFdutkyjcE4MEz5Es6fXOzo-9c,3585
1019
1019
  richie/apps/courses/settings/__init__.py,sha256=P168dzNPmOMdjbSCiuUz6V_UkIRNSrrOG03XO_YWZgU,22681
1020
1020
  richie/apps/courses/settings/mixins.py,sha256=tVkingrXH9Wykz6ybSCoT4AzXZV_ott6zv77wHjkpvc,526
@@ -1039,7 +1039,7 @@ richie/apps/courses/templates/courses/cms/organization_detail.html,sha256=5x0zHV
1039
1039
  richie/apps/courses/templates/courses/cms/organization_list.html,sha256=nRvC9OPC1jDhIvJW8le6IVqHt7DWnO0Apedve4P-fTU,1129
1040
1040
  richie/apps/courses/templates/courses/cms/person_detail.html,sha256=UbZP4eJCE2Jpb6Ppq0gQgYEVv2fR9RSRC9l4wX9wn64,9654
1041
1041
  richie/apps/courses/templates/courses/cms/person_list.html,sha256=lxF2rbS1LN7kucs3RsN5_lIDyhafYEFFchayZlUpeq0,926
1042
- richie/apps/courses/templates/courses/cms/program_detail.html,sha256=wMGh1-60jMiBjzqZJ9Oc_M19yzKuWKwKYD719tavkiE,12503
1042
+ richie/apps/courses/templates/courses/cms/program_detail.html,sha256=HFg2qd8-XnTXcBaMbBsLwkl7rfMoB4pwbwGeFg1Gg2A,12936
1043
1043
  richie/apps/courses/templates/courses/cms/program_list.html,sha256=m2zfxRM9EpCo1NX_O2TV1KmypSIxuq4pYW_sv3Z6JD8,1673
1044
1044
  richie/apps/courses/templates/courses/plugins/blogpost.html,sha256=fCUFoemD9FeZKzHtcnHz9VgUgveTvkpoVrw0bUyQR1M,221
1045
1045
  richie/apps/courses/templates/courses/plugins/category_plugin.html,sha256=W6oFmRzhRL1KO55I5KNH7xjwBZJiqWHhaLOgMPJTSZA,215
@@ -2483,9 +2483,9 @@ richie/static/richie/js/build/99870.90b7d4762235189dc2fd.index.js,sha256=4CC19Rd
2483
2483
  richie/static/richie/js/build/99895.90b7d4762235189dc2fd.index.js,sha256=Pi0STMa7ldUMZ202X_lr0p_--hmkab2RjmSwLTNqKKo,2570
2484
2484
  richie/static/richie/js/build/99953.90b7d4762235189dc2fd.index.js,sha256=OWoLPJnHrmvF3HBQPgXooAGo5E0yJpJ7QTFHFghJpI8,135
2485
2485
  richie/static/richie/js/build/index.js,sha256=_HdHfK6rZ3ETFe_WF0NBm8AsXDAgbSDYxIUYj0RjuwM,1332827
2486
- richie-3.1.2.dist-info/licenses/LICENSE,sha256=5LKjFIE1kpKzBfR2iwq_RGHhHM5XawdlfZrcHTsCLpA,1079
2487
- richie-3.1.2.dist-info/METADATA,sha256=UtWSBeJJMadRaBczdUI1A-myixgzu9L2FgJpjmbw9E4,7028
2488
- richie-3.1.2.dist-info/WHEEL,sha256=egKm5cKfE6OqlHwodY8Jjp4yqZDBXgsj09UsV5ojd_U,109
2489
- richie-3.1.2.dist-info/top_level.txt,sha256=WJvFAAHtUQ5T5MOuG6jRynDJG9kVfl4jtuf1qxIXND8,16
2490
- richie-3.1.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2491
- richie-3.1.2.dist-info/RECORD,,
2486
+ richie-3.1.3.dev2.dist-info/licenses/LICENSE,sha256=5LKjFIE1kpKzBfR2iwq_RGHhHM5XawdlfZrcHTsCLpA,1079
2487
+ richie-3.1.3.dev2.dist-info/METADATA,sha256=-Ca42dkUjsS7PxIfP_8bdeEeEXPhf5ViLScDOYr_qeo,7033
2488
+ richie-3.1.3.dev2.dist-info/WHEEL,sha256=egKm5cKfE6OqlHwodY8Jjp4yqZDBXgsj09UsV5ojd_U,109
2489
+ richie-3.1.3.dev2.dist-info/top_level.txt,sha256=WJvFAAHtUQ5T5MOuG6jRynDJG9kVfl4jtuf1qxIXND8,16
2490
+ richie-3.1.3.dev2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2491
+ richie-3.1.3.dev2.dist-info/RECORD,,