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