fix: profile, dashboard and tests

This commit is contained in:
Jannat Patel
2022-09-05 13:32:51 +05:30
parent 7ef625c598
commit e84e02ff07
8 changed files with 68 additions and 46 deletions

View File

@@ -5,14 +5,12 @@
{% block content %}
{% set portal_course_creation = frappe.db.get_single_value("LMS Settings", "portal_course_creation") %}
{% set show_creators_section = portal_course_creation == "Anyone" or has_course_instructor_role() %}
{{ frappe.session.user }}
<div class="common-page-style dashboard">
<div class="container">
{% if show_creators_section %}
<a class="btn btn-secondary btn-sm pull-right" id="create-course-link" href="/courses/new-course">
<a class="btn btn-secondary btn-sm course-creation-link" id="create-course-link" href="/courses/new-course">
{{ _("Create a Course") }}
</a>
{% endif %}

View File

@@ -0,0 +1,8 @@
import frappe
from lms.lms.utils import has_course_instructor_role
def get_content(context):
context.no_cache = 1
portal_course_creation = frappe.db.get_single_value("LMS Settings", "portal_course_creation")
context.show_creators_section = portal_course_creation == "Anyone" or has_course_instructor_role()

View File

@@ -58,7 +58,7 @@
{% if frappe.session.user == member.email %}
<div class="ml-auto mt-1">
<a class="btn btn-secondary btn-sm" href="/dashboard"> {{ _("Visit Dashboard") }} </a>
<a class="btn btn-secondary btn-sm ml-2" href="/edit-profile?name={{ member.email }}"> {{ _("Edit Profile") }} </a>
<a class="btn btn-secondary btn-sm ml-2" href="/edit-profile/{{ member.email }}"> {{ _("Edit Profile") }} </a>
</div>
{% endif %}
</div>