Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Remove trademark notice #299

Open
wants to merge 146 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
be66682
Merge pull request #230 from torchbox/heroku-move-2
kevinhowbrook Jan 8, 2020
7103e98
Merge pull request #232 from torchbox/heroku-move-2
kevinhowbrook Jan 8, 2020
3cbaaf1
Merge pull request #234 from torchbox/update-wsgi
kevinhowbrook Jan 9, 2020
3121d43
Merge branch '1032-form-amendments' into staging
Jan 9, 2020
5251e6d
Get intranet push URL from heroku config
Jan 14, 2020
a12b21d
Merge branch 'bug/image-path' into staging
kevinhowbrook Jan 17, 2020
f5f2d19
Merge branch 'master' of https://git.heroku.com/rca-verdant-staging i…
kevinhowbrook Jan 17, 2020
6cc7f3b
Expose show_on_homepage so we can filter content through the api
kevinhowbrook Jan 17, 2020
269c14f
Merge pull request #242 from torchbox/feature/api-updates-for-new-site
kevinhowbrook Jan 17, 2020
cee3c16
So we can use the social image over the api
kevinhowbrook Jan 17, 2020
49fb48b
Merge branch 'feature/api-updates-for-new-site' into staging
kevinhowbrook Jan 17, 2020
aedb708
typo
kevinhowbrook Jan 17, 2020
9b11c77
Merge branch 'feature/api-updates-for-new-site' into staging
kevinhowbrook Jan 17, 2020
5316f21
Add a negated filter option to the api filters
kevinhowbrook Jan 17, 2020
6a4f21b
Merge branch 'feature/api-updates-for-new-site' into staging
kevinhowbrook Jan 17, 2020
28ae267
Larger size image needed
kevinhowbrook Jan 18, 2020
5b7dc6b
Merge branch 'feature/api-updates-for-new-site' into staging
kevinhowbrook Jan 20, 2020
36d5ecc
Merge pull request #245 from torchbox/feature/133-sitemap
kevinhowbrook Jan 30, 2020
0f264e7
Trigger deployment via ci with empty commit
kevinhowbrook Jan 30, 2020
6c40dff
Merge pull request #246 from torchbox/feature/133-sitemap
kevinhowbrook Jan 31, 2020
345a696
Use the site.hostname value for the index view rather than the domain…
Feb 5, 2020
2ad66bd
Merge branch 'feature/133-sitemap' into staging
Feb 5, 2020
0502f2d
Merge branch '1051-1052-ap-integration' into staging
Feb 6, 2020
fc376c4
Merge branch '1051-1052-ap-integration' into staging
Feb 6, 2020
45d27bc
Merge branch '1051-1052-ap-integration' into staging
Feb 6, 2020
66b2ada
Merge branch '1051-1052-ap-integration' into staging
Feb 6, 2020
b992e9b
Merge branch '1051-1052-ap-integration' into staging
Feb 11, 2020
151cacb
Update convocation live stream code for 2020
kaedroho Feb 17, 2020
e98770c
Revert "Switch from qgtunnel to internal TCP Proxy tool"
kaedroho Feb 17, 2020
07d5790
Revert "Revert "Switch from qgtunnel to internal TCP Proxy tool""
Feb 18, 2020
d66a9a8
So the CI can use postgres
Feb 18, 2020
de01a9a
Merge pull request #251 from torchbox/switch_to_tcpproxy
kevinhowbrook Feb 18, 2020
607c85a
Merge branch '1051-1052-ap-integration' into staging
Feb 19, 2020
13a5f80
Merge branch 'feature/1046-scout-apm' into staging
Feb 20, 2020
50a49f3
Merge branch '1051-1052-ap-integration' into staging
Feb 26, 2020
848f89d
Merge branch '4345-gunicorn-timeout' into staging
Mar 13, 2020
5ac3d63
Merge branch '1051-1052-ap-integration' into staging
Mar 19, 2020
a506585
Merge branch '1051-1052-ap-integration' into staging
Mar 20, 2020
7bd6d09
Merge branch 'switch_to_tcp_proxy' into staging
kevinhowbrook Mar 20, 2020
6046e43
Merge branch 'pip-appconf' into staging
kevinhowbrook Apr 1, 2020
2d9d524
Merge branch 'cache-settings-if-error' into staging
kevinhowbrook Apr 3, 2020
80ac5aa
Merge remote-tracking branch 'origin/feature/179-populate-nav' into s…
nicklee Apr 14, 2020
6c2a6a9
Adding js for staging site
nicklee Apr 14, 2020
aa97a1d
Merge remote-tracking branch 'origin/feature/179-populate-nav' into s…
nicklee Apr 14, 2020
0c2600b
Moving js order - staging js debug
nicklee Apr 14, 2020
f40711c
Semi colon after `
nicklee Apr 14, 2020
77d8fa3
More compressor issues
nicklee Apr 14, 2020
4255368
Merge branch 'feature/179-new-navigation-rendering' into staging
kevinhowbrook Apr 14, 2020
cef824a
Migitate CVE-2020-11001 by disabling revision comparison feature
Stormheg Apr 14, 2020
5e5bd10
Merge branch 'staging' of https://github.com/torchbox/verdant-rca int…
kevinhowbrook Apr 21, 2020
006e42d
Merge branch 'feature/179-new-navigation-rendering' into staging
kevinhowbrook Apr 21, 2020
112d22b
Deploy staging via CI
kevinhowbrook Apr 21, 2020
7d265fa
Merge branch 'bug/422-noisy-logs' into staging
kevinhowbrook Apr 30, 2020
86a166a
Add an override MA value
kevinhowbrook May 7, 2020
19a6e30
Merge branch '1027-ma-override' into staging
kevinhowbrook May 7, 2020
680baac
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
helenb May 14, 2020
ec4cbe3
Merge branch '1066-accessibility-audit-changes' into staging
helenb May 14, 2020
18783c9
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
kevinhowbrook May 14, 2020
4a2b883
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
helenb May 14, 2020
db34d11
update menu markup so it's now activated on click rather than hover
chris-lawton May 15, 2020
36af3c7
match focus styles on main site
chris-lawton May 22, 2020
d6cb4c7
Merge branch '425-update-menu' into staging
chris-lawton May 22, 2020
c44ed77
Bug found on search page - page_url won't work here
kevinhowbrook Jun 1, 2020
12ffc01
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
kevinhowbrook Jun 1, 2020
2a9ebaf
CI fixing
kevinhowbrook Jun 1, 2020
b409b41
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
kevinhowbrook Jun 1, 2020
ba6ee11
Switch to buster to resolve ldap install errors
kevinhowbrook Jun 1, 2020
9484a95
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
kevinhowbrook Jun 1, 2020
64c7e23
Fix jessie backports
kevinhowbrook Jun 1, 2020
b8d3708
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
kevinhowbrook Jun 1, 2020
7cee8df
Fix jessie backports
kevinhowbrook Jun 1, 2020
448c52b
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
kevinhowbrook Jun 1, 2020
468bee6
Try circle ci fix for backports
kevinhowbrook Jun 1, 2020
7eb704d
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
kevinhowbrook Jun 1, 2020
f43a6ab
Try stretch instead
kevinhowbrook Jun 1, 2020
ef38156
Merge branch '1033-add-breadcrumb-to-legacy-site' into staging
kevinhowbrook Jun 1, 2020
03e5fb2
Merge branch 'ci-fixes' into staging
kevinhowbrook Jun 1, 2020
0547215
Trigger ci build via empty commit
kevinhowbrook Jun 2, 2020
b201929
replicate desktop menu functionality on mobile - 467
chris-lawton Jun 2, 2020
ef83805
Merge branch '425-update-menu' into staging
chris-lawton Jun 2, 2020
46162a4
Merge branch 'ci-fixes' into staging
kevinhowbrook Jun 2, 2020
ee5bad6
Trigger CI deployment
kevinhowbrook Jun 2, 2020
9b07b9d
Merge branch 'ci-fixes' into staging
kevinhowbrook Jun 2, 2020
745acdd
Allow filtering of page results by tag in the API
ababic Jun 3, 2020
0602579
Merge branch 'filter/456-api-filter-pages-by-tag' into staging
ababic Jun 3, 2020
e23e972
Add tagging to NewsItem and EventItem models
ababic Jun 4, 2020
f78e18c
Migration for tag fields
kevinhowbrook Jun 4, 2020
ee2f6a7
Merge branch 'feature/456-add-news-event-tags' into staging
ababic Jun 4, 2020
75aae20
Add an override MA value
kevinhowbrook May 7, 2020
9575fa8
Add needed merge migration to re-balance staging site
kevinhowbrook Jun 4, 2020
fd32863
Merge branch '1027-ma-override' into staging
ababic Jun 4, 2020
2ae410d
Merge branch 'feature/455-staff-student-relationship' into staging
kevinhowbrook Jun 4, 2020
0465939
Add 'tags' to api_fields for NewsItem and EventItem
ababic Jun 4, 2020
40dfb4c
Merge branch 'feature/456-apl-activate-tag-filtering-for-news-and-eve…
ababic Jun 4, 2020
b2b1f69
Merge branch 'feature/455-staff-student-relationship' into staging
kevinhowbrook Jun 8, 2020
614a5a2
Merge branch 'master' into staging
kevinhowbrook Jun 10, 2020
3712793
Merge branch 'feature/455-staff-student-relationship' into staging
kevinhowbrook Jun 10, 2020
7cf1f47
Add templatetag that gets the site-wide alert data from the API
Jun 16, 2020
59a567d
Fix imports and check if the API BASE URL is set
Jun 16, 2020
31367b1
add new sitewide alert FE with the same code (updated for less) from …
janehughes Jun 18, 2020
86cb7f4
Merge branch '1051-1052-ap-integration' into staging
Jun 22, 2020
5a40408
Fix the caching code/logic
Jun 22, 2020
f88aaa3
Merge branch 'feature/1069-sitewide-alert' into staging
Jun 22, 2020
2615366
Merge branch 'feature/1069-sitewide-alert' into feature/1069-sitewide…
janehughes Jun 24, 2020
1d445b7
update FE for sitewide alert
janehughes Jun 24, 2020
8fc3026
Merge pull request #281 from torchbox/feature/1069-sitewide-alert-FE
janehughes Jun 24, 2020
2158cec
Merge branch 'feature/1069-sitewide-alert' into staging
janehughes Jun 24, 2020
6e14be0
Remove empty headings from student pages by checking existence of fie…
helenb Jun 29, 2020
01bcf14
Fix heading structure on student pages
helenb Jun 29, 2020
becd389
Merge branch '1075-remove-student-character-limits' into staging
Jul 7, 2020
6dfc5fb
update sitewide alert to match styles of new rca site
janehughes Jul 9, 2020
2916878
Merge branch 'feature/1069-sitewide-alert' into staging
janehughes Jul 9, 2020
06f3d7b
update rich text formatting
janehughes Jul 9, 2020
260d715
Merge branch 'feature/1069-sitewide-alert' into staging
janehughes Jul 9, 2020
14ffde6
change font family for close button
janehughes Jul 9, 2020
d1d92ed
Merge branch 'feature/1069-sitewide-alert' into staging
janehughes Jul 9, 2020
c83b3fe
update font of action link
janehughes Jul 9, 2020
ad026d2
Merge branch 'feature/1069-sitewide-alert' into staging
janehughes Jul 9, 2020
1f57411
Only output an email address for staff if one exists
helenb Jul 13, 2020
5e1a7d4
Missing / duplicate alt text
helenb Jul 13, 2020
be37bf0
Merge branch 'feature/508-accessibility-updates' into staging
chris-lawton Jul 13, 2020
8269e80
Swap dt and dd tags
helenb Jul 16, 2020
fb76787
Merge remote-tracking branch 'origin/master' into 1076-further-access…
helenb Jul 17, 2020
c1a2968
Further fixes to definition lists
helenb Jul 17, 2020
b15203b
Merge branch '1076-further-accessibility-issues' into staging
helenb Jul 22, 2020
4fbad0c
Merge branch 'ldap-ci-fix' into staging
kevinhowbrook Jul 23, 2020
4222985
Merge branch '1052-ap-enquiry-form-only' into staging
Jul 23, 2020
3d33c46
Typo and lint README
Jul 23, 2020
607cbb3
Fudge to ensure that if there are no details on the left of a student…
helenb Jul 28, 2020
c5d7ac8
Merge branch '1076-further-accessibility-issues' into staging
helenb Jul 28, 2020
6fd23e8
Merge remote-tracking branch 'origin/staging' into staging
helenb Jul 28, 2020
75667e8
Merge branch 'fix/501-legacy-menu-bugs' into staging
chris-lawton Aug 4, 2020
2dd65cc
Merge branch 'fix/501-legacy-menu-bugs' into staging
chris-lawton Aug 4, 2020
c2fdfa1
Merge remote-tracking branch 'origin/fix/form-js-bug' into staging
nicklee Aug 5, 2020
9e05bfa
add default display: none, to hide popup unless cookie isn't present
janehughes Aug 6, 2020
c4e3b2d
Merge branch 'feature/1069-sitewide-alert' into staging
janehughes Aug 6, 2020
e0c4211
Merge branch '1074-richtext-sanitisation' into staging
kevinhowbrook Aug 13, 2020
869a621
Merge migrations for staging
kevinhowbrook Aug 13, 2020
7270b00
Merge branch '1074-richtext-sanitisation' into staging
kevinhowbrook Aug 13, 2020
57e54e0
Merge branch 'fix/1076-staff-work-images' into staging
chris-lawton Aug 14, 2020
30df55d
merge migrations
chris-lawton Aug 14, 2020
d60e03b
Merge branch 'fix/1076-staff-work-images' into staging
chris-lawton Aug 14, 2020
0418b41
Merge branch 'bug/1089-social-link' into staging
kevinhowbrook Oct 2, 2020
c630f28
Merge branch 'feature/1073-author-fix' into staging
kevinhowbrook Nov 3, 2020
d523298
Modify event date filter to include events which have begun but not y…
alxbridge Nov 17, 2020
eea2e65
Remove trademark notice from site footer
alxbridge Nov 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Vagrant

* Install [Vagrant](https://wiki.torchbox.com/view/Vagrant)
* ```git clone git@github.com:torchbox/verdant-rca.git```
* ```cd verdant-rca```
* ```vagrant up```
* ```vagrant ssh```
* ```djrun```
* Edit your code locally, browse at [localhost:8000](http://localhost:8000/)
- Install [Vagrant](https://wiki.torchbox.com/view/Vagrant)
- `git clone git@github.com:torchbox/verdant-rca.git`
- `cd verdant-rca`
- `vagrant up`
- `vagrant ssh`
- `djrun`
- Edit your code locally, browse at [localhost:8000](http://localhost:8000/)

## Docker

Expand All @@ -35,12 +35,10 @@ You may encounter a "Invalid input of type: 'CacheKey'" error when running a new

`redis==2.10.6` to `django-verdant/requirements.txt` and then running `pip install -r requirements.txt`


# Implementation notes

* MyRCA / student profiles: https://projects.torchbox.com/projects/rca-django-cms-project/notebook/Implementation%20notes%20for%20%22My%20RCA%22%20feature.md
* Course registration: https://projects.torchbox.com/projects/rca-django-cms-project/notebook/Implementation%20notes%20for%20Course%20registration%20(%23788).md

- MyRCA / student profiles: https://projects.torchbox.com/projects/rca-django-cms-project/notebook/Implementation%20notes%20for%20%22My%20RCA%22%20feature.md
- Course registration: https://projects.torchbox.com/projects/rca-django-cms-project/notebook/Implementation%20notes%20for%20Course%20registration%20(%23788).md

# My RCA

Expand All @@ -57,17 +55,14 @@ Also you will need to add the following user groups (with same ID)
- MPhil Students => 5
- PhD Students => 6


# Front end notes on the main RCA build


## Original set up and build

It was orignally built to a design provided by an external agency, and some of the terminology e.g. 'modules' and the names of the text styles are based on their original terminology.
It was originally built to a design provided by an external agency, and some of the terminology e.g. 'modules' and the names of the text styles are based on their original terminology.

There is no tooling, and the site uses `django-compressor`.


### CSS

This build uses Less.
Expand Down Expand Up @@ -99,7 +94,7 @@ Note that all templates for template tags sit in a separate `tags` subfolder.
There's the usual `blocks` folder for streamfield block templates.

### Carousels

The original carousel used was bxslider, and on some templates there is still functionality to add a hero carousel (with both videos and images) using bxslider. The bxslider javascript is loaded via base.html. RCA are not using this functionality much and it may get removed at a later date.

When the homepage 2018 redesign happened, there was a need to use another carousel, slick, in order to use the centre mode functionality.

2 changes: 1 addition & 1 deletion django-verdant/rca/api/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def filter_queryset(self, request, queryset, view):
date_from = request.query_params.get('event_date_from', None)
if date_from:
now = datetime.utcnow().date()
queryset = queryset.filter(dates_times__date_from__gte=now)
queryset = queryset.filter(dates_times__date_from__gte=now) | queryset.filter(dates_times__date_to__gte=now)
queryset = queryset.order_by('dates_times__date_from')

return queryset
Expand Down
20 changes: 20 additions & 0 deletions django-verdant/rca/migrations/0108_add_programme_override_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2020-05-07 14:43
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('rca', '0107_allow_event_blank_body'),
]

operations = [
migrations.AddField(
model_name='newstudentpage',
name='programme_value_override',
field=models.CharField(blank=True, help_text=b'', max_length=255),
),
]
16 changes: 16 additions & 0 deletions django-verdant/rca/migrations/0109_merge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2020-06-04 10:15
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('rca', '0108_auto_20200604_0924'),
('rca', '0108_add_programme_override_field'),
]

operations = [
]
16 changes: 16 additions & 0 deletions django-verdant/rca/migrations/0110_merge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2020-07-07 12:15
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('rca', '0109_remove-student-char-limits'),
('rca', '0109_merge'),
]

operations = [
]
16 changes: 16 additions & 0 deletions django-verdant/rca/migrations/0111_merge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2020-08-13 10:22
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('rca', '0110_merge'),
('rca', '0110_remove_ma_specialism_choices_and_last_name_validation'),
]

operations = [
]
16 changes: 16 additions & 0 deletions django-verdant/rca/migrations/0112_merge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2020-08-14 09:03
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('rca', '0111_merge'),
('rca', '0111_reimplement_ma_specialism_choices'),
]

operations = [
]
95 changes: 49 additions & 46 deletions django-verdant/rca/models.py
Original file line number Diff line number Diff line change
@@ -1,78 +1,77 @@
from datetime import date
import datetime
import hashlib
import json
import logging
import random

from datetime import date
from itertools import chain

import stripe
from captcha.fields import ReCaptchaField
from django.core.exceptions import ValidationError
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.signals import user_logged_in
from django.db import models
from django.db.models.signals import pre_delete
from django.core.exceptions import ValidationError
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.db.models import Q
from django.db.models.signals import pre_delete
from django.dispatch.dispatcher import receiver
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render, redirect
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect, render
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.utils import timezone
from django.views.decorators.vary import vary_on_headers
from modelcluster.contrib.taggit import ClusterTaggableManager
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from taggit.models import Tag, TaggedItemBase
from wagtail.contrib.settings.models import BaseSetting
from wagtail.contrib.settings.registry import register_setting

from wagtail.wagtailcore.models import Page, Orderable, PageManager
from wagtail.wagtailadmin.edit_handlers import (FieldPanel, InlinePanel,
MultiFieldPanel, ObjectList,
PageChooserPanel,
PublishingPanel,
StreamFieldPanel,
TabbedInterface)
from wagtail.wagtailadmin.utils import send_mail
from wagtail.wagtailcore.fields import RichTextField, StreamField
from wagtail.wagtailcore.models import Orderable, Page, PageManager
from wagtail.wagtailcore.query import PageQuerySet
from wagtail.wagtailcore.url_routing import RouteResult
from modelcluster.fields import ParentalKey

from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, MultiFieldPanel, InlinePanel, ObjectList, PageChooserPanel,
PublishingPanel, TabbedInterface, StreamFieldPanel
)
from wagtail.wagtaildocs.edit_handlers import DocumentChooserPanel
from wagtail.wagtailembeds import embeds
from wagtail.wagtailembeds.exceptions import EmbedNotFoundException
from wagtail.wagtailembeds.finders.embedly import AccessDeniedEmbedlyException, EmbedlyException
from wagtail.wagtailembeds.finders.embedly import (
AccessDeniedEmbedlyException, EmbedlyException)
from wagtail.wagtailforms.models import AbstractFormField, FormSubmission
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailimages.models import Image, AbstractImage, AbstractRendition
from wagtail.wagtaildocs.edit_handlers import DocumentChooserPanel
from wagtail.wagtailimages.models import (AbstractImage, AbstractRendition,
Image)
from wagtail.wagtailsearch import index
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
from wagtail.wagtailsnippets.models import register_snippet
from wagtail.wagtailsearch import index
from wagtail.wagtailcore.query import PageQuerySet
from wagtail.wagtailforms.models import AbstractFormField, FormSubmission
from wagtail.wagtailadmin.utils import send_mail

from modelcluster.contrib.taggit import ClusterTaggableManager
from modelcluster.models import ClusterableModel
from taggit.models import TaggedItemBase, Tag
from wagtailcaptcha.models import (WagtailCaptchaEmailForm,
WagtailCaptchaFormBuilder)

from donations.forms import DonationForm
from donations.mail_admins import mail_exception, full_exc_info
import stripe

import hashlib

from donations.mail_admins import full_exc_info, mail_exception
from rca.filters import (combine_filters, get_filters_q, run_filters,
run_filters_q)
from rca.standard_stream_page.models import StandardStreamPage
from rca.utils.models import (
RelatedLinkMixin, SocialFields, SidebarBehaviourFields,
OptionalBlockFields, CarouselItemFields,
)
from rca.utils.models import (CarouselItemFields, OptionalBlockFields,
RelatedLinkMixin, SidebarBehaviourFields,
SocialFields)
from rca_ee.models import FormPage
from taxonomy.models import Area, School, Programme, DegreeLevel

from rca.filters import run_filters, run_filters_q, combine_filters, get_filters_q
import json

from wagtailcaptcha.models import WagtailCaptchaEmailForm, WagtailCaptchaFormBuilder

from rca_signage.constants import SCREEN_CHOICES
from reachout_choices import REACHOUT_PROJECT_CHOICES, REACHOUT_PARTICIPANTS_CHOICES, REACHOUT_THEMES_CHOICES, REACHOUT_PARTNERSHIPS_CHOICES
from reachout_choices import (REACHOUT_PARTICIPANTS_CHOICES,
REACHOUT_PARTNERSHIPS_CHOICES,
REACHOUT_PROJECT_CHOICES,
REACHOUT_THEMES_CHOICES)
from taxonomy.models import Area, DegreeLevel, Programme, School

from .help_text import help_text

Expand Down Expand Up @@ -4057,6 +4056,7 @@ class NewStudentPage(Page, SocialFields):
show_work_type = models.CharField("Work type", max_length=255, choices=SHOW_WORK_TYPE_CHOICES, blank=True, help_text=help_text('rca.NewStudentPage', 'show_work_type'))
show_work_location = models.CharField("Work location", max_length=255, choices=CAMPUS_CHOICES, blank=True, help_text=help_text('rca.NewStudentPage', 'show_work_location'))
show_work_description = RichTextField(help_text=help_text('rca.NewStudentPage', 'show_work_description'), blank=True)
programme_value_override = models.CharField(max_length=255, blank=True, help_text=help_text('rca.NewStudentPage', 'programme_value_override'))

# MPhil details
mphil_programme = models.ForeignKey('taxonomy.Programme', verbose_name="Programme", null=True, blank=True, on_delete=models.SET_NULL, related_name='mphil_students', help_text=help_text('rca.NewStudentPage', 'mphil_programme'))
Expand Down Expand Up @@ -4341,7 +4341,9 @@ def programme(self):
return ''

def get_ma_programme_display(self):
if not self.ma_programme:
if self.programme_value_override:
return self.programme_value_override
elif not self.ma_programme:
return ''

return self.ma_programme.get_display_name_for_year(self.ma_graduation_year)
Expand Down Expand Up @@ -4515,6 +4517,7 @@ def serve(self, request, view='standard'):
FieldPanel('ma_programme'),
FieldPanel('ma_graduation_year'),
FieldPanel('ma_specialism'),
FieldPanel('programme_value_override')
], "MA details", classname="collapsible collapsed"),

# Show details
Expand Down
1 change: 0 additions & 1 deletion django-verdant/rca/static/rca/css/core.less
Original file line number Diff line number Diff line change
Expand Up @@ -2277,4 +2277,3 @@ a.hidden {
@import "streamfield-blocks/two-column-block";
@import "streamfield-blocks/testimonial";
@import "streamfield-blocks/events.less";

4 changes: 4 additions & 0 deletions django-verdant/rca/templates/rca/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@
{% endif %}
</script>

{# revert this back to live JS file path before deploying to live #}
<script src="//rca-staging.herokuapp.com/static2/js/main.js"></script>
{# <script src="//www.rca.ac.uk/static2/js/main.js"></script> #}

{% block show_js %}{% endblock %}
{% block extra_js %}{% endblock %}
{% endblock %}
Expand Down
1 change: 0 additions & 1 deletion django-verdant/rca/templates/rca/includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
<span itemprop="postalCode">SW7 2EU</span>
</span>
</p>
<p class="footer__credit-item">RCA&trade; Royal College of Art&trade; are trademarks of the Royal College of Art </p>
</div>

</div>
Expand Down
1 change: 1 addition & 0 deletions django-verdant/rcasite/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,4 @@

if "CACHE_CONTROL_STALE_IF_ERROR" in env:
CACHE_CONTROL_STALE_IF_ERROR = env["CACHE_CONTROL_STALE_IF_ERROR"]

26 changes: 26 additions & 0 deletions django-verdant/rcasitemaps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,34 @@

from django.contrib.sitemaps import views as sitemap_views

from django.contrib.sites.shortcuts import get_current_site
from django.core import urlresolvers
from django.template.response import TemplateResponse
from .sitemap_generator import Sitemap


def sitemap_views_index(request, sitemaps,
template_name='sitemap_index.xml', content_type='application/xml',
sitemap_url_name='django.contrib.sitemaps.views.sitemap'):

req_protocol = request.scheme
req_site = get_current_site(request)

sites = []
for section, site in sitemaps.items():
if callable(site):
site = site()
protocol = req_protocol if site.protocol is None else site.protocol
sitemap_url = urlresolvers.reverse(
sitemap_url_name, kwargs={'section': section})
absolute_url = '%s://%s%s' % (protocol, request.site.hostname, sitemap_url)
sites.append(absolute_url)
for page in range(2, site.paginator.num_pages + 1):
sites.append('%s?p=%s' % (absolute_url, page))

return TemplateResponse(request, template_name, {'sitemaps': sites},
content_type=content_type)

def index(request, sitemaps, **kwargs):
sitemaps = prepare_sitemaps(request, sitemaps)

Expand All @@ -21,6 +46,7 @@ def index(request, sitemaps, **kwargs):
def sitemap(request, sitemaps=None, **kwargs):
if sitemaps:
sitemaps = prepare_sitemaps(request, sitemaps)

else:
sitemaps = {'wagtail': Sitemap(request.site)}
return sitemap_views.sitemap(request, sitemaps, **kwargs)
Expand Down