fix: notify-me-ux
This commit is contained in:
@@ -58,9 +58,9 @@
|
|||||||
Continue Learning <img class="ml-2" src="/assets/school/icons/white-arrow.svg" />
|
Continue Learning <img class="ml-2" src="/assets/school/icons/white-arrow.svg" />
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if course.upcoming %}
|
{% if course.upcoming and not is_user_interested %}
|
||||||
<button class="button wide-button is-default" id="notify-me" data-course="{{course.name | urlencode}}" {% if
|
<button class="button wide-button is-default"
|
||||||
is_user_interested %} disabled="disabled" title="Your interest has already been noted." {% endif %}>
|
id="notify-me" data-course="{{course.name | urlencode}}">
|
||||||
Notify me when available
|
Notify me when available
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -74,6 +74,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="interest-alert" class="alert alert-dismissible empty-state p-4 mt-10 {% if not is_user_interested %} hide {% endif %}">
|
||||||
|
You have opted to be notified for this course. You will receive an email when the course becomes available.
|
||||||
|
<a href="#" class="close p-4" data-dismiss="alert" aria-label="close">×</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if course.video_link %}
|
{% if course.video_link %}
|
||||||
<div class="modal fade preview-modal" id="video-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
<div class="modal fade preview-modal" id="video-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
|
|||||||
@@ -215,8 +215,7 @@ var notify_user = (e) => {
|
|||||||
"course": course
|
"course": course
|
||||||
},
|
},
|
||||||
callback: (data) => {
|
callback: (data) => {
|
||||||
frappe.msgprint(__("Your interest has been noted. We'll notify you via email when this course becomes available."));
|
$("#interest-alert").removeClass("hide");
|
||||||
$("#notify-me").attr("disabled", true).attr("title", "Your interest has already been noted");
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user