diff --git a/.gitmodules b/.gitmodules index 3922ef2..d578b97 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "components"] - path = components - url = git://github.com/toulibre/ponyconf-components +[submodule "node_modules"] + path = node_modules + url = ./node_modules diff --git a/accounts/urls.py b/accounts/urls.py index 750b1dc..2e14185 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -7,6 +7,6 @@ from . import views urlpatterns = [ path('profile/', views.profile, name='profile'), path('accounts/login/', views.EmailLoginView.as_view(), {'extra_context': {'buttons': [views.RESET_PASSWORD_BUTTON]}}, name='login'), - path('logout/', auth_views.logout, {'next_page': settings.LOGOUT_REDIRECT_URL}, name='logout'), + path('logout/', auth_views.LogoutView.as_view(), {'next_page': settings.LOGOUT_REDIRECT_URL}, name='logout'), path('', include('django.contrib.auth.urls')), ] diff --git a/cfp/decorators.py b/cfp/decorators.py index 312814f..92d635e 100644 --- a/cfp/decorators.py +++ b/cfp/decorators.py @@ -12,7 +12,7 @@ from cfp.models import Participant, Volunteer def speaker_required(view_func): def wrapped_view(request, **kwargs): - speaker_token = kwargs.pop('speaker_token') + speaker_token = kwargs.pop('speaker_token', None) if speaker_token: try: speaker_token = UUID(speaker_token) @@ -30,7 +30,7 @@ def speaker_required(view_func): def volunteer_required(view_func): def wrapped_view(request, **kwargs): - volunteer_token = kwargs.pop('volunteer_token') + volunteer_token = kwargs.pop('volunteer_token', None) if volunteer_token: try: volunteer_token = UUID(volunteer_token) diff --git a/cfp/migrations/0027_auto_20200809_1530.py b/cfp/migrations/0027_auto_20200809_1530.py new file mode 100644 index 0000000..fd744bb --- /dev/null +++ b/cfp/migrations/0027_auto_20200809_1530.py @@ -0,0 +1,28 @@ +# Generated by Django 3.1 on 2020-08-09 13:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cfp', '0026_conference_end_date'), + ] + + operations = [ + migrations.AlterField( + model_name='talk', + name='accepted', + field=models.BooleanField(default=None, null=True), + ), + migrations.AlterField( + model_name='talk', + name='confirmed', + field=models.BooleanField(default=None, null=True), + ), + migrations.AlterField( + model_name='talk', + name='video_licence', + field=models.CharField(choices=[('CC-Zero CC-BY', 'CC-Zero CC-BY'), ('CC-BY-SA', 'CC-BY-SA'), ('CC-BY-ND', 'CC-BY-ND'), ('CC-BY-NC', 'CC-BY-NC'), ('CC-BY-NC-SA', 'CC-BY-NC-SA'), ('CC-BY-NC-ND', 'CC-BY-NC-ND')], default='CC-BY-SA', max_length=32, verbose_name='Video licence'), + ), + ] diff --git a/cfp/models.py b/cfp/models.py index 3a18b7f..d233574 100644 --- a/cfp/models.py +++ b/cfp/models.py @@ -167,8 +167,6 @@ class Track(PonyConfModel): slug = AutoSlugField(populate_from='name') description = models.TextField(blank=True, verbose_name=_('Description')) - #managers = models.ManyToManyField(User, blank=True, verbose_name=_('Managers')) - class Meta: unique_together = ('site', 'name') ordering = ['name'] @@ -347,10 +345,10 @@ class Talk(PonyConfModel): category = models.ForeignKey(TalkCategory, verbose_name=_('Talk Category'), on_delete=models.PROTECT) videotaped = models.BooleanField(_("I'm ok to be recorded on video"), default=True) video_licence = models.CharField(choices=LICENCES, default='CC-BY-SA', - max_length=10, verbose_name=_("Video licence")) + max_length=32, verbose_name=_("Video licence")) sound = models.BooleanField(_("I need sound"), default=False) - accepted = models.NullBooleanField(default=None) - confirmed = models.NullBooleanField(default=None) + accepted = models.BooleanField(null=True, default=None) + confirmed = models.BooleanField(null=True, default=None) start_date = models.DateTimeField(null=True, blank=True, default=None, verbose_name=_('Beginning date and time')) duration = models.PositiveIntegerField(default=0, verbose_name=_('Duration (min)')) room = models.ForeignKey(Room, blank=True, null=True, default=None, on_delete=models.SET_NULL) diff --git a/cfp/templates/cfp/admin/homepage.html b/cfp/templates/cfp/admin/homepage.html index ecbc882..248b14e 100644 --- a/cfp/templates/cfp/admin/homepage.html +++ b/cfp/templates/cfp/admin/homepage.html @@ -45,7 +45,7 @@ var markdown_preview_url = "{% url 'markdown-preview' %}"; - + {% endblock %} {% block css %} diff --git a/cfp/urls.py b/cfp/urls.py index 5a89e06..64ff36e 100644 --- a/cfp/urls.py +++ b/cfp/urls.py @@ -1,4 +1,4 @@ -from django.urls import path, re_path, register_converter +from django.urls import path, re_path, register_converter, include from . import views, converters @@ -60,7 +60,7 @@ urlpatterns = [ path('staff/volunteers/email/preview/', views.volunteer_email_preview, name='volunteer-email-preview'), path('staff/add-user/', views.create_user, name='create-user'), re_path(r'^staff/schedule/((?P[\w]+)/)?$', views.staff_schedule, name='staff-schedule'), - path('staff/select2/', views.Select2View.as_view(), name='django_select2-json'), + path('staff/select2/', include('django_select2.urls')), path('admin/', views.admin, name='admin'), path('admin/conference/', views.conference_edit, name='conference-edit'), path('admin/homepage/', views.homepage_edit, name='homepage-edit'), diff --git a/cfp/views.py b/cfp/views.py index f227080..cb78971 100644 --- a/cfp/views.py +++ b/cfp/views.py @@ -1299,7 +1299,7 @@ def schedule(request, program_format, pending, template, staff, cache=None): raise Http404(_("Format '%s' not available" % program_format)) -def public_schedule(request, program_format): +def public_schedule(request, program_format=None): if not request.conference.schedule_available and not is_staff(request, request.user): raise PermissionDenied if request.conference.schedule_redirection_url and program_format is None: @@ -1309,7 +1309,7 @@ def public_schedule(request, program_format): @staff_required -def staff_schedule(request, program_format): +def staff_schedule(request, program_format=None): return schedule(request, program_format=program_format, pending=True, template='cfp/staff/schedule.html', staff=True, cache=False) diff --git a/components b/components deleted file mode 160000 index fe849d7..0000000 --- a/components +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fe849d749c0b9d382f3134d8344ee72637432a7c diff --git a/node_modules b/node_modules new file mode 160000 index 0000000..9634617 --- /dev/null +++ b/node_modules @@ -0,0 +1 @@ +Subproject commit 9634617237843dfd0eae718b74c42666d28a38c0 diff --git a/package.json b/package.json new file mode 100644 index 0000000..97b8709 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "ponyconf", + "version": "1.0.0", + "description": "Organise your conferences", + "main": "index.js", + "directories": { + "doc": "doc" + }, + "dependencies": { + "jquery": "^3.5.1" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/PonyConf/PonyConf.git" + }, + "author": "Élie Bouttier and contributors", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/PonyConf/PonyConf/issues" + }, + "homepage": "https://github.com/PonyConf/PonyConf#readme" +} diff --git a/ponyconf/context_processors.py b/ponyconf/context_processors.py deleted file mode 100644 index 2f480be..0000000 --- a/ponyconf/context_processors.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.contrib.sites.shortcuts import get_current_site - - -def site(request): - - return { - 'site': get_current_site(request), - } diff --git a/ponyconf/settings.py b/ponyconf/settings.py index 8fd694c..505142e 100644 --- a/ponyconf/settings.py +++ b/ponyconf/settings.py @@ -1,13 +1,5 @@ """ Django settings for ponyconf project. - -Generated by 'django-admin startproject' using Django 1.9.6. - -For more information on this file, see -https://docs.djangoproject.com/en/1.9/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.9/ref/settings/ """ from django.utils.translation import ugettext_lazy as _ @@ -17,10 +9,6 @@ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ - # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'm2d03t^m)!nsborq5a1#e!#m)wjl&-%tu4ew@fxf1_b_t*@36r' @@ -33,7 +21,7 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ - # the post_migrate creating the first site should be call at first + # the post_migrate creating the first site should be called at first 'django.contrib.sites', # our apps @@ -41,11 +29,8 @@ INSTALLED_APPS = [ 'accounts', 'cfp', 'mailing', - #'planning', - #'volunteers', - # external apps - 'djangobower', + # third-party apps 'bootstrap3', 'django_select2', 'crispy_forms', @@ -152,71 +137,22 @@ LOCALE_PATHS = [ MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.9/howto/static-files/ - STATIC_URL = '/static/' -STATICFILES_FINDERS = [ - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', - 'djangobower.finders.BowerFinder', +STATICFILES_DIRS = [ + ('jquery', os.path.join(BASE_DIR, 'node_modules/jquery/dist/')), ] -BOWER_COMPONENTS_ROOT = os.path.join(BASE_DIR, 'components') -BOWER_INSTALLED_APPS = ( - 'bootstrap', - 'jquery#2', - 'jquery-ui', - 'jquery-cookie', - 'select2', - 'eonasdan-bootstrap-datetimepicker', - 'moment', -) - LOGIN_REDIRECT_URL = 'home' SITE_ID = 1 -BOOTSTRAP3 = { - - # The URL to the jQuery JavaScript file - # If not set, "build-in" CDN is used (maxcdn) - # 'jquery_url': '//code.jquery.com/jquery.min.js', - 'jquery_url': STATIC_URL + 'jquery/dist/jquery.js', - - # The Bootstrap base URL - # If not set, "build-in" CDN is used (maxcdn) - # 'base_url': '//netdna.bootstrapcdn.com/bootstrap/3.2.0/', - 'base_url': STATIC_URL + 'bootstrap/dist/', - - # The complete URL to the Bootstrap CSS file - # (None means derive it from base_url) - 'css_url': None, - - # The complete URL to the Bootstrap CSS file - # (None means no theme) - 'theme_url': None, - - # The complete URL to the Bootstrap JavaScript file - # (None means derive it from base_url) - 'javascript_url': None, -} - -SELECT2_JS = 'select2/dist/js/select2.min.js' -SELECT2_CSS = 'select2/dist/css/select2.min.css' -SELECT2_I18N_PATH = 'select2/dist/js/i18n' - AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', 'ponyconf.backends.EmailBackend', ] LOGOUT_REDIRECT_URL = 'home' -CRISPY_TEMPLATE_PACK='bootstrap3' - -# django-registration -ACCOUNT_ACTIVATION_DAYS = 7 -INCLUDE_REGISTER_URL = True +CRISPY_TEMPLATE_PACK = 'bootstrap3' CACHES = { 'default': { diff --git a/ponyconf/static/js/markdown-preview.js b/ponyconf/static/ponyconf/markdown-preview.js similarity index 100% rename from ponyconf/static/js/markdown-preview.js rename to ponyconf/static/ponyconf/markdown-preview.js diff --git a/ponyconf/static/css/ponyconf.css b/ponyconf/static/ponyconf/ponyconf.css similarity index 100% rename from ponyconf/static/css/ponyconf.css rename to ponyconf/static/ponyconf/ponyconf.css diff --git a/ponyconf/static/js/ponyconf.js b/ponyconf/static/ponyconf/ponyconf.js similarity index 100% rename from ponyconf/static/js/ponyconf.js rename to ponyconf/static/ponyconf/ponyconf.js diff --git a/ponyconf/static/ponyconf/ponyconf.png b/ponyconf/static/ponyconf/ponyconf.png new file mode 100644 index 0000000..7969913 Binary files /dev/null and b/ponyconf/static/ponyconf/ponyconf.png differ diff --git a/ponyconf/templates/_base.html b/ponyconf/templates/_base.html index bc80aaf..28cbdeb 100644 --- a/ponyconf/templates/_base.html +++ b/ponyconf/templates/_base.html @@ -6,12 +6,12 @@ - {% comment %}{% endcomment %} + {% block title %}{{ conference.name }}{% endblock %} {% bootstrap_css %} - + {% block css %}{% endblock %} {% block js %}{% endblock %} @@ -32,7 +32,7 @@ {% bootstrap_javascript %} - + {% block js_end %}{% endblock %} diff --git a/requirements.in b/requirements.in index b5f7fed..1e44517 100644 --- a/requirements.in +++ b/requirements.in @@ -1,9 +1,8 @@ -django<3 +django django-bootstrap3 -django-bower django-crispy-forms -django-select2<6 +django-select2 django-colorful django-autoslug diff --git a/requirements.txt b/requirements.txt index 696b5e8..c78917b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,25 +4,26 @@ # # pip-compile # -bleach==3.1.0 -chardet==3.0.4 -django-appconf==1.0.3 # via django-select2 -django-autoslug==1.9.6 -django-bootstrap3==11.1.0 -django-bower==5.2.0 -django-colorful==1.3 -django-crispy-forms==1.8.0 -django-select2==5.11.1 -django==2.2.8 -icalendar==4.0.3 -jinja2==2.10.3 -markdown==3.1.1 +asgiref==3.2.10 # via django +bleach==3.1.5 # via -r requirements.in +chardet==3.0.4 # via -r requirements.in +django-appconf==1.0.4 # via django-select2 +django-autoslug==1.9.8 # via -r requirements.in +django-bootstrap3==14.1.0 # via -r requirements.in +django-colorful==1.3 # via -r requirements.in +django-crispy-forms==1.9.2 # via -r requirements.in +django-select2==7.4.2 # via -r requirements.in +django==3.1 # via -r requirements.in, django-appconf, django-bootstrap3, django-colorful, django-select2 +icalendar==4.0.6 # via -r requirements.in +importlib-metadata==1.7.0 # via django-bootstrap3, markdown +jinja2==2.11.2 # via -r requirements.in +markdown==3.2.2 # via -r requirements.in markupsafe==1.1.1 # via jinja2 +packaging==20.4 # via bleach +pyparsing==2.4.7 # via packaging python-dateutil==2.8.1 # via icalendar -pytz==2019.3 # via django, icalendar -six==1.13.0 # via bleach, django-appconf, django-bower, python-dateutil -sqlparse==0.3.0 # via django +pytz==2020.1 # via django, icalendar +six==1.15.0 # via bleach, packaging, python-dateutil +sqlparse==0.3.1 # via django webencodings==0.5.1 # via bleach - -# The following packages are considered to be unsafe in a requirements file: -# setuptools +zipp==3.1.0 # via importlib-metadata