mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
fix: Student Admission and Student Applicant fixes (#23515)
* fix: student admission list portal styling * fix: added basic validations to Student Admission DocType * fix: show program description and apply button for every program * fix: don't show apply now button if admissions have not started * fix: fetch admission details in student applicant web form Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
@@ -51,12 +51,14 @@
|
|||||||
"fieldname": "admission_start_date",
|
"fieldname": "admission_start_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"label": "Admission Start Date",
|
"label": "Admission Start Date",
|
||||||
|
"mandatory_depends_on": "enable_admission_application",
|
||||||
"no_copy": 1
|
"no_copy": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "admission_end_date",
|
"fieldname": "admission_end_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"label": "Admission End Date",
|
"label": "Admission End Date",
|
||||||
|
"mandatory_depends_on": "enable_admission_application",
|
||||||
"no_copy": 1
|
"no_copy": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -83,6 +85,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "0",
|
"default": "0",
|
||||||
|
"depends_on": "published",
|
||||||
"fieldname": "enable_admission_application",
|
"fieldname": "enable_admission_application",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Enable Admission Application"
|
"label": "Enable Admission Application"
|
||||||
@@ -91,7 +94,7 @@
|
|||||||
"has_web_view": 1,
|
"has_web_view": 1,
|
||||||
"is_published_field": "published",
|
"is_published_field": "published",
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-06-15 20:18:38.591626",
|
"modified": "2020-09-18 00:14:54.615321",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Education",
|
"module": "Education",
|
||||||
"name": "Student Admission",
|
"name": "Student Admission",
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ class StudentAdmission(WebsiteGenerator):
|
|||||||
if not self.route: #pylint: disable=E0203
|
if not self.route: #pylint: disable=E0203
|
||||||
self.route = "admissions/" + "-".join(self.title.split(" "))
|
self.route = "admissions/" + "-".join(self.title.split(" "))
|
||||||
|
|
||||||
|
if self.enable_admission_application and not self.program_details:
|
||||||
|
frappe.throw(_("Please add programs to enable admission application."))
|
||||||
|
|
||||||
def get_context(self, context):
|
def get_context(self, context):
|
||||||
context.no_cache = 1
|
context.no_cache = 1
|
||||||
context.show_sidebar = True
|
context.show_sidebar = True
|
||||||
|
|||||||
@@ -43,31 +43,35 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr class="active">
|
<tr class="active">
|
||||||
<th style="width: 90px">Program/Std.</th>
|
<th style="width: 90px">Program/Std.</th>
|
||||||
<th style="width: 170px">Minumum Age</th>
|
<th style="width: 180px">Description</th>
|
||||||
<th style="width: 170px">Maximum Age</th>
|
<th style="width: 100px">Minumum Age</th>
|
||||||
|
<th style="width: 100px">Maximum Age</th>
|
||||||
<th style="width: 100px">Application Fee</th>
|
<th style="width: 100px">Application Fee</th>
|
||||||
|
{%- if doc.enable_admission_application and frappe.utils.getdate(doc.admission_start_date) <= today -%}
|
||||||
|
<th style="width: 120px"></th>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for row in program_details %}
|
{% for row in program_details %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ row.program }}</td>
|
<td>{{ row.program }}</td>
|
||||||
|
<td><div class="text-muted">{{ row.description if row.description else '' }}</div></td>
|
||||||
<td>{{ row.min_age }}</td>
|
<td>{{ row.min_age }}</td>
|
||||||
<td>{{ row.max_age }}</td>
|
<td>{{ row.max_age }}</td>
|
||||||
<td>{{ row.application_fee }}</td>
|
<td>{{ row.application_fee }}</td>
|
||||||
|
{%- if doc.enable_admission_application and frappe.utils.getdate(doc.admission_start_date) <= today -%}
|
||||||
|
<td>
|
||||||
|
<a class='btn btn-sm btn-primary' href='/student-applicant?new=1&student_admission={{doc.name}}&program={{row.program}}&academic_year={{academic_year}}'>
|
||||||
|
{{ _("Apply Now") }}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- if doc.enable_admission_application -%}
|
|
||||||
<br>
|
|
||||||
<p>
|
|
||||||
<a class='btn btn-primary'
|
|
||||||
href='/student-applicant?new=1&student_admission={{doc.name}}'>
|
|
||||||
{{ _("Apply Now") }}</a>
|
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<div class="web-list-item">
|
<div class="web-list-item transaction-list-item">
|
||||||
{% set today = frappe.utils.getdate(frappe.utils.nowdate()) %}
|
{% set today = frappe.utils.getdate(frappe.utils.nowdate()) %}
|
||||||
<a href = "{{ doc.route }}/">
|
<a href = "{{ doc.route }}/" class="no-underline">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6 text-left small bold" style="margin-top: -3px;"">
|
<div class="col-sm-4 bold">
|
||||||
<span class="indicator
|
<span class="indicator
|
||||||
{% if frappe.utils.getdate(doc.admission_end_date) == today %}
|
{% if frappe.utils.getdate(doc.admission_end_date) == today %}
|
||||||
red
|
red
|
||||||
@@ -15,6 +15,14 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
">{{ doc.title }}</span>
|
">{{ doc.title }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-sm-2 small">
|
||||||
|
<span class="text-muted">
|
||||||
|
Academic Year
|
||||||
|
</span>
|
||||||
|
<div class="text-muted bold">
|
||||||
|
{{ doc.academic_year }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-sm-3 small">
|
<div class="col-sm-3 small">
|
||||||
<span class="text-muted">
|
<span class="text-muted">
|
||||||
Starts on
|
Starts on
|
||||||
@@ -27,7 +35,7 @@
|
|||||||
<span class="text-muted">
|
<span class="text-muted">
|
||||||
Ends on
|
Ends on
|
||||||
</span>
|
</span>
|
||||||
<div class="bold">
|
<div class=" text-muted bold">
|
||||||
{{ frappe.format_date(doc.admission_end_date) }}
|
{{ frappe.format_date(doc.admission_end_date) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"program",
|
"program",
|
||||||
"min_age",
|
"min_age",
|
||||||
"max_age",
|
"max_age",
|
||||||
|
"description",
|
||||||
"column_break_4",
|
"column_break_4",
|
||||||
"application_fee",
|
"application_fee",
|
||||||
"applicant_naming_series"
|
"applicant_naming_series"
|
||||||
@@ -18,52 +19,47 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Program",
|
"label": "Program",
|
||||||
"options": "Program",
|
"options": "Program"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_4",
|
"fieldname": "column_break_4",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "application_fee",
|
"fieldname": "application_fee",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Application Fee",
|
"label": "Application Fee"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "applicant_naming_series",
|
"fieldname": "applicant_naming_series",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Naming Series (for Student Applicant)",
|
"label": "Naming Series (for Student Applicant)"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "min_age",
|
"fieldname": "min_age",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Minimum Age",
|
"label": "Minimum Age"
|
||||||
"show_days": 1,
|
|
||||||
"show_seconds": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "max_age",
|
"fieldname": "max_age",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Maximum Age",
|
"label": "Maximum Age"
|
||||||
"show_days": 1,
|
},
|
||||||
"show_seconds": 1
|
{
|
||||||
|
"fetch_from": "program.description",
|
||||||
|
"fetch_if_empty": 1,
|
||||||
|
"fieldname": "description",
|
||||||
|
"fieldtype": "Small Text",
|
||||||
|
"label": "Description"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-06-10 23:06:30.037404",
|
"modified": "2020-10-05 13:03:42.005985",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Education",
|
"module": "Education",
|
||||||
"name": "Student Admission Program",
|
"name": "Student Admission Program",
|
||||||
|
|||||||
@@ -168,6 +168,7 @@
|
|||||||
"fieldname": "student_email_id",
|
"fieldname": "student_email_id",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Student Email Address",
|
"label": "Student Email Address",
|
||||||
|
"options": "Email",
|
||||||
"unique": 1
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -261,7 +262,7 @@
|
|||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-09-07 19:31:30.063563",
|
"modified": "2020-10-05 13:59:45.631647",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Education",
|
"module": "Education",
|
||||||
"name": "Student Applicant",
|
"name": "Student Applicant",
|
||||||
|
|||||||
@@ -70,19 +70,7 @@
|
|||||||
"show_in_filter": 0
|
"show_in_filter": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_read_on_all_link_options": 0,
|
"allow_read_on_all_link_options": 1,
|
||||||
"fieldname": "image",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Image",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "program",
|
"fieldname": "program",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -95,7 +83,7 @@
|
|||||||
"show_in_filter": 0
|
"show_in_filter": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_read_on_all_link_options": 0,
|
"allow_read_on_all_link_options": 1,
|
||||||
"fieldname": "academic_year",
|
"fieldname": "academic_year",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -107,6 +95,19 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"show_in_filter": 0
|
"show_in_filter": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_read_on_all_link_options": 1,
|
||||||
|
"fieldname": "academic_term",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"label": "Academic Term",
|
||||||
|
"max_length": 0,
|
||||||
|
"max_value": 0,
|
||||||
|
"options": "Academic Term",
|
||||||
|
"read_only": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"show_in_filter": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_read_on_all_link_options": 0,
|
"allow_read_on_all_link_options": 0,
|
||||||
"fieldname": "date_of_birth",
|
"fieldname": "date_of_birth",
|
||||||
@@ -119,6 +120,19 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"show_in_filter": 0
|
"show_in_filter": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_read_on_all_link_options": 1,
|
||||||
|
"fieldname": "gender",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"label": "Gender",
|
||||||
|
"max_length": 0,
|
||||||
|
"max_value": 0,
|
||||||
|
"options": "Gender",
|
||||||
|
"read_only": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"show_in_filter": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_read_on_all_link_options": 0,
|
"allow_read_on_all_link_options": 0,
|
||||||
"fieldname": "blood_group",
|
"fieldname": "blood_group",
|
||||||
@@ -141,7 +155,7 @@
|
|||||||
"max_length": 0,
|
"max_length": 0,
|
||||||
"max_value": 0,
|
"max_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"reqd": 0,
|
"reqd": 1,
|
||||||
"show_in_filter": 0
|
"show_in_filter": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -206,19 +220,6 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"show_in_filter": 0
|
"show_in_filter": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "guardians",
|
|
||||||
"fieldtype": "Table",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Guardians",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"options": "Student Guardian",
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_read_on_all_link_options": 0,
|
"allow_read_on_all_link_options": 0,
|
||||||
"fieldname": "siblings",
|
"fieldname": "siblings",
|
||||||
|
|||||||
Reference in New Issue
Block a user