Merge branch 'main' of https://github.com/frappe/lms into ui-fixes
This commit is contained in:
@@ -189,7 +189,8 @@ jinja = {
|
||||
"lms.lms.utils.is_instructor",
|
||||
"lms.lms.utils.convert_number_to_character",
|
||||
"lms.lms.utils.get_signup_optin_checks",
|
||||
"lms.lms.utils.get_popular_courses"
|
||||
"lms.lms.utils.get_popular_courses",
|
||||
"lms.lms.utils.format_amount"
|
||||
],
|
||||
"filters": []
|
||||
}
|
||||
|
||||
@@ -203,13 +203,15 @@
|
||||
"depends_on": "paid_certificate",
|
||||
"fieldname": "price_certificate",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Certificate Price"
|
||||
"label": "Certificate Price",
|
||||
"mandatory_depends_on": "paid_certificate"
|
||||
},
|
||||
{
|
||||
"depends_on": "paid_certificate",
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Link",
|
||||
"label": "Currency",
|
||||
"mandatory_depends_on": "paid_certificate",
|
||||
"options": "Currency"
|
||||
},
|
||||
{
|
||||
@@ -258,7 +260,7 @@
|
||||
"link_fieldname": "course"
|
||||
}
|
||||
],
|
||||
"modified": "2022-05-04 11:03:24.001015",
|
||||
"modified": "2022-05-19 16:59:21.933367",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Course",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
import frappe
|
||||
from frappe.utils import flt, cint, cstr, getdate, add_months
|
||||
from frappe.utils import flt, cint, cstr, getdate, add_months, fmt_money
|
||||
from lms.lms.md import markdown_to_html, find_macros
|
||||
import string
|
||||
from frappe import _
|
||||
@@ -366,3 +366,10 @@ def get_evaluation_details(course, member=None):
|
||||
"request": request,
|
||||
"no_of_attempts": no_of_attempts
|
||||
})
|
||||
|
||||
def format_amount(amount, currency):
|
||||
amount_reduced = amount / 1000
|
||||
if amount_reduced < 1:
|
||||
return amount
|
||||
precision = 0 if amount % 1000 == 0 else 1
|
||||
return _("{0}K").format(fmt_money(amount_reduced, precision, currency))
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
{% if course.paid_certificate %}
|
||||
<div class="certificate-price small mt-3" data-price="{{ course.price_certificate }}">
|
||||
{{ _("Certificate Price: ") }} {{ frappe.utils.fmt_money(course.price_certificate, 2, course.currency) }}
|
||||
{{ _("Certificate Price: {0}").format(format_amount(course.price_certificate, course.currency)) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
{% if course.paid_certificate %}
|
||||
<div class="certificate-price" data-price="{{ course.price_certificate }}">
|
||||
{{ _("Certificate Price:") }} {{ frappe.utils.fmt_money(course.price_certificate, 2, course.currency) }}
|
||||
{{ _("Certificate Price:") }} {{ format_amount(course.price_certificate, course.currency) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -8,46 +8,47 @@
|
||||
{% block content %}
|
||||
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
{{ BreadCrumb(job) }}
|
||||
<div class="common-card-style job-detail-card">
|
||||
<div class="container">
|
||||
{{ BreadCrumb(job) }}
|
||||
<div class="common-card-style job-detail-card">
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="avatar avatar-medium align-self-center" title="{{ job.company_name}}">
|
||||
<div class="avatar-frame company-logo" style="
|
||||
background-image: url( {{ job.company_logo | urlencode }} );"></div>
|
||||
</div>
|
||||
<div class="ml-5">
|
||||
<div class="vertically-center">
|
||||
<div class="course-home-headings mb-0">{{ _(job.job_title) }}</div>
|
||||
<div class="indicator-pill green ml-5"> {{ job.type }} </div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center mt-2">
|
||||
<a class="dark-links course-meta mr-5" href="{{ job.company_website }}">{{ job.company_name }}</a>
|
||||
<div class="vertically-center course-meta mr-5">
|
||||
<svg class="icon icon-sm">
|
||||
<use class="" href="#icon-location">
|
||||
</svg>
|
||||
<div>{{ job.location }}</div>
|
||||
</div>
|
||||
<div class="course-meta"> {{ frappe.utils.format_date(job.creation, "medium") }} </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="avatar avatar-medium align-self-center" title="{{ job.company_name}}">
|
||||
<div class="avatar-frame company-logo" style="
|
||||
background-image: url( {{ job.company_logo | urlencode }} );"></div>
|
||||
</div>
|
||||
<div class="ml-5">
|
||||
<div class="vertically-center">
|
||||
<div class="course-home-headings mb-0">{{ _(job.job_title) }}</div>
|
||||
<div class="indicator-pill green ml-5"> {{ job.type }} </div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center mt-2">
|
||||
<a class="dark-links course-meta mr-5" href="{{ job.company_website }}">{{ job.company_name }}</a>
|
||||
<div class="vertically-center course-meta mr-5">
|
||||
<svg class="icon icon-sm">
|
||||
<use class="" href="#icon-location">
|
||||
</svg>
|
||||
<div>{{ job.location }}</div>
|
||||
</div>
|
||||
<div class="course-meta"> {{ frappe.utils.format_date(job.creation, "medium") }} </div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set application_link = job.application_link if frappe.session.user != 'Guest' else '/login?redirect-to=/jobs/' + job.name %}
|
||||
<div class="d-flex align-items-start ml-auto">
|
||||
<a class="button is-primary mr-2"
|
||||
href="{{ application_link }}">{{ _("Apply") }}</a>
|
||||
<div class="button is-default mr-2" id="report" data-job="{{ job.name }}">{{ _("Report") }}</div>
|
||||
{% if job.owner == frappe.session.user %}
|
||||
<a class="button is-default button-links" href="/job-opportunity?name={{ job.name }}">Edit</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="course-meta mt-10">{{ _(job.description) }}</div>
|
||||
|
||||
{% set application_link = job.application_link if frappe.session.user != 'Guest' else '/login?redirect-to=/jobs/' + job.name %}
|
||||
<div class="d-flex align-items-start ml-auto">
|
||||
<a class="button is-primary mr-2"
|
||||
href="{{ application_link }}">{{ _("Apply") }}</a>
|
||||
<div class="button is-default mr-2" id="report" data-job="{{ job.name }}">{{ _("Report") }}</div>
|
||||
{% if job.owner == frappe.session.user %}
|
||||
<a class="button is-default button-links" href="/job-opportunity?name={{ job.name }}">Edit</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="course-meta mt-10">{{ _(job.description) }}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade report-modal" id="report-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
|
||||
Reference in New Issue
Block a user