fix: course details link preview

This commit is contained in:
Jannat Patel
2023-05-15 13:13:45 +05:30
parent 0093025e5d
commit c01c248202
9 changed files with 17 additions and 19 deletions

View File

@@ -33,9 +33,9 @@
<div class="chapter-title-main"> <div class="chapter-title-main">
{{ chapter.title }} {{ chapter.title }}
</div> </div>
<div class="small ml-auto"> <!-- <div class="small ml-auto">
{{ lessons | length }} lessons {{ lessons | length }} lessons
</div> </div> -->
</div> </div>

View File

@@ -211,8 +211,8 @@ textarea.field-input {
font-size: var(--text-sm); font-size: var(--text-sm);
} }
body { .lessons {
background-color: #FFFFFF; margin-left: 1.5rem;
} }
input[type=checkbox] { input[type=checkbox] {
@@ -611,7 +611,7 @@ input[type=checkbox] {
.chapter-description { .chapter-description {
color: var(--gray-900); color: var(--gray-900);
font-size: var(--text-sm); font-size: var(--text-sm);
margin-left: 0.5rem; margin-left: 2rem;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
@@ -804,7 +804,7 @@ input[type=checkbox] {
.course-content-parent { .course-content-parent {
display: grid; display: grid;
grid-gap: 4rem; grid-gap: 2rem;
grid-template-columns: 1fr 3fr; grid-template-columns: 1fr 3fr;
} }

View File

@@ -1,9 +1,5 @@
{% extends "templates/base.html" %} {% extends "templates/base.html" %}
{% block meta_block %}
{% include "templates/includes/meta_block.html" %}
{% endblock %}
{% block content %} {% block content %}
{% include "public/icons/symbol-defs.svg" %} {% include "public/icons/symbol-defs.svg" %}
{% include "lms/templates/onboarding_header.html" %} {% include "lms/templates/onboarding_header.html" %}

View File

@@ -47,7 +47,7 @@
{% if lesson.name %} {% if lesson.name %}
<a class="btn btn-default btn-sm mr-2" href="{{ get_lesson_url(course.name, lesson_number) }}"> <a class="btn btn-default btn-sm mr-2" href="{{ get_lesson_url(course.name, lesson_number) }}">
<span> <span>
{{ _("Preview") }} {{ _("Back to Lesson") }}
</span> </span>
</a> </a>
{% endif %} {% endif %}

View File

@@ -247,7 +247,6 @@
<script type="text/javascript"> <script type="text/javascript">
var page_context = {{ page_context | tojson }}; var page_context = {{ page_context | tojson }};
</script> </script>
{{ include_script('controls.bundle.js') }}
{% for ext in page_extensions %} {% for ext in page_extensions %}
{{ ext.render_footer() }} {{ ext.render_footer() }}
{% endfor %} {% endfor %}

View File

@@ -352,8 +352,3 @@
</div> </div>
{% endmacro %} {% endmacro %}
{%- block script %}
{{ super() }}
{{ include_script('controls.bundle.js') }}
{% endblock %}

View File

@@ -69,7 +69,7 @@ def set_course_context(context, course_name):
course.edit_mode = True course.edit_mode = True
if course is None: if course is None:
redirect_to_courses_list() raise frappe.PermissionError(_("This is not a valid course URL."))
related_courses = frappe.get_all( related_courses = frappe.get_all(
"Related Courses", {"parent": course.name}, ["course"] "Related Courses", {"parent": course.name}, ["course"]

View File

@@ -23,7 +23,7 @@
<div class="align-self-center"> <div class="align-self-center">
{% if course.name %} {% if course.name %}
<a class="btn btn-default btn-sm mr-2" href="/courses/{{ course.name }}"> <a class="btn btn-default btn-sm mr-2" href="/courses/{{ course.name }}">
{{ _("Preview") }} {{ _("Back to Course") }}
</a> </a>
<a class="btn btn-default btn-sm mr-2" href="/courses/{{ course.name }}/outline"> <a class="btn btn-default btn-sm mr-2" href="/courses/{{ course.name }}/outline">

View File

@@ -7,4 +7,12 @@ def get_context(context):
except KeyError: except KeyError:
frappe.local.flags.redirect_location = "/jobs" frappe.local.flags.redirect_location = "/jobs"
raise frappe.Redirect raise frappe.Redirect
context.job = frappe.get_doc("Job Opportunity", job) context.job = frappe.get_doc("Job Opportunity", job)
context.metatags = {
"title": context.job.job_title,
"image": context.job.company_logo,
"description": f"Job Posting for {context.job.job_title} by {context.job.company_name}",
"keywords": "Job Opening, Job Posting, Job Opportunity, Job Vacancy, Job, Vacancy, Opening, Opportunity, Vacancy",
}