Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions app/eventyay/base/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
from .organizer import Organizer, OrganizerBillingModel, Team

TALK_HOSTNAME = settings.TALK_HOSTNAME
LANGUAGE_NAMES = {code: name for code, name in settings.LANGUAGES}

def event_css_path(instance, filename):
return path_with_hash(filename, base_path=f"{instance.slug}/css/")
Expand Down Expand Up @@ -2107,15 +2106,16 @@ def available_content_locales(self) -> list:
# Content locales can be anything eventyay knows as a language, merged with
# this event's plugin locales.

locale_names = dict(default_django_settings.LANGUAGES)
locale_names = dict(settings.LANGUAGES)
locale_names.update(self.named_plugin_locales)
return sorted([(key, value) for key, value in locale_names.items()])

@cached_property
def named_content_locales(self) -> list:
locale_names = dict(self.available_content_locales)
# locale_names['en-us'] = locale_names['en']
return [(code, locale_names[code]) for code in self.content_locales]
locale_names |= LANGUAGE_NAMES
return [(code, locale_names.get(code, code)) for code in self.content_locales]

@cached_property
def named_plugin_locales(self) -> list:
Expand Down
7 changes: 4 additions & 3 deletions app/eventyay/orga/templates/orga/submission/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h2 class="d-flex align-items-center">
<a href="{% querystring sort="-state" %}"><i class="fa fa-caret-up" title="{% translate "Sort (z-a)" %}"></i></a>
</th>
{% if can_change_submission %}
<th>
<th class="text-center">
{% translate "Featured" %} <i class="fa fa-question-circle" data-toggle="tooltip" title="{% translate "Show this session on the list of featured sessions, once it was accepted" %}"></i>
<a href="{% querystring sort="-is_featured" %}"><i class="fa fa-caret-down"></i></a>
<a href="{% querystring sort="is_featured" %}"><i class="fa fa-caret-up"></i></a>
Expand Down Expand Up @@ -149,12 +149,13 @@ <h2 class="d-flex align-items-center">

</td>
{% if can_change_submission %}
<td class="submission_featured">
<div class="mt-1 form-check" title="{% translate "Show this proposal in the list of featured sessions." %}">
<td class="submission_featured text-center">
<div class="form-check d-inline-block" title="{% translate "Show this proposal in the list of featured sessions." %}">
<input
type="checkbox"
id="featured_{{ submission.code }}"
data-id="{{ submission.code }}"
data-url="{{ submission.orga_urls.toggle_featured }}"
class="submission_featured"
{% if submission.is_featured %}checked{% endif %}
>
Expand Down
16 changes: 10 additions & 6 deletions app/eventyay/static/orga/css/_layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,22 @@ body {
}
}

.submission_featured {
td.submission_featured {
position: relative;
vertical-align: middle !important;
text-align: center;

.form-check {
display: inline-flex;
align-items: center;
margin: 0;
}

i {
position: absolute;
right: 30%;
top: 12px;
}

input[type="checkbox"] {
margin-right: 16px;
top: 50%;
transform: translateY(-50%);
}

.done {
Expand Down
5 changes: 3 additions & 2 deletions app/eventyay/static/orga/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ const handleFeaturedChange = (element) => {
const statusWrapper = element.parentElement.parentElement
setStatus("working")

const url = window.location.pathname + id + "/toggle_featured"
// Use the URL from the data-url attribute if available, otherwise construct it
const url = element.dataset.url || (window.location.pathname + (window.location.pathname.endsWith('/') ? '' : '/') + id + "/toggle_featured")
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-CSRFToken": getCookie("pretalx_csrftoken"),
"X-CSRFToken": getCookie("eventyay_csrftoken"),
},
credentials: "include",
}
Expand Down