webform created to apply for esoc

This commit is contained in:
Zlash65
2018-04-02 19:05:14 +05:30
parent 77534e8c10
commit a92aa868bd
5 changed files with 451 additions and 0 deletions

View File

@@ -0,0 +1,109 @@
page-content {
padding: 1rem 4rem;
}
@media screen and (min-width: 767px) {
.page-content {
padding: 1rem 8rem;
}
}
.page-header-actions-block {
display: none;
}
.button-primary {
font-size: 1em;
padding: 0.5rem 1.5rem;
color: #fff;
background: #7575ff;
border-right: 0;
border-left: 0;
border-top: 0;
}
.button-primary:hover {
color: white;
}
.form-control {
width: 90% !important;
}
.row:before,
.row:after {
display: table;
content: " ";
}
.row:after {
clear: both;
}
.row {
margin-right: -15px;
margin-left: -15px;
}
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
}
@media (min-width: 768px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
.col-sm-10 {
width: 83.33333333%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666667%;
}
.col-sm-7 {
width: 58.33333333%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666667%;
}
.col-sm-4 {
width: 33.33333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.66666667%;
}
.col-sm-1 {
width: 8.33333333%;
}
}
.heading-2 {
margin-bottom: -10px;
font-weight: 340;
}
.checkbox-inline label input {
margin-top: 0.4rem;
vertical-align: middle;
position: absolute;
}
.checkbox-inline label {
cursor: pointer !important;
}

View File

@@ -0,0 +1,35 @@
frappe.ready(function() {
let page = $(document);
page.find('.web-form-page div .text-right button')
.removeClass('btn-primary btn-sm')
.addClass('button-primary')
.empty().append("Apply");
// Minimize cancel grid
let grid_cancel = page.find('.web-form-grid-row td');
for (let i in grid_cancel) {
if (grid_cancel[i].style && grid_cancel[i].style.width == '8.3333%') {
grid_cancel[i].style.width = "1%";
}
}
// Add Section heading
$(`<h2 class="heading-2"> Candidate Detail </h2>`)
.insertBefore(page.find('.web-form-page .section').first());
$(`<h2 class="heading-2"> Education Detail </h2>`)
.insertBefore(page.find('.web-form-page .section:nth-child(3)'));
$(`<h2 class="heading-2"> Project Detail </h2>`)
.insertBefore(page.find('.web-form-page .section:nth-child(5)'));
// Make textarea's height adapt to content
page.find('textarea').css("height", "auto");
page.find('textarea').css("min-height", "100px");
// checkbox tweak
let x = page.find('div.checkbox');
x.removeClass('checkbox').addClass('checkbox-inline');
let y = page.find('div .checkbox-inline label');
$(`<a style="display: inline-block;" href="/esoc/terms-and-rules" target="_blank"> terms & rules </a>`)
.appendTo(y[0]);
})

View File

@@ -0,0 +1,300 @@
{
"accept_payment": 0,
"allow_comments": 0,
"allow_delete": 0,
"allow_edit": 0,
"allow_incomplete": 0,
"allow_multiple": 0,
"allow_print": 0,
"amount": 0.0,
"amount_based_on_field": 0,
"creation": "2018-03-27 14:58:13.838189",
"currency": "INR",
"doc_type": "ESoC Applicant",
"docstatus": 0,
"doctype": "Web Form",
"idx": 0,
"introduction_text": "",
"is_standard": 1,
"login_required": 0,
"max_attachment_size": 0,
"modified": "2018-04-02 19:02:37.665216",
"modified_by": "Administrator",
"module": "ERPNext Foundation",
"name": "apply-for-esoc",
"owner": "Administrator",
"payment_button_label": "Buy Now",
"published": 1,
"route": "apply-for-esoc",
"show_sidebar": 0,
"sidebar_items": [],
"success_message": "",
"success_url": "/esoc#timeline",
"title": "Apply for ESoC",
"web_form_fields": [
{
"fieldname": "username",
"fieldtype": "Data",
"hidden": 0,
"label": "Username",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "first_name",
"fieldtype": "Data",
"hidden": 0,
"label": "First Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "last_name",
"fieldtype": "Data",
"hidden": 0,
"label": "Last Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "mobile_no",
"fieldtype": "Data",
"hidden": 0,
"label": "Mobile No.",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "",
"fieldtype": "Column Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "email_id",
"fieldtype": "Data",
"hidden": 0,
"label": "Email ID",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "date_of_birth",
"fieldtype": "Date",
"hidden": 0,
"label": "Date of Birth",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "nationality",
"fieldtype": "Data",
"hidden": 0,
"label": "Nationality",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "gender",
"fieldtype": "Link",
"hidden": 0,
"label": "Gender",
"max_length": 0,
"max_value": 0,
"options": "Gender",
"read_only": 0,
"reqd": 0
},
{
"fieldname": "",
"fieldtype": "Section Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "university_name",
"fieldtype": "Data",
"hidden": 0,
"label": "University Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "university_city",
"fieldtype": "Data",
"hidden": 0,
"label": "University City",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "field_of_study",
"fieldtype": "Data",
"hidden": 0,
"label": "Field of Study",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "",
"fieldtype": "Column Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "college_name",
"fieldtype": "Data",
"hidden": 0,
"label": "College Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "university_country",
"fieldtype": "Data",
"hidden": 0,
"label": "University Country",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "university_website",
"fieldtype": "Data",
"hidden": 0,
"label": "University Website",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "",
"fieldtype": "Section Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "project_description",
"fieldtype": "Text",
"hidden": 0,
"label": "Briefly describe the Projects you've worked on",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "",
"fieldtype": "Section Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "github_link",
"fieldtype": "Data",
"hidden": 0,
"label": "Your Github Link",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "",
"fieldtype": "Column Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "noc",
"fieldtype": "Attach",
"hidden": 0,
"label": "NOC",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "",
"fieldtype": "Section Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "project_details",
"fieldtype": "Table",
"hidden": 0,
"label": "Project Details",
"max_length": 0,
"max_value": 0,
"options": "ESoC Project Detail",
"read_only": 0,
"reqd": 1
},
{
"fieldname": "",
"fieldtype": "Section Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "terms_and_conditions",
"fieldtype": "Check",
"hidden": 0,
"label": "I agree with the ",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
}
]
}

View File

@@ -0,0 +1,7 @@
from __future__ import unicode_literals
import frappe
def get_context(context):
# do your magic here
pass