feat: added home page
- Refactored the lms_course page and added find_all method to find courses - Added CourseTeaser widget - Added /home as a portal page
This commit is contained in:
39
community/www/home/index.html
Normal file
39
community/www/home/index.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
{{ HeroSection() }}
|
||||
{{ ExploreCourses(courses) }}
|
||||
{{ RecentSketches(recent_sketches) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% macro HeroSection() %}
|
||||
<div>TODO: Hero
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro ExploreCourses(courses) %}
|
||||
<div id="explore-courses">
|
||||
<h2>Explore Courses</h2>
|
||||
<div class="row">
|
||||
{% for course in courses %}
|
||||
<div class="col-md-6">
|
||||
{{ widgets.CoursePreview(course=course) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro RecentSketches(sketches) %}
|
||||
<div id="recet-sketches">
|
||||
<h2>Recent Sketches</h2>
|
||||
<div class="row">
|
||||
{% for sketch in sketches %}
|
||||
<div class="col-md-3">
|
||||
{{ widgets.SketchPreview(sketch=sketch) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
7
community/www/home/index.py
Normal file
7
community/www/home/index.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import frappe
|
||||
from community.lms.models import Course, Sketch
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = 1
|
||||
context.courses = Course.find_all()
|
||||
context.recent_sketches = Sketch.get_recent_sketches(limit=8)
|
||||
Reference in New Issue
Block a user