diff --git a/aic_site/context_processors.py b/aic_site/context_processors.py index 80d1e549..92b8728c 100644 --- a/aic_site/context_processors.py +++ b/aic_site/context_processors.py @@ -1,6 +1,8 @@ from django.urls import reverse from django.utils.translation import ugettext as _ +from apps.game.models import Competition + def menu(request): context = { @@ -14,10 +16,16 @@ def menu(request): _('History'): reverse('intro:index') + "#section-history", _('Schedule'): reverse('intro:index') + '#section-schedule', _('FAQ'): reverse('intro:faq'), - _('Blog and Q&A'): '/blog', _('Contact Us'): reverse('intro:index') + '#section-organizer', } - } + }, + _('Access'): { + 'dropdown': { + _('Panel'): reverse('accounts:panel'), + _('Resources'): 'https://aichallenge.sharif.edu/blog/2018/02/05/Server-Client-MapMaker/', + _('Blog and Q&A'): '/blog', + } + }, }, 'sidebar': { _('Home'): { @@ -46,9 +54,16 @@ def menu(request): 'dropdown': { _('Logout'): reverse('accounts:logout'), } - } + }, + _('Scoreboard'): { + 'dropdown': {}, + }, } } } + friendly_competitions = Competition.objects.filter(type='friendly') + for friendly_competition in friendly_competitions: + context['ai']['sidebar'][_('Scoreboard')]['dropdown'][friendly_competition.name] = reverse('game:scoreboard', args=[friendly_competition.id]) + return context diff --git a/apps/accounts/locale/fa/LC_MESSAGES/django.po b/apps/accounts/locale/fa/LC_MESSAGES/django.po index c2d88705..eb1f510f 100644 --- a/apps/accounts/locale/fa/LC_MESSAGES/django.po +++ b/apps/accounts/locale/fa/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-19 09:54+0000\n" +"POT-Creation-Date: 2018-02-19 15:37+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -121,6 +121,40 @@ msgstr "عضو دوم" msgid "Third Member" msgstr "عضو سوم" +#: apps/accounts/templates/accounts/friendly_match_scoreboard.html:4 +#: apps/accounts/templates/accounts/panel/battle_history.html:115 +#, fuzzy +#| msgid "Score" +msgid "Scoreboard" +msgstr "امتیاز" + +#: apps/accounts/templates/accounts/friendly_match_scoreboard.html:8 +msgid "Rank" +msgstr "" + +#: apps/accounts/templates/accounts/friendly_match_scoreboard.html:9 +#, fuzzy +#| msgid "Team Name" +msgid "Name" +msgstr "نام تیم" + +#: apps/accounts/templates/accounts/friendly_match_scoreboard.html:10 +#: apps/accounts/templates/accounts/panel/battle_history.html:11 +msgid "Score" +msgstr "امتیاز" + +#: apps/accounts/templates/accounts/friendly_match_scoreboard.html:11 +msgid "total num" +msgstr "" + +#: apps/accounts/templates/accounts/friendly_match_scoreboard.html:12 +msgid "win num" +msgstr "" + +#: apps/accounts/templates/accounts/friendly_match_scoreboard.html:13 +msgid "lose num" +msgstr "" + #: apps/accounts/templates/accounts/login.html:10 #: apps/accounts/templates/accounts/login.html:30 msgid "Login" @@ -158,10 +192,6 @@ msgstr "زمان" msgid "Team" msgstr "نام تیم" -#: apps/accounts/templates/accounts/panel/battle_history.html:11 -msgid "Score" -msgstr "امتیاز" - #: apps/accounts/templates/accounts/panel/battle_history.html:12 msgid "Oponent Score" msgstr "امتیاز حریف" @@ -196,12 +226,6 @@ msgstr "نقشه:" msgid "Submit" msgstr "ارسال" -#: apps/accounts/templates/accounts/panel/battle_history.html:115 -#, fuzzy -#| msgid "Score" -msgid "Scoreboard" -msgstr "امتیاز" - #: apps/accounts/templates/accounts/panel/challenge_feild.html:8 msgid "Challenge:" msgstr "رویداد:" diff --git a/apps/accounts/templates/email/locale/fa/LC_MESSAGES/django.po b/apps/accounts/templates/email/locale/fa/LC_MESSAGES/django.po index 26d1624c..57b7a2b1 100644 --- a/apps/accounts/templates/email/locale/fa/LC_MESSAGES/django.po +++ b/apps/accounts/templates/email/locale/fa/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-19 09:54+0000\n" +"POT-Creation-Date: 2018-02-19 15:37+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/apps/accounts/views.py b/apps/accounts/views.py index 129d696c..e3aa40ed 100644 --- a/apps/accounts/views.py +++ b/apps/accounts/views.py @@ -145,11 +145,6 @@ def panel(request, participation_id=None, battle_form=None): else: context['accepted_participations'].append(challenge_participation.team) - context['submissions'] = Paginator( - TeamSubmission.objects.filter(team_id=participation_id).order_by('-id'), - 5 - ).page(page) - if request.method == 'POST': form = SubmissionForm(request.POST, request.FILES) if form.is_valid(): @@ -157,6 +152,11 @@ def panel(request, participation_id=None, battle_form=None): else: form = SubmissionForm() + context['submissions'] = Paginator( + TeamSubmission.objects.filter(team_id=participation_id).order_by('-id'), + 5 + ).page(page) + form.fields['team'].queryset = TeamParticipatesChallenge.objects.filter( team__in=context['accepted_participations'] ) diff --git a/apps/game/locale/fa/LC_MESSAGES/django.po b/apps/game/locale/fa/LC_MESSAGES/django.po index 193baedc..719afebb 100644 --- a/apps/game/locale/fa/LC_MESSAGES/django.po +++ b/apps/game/locale/fa/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-19 09:54+0000\n" +"POT-Creation-Date: 2018-02-19 15:37+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/apps/game/views.py b/apps/game/views.py index aa55797e..53f03647 100644 --- a/apps/game/views.py +++ b/apps/game/views.py @@ -17,7 +17,6 @@ logger = logging.getLogger(__name__) -@login_required() def render_scoreboard(request, competition_id): competition = Competition.objects.get(pk=int(competition_id)) if competition is None: @@ -32,7 +31,7 @@ def render_scoreboard(request, competition_id): return render_double_elimination(request, competition_id) return HttpResponse('There is not such Competition!') -@login_required() + def render_double_elimination(request, competition_id): matches = list(Competition.objects.get(pk=int(competition_id)).matches.all()) win_matches = [] @@ -71,9 +70,8 @@ def render_double_elimination(request, competition_id): 'lose_matches': lose_matches }) -@login_required() -def render_friendly(request, competition_id): +def render_friendly(request, competition_id): league_scoreboard = get_scoreboard_table(competition_id) return render(request, 'scoreboard/friendly_match_scoreboard.html', { @@ -81,7 +79,6 @@ def render_friendly(request, competition_id): }) -@login_required() def render_league(request, competition_id): matches = list(Competition.objects.get(pk=int(competition_id)).matches.all()) @@ -102,7 +99,6 @@ def render_league(request, competition_id): num_one_round_matches = num_matches_per_week * num_weeks num_rounds = int(len(matches) / num_one_round_matches) - cnt = -1 for round in range(num_rounds): league_matches.append([]) @@ -124,7 +120,7 @@ def render_league(request, competition_id): 'league_matches': league_matches }) -# @login_required() + def get_scoreboard_table(competition_id): matches = list(Competition.objects.get(pk=int(competition_id)).matches.all()) @@ -163,7 +159,8 @@ def get_scoreboard_table(competition_id): for match in matches: match_result = match.get_match_result() - if match_result['part1']['result'] == 'notdone' or match_result['part1']['participant'] == match_result['part2']['participant']: + if match_result['part1']['result'] == 'notdone' or match_result['part1']['participant'] == \ + match_result['part2']['participant']: continue participants = [] participants.append(match_result['part1']) @@ -192,8 +189,6 @@ def get_scoreboard_table(competition_id): return league_scoreboard - - @csrf_exempt def report(request): logger.debug("Someone calling report") @@ -263,7 +258,7 @@ def report(request): def game_view(request): if request.GET.urlencode().__len__() > 0: return redirect(to='/static/game_graphics/game_viewer/index.html?' - + request.GET.urlencode() + + request.GET.urlencode() ) else: return redirect(to='/static/game_graphics/game_viewer/index.html') @@ -273,7 +268,6 @@ def map_maker(request): return redirect(to='/static/game_graphics/map_maker/index.html') -@login_required def render_challenge_league(request, challenge_id): # print(challenge_id) ch = Challenge.objects.first() diff --git a/apps/intro/locale/fa/LC_MESSAGES/django.po b/apps/intro/locale/fa/LC_MESSAGES/django.po index 31cff52c..128cd4fb 100644 --- a/apps/intro/locale/fa/LC_MESSAGES/django.po +++ b/apps/intro/locale/fa/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-19 09:54+0000\n" +"POT-Creation-Date: 2018-02-19 15:37+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/apps/intro/static/intro/css/stylesheet.css b/apps/intro/static/intro/css/stylesheet.css index 2f892410..2a29f367 100644 --- a/apps/intro/static/intro/css/stylesheet.css +++ b/apps/intro/static/intro/css/stylesheet.css @@ -29,8 +29,8 @@ .banner.text.image { height: 100vh; z-index: 1; - -webkit-clip-path: inset(10px 0 10px 0); - clip-path: inset(10px 0 10px 0); + -webkit-clip-path: inset(20px 0 20px 0); + clip-path: inset(20px 0 20px 0); } .section.header { diff --git a/locale/fa/LC_MESSAGES/django.po b/locale/fa/LC_MESSAGES/django.po index e20dab62..1e372a5d 100644 --- a/locale/fa/LC_MESSAGES/django.po +++ b/locale/fa/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-19 09:54+0000\n" +"POT-Creation-Date: 2018-02-19 15:37+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,71 +18,83 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: aic_site/context_processors.py:9 aic_site/context_processors.py:23 +#: aic_site/context_processors.py:11 aic_site/context_processors.py:31 msgid "Home" msgstr "خانه" -#: aic_site/context_processors.py:11 +#: aic_site/context_processors.py:13 msgid "Main Page" msgstr "صفحه‌ی اصلی" -#: aic_site/context_processors.py:12 aic_site/context_processors.py:25 +#: aic_site/context_processors.py:14 aic_site/context_processors.py:33 msgid "Introduction" msgstr "معرفی" -#: aic_site/context_processors.py:13 aic_site/context_processors.py:26 +#: aic_site/context_processors.py:15 aic_site/context_processors.py:34 msgid "Prize" msgstr "جایزه" -#: aic_site/context_processors.py:14 aic_site/context_processors.py:27 +#: aic_site/context_processors.py:16 aic_site/context_processors.py:35 msgid "History" msgstr "تاریخ" -#: aic_site/context_processors.py:15 aic_site/context_processors.py:28 +#: aic_site/context_processors.py:17 aic_site/context_processors.py:36 msgid "Schedule" msgstr "برنامه" -#: aic_site/context_processors.py:16 aic_site/context_processors.py:34 +#: aic_site/context_processors.py:18 aic_site/context_processors.py:42 msgid "FAQ" msgstr "سوالات متداول" -#: aic_site/context_processors.py:17 aic_site/context_processors.py:35 +#: aic_site/context_processors.py:19 aic_site/context_processors.py:37 +msgid "Contact Us" +msgstr "تماس با ما" + +#: aic_site/context_processors.py:22 +msgid "Access" +msgstr "دسترسی" + +#: aic_site/context_processors.py:24 aic_site/context_processors.py:48 +msgid "Panel" +msgstr "پنل" + +#: aic_site/context_processors.py:25 +msgid "Resources" +msgstr "منابع" + +#: aic_site/context_processors.py:26 aic_site/context_processors.py:43 #: templates/base/navbar.html:59 msgid "Blog and Q&A" msgstr "وبلاگ و پرسش و پاسخ" -#: aic_site/context_processors.py:18 aic_site/context_processors.py:29 -msgid "Contact Us" -msgstr "تماس با ما" - -#: aic_site/context_processors.py:32 templates/zinnia/base.html:26 +#: aic_site/context_processors.py:40 templates/zinnia/base.html:26 msgid "Blog" msgstr "بلاگ" -#: aic_site/context_processors.py:38 +#: aic_site/context_processors.py:46 msgid "Game" msgstr "بازی" -#: aic_site/context_processors.py:40 templates/base/navbar.html:23 -msgid "Panel" -msgstr "پنل" - -#: aic_site/context_processors.py:41 +#: aic_site/context_processors.py:49 msgid "Game Viewer" msgstr "نمایشگر بازی" -#: aic_site/context_processors.py:42 +#: aic_site/context_processors.py:50 msgid "Map Maker" msgstr "نقشه ساز" -#: aic_site/context_processors.py:45 +#: aic_site/context_processors.py:53 msgid "Account" msgstr "حساب کاربری" -#: aic_site/context_processors.py:47 templates/base/navbar.html:42 +#: aic_site/context_processors.py:55 templates/base/navbar.html:42 msgid "Logout" msgstr "خروج" +#: aic_site/context_processors.py:58 aic_site/context_processors.py:67 +msgid "Scoreboard" +msgstr "جدول رده‌بندی" + #: aic_site/settings/base.py:122 msgid "English" msgstr "انگلیسی" diff --git a/static/files/css/styles.css b/static/files/css/styles.css index b43951fb..3976799a 100644 --- a/static/files/css/styles.css +++ b/static/files/css/styles.css @@ -87,8 +87,8 @@ This set of fonts are used in this project under the license: RC4QT #navbar { z-index: 99; - padding-right: 30px; - padding-left: 30px; + /*padding-right: 30px;*/ + /*padding-left: 30px;*/ width: 100vw !important; diff --git a/templates/base/navbar.html b/templates/base/navbar.html index 032e1c76..89c91aa2 100644 --- a/templates/base/navbar.html +++ b/templates/base/navbar.html @@ -17,12 +17,12 @@ {% endif %} {% endfor %} - {% if request.user.is_authenticated %} - - - {% trans 'Panel' %} - - {% endif %} +{# {% if request.user.is_authenticated %}#} +{# #} +{# #} +{# {% trans 'Panel' %}#} +{# #} +{# {% endif %}#}