diff --git a/cms/static/aircox/cms/styles.css b/cms/static/aircox/cms/styles.css index 2a543d6..ff6a84a 100644 --- a/cms/static/aircox/cms/styles.css +++ b/cms/static/aircox/cms/styles.css @@ -52,31 +52,31 @@ main .section { /** comments **/ -.comment-form label { +.comment_form label { display: none; } -.comment-form input:not([type=checkbox]), -.comment-form textarea { +.comment_form input:not([type=checkbox]), +.comment_form textarea { display: inline-block; width: calc(100% - 5em); max-height: 6em; margin: 0.2em 0em; } -.comment-form input[type=checkbox], -.comment-form button[type=submit] { +.comment_form input[type=checkbox], +.comment_form button[type=submit] { max-width: 4em; vertical-align:bottom; margin: 0.2em 0em; text-align: center; } -.comment-form .extra { +.comment_form .extra { display: none; } -.comment-form input[type="checkbox"]:checked + .extra { +.comment_form input[type="checkbox"]:checked + .extra { display: block; } diff --git a/cms/templates/aircox/cms/detail.html b/cms/templates/aircox/cms/detail.html index 6d39f0e..7e28e6b 100644 --- a/cms/templates/aircox/cms/detail.html +++ b/cms/templates/aircox/cms/detail.html @@ -6,7 +6,7 @@ {% endblock %} {% block pre_title %} -
+
{% if object.thread %}
{{ object|threads:' > '|safe }} diff --git a/cms/templates/aircox/cms/section_comments.html b/cms/templates/aircox/cms/section_comments.html index 47d992b..c05edca 100644 --- a/cms/templates/aircox/cms/section_comments.html +++ b/cms/templates/aircox/cms/section_comments.html @@ -5,7 +5,7 @@ {% block section_content %} {{ form.non_field_errors }} -
+ {% csrf_token %} {% render_honeypot_field "hp_website" %}
@@ -25,13 +25,16 @@
- +
{% endblock %} diff --git a/cms/views.py b/cms/views.py index 3b24db4..95c1c20 100644 --- a/cms/views.py +++ b/cms/views.py @@ -32,7 +32,6 @@ class PostBaseView: for k in self.website.menu_layouts }.items() if v } - context['view'] = self return context diff --git a/programs/admin.py b/programs/admin.py index 7d49e4b..7df2872 100755 --- a/programs/admin.py +++ b/programs/admin.py @@ -113,8 +113,8 @@ class DiffusionAdmin (admin.ModelAdmin): def get_queryset(self, request): qs = super(DiffusionAdmin, self).get_queryset(request) - if '_changelist_filters' in request.GET or \ - 'type__exact' in request.GET and \ + if ('_changelist_filters' in request.GET or \ + 'type__exact' in request.GET) and \ str(Diffusion.Type.unconfirmed) in request.GET['type__exact']: return qs return qs.exclude(type = Diffusion.Type.unconfirmed) diff --git a/programs/management/commands/diffusions_monitor.py b/programs/management/commands/diffusions_monitor.py index 5568092..033dee7 100644 --- a/programs/management/commands/diffusions_monitor.py +++ b/programs/management/commands/diffusions_monitor.py @@ -38,7 +38,7 @@ class Actions: Return the number of conflicts """ - conflicts = item.get_conflicts() + conflicts = list(item.get_conflicts()) for i, conflict in enumerate(conflicts): if conflict.program == item.program: item.do_not_save = True @@ -74,6 +74,7 @@ class Actions: if manual: Diffusion.objects.bulk_create(items) else: + print('items: ', len(items)) for item in items: count[1] += cl.__check_conflicts(item, saved_items) if hasattr(item, 'do_not_save'): diff --git a/programs/models.py b/programs/models.py index b4e1e35..7521934 100755 --- a/programs/models.py +++ b/programs/models.py @@ -639,8 +639,11 @@ class Diffusion(models.Model): if station: filter_args['program__station'] = station + if queryset is None: + queryset = cl.objects + if now: - return cl.objects.filter( + return queryset.filter( models.Q(start__lte = date, end__gte = date) | models.Q(start__gte = date), @@ -648,18 +651,17 @@ class Diffusion(models.Model): ).order_by('start') if next: - return cl.objects.filter( + return queryset.filter( start__gte = date, **filter_args ).order_by('start') if prev: - return cl.objects.filter( + return queryset.filter( end__lte = date, **filter_args ).order_by('-start') - def is_date_in_my_range(self, date): """ Return true if the given date is in the diffusion's start-end @@ -672,10 +674,10 @@ class Diffusion(models.Model): Return a list of conflictual diffusions, based on the scheduled duration. """ r = Diffusion.objects.filter( - models.Q(start__lte = self.start, - end__gte = self.start) | - models.Q(start__gte = self.start, - start__lte = self.end) + models.Q(start__lt = self.start, + end__gt = self.start) | + models.Q(start__gt = self.start, + start__lt = self.end) ) return r