Changeset - 9e851c31fac3
[Not reviewed]
27 14 0
Sachi King - 7 years ago 2017-03-31 00:54:46
nakato@nakato.io
Remove dj-user-accounts

That's a nice macro, but we don't need it.
dj-user-accounts stands in the way of using more generic AUTN_METHODS
41 files changed with 13 insertions and 464 deletions:
0 comments (0 inline, 0 general)
pinaxcon/apps.py
Show inline comments
 
from importlib import import_module
 

	
 
from django.apps import AppConfig as BaseAppConfig
 

	
 

	
 
class AppConfig(BaseAppConfig):
 

	
 
    name = "pinaxcon"
 

	
 
    def ready(self):
 
        import_module("pinaxcon.receivers")
pinaxcon/monkey_patch.py
Show inline comments
 
from django.conf import settings
 
from functools import wraps
 

	
 

	
 
class MonkeyPatchMiddleware(object):
 
    ''' Ensures that our monkey patching only gets called after it is safe to do so.'''
 

	
 
    def process_request(self, request):
 
        do_monkey_patch()
 

	
 

	
 
def do_monkey_patch():
 
    patch_speaker_profile_form()
 
    fix_sitetree_check_access_500s()
 
    never_cache_login_page()
 
    patch_stripe_payment_form()
 

	
 
    # Remove this function from existence
 
    global do_monkey_patch
 
    do_monkey_patch = lambda: None  # noqa: E731
 

	
 

	
 
def patch_speaker_profile_form():
 
    ''' Replaces textarea widgets with markdown editors. '''
 

	
 
    import widgets
 
    from symposion.speakers.forms import SpeakerForm
 

	
 
    fields = SpeakerForm.base_fields
 
    fields["biography"].widget = widgets.AceMarkdownEditor()
 
    fields["experience"].widget = widgets.AceMarkdownEditor()
 
    fields["accessibility"].widget = widgets.AceMarkdownEditor()
 

	
 

	
 
def fix_sitetree_check_access_500s():
 
    ''' django-sitetree has a bug: https://github.com/idlesign/django-sitetree/pull/167/files
 
    -- it swallows the cause of all 500 errors. This swallows KeyErrors from
 
    the failing function. '''
 

	
 
    from sitetree.sitetreeapp import SiteTree
 

	
 
    old_check_access = SiteTree.check_access
 

	
 
    @wraps(SiteTree.check_access)
 
    def check_access(self, *a, **k):
 
        try:
 
            return old_check_access(self, *a, **k)
 
        except KeyError:
 
            return False
 

	
 
    SiteTree.check_access = check_access
 

	
 

	
 
def never_cache_login_page():
 
    from django.views.decorators.cache import never_cache
 
    from account.views import LoginView
 
    LoginView.get = never_cache(LoginView.get)
 

	
 

	
 
def patch_stripe_payment_form():  # noqa: C901
 

	
 
    import inspect  # Oh no.
 
    from django.http.request import HttpRequest
 
    from registripe.forms import CreditCardForm
 
    from pinaxcon.registrasion import models
 

	
 
    old_init = CreditCardForm.__init__
 

	
 
    @wraps(old_init)
 
    def new_init(self, *a, **k):
 

	
 
        # Map the names from our attendee profile model
 
        # To the values expected in the Stripe card model
 
        mappings = (
 
            ("address_line_1", "address_line1"),
 
            ("address_line_2", "address_line2"),
 
            ("address_suburb", "address_city"),
 
            ("address_postcode", "address_zip"),
 
            ("state", "address_state"),
 
            ("country", "address_country"),
 
        )
 

	
 
        initial = "initial"
 
        if initial not in k:
 
            k[initial] = {}
 
        initial = k[initial]
 

	
 
        # Find request context maybe?
 
        frame = inspect.currentframe()
 
        attendee_profile = None
 
        if frame:
 
            context = frame.f_back.f_locals
 
            for name, value in (context.items() or {}):
 
                if not isinstance(value, HttpRequest):
 
                    continue
 
                user = value.user
 
                if not user.is_authenticated():
 
                    break
 
                try:
 
                    attendee_profile = models.AttendeeProfile.objects.get(
 
                        attendee__user=user
 
                    )
 
                except models.AttendeeProfile.DoesNotExist:
 
                    # Profile is still none.
 
                    pass
 
                break
 

	
 
        if attendee_profile:
 
            for us, stripe in mappings:
 
                i = getattr(attendee_profile, us, None)
 
                if i:
 
                    initial[stripe] = i
 

	
 
        old_init(self, *a, **k)
 

	
 
    CreditCardForm.__init__ = new_init
pinaxcon/receivers.py
Show inline comments
 
deleted file
pinaxcon/settings.py
Show inline comments
 
import os
 
from django.utils.crypto import get_random_string
 

	
 

	
 
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
 
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
 
BASE_DIR = PACKAGE_ROOT
 

	
 
DEBUG = True  # bool(int(os.environ.get("DEBUG", "1")))
 

	
 
DATABASES = {
 
    "default": {
 
        "ENGINE": "django.db.backends.sqlite3",
 
        "NAME": os.path.join(PROJECT_ROOT, "dev.db"),
 
    }
 
}
 

	
 
CACHES = {
 
    'default': {
 
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
 
    }
 
}
 

	
 

	
 
ALLOWED_HOSTS = ['lca2018.org']
 

	
 
TIME_ZONE = "Australia/Sydney"
 
DATE_FORMAT = "j F Y"
 
LANGUAGE_CODE = "en-au"
 

	
 
SITE_ID = int(os.environ.get("SITE_ID", 1))
 
USE_I18N = True
 
USE_L10N = True
 
USE_TZ = True
 

	
 
MEDIA_ROOT = os.path.join(PACKAGE_ROOT, "site_media", "media")
 
MEDIA_URL = "/site_media/media/"
 

	
 
STATIC_ROOT = os.path.join(PROJECT_ROOT, "static", "distx")
 
STATIC_URL = "/static/dist/"
 

	
 
STATICFILES_DIRS = [
 
    os.path.join(PROJECT_ROOT, "static", "dist"),
 
]
 

	
 
STATICFILES_FINDERS = [
 
    "django.contrib.staticfiles.finders.FileSystemFinder",
 
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
 
]
 

	
 
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", get_random_string(length=64))
 

	
 
TEMPLATES = [
 
    {
 
        "BACKEND": "django.template.backends.django.DjangoTemplates",
 
        "DIRS": [
 
            os.path.join(PACKAGE_ROOT, "templates"),
 
        ],
 
        "APP_DIRS": True,
 
        "OPTIONS": {
 
            "debug": DEBUG,
 
            "context_processors": [
 
                "django.contrib.auth.context_processors.auth",
 
                "django.core.context_processors.debug",
 
                "django.core.context_processors.i18n",
 
                "django.core.context_processors.media",
 
                "django.core.context_processors.static",
 
                "django.core.context_processors.tz",
 
                "django.core.context_processors.request",
 
                "django.contrib.messages.context_processors.messages",
 
                "account.context_processors.account",
 
                "pinax_theme_bootstrap.context_processors.theme",
 
                "symposion.reviews.context_processors.reviews",
 
            ],
 
        },
 
    },
 
]
 

	
 
MIDDLEWARE_CLASSES = [
 
    "django.contrib.sessions.middleware.SessionMiddleware",
 
    "django.middleware.common.CommonMiddleware",
 
    "django.middleware.csrf.CsrfViewMiddleware",
 
    "django.contrib.auth.middleware.AuthenticationMiddleware",
 
    "django.contrib.auth.middleware.SessionAuthenticationMiddleware",
 
    "django.contrib.messages.middleware.MessageMiddleware",
 
    "debug_toolbar.middleware.DebugToolbarMiddleware",
 
    "reversion.middleware.RevisionMiddleware",
 
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
 
    'wagtail.wagtailcore.middleware.SiteMiddleware',
 
    'wagtail.wagtailredirects.middleware.RedirectMiddleware',
 
    'pinaxcon.monkey_patch.MonkeyPatchMiddleware',
 
]
 

	
 
ROOT_URLCONF = "pinaxcon.urls"
 

	
 
# Python dotted path to the WSGI application used by Django's runserver.
 
WSGI_APPLICATION = "pinaxcon.wsgi.application"
 

	
 
INSTALLED_APPS = [
 
    "django.contrib.admin",
 
    "django.contrib.auth",
 
    "django.contrib.contenttypes",
 
    "django.contrib.messages",
 
    "django.contrib.sessions",
 
    "django.contrib.sites",
 
    "django.contrib.staticfiles",
 
    "django.contrib.humanize",
 
    "debug_toolbar",
 

	
 
    # theme
 
    "bootstrapform",
 
    "pinax_theme_bootstrap",
 

	
 
    # external
 
    "account",
 
    "easy_thumbnails",
 
    "taggit",
 
    "reversion",
 
    "metron",
 
    "sitetree",
 
    "pinax.eventlog",
 

	
 
    # wagtail
 
    'wagtail.wagtailforms',
 
    'wagtail.wagtailredirects',
 
    'wagtail.wagtailembeds',
 
    'wagtail.wagtailsites',
 
    'wagtail.wagtailusers',
 
    'wagtail.wagtailsnippets',
 
    'wagtail.wagtaildocs',
 
    'wagtail.wagtailimages',
 
    'wagtail.wagtailsearch',
 
    'wagtail.wagtailadmin',
 
    'wagtail.wagtailcore',
 

	
 
    'modelcluster',
 

	
 

	
 
    # symposion
 
    "symposion",
 
    "symposion.conference",
 
    "symposion.proposals",
 
    "symposion.reviews",
 
    "symposion.schedule",
 
    "symposion.speakers",
 
    "symposion.sponsorship",
 
    "symposion.teams",
 

	
 
    # Registrasion
 
    "registrasion",
 

	
 
    # Registrasion-stipe
 
    "pinax.stripe",
 
    "django_countries",
 
    "registripe",
 

	
 
    # admin - required by registrasion ??
 
    "nested_admin",
 

	
 
    # project
 
    "cms_pages",
 
    "pinaxcon",
 
    "pinaxcon.proposals",
 
    "pinaxcon.registrasion",
 
    "jquery",
 
    "djangoformsetjs",
 

	
 
    # testing
 
    "django_nose",
 
]
 

	
 
DEBUG_TOOLBAR_PANELS = [
 
    'debug_toolbar.panels.versions.VersionsPanel',
 
    'debug_toolbar.panels.timer.TimerPanel',
 
    'debug_toolbar.panels.settings.SettingsPanel',
 
    'debug_toolbar.panels.headers.HeadersPanel',
 
    'debug_toolbar.panels.request.RequestPanel',
 
    'debug_toolbar.panels.sql.SQLPanel',
 
    'debug_toolbar.panels.staticfiles.StaticFilesPanel',
 
    'debug_toolbar.panels.templates.TemplatesPanel',
 
    'debug_toolbar.panels.cache.CachePanel',
 
    'debug_toolbar.panels.signals.SignalsPanel',
 
    'debug_toolbar.panels.logging.LoggingPanel',
 
    'debug_toolbar.panels.redirects.RedirectsPanel',
 
]
 

	
 
DEBUG_TOOLBAR_CONFIG = {
 
    'INTERCEPT_REDIRECTS': False,
 
    'SHOW_TOOLBAR_CALLBACK': lambda x: DEBUG,
 
}
 

	
 
LOGGING = {
 
    'version': 1,
 
    'disable_existing_loggers': False,
 
    'formatters': {
 
        'verbose': {
 
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
 
        },
 
        'simple': {
 
            'format': '%(asctime)s %(levelname)s $(module)s %(message)s'
 
        },
 
    },
 
    'filters': {
 
        'require_debug_false': {
 
            '()': 'django.utils.log.RequireDebugFalse'
 
        }
 
    },
 
    'handlers': {
 
        'console': {
 
            'level': 'DEBUG',
 
            'class': 'logging.StreamHandler',
 
            'formatter': 'simple'
 
        },
 
        'mail_admins': {
 
            'level': 'ERROR',
 
            'filters': ['require_debug_false'],
 
            'class': 'django.utils.log.AdminEmailHandler',
 
            'include_html': True,
 
        }
 
    },
 
    'loggers': {
 
        'django.request': {
 
            'handlers': ['mail_admins'],
 
            'level': 'DEBUG',
 
            'propagate': True,
 
        },
 
        'symposion.request': {
 
            'handlers': ['mail_admins'],
 
            'level': 'DEBUG',
 
            'propagate': True,
 
        },
 
    },
 
    'root': {
 
        'handlers': ['console'],
 
        'level': 'DEBUG'
 
    },
 
}
 
FIXTURE_DIRS = [
 
    os.path.join(PROJECT_ROOT, "fixtures"),
 
]
 

	
 
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
 

	
 
ACCOUNT_OPEN_SIGNUP = True
 
ACCOUNT_EMAIL_UNIQUE = True
 
ACCOUNT_EMAIL_CONFIRMATION_REQUIRED = False
 
ACCOUNT_LOGIN_REDIRECT_URL = "dashboard"
 
ACCOUNT_LOGOUT_REDIRECT_URL = "/"
 
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 2
 
ACCOUNT_USE_AUTH_AUTHENTICATE = True
 

	
 
THEME_CONTACT_EMAIL = "team@lca2018.org"
 

	
 
AUTHENTICATION_BACKENDS = [
 
    "symposion.teams.backends.TeamPermissionsBackend",
 
    "account.auth_backends.UsernameAuthenticationBackend",
 
    "account.auth_backends.EmailAuthenticationBackend",
 
]
 

	
 
CONFERENCE_ID = 1
 
PROPOSAL_FORMS = {
 
    "talk": "pinaxcon.proposals.forms.TalkProposalForm",
 
    "tutorial": "pinaxcon.proposals.forms.TutorialProposalForm",
 
    "miniconf": "pinaxcon.proposals.forms.MiniconfProposalForm",
 
    "sysadmin-miniconf": "pinaxcon.proposals.forms.SysAdminProposalForm",
 
    "openradio-miniconf": "pinaxcon.proposals.forms.RadioProposalForm",
 
    "wootconf-miniconf": "pinaxcon.proposals.forms.WootconfProposalForm",
 
    "writethedocs-miniconf": "pinaxcon.proposals.forms.WriteTheDocsProposalForm",
 
    "security-miniconf": "pinaxcon.proposals.forms.SecurityProposalForm",
 
    "kernel-miniconf": "pinaxcon.proposals.forms.KernelProposalForm",
 
    "games-miniconf": "pinaxcon.proposals.forms.GamesProposalForm",
 
    "testing-miniconf": "pinaxcon.proposals.forms.TestingProposalForm",
 
    "knowledge-miniconf": "pinaxcon.proposals.forms.KnowledgeProposalForm",
 
    "lawpolicy-miniconf": "pinaxcon.proposals.forms.LawProposalForm",
 
    "openhardware-miniconf": "pinaxcon.proposals.forms.OpenHardwareProposalForm",
 
}
 

	
 
# PINAX_PAGES_HOOKSET = "pinaxcon.hooks.PinaxPagesHookSet"
 
# PINAX_BOXES_HOOKSET = "pinaxcon.hooks.PinaxBoxesHookSet"
 

	
 
# Registrasion bits:
 
ATTENDEE_PROFILE_MODEL = "pinaxcon.registrasion.models.AttendeeProfile"
 
ATTENDEE_PROFILE_FORM = "pinaxcon.registrasion.forms.ProfileForm"
 
INVOICE_CURRENCY = "AUD"
 
PINAX_STRIPE_PUBLIC_KEY = os.environ.get("STRIPE_PUBLIC_KEY", "your test public key")
 
PINAX_STRIPE_SECRET_KEY = os.environ.get("STRIPE_SECRET_KEY", "your test secret key")
 
PINAX_STRIPE_SEND_EMAIL_RECEIPTS = False
 

	
 
# Wagtail config
 
WAGTAIL_SITE_NAME = 'linux.conf.au 2018'
 
WAGTAIL_APPEND_SLASH = True
 
WAGTAILIMAGES_IMAGE_MODEL = 'cms_pages.CustomImage'
 

	
 
ATTENDEE_PROFILE_FORM = "pinaxcon.registrasion.forms.ProfileForm"
 

	
 
# CSRF custom error screen
 
CSRF_FAILURE_VIEW = "pinaxcon.csrf_view.csrf_failure"
 

	
 
# Use nose to run all tests
 
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
 

	
 
# Tell nose to measure coverage on the 'foo' and 'bar' apps
 
NOSE_ARGS = [
 
    '--with-coverage',
 
    '--cover-package=registrasion.controllers,registrasion.models',
 
]
 

	
 
# Production settings have their own file to override stuff here
 
try:
 
    LOCAL_SETTINGS
 
except NameError:
 
    try:
 
        from local_settings import *  # noqa: F401,F403
 
    except ImportError:
 
        pass
pinaxcon/templates/_account_bar.html
Show inline comments
 
deleted file
pinaxcon/templates/account/_login_sidebar.html
Show inline comments
 
deleted file
pinaxcon/templates/account/_signup_sidebar.html
Show inline comments
 
deleted file
pinaxcon/templates/account/base.html
Show inline comments
 
deleted file
pinaxcon/templates/account/delete.html
Show inline comments
 
deleted file
pinaxcon/templates/account/email/email_confirmation_message.txt
Show inline comments
 
deleted file
pinaxcon/templates/account/email/email_confirmation_subject.txt
Show inline comments
 
deleted file
pinaxcon/templates/account/email/invite_user.txt
Show inline comments
 
deleted file
pinaxcon/templates/account/email/invite_user_subject.txt
Show inline comments
 
deleted file
pinaxcon/templates/account/email/password_change.txt
Show inline comments
 
deleted file
pinaxcon/templates/account/email/password_change_subject.txt
Show inline comments
 
deleted file
pinaxcon/templates/account/email/password_reset.txt
Show inline comments
 
deleted file
pinaxcon/templates/account/email/password_reset_subject.txt
Show inline comments
 
deleted file
pinaxcon/templates/account/email_confirm.html
Show inline comments
 
deleted file
pinaxcon/templates/account/email_confirmation_sent.html
Show inline comments
 
deleted file
pinaxcon/templates/account/email_confirmed.html
Show inline comments
 
deleted file
pinaxcon/templates/account/login.html
Show inline comments
 
deleted file
pinaxcon/templates/account/logout.html
Show inline comments
 
deleted file
pinaxcon/templates/account/password_change.html
Show inline comments
 
deleted file
pinaxcon/templates/account/password_reset.html
Show inline comments
 
deleted file
pinaxcon/templates/account/password_reset_sent.html
Show inline comments
 
deleted file
pinaxcon/templates/account/password_reset_token.html
Show inline comments
 
deleted file
pinaxcon/templates/account/password_reset_token_fail.html
Show inline comments
 
deleted file
pinaxcon/templates/account/settings.html
Show inline comments
 
deleted file
pinaxcon/templates/account/signup.html
Show inline comments
 
deleted file
pinaxcon/templates/account/signup_closed.html
Show inline comments
 
deleted file
pinaxcon/templates/symposion/emails/proposal_new_message/message.html
Show inline comments
 
{% load account_tags %}
 
{% load i18n %}
 
{% user_display message.user as user %}
 
<p>
 
  {% blocktrans with title=proposal.title %}<b>{{ user }}</b> has added a message on <b>{{ title }}</b>.{% endblocktrans %}
 
  {% blocktrans with title=proposal.title user=message.user %}<b>{{ user }}</b> has added a message on <b>{{ title }}</b>.{% endblocktrans %}
 
</p>
 
<blockquote>
 
    {{ message.message|safe }}
 
</blockquote>
 
<p>
 
    {% if reviewer %}{% url 'review_detail' proposal.pk as detail_url %}{% else %}{% url 'proposal_detail' proposal.pk as detail_url %}{% endif %}
 
    {% blocktrans %} Respond online at <a href="http://{{ current_site }}{{ detail_url }}#proposal-feedback">http://{{ current_site }}{{ detail_url }}#proposal-feedback</a>{% endblocktrans %}
 
</p>
pinaxcon/templates/symposion/emails/proposal_new_message/subject.txt
Show inline comments
 
{% load account_tags i18n %}{% user_display message.user as user %}{% blocktrans with title=proposal.title %}New message on "{{ title }}" from {{ user }}{% endblocktrans %}
 
{% load i18n %}{% blocktrans with title=proposal.title user=message.user.username %}New message on "{{ title }}" from {{ user }}{% endblocktrans %}
pinaxcon/templates/symposion/emails/proposal_updated/message.html
Show inline comments
 
{% load account_tags %}
 
{% load i18n %}
 
{% user_display user as username %}
 
<p>
 
  {% blocktrans with title=proposal.title %}<b>{{ username }}</b> has made changes to <b>{{ title }}</b> which you have previously reviewed or commented on.{% endblocktrans %}
 
  {% blocktrans with title=proposal.title username=user.username %}<b>{{ username }}</b> has made changes to <b>{{ title }}</b> which you have previously reviewed or commented on.{% endblocktrans %}
 
</p>
 
<p>
 
    {% url 'review_detail' proposal.pk as detail_url %}
 
    {% blocktrans %}View the latest version of the proposal online at <a href="http://{{ current_site }}{{ detail_url }}">http://{{ current_site }}{{ detail_url }}</a>{% endblocktrans %}
 
</p>
pinaxcon/templates/symposion/emails/proposal_updated/subject.txt
Show inline comments
 
{% load account_tags i18n %}{% user_display user as username %}{% blocktrans with title=proposal.title %}"{{ title }}" has been updated by {{ username }}{% endblocktrans %}
 
{% load i18n %}{% blocktrans with title=proposal.title username=user.username %}"{{ title }}" has been updated by {{ username }}{% endblocktrans %}
pinaxcon/templates/symposion/emails/teams_user_applied/message.html
Show inline comments
 
{% load i18n account_tags %}
 
{% user_display user as username %}
 
{% blocktrans with team_name=team team_url=team.get_absolute_url site_name=current_site.name site_url=current_site %}
 
{% load i18n %}
 
{% blocktrans with team_name=team team_url=team.get_absolute_url site_name=current_site.name site_url=current_site username=user.username %}
 
    <p>
 
        User "{{ username }}" has applied to join <b>{{ team_name }}</b> on {{ site_name }}.
 
    </p>
 

	
 
    <p>
 
        To accept this application and see any other pending applications, visit the following url:
 
        <a href="http://{{ site_url }}{{ team_url }}">http://{{ site_url }}{{ team_url }}</a>
 
    </p>
 
{% endblocktrans %}
pinaxcon/templates/symposion/emails/teams_user_applied/subject.txt
Show inline comments
 
{% load i18n account_tags %}{% user_display user as username %}{% blocktrans %}{{ username}} has applied to to join "{{ team }}"{% endblocktrans %}
...
 
\ No newline at end of file
 
{% load i18n %}{% blocktrans with username=user.username %}{{ username }} has applied to to join "{{ team }}"{% endblocktrans %}
pinaxcon/templates/symposion/emails/teams_user_invited/message.html
Show inline comments
 
{% load i18n account_tags %}
 
{% load i18n %}
 

	
 
{% blocktrans with team_name=team team_url=team.get_absolute_url site_name=current_site.name site_url=current_site %}
 
    <p>
 
        You have been invited to join <b>{{ team_name }}</b> on {{ site_name }}.
 
    </p>
 

	
 
    <p>
 
        To accept this invitation, visit the following url:
 
        <a href="http://{{ site_url }}{{ team_url }}">http://{{ site_url }}{{ team_url }}</a>
 
    </p>
 
{% endblocktrans %}
...
 
\ No newline at end of file
 
{% endblocktrans %}
pinaxcon/templates/symposion/proposals/proposal_detail.html
Show inline comments
 
{% extends "symposion/proposals/base.html" %}
 

	
 
{% load i18n %}
 
{% load account_tags %}
 
{% load bootstrap %}
 

	
 
{% block head_title %}{{ proposal.title }}{% endblock %}
 
{% block page_title %}#{{ proposal.number }}: {{ proposal.title }} ({{ proposal.speaker }}){% endblock %}
 

	
 
{% block proposals_body_outer %}
 

	
 
<div class="panel panel__compact">
 
  <div class="panel--content">
 

	
 
        <div class="panel--tab-controls">
 
          <div class="panel--tabs"><a data-tab-control="Details" class="panel--tab-switch is-active">{% trans "Proposal Details" %}</a><a data-tab-control="Documents" class="panel--tab-switch">{% trans "Supporting Documents" %}</a><a data-tab-control="Feedback" class="panel--tab-switch">{% trans "Reviewer Feedback" %} ({{ proposal.messages.all|length }})</a>
 
          </div>
 
        </div>
 
        <div data-tab-content="Details" class="panel--tab-content is-active">
 
          {% include "symposion/proposals/_proposal_fields.html" %}
 

	
 
          <div class="btn-group">
 
              {% if not proposal.cancelled %}
 
                  {% if request.user == proposal.speaker.user %}
 
                      <a href="{% url "proposal_edit" proposal.pk %}" class="btn btn-default">
 
                          {% trans "Edit this proposal" %}
 
                      </a>
 
                      <a href="{% url "proposal_cancel" proposal.pk %}" class="btn btn-default">
 
                          {% trans "Cancel this proposal" %}
 
                      </a>
 
                  {% else %}
 
                      <a href="{% url "proposal_leave" proposal.pk %}" class="btn btn-default">
 
                          {% trans "Remove me from this proposal" %}
 
                      </a>
 
                  {% endif %}
 
              {% else %}
 
                  {% trans 'Cancelled' %}
 
              {% endif %}
 
          </div>
 
        </div>
 

	
 
        <div data-tab-content="Documents" class="panel--tab-content">
 
          {% if proposal.supporting_documents.exists %}
 
              <table class="table table-striped">
 
                  {% for document in proposal.supporting_documents.all %}
 
                      <tr>
 
                          <td><a href="{{ document.download_url }}">{{ document.description }}</a></td>
 
                          <td>
 
                          <form style="margin: 0;" method="post" action="{% url "proposal_document_delete" document.pk %}">
 
                              {% csrf_token %}
 
                              <button type="submit" class="btn btn-xs">{% trans 'delete' %}</button>
 
                          </form>
 
                      </td>
 
                      </tr>
 
                  {% endfor %}
 
              </table>
 
          {% else %}
 
              <p>{% trans 'No supporting documents attached to this proposal.' %}</p>
 
          {% endif %}
 
          <a class="btn btn-default btn-sm{% if proposal.cancelled %} btn-disabled{% endif %}" href="{% url "proposal_document_create" proposal.pk %}"><i class="fa fa-upload"></i> {% trans 'Add Document' %}</a>
 
        </div>
 
        <div data-tab-content="Feedback" class="panel--tab-content">
 

	
 
          <h3>{% trans 'Conversation with Reviewers' %}</h3>
 
          {% for message in proposal.messages.all %}
 
              <div class="review-box">
 
                  <div class="comment"><em>{{ message.message|safe }}</em></div>
 
                  <div class="dateline"><b>{% user_display message.user %}</b> {{ message.submitted_at|timesince }} ago</div>
 
                  <div class="dateline"><b>{{ message.user.username }}</b> {{ message.submitted_at|timesince }} ago</div>
 
              </div>
 
              <br />
 
          {% endfor %}
 

	
 
          <h3>{% trans 'Leave a Message' %}</h3>
 

	
 
          <p>{% trans 'You can leave a message for the reviewers here.' %}</p>
 

	
 
          <form action="" method="POST" accept-charset="utf-8">
 
              {% csrf_token %}
 
              <fieldset>
 
                {% include "_form_snippet.html" with form=message_form %}
 
                <div class="btn-group">
 
                    <button type="submit" name="message_submit" class="btn btn-primary">{% trans 'Submit' %}</button>
 
                </div>
 
              </fieldset>
 
          </form>
 
        </div>
 
      </div>
 
    </div>
 

	
 
{% endblock %}
 

	
 
{% block extra_script %}
 
{{ block.super }}
 
    <script src="{{ STATIC_URL }}symposion/js/jquery.history.js"></script>
 
    <script type="text/javascript">
 
        $(function() {
 
            var History = window.History;
 

	
 
            $(window).bind("anchorchange", function() {
 
                $(".nav-tabs a[href='" + location.hash + "']").click();
 
            });
 

	
 
            $('#.nav-tabs a[data-toggle="tab"]').on('shown', function (e) {
 
                if (History.enabled) {
 
                    History.pushState(null, null, $(e.target).attr("href"));
 
                }
 
            });
 
        });
 
    </script>
 
{% endblock extra_script %}
pinaxcon/templates/symposion/reviews/review_detail.html
Show inline comments
 
{% extends "symposion/reviews/base.html" %}
 

	
 
{% load i18n %}
 
{% load bootstrap %}
 
{% load account_tags %}
 

	
 

	
 
{% block body %}
 

	
 
    <div>
 
        <a class="btn btn-primary" href="{% url "user_random" proposal.section.slug %}">
 
            {% trans "Jump to a random unreviewed proposal" %}
 
        </a>
 
    </div>
 

	
 
    {% if is_manager %}
 
        <div class="pull-right">
 
            <form class="result-form form-inline" method="POST" action="">
 
                {% csrf_token %}
 
                <div class="btn-group">
 
                    {% if proposal.result.status == "accepted" %}
 
                        <a class="btn dropdown-toggle btn-success" data-toggle="dropdown" href="#">Accepted <span class="caret"></span></a>
 
                        <div class="dropdown-menu pull-right" style="width: 200px; padding-left: 10px;">
 
                            <div class="btn-group">
 
                                <input type="submit" name="result_submit" value="reject" class="btn btn-xs btn-danger" />
 
                                <input type="submit" name="result_submit" value="standby" class="btn btn-xs" />
 
                                <input type="submit" name="result_submit" value="undecide" class="btn btn-default btn-xs" />
 
                            </div>
 
                        </div>
 
                        <input type="submit" name="publish_changes" value="Publish Changes" class="btn btn-success" />
 
                    {% else %}
 
                        {% if proposal.result.status == "rejected" %}
 
                            <a class="btn dropdown-toggle btn-danger" data-toggle="dropdown" href="#">Rejected <span class="caret"></span></a>
 
                            <div class="dropdown-menu pull-right" style="width: 200px; padding-left: 10px;">
 
                                <div class="btn-group">
 
                                    <input type="submit" name="result_submit" value="accept" class="btn btn-xs btn-success" />
 
                                    <input type="submit" name="result_submit" value="standby" class="btn btn-xs" />
 
                                    <input type="submit" name="result_submit" value="undecide" class="btn btn-default btn-xs" />
 
                                </div>
 
                            </div>
 
                        {% else %}
 
                            {% if proposal.result.status == "standby" %}
 
                                <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Standby <span class="caret"></span></a>
 
                                <div class="dropdown-menu pull-right" style="width: 200px; padding-left: 10px;">
 
                                    <div class="btn-group">
 
                                        <input type="submit" name="result_submit" value="accept" class="btn btn-xs btn-success" />
 
                                        <input type="submit" name="result_submit" value="reject" class="btn btn-xs btn-danger" />
 
                                        <input type="submit" name="result_submit" value="undecide" class="btn btn-default btn-xs" />
 
                                    </div>
 
                                </div>
 
                            {% else %}
 
                                <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Undecided <span class="caret"></span></a>
 
                                <div class="dropdown-menu pull-right" style="width: 200px; padding-left: 10px;">
 
                                    <div class="btn-group">
 
                                        <input type="submit" name="result_submit" value="accept" class="btn btn-xs btn-success" />
 
                                        <input type="submit" name="result_submit" value="reject" class="btn btn-xs btn-danger" />
 
                                        <input type="submit" name="result_submit" value="standby" class="btn btn-default btn-xs" />
 
                                    </div>
 
                                </div>
 
                            {% endif %}
 
                        {% endif %}
 
                    {% endif %}
 
                </div>
 
            </form>
 
        </div>
 
    {% endif %}
 

	
 
    <h3>#{{ proposal.number }}: {{ proposal.title }} ({{ proposal.speaker }})</h3>
 

	
 
    <div class="tabbable">
 
        <ul class="nav nav-tabs">
 
            <li class="active"><a href="#proposal-detail" data-toggle="tab">{% trans "Proposal Details" %}</a></li>
 
            <li><a href="#proposal-reviews" data-toggle="tab">{% trans "Reviews" %} <span class="badge">{{ reviews|length }}</span></a></li>
 
            <li><a href="#proposal-feedback" data-toggle="tab">{% trans "Speaker Feedback" %} <span class="badge">{{ proposal.messages.all|length }}</span></a></li>
 
        </ul>
 
        <div class="tab-content">
 
            <div class="tab-pane active" id="proposal-detail">
 
                {% include "symposion/proposals/_proposal_fields.html" %}
 
            </div>
 
            <div class="tab-pane" id="proposal-reviews">
 

	
 
                <h4>{% trans "Current Results" %}</h4>
 
                <table class="table table-striped">
 
                    <thead>
 
                        <th>+2 votes</th>
 
                        <th>+1 votes</th>
 
                        <th>-1 votes</th>
 
                        <th>-2 votes</th>
 
                        <th>{% trans "Total Responses" %}
 
                    </thead>
 
                    <tbody>
 
                        <tr>
 
                            <td>{{ proposal.plus_two }}</td>
 
                            <td>{{ proposal.plus_one }}</td>
 
                            <td>{{ proposal.minus_one }}</td>
 
                            <td>{{ proposal.minus_two }}</td>
 
                            <td>{{ proposal.total_votes }}</td>
 
                        </tr>
 
                    </tbody>
 
                </table>
 

	
 
                <hr />
 

	
 
                {% if review_form %}
 
                    <form method="POST" action="#proposal-reviews" class="review-form">
 
                        <legend>{% trans "Submit Review" %}</legend>
 
                        <p>Enter your vote and any comment to go along with it. You can revise your vote or comment multiple times with an existing vote (your previously recorded score will be replaced during calculations). <b>Your vote and comments are not public and will only be viewable by other reviewers.</b></p>
 
                        {% csrf_token %}
 
                            {{ review_form|bootstrap }}
 
                            <div class="form-action">
 
                              <input type="submit" class="btn btn-primary" name="vote_submit" value="Submit Review" />
 
                              <input type="submit" class="btn btn-primary" name="vote_submit_and_random" value="Submit Review and jump to random proposal" />
 
                            </div>
 
                    </form>
 
                {% else %}
 
                    <p>You do not have permission to vote on this proposal.</p>
 
                {% endif %}
 

	
 
                {% if reviews %}
 
                    <h5>Review Comments</h5>
 
                    {% for review in reviews %}
 
                        <div class="review-box">
 
                            <div class="vote pull-left">
 
                                <span>{{ review.vote }}</span>
 
                            </div>
 
                            {% if is_manager %}
 
                                <div class="pull-right">
 
                                    <form class="form-inline" action="{% url "review_delete" review.id %}" method="POST">
 
                                        {% csrf_token %}
 
                                        <button class="btn btn-xs btn-danger" type="submit">Delete</button>
 
                                    </form>
 
                                </div>
 
                            {% endif %}
 
                            <div class="review-content">
 
                                &nbsp;
 
                                <b>
 
                                  {% if review.user.speaker_profile %}
 
                                    {{ review.user.speaker_profile.name }}
 
                                  {% else %}
 
                                    {% user_display review.user %}
 
                                    {{ review.user.username }}
 
                                  {% endif %}
 
                                </b>
 
                                {{ review.submitted_at|timesince }} ago <br />
 
                                {{ review.comment_html|safe }}
 
                            </div>
 
                        </div>
 
                    {% endfor %}
 
                {% endif %}
 
            </div>
 
            <div class="tab-pane" id="proposal-feedback">
 
                {% if review_messages %}
 
                    <h3>{% trans "Conversation with the submitter" %}</h3>
 
                    {% for message in review_messages %}
 
                        <div class="comment-box">
 
                            <div class="commment-content">
 
                                <b>{% user_display message.user %}</b>
 
                                <b>{{ message.user.username }}</b>
 
                                {{ message.submitted_at|timesince }} ago <br />
 
                                {{ message.message|safe }}
 
                            </div>
 
                        </div>
 
                    {% endfor %}
 
                    <hr />
 
                {% endif %}
 

	
 
		{% if is_manager %}
 
                <form action="" method="POST"accept-charset="utf-8">
 
                    <legend>{% trans "Send a message" %}</legend>
 
                    <p>
 
                        {% blocktrans %}
 
                            If you'd like to communicate with the submitter, use the following form and he or she will be
 
                            notified and given the opportunity to respond.
 
                        {% endblocktrans %}
 
                    </p>
 
                    {% csrf_token %}
 
                    {{ message_form|bootstrap }}
 
                    <div class="form-actions">
 
                        <input type="submit" class="btn btn-primary" name="message_submit" value="Send Message" />
 
                    </div>
 
                </form>
 
                {% endif %}
 
            </div>
 
        </div>
 
    </div>
 

	
 
    <div>
 
        <a class="btn btn-primary" href="{% url "user_random" proposal.section.slug %}">
 
            {% trans "Jump to a random unreviewed proposal" %}
 
        </a>
 
    </div>
 

	
 
{% endblock %}
 

	
 
{% block extra_script %}
 
{{ block.super }}
 
    <script src="{{ STATIC_URL }}symposion/js/jquery.history.js"></script>
 
    <script type="text/javascript">
 
        $(function() {
 
            var History = window.History;
 

	
 
            $(window).bind("anchorchange", function() {
 
                $(".nav-tabs a[href='" + location.hash + "']").click();
 
            });
 

	
 
            $('.nav-tabs a[data-toggle="tab"]').on('shown', function (e) {
 
                if (History.enabled) {
 
                    History.pushState(null, null, $(e.target).attr("href"));
 
                }
 
            });
 

	
 
            if (window.location.hash !== '') {
 
            	$('.nav-tabs a[href="' + window.location.hash + '"]').tab('show')
 
            }
 
        });
 
    </script>
 

	
 
{% endblock %}
pinaxcon/urls.py
Show inline comments
 
from django.conf import settings
 
from django.conf.urls import include, url
 
from django.conf.urls.static import static
 
from django.views.generic import TemplateView
 

	
 
from wagtail.wagtailadmin import urls as wagtailadmin_urls
 
from wagtail.wagtailcore import urls as wagtail_urls
 

	
 
from django.contrib import admin
 

	
 
import symposion.views
 

	
 

	
 
urlpatterns = [
 
    url(r"^admin/", include(admin.site.urls)),
 

	
 
    url(r"^account/", include("account.urls")),
 

	
 
    url(r"^dashboard/", symposion.views.dashboard, name="dashboard"),
 

	
 
    url(r"^speaker/", include("symposion.speakers.urls")),
 
    url(r"^proposals/", include("symposion.proposals.urls")),
 
    url(r"^sponsors/", include("symposion.sponsorship.urls")),
 
    url(r"^reviews/", include("symposion.reviews.urls")),
 
    url(r"^schedule/", include("symposion.schedule.urls")),
 

	
 
    url(r"^teams/", include("symposion.teams.urls")),
 

	
 
    url(r'^cms/', include(wagtailadmin_urls)),
 

	
 
    # Required by registrasion
 
    url(r'^tickets/payments/', include('registripe.urls')),
 
    url(r'^tickets/', include('registrasion.urls')),
 
    url(r'^nested_admin/', include('nested_admin.urls')),
 

	
 

	
 
    # Default catch-all for wagtail pages.
 
    url(r'^', include(wagtail_urls)),
 

	
 
    # Matches *NOTHING* -- remove once site_tree is fixed
 
    url(r"^$", TemplateView.as_view(template_name="homepage.html"), name="home"),
 

	
 
    # Demo payment gateway and related features
 
    # url(r"^register/pinaxcon/", include("pinaxcon.registrasion.urls")),
 

	
 
]
 

	
 
if settings.DEBUG:
 
    import debug_toolbar
 
    urlpatterns.insert(0, url(r'^__debug__/', include(debug_toolbar.urls)))
 

	
 

	
 
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
requirements.txt
Show inline comments
 
# Should use latest 1.9 for security
 
Django==1.9.7
 
pinax-theme-bootstrap==7.3.0
 
django-user-accounts==1.3.1
 
metron==1.3.7
 
pinax-eventlog==1.1.1
 
django-formset-js==0.5.0
 
dj-static==0.0.6
 
dj-database-url==0.4.0
 
wagtail==1.6.2
 
pylibmc==1.5.1
 
raven==5.27.0
 
django-debug-toolbar==1.6
 

	
 
# database
 
mysqlclient>=1.3.3
 

	
 
# For testing
 
django-nose==1.4.3
 
coverage==4.0.3
 

	
 
-e git+https://github.com/lca2017/symposion.git@lca2017#egg=symposion
 
-e git+https://gitlab.com/lca2018/symposion.git@lca2018#egg=symposion
 
-e git+https://github.com/chrisjrn/registrasion.git@master#egg=registrasion
 
-e git+https://github.com/chrisjrn/registrasion-stripe.git@master#egg=registrasion-stripe
0 comments (0 inline, 0 general)