Skip to content

Commit

Permalink
refactor and fix conflict after synced upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
odkhang committed Oct 23, 2024
1 parent c88aaa8 commit 01a2e01
Show file tree
Hide file tree
Showing 22 changed files with 263 additions and 203 deletions.
15 changes: 7 additions & 8 deletions src/pretalx/agenda/templates/agenda/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% load event_tags %}
{% load i18n %}
{% load rules %}

{% block custom_header %}
{% block alternate_link %}
<link rel="alternate" type="application/atom+xml" title="{{ request.event.name }} Schedule Versions" href="{{ request.event.urls.feed }}" />
Expand All @@ -20,31 +19,31 @@
{{ request.event.urls.base }}
{% endif %}
{% endblock nav_link %}

{% block header_tabs %}
<a href="{{ request.event.urls.schedule }}" class="header-tab {% if "/schedule/" in request.path_info %}active{% endif %}">
<a href="{{ request.event.urls.schedule }}" class='header-tab {% if "/schedule/" in request.path_info %}active{% endif %}'>
<i class="fa fa-calendar"></i> {{ phrases.schedule.schedule }}
</a>
{% if request.event.display_settings.schedule_display != "list" %}
<a href="{{ request.event.urls.talks }}" class="header-tab {% if "/talk/" in request.path_info %} active{% endif %}">
<a href="{{ request.event.urls.talks }}" class='header-tab {% if "/talk/" in request.path_info %} active{% endif %}'>
<i class="fa fa-comments-o"></i> {{ phrases.schedule.sessions }}
</a>
{% endif %}
<a href="{{ request.event.urls.speakers }}" class="header-tab {% if "/speaker/" in request.path_info %} active{% endif %}">
<a href="{{ request.event.urls.speakers }}" class='header-tab {% if "/speaker/" in request.path_info %} active{% endif %}'>
<i class="fa fa-group"></i> {{ phrases.schedule.speakers }}
</a>
{% if request.event.display_settings.ticket_link %}
<a href="{{ request.event.display_settings.ticket_link }}" class="btn btn-outline-success">
<i class="fa fa-group"></i> {% translate "Tickets" %}
<a href="{{ request.event.display_settings.ticket_link }}" class="header-tab">
<i class="fa fa-ticket"></i> {% translate "Tickets" %}
</a>
{% endif %}

<a id="join-event-link" href='{% url "agenda:event.onlinevideo.join" event=request.event.slug %}' class="btn btn-outline-success">
<a id="join-event-link" href='{% url "agenda:event.onlinevideo.join" event=request.event.slug %}' class="header-tab">
<i class="fa fa-video-camera"></i> {% translate "Videos" %}
</a>
{% endblock header_tabs %}

{% block content %}
{% include "agenda/header_row.html" %}
{% if not request.event|get_feature_flag:"show_schedule" and not request.user.is_anonymous and not hide_visibility_warning %}
<div id="event-nonpublic" class="d-print-none">
<i class="fa fa-user-secret"></i>
Expand Down
6 changes: 3 additions & 3 deletions src/pretalx/agenda/templates/agenda/header_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ <h3>
</h3>
<p class="text">
{% trans "Can't find your ticket?" %}
<a id="resend_link" class="btn btn-default" href='{{ request.event.display_settings.ticket_link }}resend'>
<a id="resend_link" class="btn-link" href='{{ request.event.display_settings.ticket_link }}resend'>
{% trans "Resend the email" %}
</a>
{% trans "to receive it." %}
</p>
<p class="text">
{% trans "Want to order a ticket?" %}
<a id="ticket_link" class="btn btn-default" href='{{ request.event.display_settings.ticket_link }}'>
<a id="ticket_link" class="btn-link" href='{{ request.event.display_settings.ticket_link }}'>
{% trans "Get a ticket here" %}
</a>
</p>
</div>
</div>
<div class="join-online-close">
<button id="join-online-close-button" class="btn btn-default join-online-close-button">Close</button>
<button id="join-online-close-button" class="btn-link join-online-close-button">Close</button>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/pretalx/agenda/templates/agenda/schedule.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{% block agenda_custom_header %}
<script id="pretalx-messages" data-logged-in="{% if request.user.is_anonymous %}false{% else %}true{% endif %}" src="{{ request.event.urls.schedule }}widget/messages.js"></script>
{% endblock agenda_custom_header %}
{% include "agenda/header_row.html" with with_margin=True with_extra=True %}
{% block header_right %}
<details class="dropdown mr-2" aria-haspopup="menu" role="menu">
<summary>
Expand Down
2 changes: 0 additions & 2 deletions src/pretalx/agenda/templates/agenda/schedule_nojs.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
</div>
{% endif %}

{% include "agenda/header_row.html" with with_margin=True with_extra=True %}

<div class="pretalx-tabbed">
<div class="pretalx-tabbed-content">
{% if day_count > 1 %}
Expand Down
1 change: 0 additions & 1 deletion src/pretalx/agenda/templates/agenda/speakers.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
{% load thumbnail %}

{% block agenda_content %}
{% include "agenda/header_row.html" %}
<p></p>
<article>
<section style="--track-color: {{ request.event.visible_primary_color }}" class="pretalx-list-day">
Expand Down
9 changes: 7 additions & 2 deletions src/pretalx/agenda/views/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from contextlib import suppress

from pretalx.common.signals import register_data_exporters
from pretalx.common.signals import register_data_exporters, register_my_data_exporters


def is_visible(exporter, request, public=False):
Expand All @@ -19,9 +19,14 @@ def get_schedule_exporters(request, public=False):
exporter(request.event)
for _, exporter in register_data_exporters.send_robust(request.event)
]
my_exporters = [
exporter(request.event)
for _, exporter in register_my_data_exporters.send_robust(request.event)
]
all_exporters = exporters + my_exporters
return [
exporter
for exporter in exporters
for exporter in all_exporters
if (
not isinstance(exporter, Exception)
and is_visible(exporter, request, public=public)
Expand Down
4 changes: 2 additions & 2 deletions src/pretalx/cfp/templates/cfp/event/submission_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
{% if form.avatar or form.get_gravatar %}
{% include "common/avatar.html" with user=user form=form %}
{% endif %}
{% if form.avatar_source %}{% bootstrap_field form.avatar_source layout='event' %}{% endif %}
{% if form.avatar_license %}{% bootstrap_field form.avatar_license layout='event' %}{% endif %}
{% if form.avatar_source %}{{ form.avatar_source.as_field_group }}{% endif %}
{% if form.avatar_license %}{{ form.avatar_license.as_field_group }}{% endif %}

{% if form.availabilities %}
{% include "common/availabilities.html" %}
Expand Down
29 changes: 0 additions & 29 deletions src/pretalx/common/templates/common/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@
{% translate "Login with SSO" %}
</a>
</div>
<div id="collapseOne" class="auth-form-block panel-collapse collapse in" aria-labelledby="headingOne">
<div class="panel-body">
{% bootstrap_field form.login_email layout="inline" %}
{% bootstrap_field form.login_password layout="inline" %}
{% if not no_buttons %}
<button type="submit" class="btn btn-lg btn-success btn-block">
{% translate "Log in" %}
</button>
{% endif %}
{% if password_reset_link or request.event %}
<a class="btn btn-block btn-link" href="{% if password_reset_link %}{{ password_reset_link }}{% else %}{{ request.event.urls.reset }}{% endif %}">
{% translate "Reset password" %}
</a>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% if not hide_register %}
Expand All @@ -70,19 +54,6 @@
{% translate "Register Speaker Account" %}
</a>
</div>
<div id="collapseTwo" class="auth-form-block panel-collapse collapse in" aria-labelledby="headingTwo">
<div class="panel-body">
{% bootstrap_field form.register_name layout="inline" %}
{% bootstrap_field form.register_email layout="inline" %}
{% bootstrap_field form.register_password layout="inline" %}
{% bootstrap_field form.register_password_repeat layout="inline" %}
{% if not no_buttons %}
<button type="submit" class="btn btn-lg btn-info btn-block">
{% translate "Register" %}
</button>
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/pretalx/common/templates/common/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
{% if request.event and request.event.custom_css %}<link rel="stylesheet" type="text/css" href="{{ request.event.custom_css.url }}"/>{% endif %}
{% compress js %}
<script defer src="{% static "common/js/base.js" %}"></script>
<script src="{% static "jquery/js/jquery-3.7.1.min.js" %}"></script>
<script src="{% static "agenda/js/join-online-event.js" %}"></script>
{% endcompress %}
{% block scripts %}{% endblock scripts %}
{% block custom_header %}{% endblock custom_header %}
Expand Down
4 changes: 3 additions & 1 deletion src/pretalx/eventyay_common/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.conf import settings
from django.contrib.auth import login
from django.shortcuts import redirect
from django.urls import reverse
from requests_oauthlib import OAuth2Session

from pretalx.person.models import User
Expand Down Expand Up @@ -50,6 +51,7 @@ def oauth2_callback(request):
settings.OAUTH2_PROVIDER["ACCESS_TOKEN_URL"],
client_secret=settings.OAUTH2_PROVIDER["CLIENT_SECRET"],
authorization_response=request.build_absolute_uri(),
scope=settings.OAUTH2_PROVIDER["SCOPE"]
)

# Use the token to fetch user info from the SSO provider
Expand All @@ -74,4 +76,4 @@ def oauth2_callback(request):

# Log the user into the session
login(request, user, backend="django.contrib.auth.backends.ModelBackend")
return redirect(settings.LOGIN_REDIRECT_URL)
return redirect(reverse('cfp:root.main'))
12 changes: 12 additions & 0 deletions src/pretalx/orga/templates/orga/cfp/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ <h2>
<td></td>
<td></td>
</tr>
<tr>
<th>{% translate "Profile picture source" %}</th>
<td class="hide-label">{{ sform.cfp_ask_avatar_source.as_field_group }}</td>
<td>{{ sform.cfp_avatar_source_min_length.as_field_group }}</td>
<td>{{ sform.cfp_avatar_source_max_length.as_field_group }}</td>
</tr>
<tr>
<th>{% translate "Profile picture license" %}</th>
<td class="hide-label">{{ sform.cfp_ask_avatar_license.as_field_group }}</td>
<td>{{ sform.cfp_avatar_license_min_length.as_field_group }}</td>
<td>{{ sform.cfp_avatar_license_max_length.as_field_group }}</td>
</tr>
</tbody>
</table></div>
</fieldset>
Expand Down
5 changes: 2 additions & 3 deletions src/pretalx/orga/templates/orga/organiser/organiser_sso.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% load bootstrap4 %}
{% load i18n %}
{% load rules %}

Expand All @@ -7,8 +6,8 @@
<fieldset>
<legend>{% translate "SSO with Eventyay-ticket" %}</legend>
{% csrf_token %}
{% bootstrap_field sso_client_form.client_id layout='event' %}
{% bootstrap_field sso_client_form.secret layout='event' %}
{{ sso_client_form.client_id.as_field_group }}
{{ sso_client_form.secret.as_field_group }}
<div class="submit-group panel">
<span></span>
<span>
Expand Down
13 changes: 13 additions & 0 deletions src/pretalx/person/migrations/0033_merge_20241022_1752.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated by Django 5.1.1 on 2024-10-22 10:52

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("person", "0029_alter_user_avatar_thumbnail_and_more"),
("person", "0032_alter_user_avatar_source"),
]

operations = []
2 changes: 1 addition & 1 deletion src/pretalx/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def merge_csp(*options, config=None):
"CLIENT_SECRET": SSO_CLIENT_SECRET,
"AUTHORIZE_URL": "/".join([EVENTYAY_TICKET_BASE_PATH, "control/oauth2/authorize/"]),
"ACCESS_TOKEN_URL": "/".join([EVENTYAY_TICKET_BASE_PATH, "control/oauth2/token/"]),
"REDIRECT_URI": "/".join([SITE_URL, BASE_PATH[1:], "oauth2/callback/"]),
"REDIRECT_URI": "/".join(filter(None, [SITE_URL.rstrip("/"), BASE_PATH.strip("/") if BASE_PATH else "", "oauth2/callback/"])),
"SCOPE": ["profile"],
}
# Set default Application model if using default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% extends "socialaccount/base.html" %}
{% load bootstrap4 %}
{% load compress %}
{% load i18n %}
{% load static %}
Expand Down
Loading

0 comments on commit 01a2e01

Please sign in to comment.