[new] Module Leader Webform Added

This commit is contained in:
Vishal
2017-10-26 14:44:06 +05:30
parent c62cf5729c
commit 86aefef6bc
13 changed files with 876 additions and 7 deletions

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2017, EOSSF and contributors
// For license information, please see license.txt
frappe.ui.form.on('Module Leader', {
refresh: function(frm) {
}
});

View File

@@ -0,0 +1,574 @@
{
"allow_copy": 0,
"allow_guest_to_view": 1,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:title",
"beta": 0,
"creation": "2017-10-26 03:36:39.301981",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Title",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "module_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Module Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "country",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Country",
"length": 0,
"no_copy": 0,
"options": "Country",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "email",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "phone",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Phone",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "website",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Website",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "address",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Address",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_8",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "image",
"fieldtype": "Attach Image",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Image",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_10",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "introduction",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Introduction",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "details",
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Details",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_13",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "discuss_ids",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Discuss IDs",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "github_id",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "GitHub ID",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "route",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Route",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "show_in_website",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Show in Website",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"has_web_view": 1,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_field": "image",
"image_view": 0,
"in_create": 0,
"is_published_field": "show_in_website",
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-10-26 04:35:17.608511",
"modified_by": "Administrator",
"module": "ERPNext Foundation",
"name": "Module Leader",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
}
],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"route": "module-leaders",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
}

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017, EOSSF and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
from frappe.utils import get_datetime
class ModuleLeader(WebsiteGenerator):
_website = frappe._dict(
condition_field = "show_in_website",
)
def validate(self):
if not self.route:
self.route = 'module-leaders/' + self.scrub(self.name)
def get_context(self, context):
context.no_cache = True
context.parents = [dict(label='View All Module Leaders',
route='module-leaders', title='View All Module Leaders')]
def get_list_context(context):
context.allow_guest = True
context.no_cache = True
context.no_breadcrumbs = True
context.order_by = 'creation desc'

View File

@@ -0,0 +1,61 @@
{% extends "templates/web.html" %}
{% from "foundation/templates/includes/macros.html" import media %}
{% block page_content %}
<h1 class="media-heading">{{ title }}</h1>
<section>
<div class="media" style="margin: 45px 0px; ">
<div class="media-left" style='min-width: 80px;'>
<a href="#">
<img class="media-object"
src="{{ image }}"
style="max-width: 80px; ">
</a>
</div>
<div class="media-body">
{{ introduction }}
<table class='table table-bordered small'
style='max-width: 400px; margin-bottom: 0px; margin-top: 20px'>
<tr>
<td style='width: 38.2%'>Module Name</td>
<td>{{ module_name }}</td>
</tr>
<tr>
<td style='width: 38.2%'>Country</td>
<td>{{ country }}</td>
</tr>
<tr>
<td>Address</td>
<td>{{ (address or '').replace('\n', '<br>') }}</td>
</tr>
</tr>
<td>Phone</td>
<td>{{ phone }}</td>
</tr>
</tr>
<td>Email</td>
<td><a href="mailto:{{ email }}" target="_blank">
{{ email }}</a></td>
</tr>
</tr>
<td>Disscuss Id</td>
<td>{{ discuss_ids }}</td>
</tr>
</tr>
<td>Website</td>
<td><a href="{{ website }}" target="_blank">{{ website }}</a></td>
</tr>
</table>
</div>
</div>
</section>
<section>
{{ details }}
</section>
<section>
<p><a class='btn-primary btn' href="mailto:{{ email }}">Contact {{ title }}</a></p>
</section>
{% endblock %}

View File

@@ -0,0 +1,11 @@
<div style='margin-bottom: 30px; max-width: 600px;'
class='with-border clickable'>
<a href="/{{ doc.route }}">
<h3 style='margin-top: 0px;'>{{ doc.title }}</h3>
<p>
<span class='label'>{{ frappe.format_date(doc.creation) }}</span>
<span class='label'>{{ doc.country }}</span>
<span class='label'>{{ doc.module_name }}</span>
</p>
</a>
</div>

View File

@@ -0,0 +1,23 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Module Leader", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Module Leader
() => frappe.tests.make('Module Leader', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017, EOSSF and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestModuleLeader(unittest.TestCase):
pass

View File

@@ -0,0 +1,3 @@
frappe.ready(function() {
// bind events here
})

View File

@@ -0,0 +1,137 @@
{
"accept_payment": 0,
"allow_comments": 0,
"allow_delete": 0,
"allow_edit": 1,
"allow_incomplete": 0,
"allow_multiple": 0,
"allow_print": 0,
"amount": 0.0,
"amount_based_on_field": 0,
"creation": "2017-10-26 05:03:25.027338",
"currency": "USD",
"doc_type": "Module Leader",
"docstatus": 0,
"doctype": "Web Form",
"idx": 0,
"introduction_text": "Update your profile that will be shown on your Module Leader Listing.",
"is_standard": 1,
"login_required": 1,
"max_attachment_size": 0,
"modified": "2017-10-26 05:12:41.826615",
"modified_by": "Administrator",
"module": "ERPNext Foundation",
"name": "module-leaders",
"owner": "Administrator",
"payment_button_label": "Buy Now",
"payment_gateway": "",
"published": 1,
"route": "module-leader-settings",
"show_sidebar": 1,
"sidebar_items": [],
"success_url": "/module-leaders",
"title": "Module Leaders",
"web_form_fields": [
{
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"label": "Title",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "module_name",
"fieldtype": "Data",
"hidden": 0,
"label": "Module Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "country",
"fieldtype": "Link",
"hidden": 0,
"label": "Country",
"max_length": 0,
"max_value": 0,
"options": "Country",
"read_only": 0,
"reqd": 1
},
{
"fieldname": "email",
"fieldtype": "Data",
"hidden": 0,
"label": "Email",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "phone",
"fieldtype": "Data",
"hidden": 0,
"label": "Phone",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "image",
"fieldtype": "Attach",
"hidden": 0,
"label": "Image",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "introduction",
"fieldtype": "Small Text",
"hidden": 0,
"label": "Introduction",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "details",
"fieldtype": "Text Editor",
"hidden": 0,
"label": "Details",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "discuss_ids",
"fieldtype": "Data",
"hidden": 0,
"label": "Discuss IDs",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "github_id",
"fieldtype": "Data",
"hidden": 0,
"label": "GitHub ID",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
}
]
}

View File

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

View File

@@ -43,15 +43,19 @@ website_context = {
"copyright": "ERPNext Open Source Software Foundation",
"footer_address": "<br>ERPNext is and will always be 100% Open Source",
"top_bar_items": [
{"label": "Docs", "url": "/docs", "right": 1},
{"label": "Services", "url": "/service-providers", "right": 1},
{"label": "Jobs", "url": "/erpnext-jobs", "right": 1},
{"label": "Chapters", "url": "/chapters", "right": 1},
{"label": "Bounties", "url": "/bounties", "right": 1},
{"label": '<span class="indicator blue">Conference</span>', "url": "/conf/2017", "right": 1},
{"label": "User Manual", "url": "/docs", "right": 1},
{"label": "Foundation", "child_items":[
{"label": "Chapter", "url": "/service-providers","right": 1},
{"label": "Module Leader", "url": "module-leaders","right": 1},
{"label": "Foundation Fellow", "url": "#","right": 1}
], "right":1},
{"label": "Services", "child_items":[
{"label": "Service Providers", "url": "/service-providers","right": 1},
{"label": "Hire Developer", "url": "/erpnext-jobs", "right": 1},
], "right":1},
{"label": "About", "url": "/about", "right": 1},
],
"hide_login": 1,
"hide_login": 0,
"favicon": "/assets/frappe_theme/img/favicon.ico"
}
# website user home page (by Role)
@@ -70,6 +74,7 @@ website_context = {
portal_menu_items = [
{'label': 'My Profile', 'route': '/service-provider-settings'},
{'label': 'Module Leader', 'route': '/module-leader-settings'},
{'label': 'Membership', 'route': '/members/details'},
{'label': 'Conference Talks', 'route': '/conference-talk-proposal'},
{'label': 'Jobs', 'route': '/my-jobs'},