fixes for student admission (#6377)

* fixes for student admission

* Added Application Route to Student Admission
This commit is contained in:
Neil Trini Lasrado 2016-09-15 15:36:14 +05:30 committed by Rushabh Mehta
parent 769dda0874
commit 7e1b516103
4 changed files with 43 additions and 6 deletions

View File

@ -2,7 +2,14 @@
// For license information, please see license.txt
frappe.ui.form.on('Student Admission', {
refresh: function(frm) {
program: function(frm) {
if (frm.doc.academic_year && frm.doc.program) {
frm.doc.route = frappe.model.scrub(frm.doc.program) + "-" + frappe.model.scrub(frm.doc.academic_year)
frm.refresh_field("route");
}
},
academic_year: function(frm) {
frm.trigger("program");
}
});

View File

@ -163,7 +163,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@ -227,6 +227,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "route",
"fieldtype": "Data",
"hidden": 0,
@ -243,6 +244,32 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 1
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "application_form_route",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Application Form Route",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@ -336,7 +363,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-09-15 02:59:15.180465",
"modified": "2016-09-15 05:59:18.435682",
"modified_by": "Administrator",
"module": "Schools",
"name": "Student Admission",

View File

@ -10,7 +10,8 @@ from frappe import _
class StudentAdmission(WebsiteGenerator):
website = frappe._dict(
template = "templates/generators/student_admission.html",
condition_field = "publish"
condition_field = "publish",
page_title_field = "route"
)
def get_context(self, context):

View File

@ -40,10 +40,12 @@
</tr>
</table>
{%- if application_form_route -%}
<p>
<a class='btn btn-primary'
href='/student-applicant?program={{ doc.program }}&academic_year={{ doc.academic_year }}&new=1'>
href='/{{ doc.application_form_route }}?program={{ doc.program }}&academic_year={{ doc.academic_year }}&new=1'>
{{ _("Apply Now") }}</a>
</p>
{% endif %}
{% endblock %}