Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Russian and Ukrainian as active languages #45

Closed
wants to merge 8 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Build

on:
push:
branches: [ main ]
branches: [ development ]
paths-ignore:
- 'src/pretalx/locale/**'
- 'doc/**'
pull_request:
branches: [ main ]
branches: [ development ]
paths-ignore:
- 'src/pretalx/locale/**'
- 'doc/**'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Documentation

on:
push:
branches: [ main ]
branches: [ development ]
paths:
- 'doc/**'
pull_request:
branches: [ main ]
branches: [ development ]
paths:
- 'doc/**'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Strings

on:
push:
branches: [ main ]
branches: [ development ]
paths:
- 'src/pretalx/locale/**'
pull_request:
branches: [ main ]
branches: [ development ]
paths:
- 'src/pretalx/locale/**'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Code Style

on:
push:
branches: [ main ]
branches: [ development ]
paths-ignore:
- 'src/pretalx/locale/**'
- 'src/pretalx/static/**'
- 'doc/**'
pull_request:
branches: [ main ]
branches: [ development ]
paths-ignore:
- 'src/pretalx/locale/**'
- 'src/pretalx/static/**'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Tests

on:
push:
branches: [ main ]
branches: [ development ]
paths-ignore:
- 'doc/**'
- 'src/pretalx/locale/**'
pull_request:
branches: [ main ]
branches: [ development ]
paths-ignore:
- 'doc/**'
- 'src/pretalx/locale/**'
Expand Down Expand Up @@ -113,4 +113,4 @@ jobs:
label: coverage
message: ${{ env.TOTAL_COV }}%
color: "#3aa57c"
if: env.TOTAL_COV && github.ref == 'refs/heads/main'
if: env.TOTAL_COV && github.ref == 'refs/heads/development'
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ include _build/backend.py
include LICENSE
include README.rst
include src/pretalx.example.cfg
include Dockerfile

recursive-include deployment *.bash
recursive-include deployment *.conf

exclude src/pretalx/override_settings.py
exclude src/pretalx.cfg
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.10 on 2024-02-19 16:29

from django.db import migrations
import tinymce.models


class Migration(migrations.Migration):

dependencies = [
("event", "0035_created_updated_everywhere"),
]

operations = [
migrations.AlterField(
model_name="event",
name="featured_sessions_text",
field=tinymce.models.HTMLField(null=True),
),
]
3 changes: 2 additions & 1 deletion src/pretalx/event/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from django.utils.translation import gettext_lazy as _
from django_scopes import scopes_disabled
from i18nfield.fields import I18nCharField, I18nTextField
from tinymce.models import HTMLField

from pretalx.common.cache import ObjectRelatedCache
from pretalx.common.language import LANGUAGE_NAMES
Expand Down Expand Up @@ -300,7 +301,7 @@ class Event(PretalxModel):
null=True,
blank=True,
)
featured_sessions_text = I18nTextField(
featured_sessions_text = HTMLField(
verbose_name=_("Featured sessions text"),
help_text=_(
"This text will be shown at the top of the featured sessions page instead of the default text."
Expand Down
3 changes: 0 additions & 3 deletions src/pretalx/orga/forms/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ class Meta:
"tags": forms.SelectMultiple(attrs={"class": "select2"}),
"track": forms.Select(attrs={"class": "select2"}),
"submission_type": forms.Select(attrs={"class": "select2"}),
"abstract": MarkdownWidget,
"description": MarkdownWidget,
"notes": MarkdownWidget,
}
field_classes = {
"submission_type": SafeModelChoiceField,
Expand Down
1 change: 1 addition & 0 deletions src/pretalx/orga/templates/orga/cfp/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<div class="flex-content">
<form method="post">
{% csrf_token %}
{{ form.media }}
{% bootstrap_form_errors form %}
{% bootstrap_form_errors sform %}
<fieldset>
Expand Down
3 changes: 2 additions & 1 deletion src/pretalx/orga/templates/orga/settings/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ <h2>{% translate "Settings" %}</h2>
<div class="flex-container"><div class="flex-content">
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.media }}
<fieldset>
<legend id="general">
{% translate "General information" %}
</legend>
{% bootstrap_form_errors form %}

{% bootstrap_field form.name layout='event' %}
{% bootstrap_field form.slug layout='event' addon_before=url_placeholder addon_before_class="input-group-prepend input-group-text" %}
{% bootstrap_field form.date_from layout='event' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ <h2>
</h2>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.media}}
{% bootstrap_form form layout='event' %}
{% include "orga/includes/submit_row.html" %}
</form>
Expand Down
4 changes: 3 additions & 1 deletion src/pretalx/orga/templates/orga/submission/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
{% endif %}
{% bootstrap_form_errors form %}
{% csrf_token %}
{{ form.media}}
{% bootstrap_field form.title layout='event' %}
{% if action == "create" %}
{% bootstrap_field form.speaker layout='event' %}
Expand Down Expand Up @@ -63,7 +64,8 @@
{% bootstrap_field form.submission_type layout='event' %}
{% if form.track %}{% bootstrap_field form.track layout='event' %}{% endif %}
{% if form.tags %}{% bootstrap_field form.tags layout='event' %}{% endif %}
{% if form.abstract %}{% bootstrap_field form.abstract layout='event' %}{% endif %}
{% if form.abstract %}
{% bootstrap_field form.abstract layout='event' %}{% endif %}
{% if form.description %}{% bootstrap_field form.description layout='event' %}{% endif %}
{% if form.notes %}{% bootstrap_field form.notes layout='event' %}{% endif %}
{% bootstrap_field form.internal_notes layout='event' %}
Expand Down
8 changes: 1 addition & 7 deletions src/pretalx/orga/templates/orga/submission/review.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@
{% else %}
{% if not read_only %}
{% if request.event.settings.review_help_text %}
<div class="alert alert-info">
<div>
<p>
{{ request.event.settings.review_help_text|rich_text }}
</p>
</div>
</div>

{% elif not form.instance.pk and not can_view_other_reviews and request.event.active_review_phase and request.event.active_review_phase.can_see_other_reviews == 'after_review' %}
<div class="alert alert-info">
<p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.10 on 2024-02-19 19:27

from django.db import migrations
import tinymce.models


class Migration(migrations.Migration):

dependencies = [
("person", "0027_created_updated_everywhere"),
]

operations = [
migrations.AlterField(
model_name="speakerinformation",
name="text",
field=tinymce.models.HTMLField(),
),
]
3 changes: 2 additions & 1 deletion src/pretalx/person/models/information.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pretalx.common.phrases import phrases
from pretalx.common.urls import EventUrls
from pretalx.common.utils import path_with_hash
from tinymce.models import HTMLField


def resource_path(instance, filename):
Expand Down Expand Up @@ -41,7 +42,7 @@ class SpeakerInformation(PretalxModel):
help_text=_("Leave empty to show this information for all proposal types."),
)
title = I18nCharField(verbose_name=_("Subject"), max_length=200)
text = I18nTextField(verbose_name=_("Text"), help_text=phrases.base.use_markdown)
text = HTMLField(verbose_name=_("Text"), help_text=phrases.base.use_markdown)
resource = models.FileField(
verbose_name=_("File"),
null=True,
Expand Down
82 changes: 71 additions & 11 deletions src/pretalx/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,40 @@
"django.forms",
"rest_framework",
]
INSTALLED_APPS = DJANGO_APPS + EXTERNAL_APPS + LOCAL_APPS + FALLBACK_APPS
INSTALLED_APPS = DJANGO_APPS + EXTERNAL_APPS + LOCAL_APPS + FALLBACK_APPS + ['tinymce']

# TinyMCE Editor Settings
TINYMCE_DEFAULT_CONFIG = {
'height': 400,
'cleanup_on_startup': True,
'custom_undo_redo_levels': 20,
'selector': 'textarea',
'theme': 'silver',
'menubar': False,
'plugins': '''
advlist autolink lists link image charmap print preview anchor
searchreplace visualblocks code fullscreen
insertdatetime media table paste codesample help wordcount
''',
'toolbar': '''
undo redo | formatselect | bold italic underline strikethrough forecolor | \
alignleft aligncenter alignright alignjustify | \
bullist numlist outdent indent | codesample
''',
'valid_elements': '''
a[!href|target|title],abbr[!title],acronym[!title],b,br,code,div,em,h1,h2,
h3,h4,h5,h6,hr,i,li,ol,p,pre,span,strong,table[!width],tbody,td[!width|align],thead,tr,ul
''',
'extended_valid_elements': '''
a[href|target|title],abbr[title],acronym[title],table[width],td[width|align],div[class],p[class],span[class]
''',
'toolbar_sticky': True,
'toolbar_drawer': 'wrap',
'content_css' : "writer",
}




PLUGINS = []
for entry_point in iter_entry_points(group="pretalx.plugin", name=None):
Expand Down Expand Up @@ -351,6 +384,7 @@ def merge_csp(*options, config=None):
LANGUAGE_CODE = config.get("locale", "language_code")
LANGUAGE_COOKIE_NAME = "pretalx_language"
LANGUAGES_INFORMATION = {

"en": {
"name": _("English"),
"natural_name": "English",
Expand All @@ -376,68 +410,94 @@ def merge_csp(*options, config=None):
"name": _("Arabic"),
"natural_name": "اَلْعَرَبِيَّةُ",
"official": False,
"percentage": 80,
"percentage": 77,
},
"cs": {
"name": _("Czech"),
"natural_name": "Čeština",
"official": False,
"percentage": 99,
"percentage": 95,
},
"el": {
"name": _("Greek"),
"natural_name": "Ελληνικά",
"official": False,
"percentage": 100,
"percentage": 95,
},
"es": {
"name": _("Spanish"),
"natural_name": "Español",
"official": False,
"percentage": 88,
"percentage": 85,
},
"fr": {
"name": _("French"),
"natural_name": "Français",
"official": False,
"percentage": 86,
"percentage": 85,
"path": "fr_FR",
},
"it": {
"name": _("Italian"),
"natural_name": "Italiano",
"official": False,
"percentage": 96,
},
"ja-jp": {
"name": _("Japanese"),
"natural_name": "日本語",
"official": False,
"percentage": 76,
"percentage": 74,
"public_code": "jp",
},
"nl": {
"name": _("Dutch"),
"natural_name": "Nederlands",
"official": False,
"percentage": 92,
},
"pt-br": {
"name": _("Brasilian Portuguese"),
"natural_name": "Português brasileiro",
"official": False,
"percentage": 87,
"percentage": 94,
"public_code": "pt",
},
"pt-pt": {
"name": _("Portuguese"),
"natural_name": "Português",
"official": False,
"percentage": 94,
"percentage": 91,
"public_code": "pt",
},
"zh-hant": {
"name": _("Traditional Chinese (Taiwan)"),
"natural_name": "漢語",
"official": False,
"percentage": 73,
"percentage": 70,
"public_code": "zh",
},
"zh-hans": {
"name": _("Simplified Chinese"),
"natural_name": "简体中文",
"official": False,
"percentage": 94,
"percentage": 90,
"public_code": "zh",
},
"ru": {
"name": _("Russian"),
"natural_name": "Русский",
"official": True,
"percentage": 100,
},

"uk": {
"name": _("Ukrainian"),
"natural_name": "Українська",
"official": True,
"percentage": 100,
},

}
LANGUAGES_RTL = {
"ar",
Expand Down
Loading
Loading