From d22f8e8e35f7dfbceb6e2840b2d9f433acb8c49e Mon Sep 17 00:00:00 2001 From: James Polley Date: Fri, 22 Sep 2017 16:37:36 +1000 Subject: [PATCH 1/5] expand proposal admin --- pinaxcon/proposals/admin.py | 50 ++++++++++++++++++---------- vendor/symposion/proposals/admin.py | 9 ++++- vendor/symposion/proposals/models.py | 1 + 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/pinaxcon/proposals/admin.py b/pinaxcon/proposals/admin.py index 8070d290..d3e2278e 100644 --- a/pinaxcon/proposals/admin.py +++ b/pinaxcon/proposals/admin.py @@ -2,29 +2,45 @@ from django.contrib import admin from pinaxcon.proposals import models from symposion.proposals import models as symposion_models - - -@admin.register(models.TalkProposal) -@admin.register(models.TutorialProposal) -@admin.register(models.MiniconfProposal) -@admin.register(models.SysAdminProposal) -@admin.register(models.KernelProposal) -@admin.register(models.GamesProposal) -@admin.register(models.OpenHardwareProposal) -@admin.register(models.ClsXLCAProposal) -@admin.register(models.FuncProgProposal) -@admin.register(models.OpenEdProposal) -@admin.register(models.OpenGLAMProposal) -@admin.register(models.FPGAProposal) -@admin.register(models.DevDevProposal) -@admin.register(models.ArtTechProposal) -@admin.register(models.BioInformaticsProposal) +from symposion.reviews.models import ProposalResult class CategoryAdmin(admin.ModelAdmin): class AdditionalSpeakerInline(admin.TabularInline): model = symposion_models.AdditionalSpeaker + class ProposalResultInline(admin.TabularInline): + model = ProposalResult + readonly_fields = ["score"] + fields = ["status"] + inlines = [ AdditionalSpeakerInline, + ProposalResultInline, ] + + +for model in [ models.TalkProposal, models.TutorialProposal, + models.MiniconfProposal, models.SysAdminProposal, + models.KernelProposal, models.GamesProposal, + models.OpenHardwareProposal, models.ClsXLCAProposal, + models.FuncProgProposal, models.OpenEdProposal, + models.OpenGLAMProposal, models.FPGAProposal, models.DevDevProposal, + models.ArtTechProposal, models.BioInformaticsProposal ]: + admin.site.register(model, CategoryAdmin, + list_display = [ + "id", + "title", + "speaker", + "speaker_email", + "kind", + "target_audience", + "status", + "cancelled", + ], + list_filter = [ + "result__status", + "cancelled", + ], + ) + diff --git a/vendor/symposion/proposals/admin.py b/vendor/symposion/proposals/admin.py index af274aaa..37261f65 100644 --- a/vendor/symposion/proposals/admin.py +++ b/vendor/symposion/proposals/admin.py @@ -28,5 +28,12 @@ from symposion.proposals.models import ProposalSection, ProposalKind # ) -admin.site.register(ProposalSection) +admin.site.register(ProposalSection, + list_display = [ + "section", + "start", + "end", + "closed", + "published" + ]) admin.site.register(ProposalKind) diff --git a/vendor/symposion/proposals/models.py b/vendor/symposion/proposals/models.py index 4a8650a0..08120eca 100644 --- a/vendor/symposion/proposals/models.py +++ b/vendor/symposion/proposals/models.py @@ -177,6 +177,7 @@ class ProposalBase(models.Model): except ObjectDoesNotExist: return _('Undecided') + def speakers(self): yield self.speaker speakers = self.additional_speakers.exclude( From d1f5acbf64cbe9e274b73f8ad7f7014ae916a782 Mon Sep 17 00:00:00 2001 From: James Polley Date: Fri, 22 Sep 2017 19:29:43 +1000 Subject: [PATCH 2/5] Fix miniconf fixture dates Some proposalsections were still set to open immediately. Change that to 1 Nov. --- fixtures/miniconf-fixtures/symposion_proposals.json | 10 +++++----- make_dev_container.sh | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fixtures/miniconf-fixtures/symposion_proposals.json b/fixtures/miniconf-fixtures/symposion_proposals.json index da6ca001..e54c63d1 100644 --- a/fixtures/miniconf-fixtures/symposion_proposals.json +++ b/fixtures/miniconf-fixtures/symposion_proposals.json @@ -5,7 +5,7 @@ "end": "2017-11-30T12:59:00Z", "published": false, "section": 3, - "start": "2017-09-21T14:01:00Z" + "start": "2017-11-01T14:01:00Z" }, "model": "symposion_proposals.proposalsection", "pk": 3 @@ -16,7 +16,7 @@ "end": "2017-11-30T12:59:00Z", "published": false, "section": 4, - "start": "2017-09-21T14:01:00Z" + "start": "2017-11-01T14:01:00Z" }, "model": "symposion_proposals.proposalsection", "pk": 4 @@ -27,7 +27,7 @@ "end": "2017-11-30T12:59:00Z", "published": false, "section": 5, - "start": "2017-09-21T14:01:00Z" + "start": "2017-11-01T14:01:00Z" }, "model": "symposion_proposals.proposalsection", "pk": 5 @@ -38,7 +38,7 @@ "end": "2017-11-30T12:59:00Z", "published": false, "section": 6, - "start": "2017-09-21T14:01:00Z" + "start": "2017-11-01T14:01:00Z" }, "model": "symposion_proposals.proposalsection", "pk": 6 @@ -49,7 +49,7 @@ "end": "2017-11-29T13:01:00Z", "published": false, "section": 7, - "start": "2017-09-21T14:01:00Z" + "start": "2017-11-01T14:01:00Z" }, "model": "symposion_proposals.proposalsection", "pk": 7 diff --git a/make_dev_container.sh b/make_dev_container.sh index 6a057663..6cd97397 100755 --- a/make_dev_container.sh +++ b/make_dev_container.sh @@ -11,6 +11,7 @@ docker exec symposion ./manage.py migrate docker exec symposion ./manage.py loaddata ./fixtures/*.json docker exec symposion ./manage.py populate_inventory docker exec symposion ./manage.py create_review_permissions +docker exec symposion ./manage.py loaddata ./fixtures/miniconf-fixtures/*.json if [ -e ./symposion-fixtures ]; then pushd ./symposion-fixtures ./load_data_local.sh From 750902c5c395c2ae619974fe5227d8e0bd303385 Mon Sep 17 00:00:00 2001 From: James Polley Date: Fri, 22 Sep 2017 22:17:52 +1000 Subject: [PATCH 3/5] Restore messages to site_base template --- pinaxcon/templates/site_base.html | 8 +++ static/src/css/app.css | 106 ++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/pinaxcon/templates/site_base.html b/pinaxcon/templates/site_base.html index 47864613..328cd76a 100644 --- a/pinaxcon/templates/site_base.html +++ b/pinaxcon/templates/site_base.html @@ -29,6 +29,14 @@
{% sitetree_menu from "main" include "trunk" template "sitetree_header.html" %} + {% if messages %} +
    + {% for message in messages %} + {{ message }} + {% endfor %} +
+ {% endif %} +

{% block header_title %}{% endblock %}

{% block header_paragraph %}{% endblock %}

diff --git a/static/src/css/app.css b/static/src/css/app.css index c1125ca1..97289099 100644 --- a/static/src/css/app.css +++ b/static/src/css/app.css @@ -1,3 +1,109 @@ .label-required:after { content: ' *'; } textarea, .monospace-text { font-family: Hack, monospace; } .monospace-text { white-space: pre-wrap; } + +/* MESSAGES & ERRORS */ + +ul.messagelist { + padding: 0; + margin: 0; +} + +ul.messagelist li { + display: block; + font-weight: 400; + font-size: 13px; + padding: 10px 10px 10px 65px; + margin: 0 0 10px 0; + background: #dfd url(../img/icon-yes.svg) 40px 12px no-repeat; + background-size: 16px auto; + color: #333; +} + +ul.messagelist li.warning { + background: #ffc url(../img/icon-alert.svg) 40px 14px no-repeat; + background-size: 14px auto; +} + +ul.messagelist li.error { + background: #ffefef url(../img/icon-no.svg) 40px 12px no-repeat; + background-size: 16px auto; +} + +.errornote { + font-size: 14px; + font-weight: 700; + display: block; + padding: 10px 12px; + margin: 0 0 10px 0; + color: #ba2121; + border: 1px solid #ba2121; + border-radius: 4px; + background-color: #fff; + background-position: 5px 12px; +} + +ul.errorlist { + margin: 0 0 4px; + padding: 0; + color: #ba2121; + background: #fff; +} + +ul.errorlist li { + font-size: 13px; + display: block; + margin-bottom: 4px; +} + +ul.errorlist li:first-child { + margin-top: 0; +} + +ul.errorlist li a { + color: inherit; + text-decoration: underline; +} + +td ul.errorlist { + margin: 0; + padding: 0; +} + +td ul.errorlist li { + margin: 0; +} + +.form-row.errors { + margin: 0; + border: none; + border-bottom: 1px solid #eee; + background: none; +} + +.form-row.errors ul.errorlist li { + padding-left: 0; +} + +.errors input, .errors select, .errors textarea { + border: 1px solid #ba2121; +} + +div.system-message { + background: #ffc; + margin: 10px; + padding: 6px 8px; + font-size: .8em; +} + +div.system-message p.system-message-title { + padding: 4px 5px 4px 25px; + margin: 0; + color: #c11; + background: #ffefef url(../img/icon-no.svg) 5px 5px no-repeat; +} + +.description { + font-size: 12px; + padding: 5px 0 0 12px; +} From 1e20731e3221d3dc315047137eea187de7ffab5d Mon Sep 17 00:00:00 2001 From: James Polley Date: Fri, 22 Sep 2017 22:25:01 +1000 Subject: [PATCH 4/5] Fix list of teams --- pinaxcon/templates/dashboard.html | 43 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/pinaxcon/templates/dashboard.html b/pinaxcon/templates/dashboard.html index d9a08556..dcfeb020 100644 --- a/pinaxcon/templates/dashboard.html +++ b/pinaxcon/templates/dashboard.html @@ -299,31 +299,32 @@ {% endif %}
- {% if available_teams %} - -
- {% for team in available_teams %} -
-
-
-
{{ team }}
-
-
- {% if team.description %}

{{ team.description }}

{% endif %} - {{ team.get_access_display }} - Details -
-
+
+ {% if available_teams %} + - {% endfor %} +
+ {% for team in available_teams %} +
+
+
+
{{ team }}
+
+
+ {% if team.description %}

{{ team.description }}

{% endif %} + {{ team.get_access_display }} + Details +
+
+
+ {% endfor %} +
+ {% endif %}
- {% endif %}
+ {% endif %}
- {% endif %} -
{% endblock %} From ba98c368681bb22196fc7a3ea3308ea7e50a4dd8 Mon Sep 17 00:00:00 2001 From: James Polley Date: Fri, 22 Sep 2017 22:28:27 +1000 Subject: [PATCH 5/5] Add admin links to review sections that the user can manager --- pinaxcon/templates/dashboard.html | 8 ++++++++ vendor/symposion/proposals/views.py | 2 +- vendor/symposion/reviews/context_processors.py | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pinaxcon/templates/dashboard.html b/pinaxcon/templates/dashboard.html index dcfeb020..579899d1 100644 --- a/pinaxcon/templates/dashboard.html +++ b/pinaxcon/templates/dashboard.html @@ -256,6 +256,14 @@
  • Reviewed by you
  • Not Reviewed by you
  • + {% if section in manage_sections %} + + {% endif %}
    diff --git a/vendor/symposion/proposals/views.py b/vendor/symposion/proposals/views.py index 051a794b..925ad17c 100644 --- a/vendor/symposion/proposals/views.py +++ b/vendor/symposion/proposals/views.py @@ -40,7 +40,7 @@ def proposal_submit(request): messages.info(request, _("To submit a proposal, please " "log in and create a speaker profile " "via the dashboard.".format(settings.LOGIN_URL))) - return redirect("home") # @@@ unauth'd speaker info page? + return redirect("dashboard") # @@@ unauth'd speaker info page? else: try: request.user.speaker_profile diff --git a/vendor/symposion/reviews/context_processors.py b/vendor/symposion/reviews/context_processors.py index 02850f15..7b164896 100644 --- a/vendor/symposion/reviews/context_processors.py +++ b/vendor/symposion/reviews/context_processors.py @@ -3,9 +3,14 @@ from symposion.proposals.models import ProposalSection def reviews(request): sections = [] + manage_sections = {} for section in ProposalSection.objects.all(): if request.user.has_perm("reviews.can_review_%s" % section.section.slug): sections.append(section) + if request.user.has_perm("reviews.can_manage_%s" % section.section.slug): + manage_sections.setdefault(section, []).append return { "review_sections": sections, + "manage_sections": manage_sections } +