Merge branch 'master' into develop

This commit is contained in:
Saurabh
2018-01-15 18:36:35 +05:30
19 changed files with 151 additions and 56 deletions

View File

@@ -35,4 +35,16 @@ def get_list_context(context):
context.title = 'All Chapters'
context.no_breadcrumbs = True
context.order_by = 'creation desc'
context.introduction = '<p>All Chapters</p>'
context.introduction = '<p>All Chapters</p>'
@frappe.whitelist()
def leave(title, user_id, leave_reason):
chapter = frappe.get_doc("Chapter", title)
for member in chapter.members:
if member.user == user_id:
member.enabled = 0
member.leave_reason = leave_reason
chapter.save(ignore_permissions=1)
frappe.db.commit()
return "Thank you for Feedback"

View File

@@ -5,34 +5,39 @@
<h3>Details</h3>
<p>{{ introduction }}</p>
{% if meetup_embed_html %}
{{ meetup_embed_html }}
{{ meetup_embed_html }}
{% endif %}
<h3>List of Members</h3>
{% if members %}
{% if members %}
<table class="table table-bordered small" style="max-width: 500px;">
<tr>
<th width="15%" ></th>
<th>Member Details</th>
</tr>
{% set index = [1] %}
{% for user in members %}
<tr>
<td>{{ loop.index }}</td>
<td>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">{{ frappe.db.get_value('User', user.user, 'full_name') }}</div>
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
{% if user.website_url %}
<a href="{{ user.website_url }}">{{ user.website_url or '' }}</a>
{% if user.enabled == 1 %}
<tr>
<td>{{ index|length }}</td>
<td>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">{{ frappe.db.get_value('User', user.user, 'full_name') }}</div>
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
{% if user.website_url %}
<a href="{{ user.website_url }}">{{ user.website_url or '' }}</a>
{% endif %}
</div>
<div class="col-lg-12">
{% if user.introduction %}
{{ user.introduction }}
{% endif %}
</div>
</div>
<div class="col-lg-12">
{% if user.introduction %}
{{ user.introduction }}
{% endif %}
</div>
</div>
</td>
</tr>
</td>
</tr>
{% set __ = index.append(1) %}
{% endif %}
{% endfor %}
</table>
{% else %}

View File

@@ -1,21 +1,30 @@
{% if doc.published %}
<div style="margin-bottom: 30px; max-width: 600px" class="with-border clickable">
<a href="/{{ doc.route }}">
<a href={{ route }}>
<h3>{{ doc.name }}</h3>
<p>
<span class="label">{{ frappe.db.get_value('User', chapter_head, 'full_name') }}</span>
<span class="label"> Chapter Head : {{ frappe.db.get_value('User', chapter_head, 'full_name') }} </span>
<span class="label">
{% if members %}
Members: {{ members|length }}
{% set index = [] %}
{% for user in members %}
{% if user.enabled == 1 %}
{% set __ = index.append(1) %}
{% endif %}
{% endfor %}
Members: {{ index|length }}
{% else %}
Members: 0
{% endif %}
</span>
</span>
<!-- Assignment of value to global variable not working in jinja -->
</p>
<p>{{ html2text(doc.introduction[:200]) }}{% if introduction|len > 200 %}...{% endif %}</p>
</a>
</div>
{% endif %}
<!-- this is a sample default list template -->
<style type="text/css">
.label {

View File

@@ -132,6 +132,36 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "leave_reason",
"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": "Leave Reason",
"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": 0,
@@ -144,7 +174,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-12-06 11:33:34.300252",
"modified": "2018-01-12 12:16:10.591039",
"modified_by": "Administrator",
"module": "Non Profit",
"name": "Chapter Member",

View File

@@ -295,7 +295,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-05 07:02:06.690416",
"modified": "2018-01-15 09:40:41.153561",
"modified_by": "Administrator",
"module": "Non Profit",
"name": "Donor",
@@ -330,6 +330,7 @@
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "donor_name",
"track_changes": 1,
"track_seen": 0
}

View File

@@ -325,7 +325,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-05 07:03:21.606732",
"modified": "2018-01-15 09:38:41.878167",
"modified_by": "Administrator",
"module": "Non Profit",
"name": "Member",
@@ -380,6 +380,7 @@
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "member_name",
"track_changes": 1,
"track_seen": 0
}

View File

@@ -506,7 +506,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-12-06 12:03:08.624579",
"modified": "2018-01-15 09:40:25.229551",
"modified_by": "Administrator",
"module": "Non Profit",
"name": "Volunteer",
@@ -540,6 +540,7 @@
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "volunteer_name",
"track_changes": 1,
"track_seen": 0
}