refactor: course and sidebar cleanup
This commit is contained in:
@@ -28,7 +28,8 @@
|
||||
{
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"label": "Description"
|
||||
"label": "Description",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
@@ -57,7 +58,8 @@
|
||||
{
|
||||
"fieldname": "short_introduction",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Short Introduction"
|
||||
"label": "Short Introduction",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
@@ -84,7 +86,7 @@
|
||||
"link_fieldname": "course"
|
||||
}
|
||||
],
|
||||
"modified": "2021-05-06 13:37:03.318829",
|
||||
"modified": "2021-05-23 18:14:32.602647",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Course",
|
||||
|
||||
28
community/lms/widgets/BatchTabs.html
Normal file
28
community/lms/widgets/BatchTabs.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<ul class="nav nav-tabs mt-4" id="myTab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="home-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/learn"
|
||||
role="tab" aria-controls="home" aria-selected="true">Learn</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="schedule-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/schedule"
|
||||
role="tab" aria-controls="schedule" aria-selected="false">Schedule</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="members-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/members"
|
||||
role="tab" aria-controls="members" aria-selected="false">Members</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="discussion-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/discuss"
|
||||
role="tab" aria-controls="discussion" aria-selected="false">Discussion</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="about-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/about" role="tab"
|
||||
aria-controls="about" aria-selected="false">About</a>
|
||||
</li>
|
||||
{% if batch.is_member(frappe.session.user, member_type="Mentor") %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="progress-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/progress"
|
||||
role="tab" aria-controls="progress" aria-selected="false">Progress</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="chapter-teaser">
|
||||
<div class="teaser-body">
|
||||
<h3 class="chapter-title"><span class="chapter-number">{{index}}</span> {{ chapter.title }}</h3>
|
||||
<h3 class="chapter-title"><span class="mr-1">{{index}}.</span> {{ chapter.title }}</h3>
|
||||
<div class="chapter-description">
|
||||
{{ chapter.description or "" }}
|
||||
</div>
|
||||
|
||||
@@ -97,14 +97,6 @@ body {
|
||||
border-top: 1px solid #ddc;
|
||||
}
|
||||
|
||||
.batch .cta button {
|
||||
background: var(--cta-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.batch .right {
|
||||
float: right;
|
||||
}
|
||||
@@ -227,6 +219,14 @@ img.profile-photo {
|
||||
}
|
||||
|
||||
.anchor_style {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 5rem 0 5rem 0;
|
||||
}
|
||||
|
||||
@@ -179,11 +179,8 @@ section.lightgray {
|
||||
.chapter-number {
|
||||
background: var(--text-color);
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
height: 24px;
|
||||
min-width: 24px;
|
||||
align-items: center;
|
||||
padding: 5px 8px 2px 8px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% from "www/macros/sidebar.html" import Sidebar %}
|
||||
{% from "www/macros/common_macro.html" import InstructorsSection, MentorsSection %}
|
||||
|
||||
{% block title %}About{% endblock %}
|
||||
@@ -11,13 +10,14 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ Sidebar(course, batch) }}
|
||||
|
||||
<div>
|
||||
{{ widgets.BatchTabs(course=course, batch=batch) }}
|
||||
<div class="container">
|
||||
{{ CourseBasicDetail(course)}}
|
||||
{{ InstructorsSection(course.get_instructor()) }}
|
||||
{{ BatchDetails(batch)}}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% macro CourseBasicDetail(course) %}
|
||||
@@ -43,7 +43,8 @@
|
||||
<div class="batch-details">
|
||||
<div>Session every {{batch.sessions_on}}</div>
|
||||
<div>{{frappe.utils.format_time(batch.start_time, "short")}} -
|
||||
{{frappe.utils.format_time(batch.end_time, "short")}}</div>
|
||||
{{frappe.utils.format_time(batch.end_time, "short")}}
|
||||
</div>
|
||||
<div>Starting {{frappe.utils.format_date(batch.start_date, "medium")}}</div>
|
||||
<div class="course-type" style="color: #888; padding: 10px 0px;">mentors</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% from "www/macros/sidebar.html" import Sidebar %}
|
||||
{% from "www/macros/common_macro.html" import BatchHearder %}
|
||||
|
||||
{% block title %}Discuss{% endblock %}
|
||||
@@ -11,7 +10,8 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ Sidebar(course, batch) }}
|
||||
<div>
|
||||
{{ widgets.BatchTabs(course=course, batch=batch) }}
|
||||
|
||||
<div class="">
|
||||
<div class="batch-header">
|
||||
@@ -24,6 +24,7 @@
|
||||
{{ TextArea() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% macro Messages(messages) %}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% from "www/macros/sidebar.html" import Sidebar %}
|
||||
{% from "www/macros/livecode.html" import LiveCodeEditorJS, LiveCodeEditor with context %}
|
||||
{% block title %}{{ lesson.title }}{% endblock %}
|
||||
|
||||
@@ -23,7 +22,8 @@
|
||||
|
||||
|
||||
{% block content %}
|
||||
{{ Sidebar(course, batch) }}
|
||||
<div>
|
||||
{{ widgets.BatchTabs(course=course, batch=batch) }}
|
||||
|
||||
<div class="container">
|
||||
<div class="lesson-page">
|
||||
@@ -38,7 +38,7 @@
|
||||
{% endfor %}
|
||||
|
||||
{{ pagination(prev_url, next_url) }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% from "www/macros/sidebar.html" import Sidebar %}
|
||||
{% from "www/macros/common_macro.html" import BatchHearder %}
|
||||
|
||||
{% block title %}Members{% endblock %}
|
||||
@@ -10,12 +9,14 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ Sidebar(course, batch) }}
|
||||
<div>
|
||||
{{ widgets.BatchTabs(course=course, batch=batch) }}
|
||||
|
||||
<div class="container">
|
||||
{{ BatchHearder(course.title, member_count)}}
|
||||
{{ MembersList(members)}}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% from "www/macros/sidebar.html" import Sidebar %}
|
||||
{% from "www/macros/livecode.html" import LiveCodeEditorJS, LiveCodeEditor with context %}
|
||||
{% block title %}{{ course.title }} - Batch Dashboard{% endblock %}
|
||||
|
||||
@@ -23,7 +22,8 @@
|
||||
|
||||
|
||||
{% block content %}
|
||||
{{ Sidebar(course, batch) }}
|
||||
<div>
|
||||
{{ widgets.BatchTabs(course=course, batch=batch) }}
|
||||
|
||||
<div class="container">
|
||||
<div class="mentor-dashboard">
|
||||
@@ -43,6 +43,7 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% from "www/macros/sidebar.html" import Sidebar %}
|
||||
{% block title %}Schedule{% endblock %}
|
||||
|
||||
{% block head_include %}
|
||||
<meta name="description" content="Courses" />
|
||||
<meta name="keywords" content="" />
|
||||
@@ -8,7 +8,12 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ Sidebar(course, batch) }}
|
||||
<div>
|
||||
{{ widgetsBatchTabs(course=course, batch=batch) }}
|
||||
<div class="container">
|
||||
<h3>
|
||||
Schedule
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="course-header">
|
||||
<div class="course-type">course</div>
|
||||
<div class="mb-5">
|
||||
<a class="font-weight-bold anchor_style" href="/courses">Courses</a> / <span class="text-muted">{{ course.title }}</span>
|
||||
</div>
|
||||
<h1 id="course-title" data-course="{{course.name}}">{{course.title}}</h1>
|
||||
<div class="course-short-intro">{{ course.short_introduction }}</div>
|
||||
</div>
|
||||
@@ -88,7 +90,7 @@
|
||||
{% if can_manage %}
|
||||
<a href="/courses/{{course.name}}/{{batch.name}}/about" class="btn btn-secondary">Manage</a>
|
||||
{% else %}
|
||||
<button class="join-batch" data-batch="{{ batch.name | urlencode }}"
|
||||
<button class="join-batch btn btn-primary" data-batch="{{ batch.name | urlencode }}"
|
||||
data-course="{{ course.name | urlencode }}">Join this Batch</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% from "www/hackathons/macros/card.html" import null_card %}
|
||||
{% block title %}{{ 'Courses' }}{% endblock %}
|
||||
{% block head_include %}
|
||||
<meta name="description" content="{{ 'Courses' }}" />
|
||||
@@ -17,6 +18,11 @@
|
||||
{% for course in courses %}
|
||||
{{ course_card(course) }}
|
||||
{% endfor %}
|
||||
{% if courses %}
|
||||
{% for n in range( (3 - (courses|length)) %3) %}
|
||||
{{ null_card() }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -24,13 +30,16 @@
|
||||
|
||||
|
||||
{% macro course_card(course) %}
|
||||
<div class="card mb-5 w-100">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><a href="/courses/{{course.name}}">{{course.title}}</a></h5>
|
||||
<div class="col-sm-4 mb-4 text-left">
|
||||
<a class="anchor_style" href="/courses/{{course.name}}">
|
||||
<div class="card h-100">
|
||||
<div class='card-body'>
|
||||
<h5 class='card-title'>{{ course.title }}</h5>
|
||||
{% if course.description %}
|
||||
<p class="card-text">{{ frappe.utils.md_to_html(course.description[:250]) }}</p>
|
||||
{{ frappe.utils.md_to_html(course.description[:250]) }}
|
||||
{% endif %}
|
||||
<a href="/courses/{{course.name}}" class="card-link">See more →</a>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
{% macro Sidebar(course, batch, is_mentor=False) %}
|
||||
<div class="sidebar-batch">
|
||||
<a href=""><i class="fa fa-bars fa-lg"></i></a>
|
||||
<br>
|
||||
<a href="/courses/{{course.name}}/{{batch.name}}/learn"><i class="fa fa-book fa-lg"></i></a>
|
||||
<a href="/courses/{{course.name}}/{{batch.name}}/schedule"><i class="fa fa-calendar fa-lg"></i></a>
|
||||
<a href="/courses/{{course.name}}/{{batch.name}}/members"><i class="fa fa-users fa-lg"></i></a>
|
||||
<a href="/courses/{{course.name}}/{{batch.name}}/discuss"><i class="fa fa-comments fa-lg"></i></a>
|
||||
<a href="/courses/{{course.name}}/{{batch.name}}/about"><i class="fa fa-info-circle fa-lg"></i></a>
|
||||
{% macro BatchTabs(course, batch, is_mentor=False) %}
|
||||
<ul class="nav nav-tabs mt-4" id="myTab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="home-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/learn"
|
||||
role="tab" aria-controls="home" aria-selected="true">Learn</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="schedule-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/schedule"
|
||||
role="tab" aria-controls="schedule" aria-selected="false">Schedule</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="members-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/members"
|
||||
role="tab" aria-controls="members" aria-selected="false">Members</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="discussion-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/discuss"
|
||||
role="tab" aria-controls="discussion" aria-selected="false">Discussion</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="about-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/about" role="tab"
|
||||
aria-controls="about" aria-selected="false">About</a>
|
||||
</li>
|
||||
{% if batch.is_member(frappe.session.user, member_type="Mentor") %}
|
||||
<a href="/courses/{{course.name}}/{{batch.name}}/progress"><i class="fa fa-flag-checkered fa-lg"></i></a>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="progress-tab" data-toggle="tab" href="/courses/{{course.name}}/{{batch.name}}/progress"
|
||||
role="tab" aria-controls="progress" aria-selected="false">Progress</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</div>
|
||||
</ul>
|
||||
{% endmacro %}
|
||||
|
||||
Reference in New Issue
Block a user