diff --git a/community/public/css/style.css b/community/public/css/style.css index fe5af14c..9e60ccd6 100644 --- a/community/public/css/style.css +++ b/community/public/css/style.css @@ -259,6 +259,7 @@ input[type=checkbox] { .common-page-style { background: #F4F5F6; + padding-bottom: 2rem; } .common-card-style { @@ -353,7 +354,7 @@ input[type=checkbox] { @media (max-width: 767px) { .cards-parent { - grid-template-columns: repeat(auto-fill, minmax(300px, 336px)); + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); -moz-column-gap: 16px; column-gap: 16px; row-gap: 16px; @@ -362,7 +363,7 @@ input[type=checkbox] { @media (max-width: 375px) { .cards-parent { - grid-template-columns: repeat(auto-fill, minmax(100%, 312px)); + grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); -moz-column-gap: 24px; column-gap: 24px; row-gap: 24px; diff --git a/community/www/batch/about.html b/community/www/batch/about.html deleted file mode 100644 index 132bf8a0..00000000 --- a/community/www/batch/about.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends "templates/base.html" %} -{% block title %}About{% endblock %} -{% block head_include %} - - - - -{% endblock %} - -{% block content %} -
- {{ widgets.BatchTabs(course=course, batch=batch) }} -
- {{ CourseBasicDetail(course)}} -
-
- -
-
-
-
-{% endblock %} - -{% macro CourseBasicDetail(course) %} -

{{course.title}}

-
- {{course.short_introduction}} -
-{% if course.video_link %} -
- -
-{% endif %} -

About the Course

-
{{frappe.utils.md_to_html(course.description)}}
-{% endmacro %} diff --git a/community/www/batch/about.py b/community/www/batch/about.py deleted file mode 100644 index 48be81c9..00000000 --- a/community/www/batch/about.py +++ /dev/null @@ -1,5 +0,0 @@ -import frappe -from . import utils - -def get_context(context): - utils.get_common_context(context) diff --git a/community/www/batch/home.html b/community/www/batch/home.html deleted file mode 100644 index e7542071..00000000 --- a/community/www/batch/home.html +++ /dev/null @@ -1,61 +0,0 @@ -{% extends "templates/base.html" %} -{% block title %} Batch {% endblock %} - -{% block head_include %} - - - -{% endblock %} - -{% block content %} -
- {{ widgets.BatchTabs(course=course, membership=membership) }} -
- {{ widgets.CourseOutline(course=course, batch=batch, show_link=membership, show_progress=True) }} -
- - {% if batch %} -
-

Batch Schedule

- {{ widgets.RenderBatch(course=course, batch=batch) }} -
- - {% if batch.description %} -
-

Batch Details

- {{ frappe.utils.md_to_html(batch.description) }} -
- {% endif %} - {% endif %} - {% if course.is_mentor(frappe.session.user) %} - {% set invite_link = frappe.utils.get_url() + "/courses/" + course.name + "/join?batch=" + batch.name %} -
-

Invite Members

- Get Batch Invitation - Link - -
- {% endif %} - -
- - -{% endblock %} diff --git a/community/www/batch/home.py b/community/www/batch/home.py deleted file mode 100644 index 48be81c9..00000000 --- a/community/www/batch/home.py +++ /dev/null @@ -1,5 +0,0 @@ -import frappe -from . import utils - -def get_context(context): - utils.get_common_context(context) diff --git a/community/www/batch/members.html b/community/www/batch/members.html deleted file mode 100644 index b1c9712c..00000000 --- a/community/www/batch/members.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends "templates/base.html" %} - -{% block title %}Members{% endblock %} -{% block head_include %} - - - -{% endblock %} - -{% block content %} - -
- {{ widgets.BatchTabs(course=course, membership=membership) }} - {{ MembersList(members)}} -
-{% endblock %} - - -{% macro MembersList(members) %} -
- {% for member in members %} -
- {{ widgets.Avatar(member=member, avatar_class="avatar-medium") }} -
-
- -
{{ member.full_name }}
-
- {% if course.is_mentor(member.name) %} -
Mentor
- {% endif %} -
-
-
- {% if loop.index != member_count %} -
- {% endif %} - {% endfor %} -
-{% endmacro %} diff --git a/community/www/batch/members.py b/community/www/batch/members.py deleted file mode 100644 index 937af7ea..00000000 --- a/community/www/batch/members.py +++ /dev/null @@ -1,7 +0,0 @@ -import frappe -from . import utils - -def get_context(context): - utils.get_common_context(context) - if not context.membership: - utils.redirect_to_lesson(context.course) diff --git a/community/www/batch/progress.html b/community/www/batch/progress.html deleted file mode 100644 index 3fa41bfe..00000000 --- a/community/www/batch/progress.html +++ /dev/null @@ -1,51 +0,0 @@ -{% extends "templates/base.html" %} -{% from "www/macros/livecode.html" import LiveCodeEditorJS, LiveCodeEditor with context %} -{% block title %}{{ course.title }} - Batch Dashboard{% endblock %} - -{% block head_include %} - - - - - - - - - - - - - - -{% endblock %} - - -{% block content %} - -
- {{ widgets.BatchTabs(course=course, membership=membership) }} -
-

Batch Progress

- {% for exercise in report.exercises %} -
-

Exercise {{exercise.index_label}}: {{exercise.title}}

- {% for s in report.get_submissions_of_exercise(exercise.name) %} -
-

{{s.owner.full_name}}

-
- {{ LiveCodeEditor(name=s.name, code=s.solution, reset_code=s.solution) }} -
-
- {% endfor %} -
- {% endfor %} -
-
-{% endblock %} - - -{%- block script %} -{{ super() }} -{{ LiveCodeEditorJS() }} -{% endblock %} diff --git a/community/www/batch/progress.py b/community/www/batch/progress.py deleted file mode 100644 index 446714e9..00000000 --- a/community/www/batch/progress.py +++ /dev/null @@ -1,62 +0,0 @@ -import frappe -from community.lms.models import Course -from collections import defaultdict -from . import utils - -def get_context(context): - utils.get_common_context(context) - - exercise_name = frappe.form_dict.get("exercise") - if exercise_name: - exercise = frappe.get_doc("Exercise", exercise_name) - else: - exercise = None - - context.exercise = exercise - context.report = BatchReport(context.course, context.batch) - -class BatchReport: - def __init__(self, course, batch): - self.submissions = get_submissions(course, batch) - self.exercises = self.get_exercises(course.name) - self.submissions_by_exercise = defaultdict(list) - for s in self.submissions: - self.submissions_by_exercise[s.exercise].append(s) - - def get_exercises(self, course_name): - return frappe.get_all("Exercise", {"course": course_name, "lesson": ["!=", ""]}, ["name", "title", "index_label"], order_by="index_label") - - def get_submissions_of_exercise(self, exercise_name): - return self.submissions_by_exercise[exercise_name] - -def get_submissions(course, batch): - students = course.get_students(batch.name) - if not len(students): - return [] - students_map = {s.email: s for s in students} - names, values = nparams("s", students_map.keys()) - sql = """ - select owner, exercise, name, solution, creation, image - from ( - select owner, exercise, name, solution, creation, image, - row_number() over (partition by owner, exercise order by creation desc) as ix - from `tabExercise Submission`) as t - where t.ix=1 and owner IN {} - """.format(names) - - data = frappe.db.sql(sql, values=values, as_dict=True) - for row in data: - row['owner'] = students_map[row['owner']] - return data - -def nparams(name, values): - """Creates n paramters from a list of values for a db query. - - >>> nparams("name", ["a", "b]) - ("(%(name_1)s, %(name_2)s)", {"name_1": "a", "name_2": "b"}) - """ - keys = [f"{name}_{i}" for i, _ in enumerate(values, start=1)] - param_names = [f"%({k})s" for k in keys] - param_values = dict(zip(keys, values)) - joined_names = "(" + ", ".join(param_names) + ")" - return joined_names, param_values diff --git a/community/www/batch/schedule.html b/community/www/batch/schedule.html deleted file mode 100644 index 36e87c48..00000000 --- a/community/www/batch/schedule.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "templates/base.html" %} -{% block title %}Schedule{% endblock %} - -{% block head_include %} - - - -{% endblock %} - -{% block content %} -
- {{ widgets.BatchTabs(course=course, batch=batch) }} -

- Schedule -

-
-{% endblock %} diff --git a/community/www/batch/schedule.py b/community/www/batch/schedule.py deleted file mode 100644 index 65d68fc3..00000000 --- a/community/www/batch/schedule.py +++ /dev/null @@ -1,20 +0,0 @@ -import frappe -from community.lms.models import Course - -def get_context(context): - context.no_cache = 1 - course_name = frappe.form_dict["course"] - batch_name = frappe.form_dict["batch"] - - course = Course.find(course_name) - if not course: - context.template = "www/404.html" - return - - batch = course.get_batch(batch_name) - if not batch: - frappe.local.flags.redirect_location = "/courses/" + course_name - raise frappe.Redirect - - context.course = course - context.batch = batch diff --git a/community/www/courses/index.html b/community/www/courses/index.html index 871bb6c4..a1f74536 100644 --- a/community/www/courses/index.html +++ b/community/www/courses/index.html @@ -10,7 +10,7 @@ {% block content %}
-
+
{{ 'All Courses' }}