diff --git a/oioioi/base/processors.py b/oioioi/base/processors.py index 98d714808..d040643fa 100644 --- a/oioioi/base/processors.py +++ b/oioioi/base/processors.py @@ -1,5 +1,6 @@ from django.core.urlresolvers import get_script_prefix from oioioi.base.menu import side_pane_menus_registry +from django.conf import settings def base_url(request): @@ -9,3 +10,7 @@ def base_url(request): def side_menus(request): menus = [m for m in side_pane_menus_registry if m.condition(request)] return {'side_menus': menus} + + +def site_name(request): + return {'site_name': settings.SITE_NAME} diff --git a/oioioi/base/templates/admin/base_site.html b/oioioi/base/templates/admin/base_site.html index 283052611..c107425b7 100644 --- a/oioioi/base/templates/admin/base_site.html +++ b/oioioi/base/templates/admin/base_site.html @@ -36,10 +36,10 @@ {% all_with_prefix extra_head_ %} {% endblock %} -{% block title %}{{ title }} | {% trans 'OIOIOI Admin' %}{% endblock %} +{% block title %}{{ title }} - {% blocktrans %}{{ site_name }} Admin{% endblocktrans %}{% endblock %} {% block branding %} -

{% trans 'OIOIOI Admin' %}

+

{% blocktrans %}{{ site_name }} Admin{% endblocktrans %}

{% endblock %} {% block footer %} diff --git a/oioioi/base/templates/base.html b/oioioi/base/templates/base.html index da34fa8d2..da605d1e4 100644 --- a/oioioi/base/templates/base.html +++ b/oioioi/base/templates/base.html @@ -7,7 +7,7 @@ {% block head %} - {% block title %}OIOIOI{% endblock %} + {% block title %}{% trans "Main page" %}{% endblock %} - {{ site_name }} {% block styles %} {% compress css %} diff --git a/oioioi/base/templates/ingredients/navbar_branding.html b/oioioi/base/templates/ingredients/navbar_branding.html index 641260855..ac74485c6 100644 --- a/oioioi/base/templates/ingredients/navbar_branding.html +++ b/oioioi/base/templates/ingredients/navbar_branding.html @@ -1 +1 @@ -OIOIOI +{{ site_name }} diff --git a/oioioi/base/templates/registration/password_reset_confirm.html b/oioioi/base/templates/registration/password_reset_confirm.html index 67b2e6e77..0306a7760 100644 --- a/oioioi/base/templates/registration/password_reset_confirm.html +++ b/oioioi/base/templates/registration/password_reset_confirm.html @@ -1,7 +1,7 @@ {% extends "simple-centered.html" %} {% load i18n %} -{% block title %}{% trans 'Password reset' %}{% endblock %} +{% block title %}{% trans "Enter new password" %} - {% trans "Password reset" %}{% endblock %} {% block content %} diff --git a/oioioi/complaints/templates/complaints/make.html b/oioioi/complaints/templates/complaints/make.html index 89d3b091c..b203485ba 100644 --- a/oioioi/complaints/templates/complaints/make.html +++ b/oioioi/complaints/templates/complaints/make.html @@ -1,7 +1,7 @@ {% extends "base-with-menu.html" %} {% load i18n %} -{% block title %}{% trans "Complaints" %}{% endblock %} +{% block title %}{% trans "Make complaint" %} - {% trans "Complaints" %}{% endblock %} {% block content %}

{% trans "Complaint form" %}

diff --git a/oioioi/contests/templates/contests/html_statement.html b/oioioi/contests/templates/contests/html_statement.html index 344b45e05..ea428fe76 100644 --- a/oioioi/contests/templates/contests/html_statement.html +++ b/oioioi/contests/templates/contests/html_statement.html @@ -1,6 +1,8 @@ {% extends "base-with-menu.html" %} {% load i18n %} +{% block title %}{{ problem_name }} - {% trans "Problem statement" %}{% endblock %} + {% block content %} {{ content }} {% endblock %} diff --git a/oioioi/contests/templates/contests/nothing_to_submit.html b/oioioi/contests/templates/contests/nothing_to_submit.html index a3170677a..b1217da5d 100644 --- a/oioioi/contests/templates/contests/nothing_to_submit.html +++ b/oioioi/contests/templates/contests/nothing_to_submit.html @@ -1,7 +1,7 @@ {% extends "base-with-menu.html" %} {% load i18n %} -{% block title %}{% trans "Submit solution" %}{% endblock %} +{% block title %}{% trans "No problems available" %} - {% trans "Submit solution" %}{% endblock %} {% block content %}

{% trans "Submit solution" %}

diff --git a/oioioi/contests/templates/contests/submission.html b/oioioi/contests/templates/contests/submission.html index cfc4ef05e..0ed881f68 100644 --- a/oioioi/contests/templates/contests/submission.html +++ b/oioioi/contests/templates/contests/submission.html @@ -2,7 +2,7 @@ {% load i18n %} {% load check_perm %} -{% block title %}{% trans "Submission" %} {{ submission.id }}{% endblock %} +{% block title %}{% blocktrans with submission.id as id %}Submission {{ id }}{% endblocktrans %}{% endblock %} {% block scripts %} {{ block.super }} diff --git a/oioioi/contests/views.py b/oioioi/contests/views.py index 3798b173c..48510e6d6 100644 --- a/oioioi/contests/views.py +++ b/oioioi/contests/views.py @@ -97,8 +97,12 @@ def problem_statement_zip_index_view(request, contest_id, problem_instance, statement_id): response = problem_statement_zip_view(request, contest_id, problem_instance, statement_id, 'index.html') + + problem_statement = get_object_or_404(ProblemStatement, id=statement_id) + return TemplateResponse(request, 'contests/html_statement.html', - {'content': mark_safe(response.content)}) + {'content': mark_safe(response.content), + 'problem_name' : problem_statement.problem.name}) @enforce_condition(contest_exists & can_enter_contest) diff --git a/oioioi/dashboard/templates/dashboard/dashboard.html b/oioioi/dashboard/templates/dashboard/dashboard.html index 0e161c12a..1e43f0956 100644 --- a/oioioi/dashboard/templates/dashboard/dashboard.html +++ b/oioioi/dashboard/templates/dashboard/dashboard.html @@ -1,10 +1,13 @@ {% extends "base-with-menu.html" %} +{% load i18n %} {% block styles %} {{ block.super }} {% endblock %} +{% block title %}{% trans "Contest dashboard" %}{% endblock %} + {% block content %} {% for header in headers %}{{ header }}{% endfor %} {% for fragment in fragments %}{{ fragment }}{% endfor %} diff --git a/oioioi/default_settings.py b/oioioi/default_settings.py index 7b932cb03..626f10f3c 100644 --- a/oioioi/default_settings.py +++ b/oioioi/default_settings.py @@ -14,6 +14,9 @@ TEMPLATE_DEBUG = DEBUG INTERNAL_IPS = ('127.0.0.1',) +# Site name displayed in the title +SITE_NAME = 'OIOIOI' + # Run uwsgi daemon. Shall be True, False or 'auto'. # 'auto' means daemon will be run iff DEBUG is disabled. UWSGI_ENABLED = 'auto' @@ -88,6 +91,7 @@ 'oioioi.su.processors.real_user', 'oioioi.base.processors.base_url', 'oioioi.base.processors.side_menus', + 'oioioi.base.processors.site_name', 'oioioi.jotform.processors.jotform', 'oioioi.contests.processors.register_current_contest', 'oioioi.contests.processors.register_recent_contests', diff --git a/oioioi/deployment/settings.py.template b/oioioi/deployment/settings.py.template index 1e5007b7f..766e1f3d5 100644 --- a/oioioi/deployment/settings.py.template +++ b/oioioi/deployment/settings.py.template @@ -8,6 +8,9 @@ DEBUG = True TEMPLATE_DEBUG = DEBUG +# Site name displayed in the title +SITE_NAME = 'OIOIOI' + # Email addresses to send error message reports. ADMINS = ( ('Your Name', 'youremail@example.com'), diff --git a/oioioi/forum/templates/forum/confirm_delete.html b/oioioi/forum/templates/forum/confirm_delete.html index cfdbd2e21..6b9324490 100644 --- a/oioioi/forum/templates/forum/confirm_delete.html +++ b/oioioi/forum/templates/forum/confirm_delete.html @@ -1,7 +1,7 @@ {% extends "simple-centered-confirmation.html" %} {% load i18n %} -{% block title %}{% trans "Confirmation" %}{% endblock %} +{% block title %}{% trans "Delete confirmation" %} - {% trans "Forum" %}{% endblock %} {% block help_text %} {% blocktrans with el=elem %}Are you sure, that you want to delete {{ elem }}?{% endblocktrans %} diff --git a/oioioi/forum/templates/forum/edit_post.html b/oioioi/forum/templates/forum/edit_post.html index 1da64e1d1..ef2f9a886 100644 --- a/oioioi/forum/templates/forum/edit_post.html +++ b/oioioi/forum/templates/forum/edit_post.html @@ -2,7 +2,7 @@ {% load i18n %} {% load check_perm %} -{% block title %}{% trans "Thread" %}: {{ thread.name }} - {% trans "Edit post" %}{% endblock %} +{% block title %}{% trans "Edit post" %} - {% trans "Thread" %}: {{ thread.name }}{% endblock %} {% block content %} {% check_perm 'contests.contest_admin' for contest as is_admin %} diff --git a/oioioi/forum/templates/forum/forum.html b/oioioi/forum/templates/forum/forum.html index 4839dded2..bedd31644 100644 --- a/oioioi/forum/templates/forum/forum.html +++ b/oioioi/forum/templates/forum/forum.html @@ -2,7 +2,7 @@ {% load i18n %} {% load check_perm %} -{% block title %}{% trans "Forum" %}: {{ forum }}{% endblock %} +{% block title %}{{ forum }} - {% trans "Forum" %}{% endblock %} {% block content %} {% check_perm 'contests.contest_admin' for contest as is_admin %} diff --git a/oioioi/forum/tests.py b/oioioi/forum/tests.py index a1680e6ff..665af374f 100644 --- a/oioioi/forum/tests.py +++ b/oioioi/forum/tests.py @@ -188,13 +188,13 @@ def test_remove_posts(self): # user can remove p2 (last post, added by user) response = self.try_to_remove_post(p2) self.assertEqual(200, response.status_code) - self.assertIn('Confirmation', response.content) + self.assertIn('Delete confirmation', response.content) p2.delete() # user tries to remove post p1 (and he can!) response = self.try_to_remove_post(p1) self.assertEqual(200, response.status_code) - self.assertIn('Confirmation', response.content) + self.assertIn('Delete confirmation', response.content) p1.delete() # user tries to remove post p0 but cannot (added earlier than 15min ago) diff --git a/oioioi/oireports/templates/oireports/no_reports.html b/oioioi/oireports/templates/oireports/no_reports.html index 8bedc9c72..8a901bed1 100644 --- a/oioioi/oireports/templates/oireports/no_reports.html +++ b/oioioi/oireports/templates/oireports/no_reports.html @@ -1,7 +1,7 @@ {% extends "base-with-menu.html" %} {% load i18n %} -{% block title %}{% trans "Report" %}{% endblock %} +{% block title %}{% trans "No reports available" %}{% endblock %} {% block content %}

{% trans "Report" %}

diff --git a/oioioi/participants/templates/participants/registration.html b/oioioi/participants/templates/participants/registration.html index 7eab44d7b..f357489f9 100644 --- a/oioioi/participants/templates/participants/registration.html +++ b/oioioi/participants/templates/participants/registration.html @@ -11,6 +11,8 @@ {{ form.media.js }} {% endblock %} +{% block title %}{% trans "Register to the contest" %}{% endblock %} + {% block content %}

{% trans "Register to the contest" %}

diff --git a/oioioi/participants/templates/participants/unregister.html b/oioioi/participants/templates/participants/unregister.html index 0d6fd50ca..04ebf7d00 100644 --- a/oioioi/participants/templates/participants/unregister.html +++ b/oioioi/participants/templates/participants/unregister.html @@ -1,6 +1,8 @@ {% extends "base-with-menu.html" %} {% load i18n %} +{% block title %}{% trans "Confirm unregistration" %}{% endblock %} + {% block content %}
{% csrf_token %} diff --git a/oioioi/printing/templates/printing/nothing_to_print.html b/oioioi/printing/templates/printing/nothing_to_print.html index 8ae78cc5a..1398ce6cb 100644 --- a/oioioi/printing/templates/printing/nothing_to_print.html +++ b/oioioi/printing/templates/printing/nothing_to_print.html @@ -1,7 +1,7 @@ {% extends "base-with-menu.html" %} {% load i18n %} -{% block title %}{% trans "Printing" %}{% endblock %} +{% block title %}{% trans "Nothing to print" %} - {% trans "Printing" %}{% endblock %} {% block content %}

{% trans "Printing" %}

diff --git a/oioioi/problems/templates/problems/add_or_update.html b/oioioi/problems/templates/problems/add_or_update.html index e62d4c12b..e2e84f45c 100644 --- a/oioioi/problems/templates/problems/add_or_update.html +++ b/oioioi/problems/templates/problems/add_or_update.html @@ -1,6 +1,8 @@ {% extends "base-with-menu.html" %} {% load i18n %} +{% block title %}{% trans "Add or update problem" %}{% endblock %} + {% block content %}

{% if existing_problem %}{% blocktrans with existing_problem as name %}Update problem {{ name }}{% endblocktrans %}{% else %}{% trans "Add problem" %}{% endif %}

{% if sources|length > 1 %} diff --git a/oioioi/programs/templates/programs/source.html b/oioioi/programs/templates/programs/source.html index 469836059..51f4df1e3 100644 --- a/oioioi/programs/templates/programs/source.html +++ b/oioioi/programs/templates/programs/source.html @@ -8,6 +8,8 @@ {% endblock %} +{% block title %}{% blocktrans %}Source code for submission {{ submission_id }}{% endblocktrans %}{% endblock %} + {% block content %} {% if decode_error %} {% include "programs/file_decoding_error.html" %} diff --git a/oioioi/programs/templates/programs/source_diff.html b/oioioi/programs/templates/programs/source_diff.html index aa857ae3f..074e297f2 100644 --- a/oioioi/programs/templates/programs/source_diff.html +++ b/oioioi/programs/templates/programs/source_diff.html @@ -1,6 +1,8 @@ {% extends "base-with-menu.html" %} {% load i18n %} +{% block title %}{% blocktrans %}Source diff between submissions {{ submission1_id }} and {{ submission2_id }}{% endblocktrans %}{% endblock %} + {% block content %} {% trans "Swap sides" %} diff --git a/oioioi/programs/views.py b/oioioi/programs/views.py index 145feb17d..e317fa9db 100644 --- a/oioioi/programs/views.py +++ b/oioioi/programs/views.py @@ -54,7 +54,8 @@ def show_submission_source_view(request, contest_id, submission_id): 'css': formatted_source_css, 'is_source_safe': is_source_safe, 'download_url': download_url, - 'decode_error': decode_error + 'decode_error': decode_error, + 'submission_id': submission_id }) @@ -134,6 +135,8 @@ def numformat(num): 'download_url1': download_url1, 'source2': diff2, 'decode_error2': decode_error2, 'download_url2': download_url2, + 'submission1_id': submission1_id, + 'submission2_id': submission2_id, 'reverse_diff_url': reverse('source_diff', kwargs={ 'contest_id': contest_id, 'submission1_id': submission2_id, diff --git a/oioioi/questions/templates/admin/questions/change_message.html b/oioioi/questions/templates/admin/questions/change_message.html index 128e33c35..10ca9bc1d 100644 --- a/oioioi/questions/templates/admin/questions/change_message.html +++ b/oioioi/questions/templates/admin/questions/change_message.html @@ -1,6 +1,7 @@ {% extends "base-with-menu.html" %} {% load i18n %} +{% block title %}{% trans "Change message" %}{% endblock %} {% block content %}

{% trans "Change message" %}

diff --git a/oioioi/questions/templates/questions/message.html b/oioioi/questions/templates/questions/message.html index 70408a73b..07a812f5a 100644 --- a/oioioi/questions/templates/questions/message.html +++ b/oioioi/questions/templates/questions/message.html @@ -2,12 +2,12 @@ {% load i18n %} {% load check_perm %} -{% block title %}{% trans "Questions and announcements" %}{% endblock %} +{% block title %}{{ message.topic }} - {% trans "Questions and announcements" %}{% endblock %} {% block content %} {% check_perm 'contests.contest_admin' for contest as is_admin %}

- {% if message.problem_instance %}{{ message.problem_instance.problem }}{% else %}{% trans "General" %}{% endif %}: + {% if message.problem_instance %}{{ message.problem_instance.problem }}{% else %}{% trans "General" %}{% endif %}: {{ message.topic }}

{% if is_admin %} diff --git a/oioioi/rankings/templates/rankings/no_rankings.html b/oioioi/rankings/templates/rankings/no_rankings.html index 712499c16..3346090df 100644 --- a/oioioi/rankings/templates/rankings/no_rankings.html +++ b/oioioi/rankings/templates/rankings/no_rankings.html @@ -1,7 +1,7 @@ {% extends "base-with-menu.html" %} {% load i18n %} -{% block title %}{% trans "Ranking" %}{% endblock %} +{% block title %}{% trans "No rankings available" %} - {% trans "Ranking" %}{% endblock %} {% block content %}

{% trans "Ranking" %}

diff --git a/oioioi/testrun/templates/testrun/no_testrun_problems.html b/oioioi/testrun/templates/testrun/no_testrun_problems.html index a653376e4..b099a4906 100644 --- a/oioioi/testrun/templates/testrun/no_testrun_problems.html +++ b/oioioi/testrun/templates/testrun/no_testrun_problems.html @@ -1,7 +1,7 @@ {% extends "base-with-menu.html" %} {% load i18n %} -{% block title %}{% trans "Test run" %}{% endblock %} +{% block title %}{% trans "No test run problems" %} - {% trans "Test run" %}{% endblock %} {% block content %}

{% trans "Test run" %}

diff --git a/oioioi/testrun/templates/testrun/submit.html b/oioioi/testrun/templates/testrun/submit.html index 938e1f192..62bec9822 100644 --- a/oioioi/testrun/templates/testrun/submit.html +++ b/oioioi/testrun/templates/testrun/submit.html @@ -1,7 +1,7 @@ {% extends "base-with-menu.html" %} {% load i18n %} -{% block title %}{% trans "Test run" %}{% endblock %} +{% block title %}{% trans "Submit solution" %} - {% trans "Test run" %}{% endblock %} {% block content %}

{% trans "Test run" %}