mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-28 01:14:46 +00:00
feat: show signup dialog for Guest
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
{% if has_access %}
|
{% if has_access %}
|
||||||
<a href="/lms/topic?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}" class="no-decoration no-underline">
|
<a href="/lms/topic?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}" class="no-decoration no-underline">
|
||||||
{% else %}
|
{% else %}
|
||||||
<div>
|
<div onclick="show_singup()">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if topic.hero_image %}
|
{% if topic.hero_image %}
|
||||||
<div class="card-hero-img" style="background-image: url('{{ topic.hero_image }})'"></div>
|
<div class="card-hero-img" style="background-image: url('{{ topic.hero_image }})'"></div>
|
||||||
@@ -103,4 +103,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block script %}
|
||||||
|
<script>
|
||||||
|
function show_singup() {
|
||||||
|
if (frappe.session.user == "Guest") {
|
||||||
|
let signup_dialog = new frappe.ui.Dialog({
|
||||||
|
title: __('Sign Up'),
|
||||||
|
primary_action: function() {
|
||||||
|
window.location.href = '/login#signup'
|
||||||
|
},
|
||||||
|
primary_action_label: 'Sign Up'
|
||||||
|
})
|
||||||
|
signup_dialog.set_message('You have to sign up to access the course');
|
||||||
|
signup_dialog.$message.show()
|
||||||
|
signup_dialog.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<a href="/lms/content?program={{ program }}&course={{ course }}&topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content.name }}" class="no-decoration no-underline">
|
<a href="/lms/content?program={{ program }}&course={{ course }}&topic={{ topic.name }}&type={{ content.content_type }}&content={{ content.content.name }}" class="no-decoration no-underline">
|
||||||
<div class="card h-100">
|
<div class="card h-100">
|
||||||
<div class='card-body'>
|
<div class='card-body'>
|
||||||
<div>{{ content.content_type or '' }}</div>
|
<div class="text-muted">{{ content.content_type or '' }}</div>
|
||||||
<h5 class='card-title'>{{ content.content.name }}</h5>
|
<h5 class='card-title'>{{ content.content.name }}</h5>
|
||||||
</div>
|
</div>
|
||||||
{% if has_access %}
|
{% if has_access %}
|
||||||
|
|||||||
Reference in New Issue
Block a user