diff --git a/scriptnet/competitions/templates/competitions/competition.html b/scriptnet/competitions/templates/competitions/competition.html index 61b865e..618591c 100644 --- a/scriptnet/competitions/templates/competitions/competition.html +++ b/scriptnet/competitions/templates/competitions/competition.html @@ -39,79 +39,7 @@ @@ -119,85 +47,19 @@
- - - -
-
-

{{ competition.name }}

-

- {% block content %} - {% if track %} -

-

{% trans "Track" %} {{ track.percomp_uniqueid }} - {{ track.name }}

-
- {{ track.overview | safe }} - {% if subtrack %} -

{% trans "Subtrack" %} {{ track.percomp_uniqueid }}.{{ subtrack.pertrack_uniqueid }} - {{ subtrack.name }}

- - {% else %} - {% if track.subtrack_set.all %} -

{% trans "Please choose one of the available subtracks" %}:

-
    - {% for subtr in track.subtrack_set.all %} -
  • {% trans "Subtrack" %} {{ track.percomp_uniqueid }}.{{ subtr.pertrack_uniqueid }}: - {{ subtr.name }} -
  • - {% endfor %} -
- {% else %} -

{% trans "There are no available subtracks for the current track" %}.

- {% endif %} - {% endif %} - {% else %} - {{ competition.overview | safe }} - {% endif %} - {% endblock %} -

-
- -
-
-

{% trans "News" %}

- {{ competition.newsfeed | safe }} -
- -
-

{% trans "Important Dates" %}

- {{ competition.important_dates | safe }} -
- - -
- -
- + {% if track and not subtrack and track.subtrack_set.count == 1 %} + {% include "competitions/competition_content.html" with subtrack=track.subtrack_set.all|first %} + {% else %} + {% include "competitions/competition_content.html" %} + {% endif %}




+ + +
diff --git a/scriptnet/competitions/templates/competitions/competition_content.html b/scriptnet/competitions/templates/competitions/competition_content.html new file mode 100644 index 0000000..cc4e884 --- /dev/null +++ b/scriptnet/competitions/templates/competitions/competition_content.html @@ -0,0 +1,67 @@ +{% load staticfiles %} +{% load i18n %} +{% load bootstrap3 %} + + +
+
+

{{ competition.name }}

+

+ {% block content %} + {% if track %} +

+

{% trans "Track" %} {{ track.percomp_uniqueid }} - {{ track.name }}

+
+ {{ track.overview | safe }} + {% if subtrack %} +

{% trans "Subtrack" %} {{ track.percomp_uniqueid }}.{{ subtrack.pertrack_uniqueid }} - {{ subtrack.name }}

+ + {% else %} + {% if track.subtrack_set.all %} +

{% trans "Please choose one of the available subtracks" %}:

+
    + {% for subtr in track.subtrack_set.all %} +
  • {% trans "Subtrack" %} {{ track.percomp_uniqueid }}.{{ subtr.pertrack_uniqueid }}: + {{ subtr.name }} +
  • + {% endfor %} +
+ {% else %} +

{% trans "There are no available subtracks for the current track" %}.

+ {% endif %} + {% endif %} + {% else %} + {{ competition.overview | safe }} + {% endif %} + {% endblock %} +

+
+ +
+
+

{% trans "News" %}

+ {{ competition.newsfeed | safe }} +
+ +
+

{% trans "Important Dates" %}

+ {{ competition.important_dates | safe }} +
+ + +
+ +
+ diff --git a/scriptnet/competitions/templates/competitions/competition_navbar.html b/scriptnet/competitions/templates/competitions/competition_navbar.html new file mode 100644 index 0000000..9231282 --- /dev/null +++ b/scriptnet/competitions/templates/competitions/competition_navbar.html @@ -0,0 +1,78 @@ +{% load staticfiles %} +{% load i18n %} +{% load bootstrap3 %} + + + +