Skip to content

Commit

Permalink
Deleted redundant base files and fixed incorrect code (#849)
Browse files Browse the repository at this point in the history
* Deleted redundant base files.
Also moved template to partials folder.
  • Loading branch information
faucomte97 committed Dec 17, 2018
1 parent 27a85ad commit 3c65c0f
Show file tree
Hide file tree
Showing 26 changed files with 34 additions and 80 deletions.
4 changes: 2 additions & 2 deletions portal/templates/portal/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@
<a href="{% url 'teach' %}" class="button--menu button--menu--primary"><b>Teacher</b></a>
{% block secondaryButtons %}
{% if user|has_teacher_finished_onboarding %}
<a href="{% url 'dashboard' %}" class="button--menu button--menu--secondary button--menu--enabled">School / Club</a>
{% block dashboard %}<a href="{% url 'dashboard' %}" class="button--menu button--menu--secondary button--menu--enabled">School / Club</a>{% endblock dashboard %}
{% block rapidrouter %}<a href="{% url 'game.views.level_selection.levels' %}" class="button--menu button--menu--secondary button--menu--enabled">Rapid Router</a>{% endblock rapidrouter %}
{% block aimmo %}<a href="{% url 'play_aimmo' %}" class="button--menu button--menu--secondary button--menu--enabled">AI:MMO</a>{% endblock aimmo %}
<a href="{% url 'teaching_resources' %}" class="button--menu button--menu--secondary button--menu--enabled">Teaching Resources</a>
{% block materials %}<a id="resources_button" href="{% url 'teaching_resources' %}" class="button--menu button--menu--secondary button--menu--enabled">Teaching Resources</a>{% endblock materials %}
{% else %}
<a href="{% url 'onboarding-organisation' %}" class="button--menu button--menu--secondary button--menu--enabled">School / Club</a>
<a class="button--menu button--menu--secondary button--menu--disabled">Rapid Router</a>
Expand Down
5 changes: 0 additions & 5 deletions portal/templates/portal/play/base.html

This file was deleted.

2 changes: 1 addition & 1 deletion portal/templates/portal/play/student_edit_account.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/play/base.html' %}
{% extends 'portal/base_old.html' %}
{% load static %}

{% block studentButtons %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/play/base.html' %}
{% extends 'portal/base_old.html' %}
{% load static %}

{% block studentButtons %}
Expand Down
11 changes: 0 additions & 11 deletions portal/templates/portal/teach/base_logged_in.html

This file was deleted.

2 changes: 1 addition & 1 deletion portal/templates/portal/teach/class.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load staticfiles %}
{% load app_tags %}

Expand Down
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load staticfiles %}
{% load app_tags %}

Expand Down
44 changes: 14 additions & 30 deletions portal/templates/portal/teach/invite.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load staticfiles %}
{% load app_tags %}

{% block dashboard %}
<a href="{% url 'invite_teacher' %}" class="button--menu button--menu--secondary button--menu--enabled button--menu--teacher--active">School / Club</a>
<a href="{% url 'dashboard' %}" class="button--menu button--menu--secondary button--menu--enabled button--menu--teacher--active">School / Club</a>
{% endblock dashboard %}

{% block css %}
{{ block.super }}
{% endblock css %}


{% block pageID %}id='homeWrapper'{% endblock %}




{% block content %}

<div class="background form--register form--register--teacher col-sm-12">
Expand All @@ -25,31 +21,19 @@ <h1>Invite a teacher</h1>
<p>To invite another teacher from your school or club to join Code for Life,</p>
<p>Just put <b>their email address</b> in the field below.</p>
</div>
<form action="{% url 'invite_teacher' %}" method="post" class="col-md-6 col-md-offset-3">
{{ invite_form.non_field_errors }}
<div class="btn-toolbar" >
{% csrf_token %}
{{ invite_form.email }}
{{ invite_form.email.errors }}
</br>
<a class="button button--regular button--secondary button--secondary--light">Cancel</a>
<button type="submit" name="submit" value="Submit" class="button button-primary button--primary--general-educate">Submit</button>
</div>
</br>
</form>
<form action="{% url 'invite_teacher' %}" method="post" class="col-md-6 col-md-offset-3">
{{ invite_form.non_field_errors }}
<div class="btn-toolbar" >
{% csrf_token %}
{{ invite_form.email }}
{{ invite_form.email.errors }}
<div class="background button-group">
<a class="button button--regular button--secondary button--secondary--light">Cancel</a>
<button type="submit" name="submit" value="Submit" class="button button-primary button--primary--general-educate">Submit</button>
</div>
</div>
</form>
</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
if($(window).width() > 760) {
toggleStickySubnav($('.banner').outerHeight() + $('.menu').outerHeight());
}

{% if anchor %}
window.location = '#{{anchor}}';
{% endif %}
});
</script>

{% endblock content %}
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/materials.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load staticfiles %}
{% load app_tags %}
{% load table_tags %}
Expand Down
6 changes: 0 additions & 6 deletions portal/templates/portal/teach/onboarding_classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ <h3>Create a class</h3>
</form>
</div>
</div>

<script>
$(document).ready(function(){
toggleStickySubnav($('.banner').outerHeight() + $('.menu').outerHeight());
});
</script>
{% endif %}

{% endblock content %}
4 changes: 0 additions & 4 deletions portal/templates/portal/teach/onboarding_school.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ <h3>It looks like you&rsquo;ve already created your school ({{ user.new_teacher.
document.getElementById("right-arrow").style.display = "block";
}
}

$(document).ready(function(){
toggleStickySubnav($('.banner').outerHeight() + $('.menu').outerHeight());
});
</script>
{% endif %}
{% endif %}
Expand Down
2 changes: 0 additions & 2 deletions portal/templates/portal/teach/onboarding_students.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ <h3>Add students to class: {{ class.name }}</h3>

<script>
$(document).ready(function(){
toggleStickySubnav($('.banner').outerHeight() + $('.menu').outerHeight());

$('#form-create-students').submit(disableOnClick('#submitStudents'));
});
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load static %}

{% block dashboard %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load static %}

{% block dashboard %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load static %}

{% block dashboard %}
Expand Down
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/teacher_edit_class.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}

{% block dashboard %}
<a href="{% url 'dashboard' %}" class="button--menu button--menu--secondary button--menu--enabled button--menu--teacher--active">School / Club</a>
Expand Down
4 changes: 1 addition & 3 deletions portal/templates/portal/teach/teacher_edit_student.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}

{% block dashboard %}
<a href="{% url 'dashboard' %}" class="button--menu button--menu--secondary button--menu--enabled button--menu--teacher--active">School / Club</a>
Expand All @@ -20,8 +20,6 @@
$('#password-setter').show();
window.location = '#set-password';
{%endif%}

toggleStickySubnav($('.menu').outerHeight());
});
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load static %}
{% load app_tags %}

Expand Down
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/teacher_move_class.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load static %}

{% block dashboard %}
Expand Down
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/teacher_move_students.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}

{% block dashboard %}
<a href="{% url 'dashboard' %}" class="button--menu button--menu--secondary button--menu--enabled button--menu--teacher--active">School / Club</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}

{% block dashboard %}
<a href="{% url 'dashboard' %}" class="button--menu button--menu--secondary button--menu--enabled button--menu--teacher--active">School / Club</a>
Expand Down
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/teacher_resources.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}
{% load staticfiles %}
{% load app_tags %}

Expand Down
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/teacher_student_reset.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}

{% block dashboard %}
<a href="{% url 'dashboard' %}" class="button--menu button--menu--secondary button--menu--enabled button--menu--teacher--active">School / Club</a>
Expand Down
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/viewer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'portal/teach/base_logged_in.html' %}
{% extends 'portal/base.html' %}

{% load app_tags %}
{% load static %}
Expand Down
2 changes: 1 addition & 1 deletion portal/templatetags/table_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def is_numerical(str):
return False


@register.inclusion_tag('portal/teach/resource_sheets_table.html')
@register.inclusion_tag('portal/partials/resource_sheets_table.html')
def resource_sheets_table(table):
max_count = len(max(table, key=len))
return {'table': [lengthen_list(max_count, row) for row in table]}
Expand Down

0 comments on commit 3c65c0f

Please sign in to comment.