fix: notify-me-ux

This commit is contained in:
Jannat Patel
2021-11-23 22:28:07 +05:30
parent 9582a27dc6
commit 6ae346df44
2 changed files with 9 additions and 5 deletions

View File

@@ -58,9 +58,9 @@
Continue Learning <img class="ml-2" src="/assets/school/icons/white-arrow.svg" />
</a>
{% endif %}
{% if course.upcoming %}
<button class="button wide-button is-default" id="notify-me" data-course="{{course.name | urlencode}}" {% if
is_user_interested %} disabled="disabled" title="Your interest has already been noted." {% endif %}>
{% if course.upcoming and not is_user_interested %}
<button class="button wide-button is-default"
id="notify-me" data-course="{{course.name | urlencode}}">
Notify me when available
</button>
{% endif %}
@@ -74,6 +74,11 @@
</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">&times;</a>
</div>
{% if course.video_link %}
<div class="modal fade preview-modal" id="video-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">

View File

@@ -215,8 +215,7 @@ var notify_user = (e) => {
"course": course
},
callback: (data) => {
frappe.msgprint(__("Your interest has been noted. We'll notify you via email when this course becomes available."));
$("#notify-me").attr("disabled", true).attr("title", "Your interest has already been noted");
$("#interest-alert").removeClass("hide");
}
})
}