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
5 changes: 3 additions & 2 deletions app/eventyay/base/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -2148,15 +2148,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
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The merge operation locale_names |= LANGUAGE_NAMES is problematic because:

  1. locale_names is created from dict(self.available_content_locales) (line 2157)
  2. available_content_locales already uses dict(settings.LANGUAGES) (line 2151)
  3. LANGUAGE_NAMES is redefined at line 74 as {code: name for code, name in settings.LANGUAGES}

This means you're merging settings.LANGUAGES back into a dict that was already built from settings.LANGUAGES, making this operation redundant.

The intended behavior appears to be merging the imported LANGUAGE_NAMES from eventyay.common.language (which contains additional language names from settings.LANGUAGES_INFORMATION), but the redefinition at line 74 overwrites that import.

Suggestion: Remove the redefinition at line 74 to use the imported LANGUAGE_NAMES, which contains the enhanced language information from settings.LANGUAGES_INFORMATION.

Copilot uses AI. Check for mistakes.
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
Loading