fix: email patch and conference portal
This commit is contained in:
@@ -69,7 +69,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_published_field": "enabled",
|
"is_published_field": "enabled",
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-03-09 11:17:40.842666",
|
"modified": "2021-04-06 11:50:41.551665",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Community",
|
"module": "Community",
|
||||||
"name": "Community Course Member",
|
"name": "Community Course Member",
|
||||||
@@ -89,6 +89,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
|
"route": "community-course-member",
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
|
|||||||
@@ -1,28 +1,36 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
|
"autoname": "field:conference_name",
|
||||||
"creation": "2021-02-25 17:12:51.981534",
|
"creation": "2021-02-25 17:12:51.981534",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"conference_name",
|
"conference_name",
|
||||||
"live_stream_url"
|
"live_stream_url",
|
||||||
|
"conference_details"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldname": "conference_name",
|
"fieldname": "conference_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Conference Name"
|
"label": "Conference Name",
|
||||||
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "live_stream_url",
|
"fieldname": "live_stream_url",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Live Stream URL"
|
"label": "Live Stream URL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "conference_details",
|
||||||
|
"fieldtype": "Markdown Editor",
|
||||||
|
"label": "Conference Details"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-03-04 20:13:09.893749",
|
"modified": "2021-04-06 18:30:18.228083",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Conference",
|
"module": "Conference",
|
||||||
"name": "Community Conference",
|
"name": "Community Conference",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
frappe.reload_doc("community", "doctype", "community_member")
|
||||||
members = frappe.get_all("Community Member", ["name", "email_preference"])
|
members = frappe.get_all("Community Member", ["name", "email_preference"])
|
||||||
for member in members:
|
for member in members:
|
||||||
if not member.email_preference:
|
if not member.email_preference:
|
||||||
|
|||||||
41
community/www/conferences/index.html
Normal file
41
community/www/conferences/index.html
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{% extends "templates/base.html" %}
|
||||||
|
{% block title %}{{ 'Hackathons' }}{% endblock %}
|
||||||
|
{% from "www/hackathons/macros/card.html" import hackathon_card %}
|
||||||
|
{% from "www/hackathons/macros/card.html" import null_card %}
|
||||||
|
{% block head_include %}
|
||||||
|
<meta name="description" content="{{ 'Conferences' }}" />
|
||||||
|
<meta name="keywords" content="An app that supports Communities." />
|
||||||
|
<style>
|
||||||
|
section {
|
||||||
|
padding: 5rem 0 5rem 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<section class="top-section" style="padding: 6rem 0rem;">
|
||||||
|
<div class='container pb-5'>
|
||||||
|
<h1>{{ 'Conferences' }}</h1>
|
||||||
|
</div>
|
||||||
|
<div class='container'>
|
||||||
|
<div class="row mt-5">
|
||||||
|
{% for conference in conferences %}
|
||||||
|
<div class="col-sm-4 mb-4 text-left">
|
||||||
|
<a href="{{ conference.live_stream_url }}" class="no-decoration no-underline">
|
||||||
|
<div class="card h-100">
|
||||||
|
<div class='card-body'>
|
||||||
|
<h5 class='card-title'>{{ conference.name }}</h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
{% if conferences %}
|
||||||
|
{% for n in range( (3 - (conferences|length)) %3) %}
|
||||||
|
{{ null_card() }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endblock %}
|
||||||
8
community/www/conferences/index.py
Normal file
8
community/www/conferences/index.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
def get_context(context):
|
||||||
|
context.no_cache = 1
|
||||||
|
context.conferences = get_conferences()
|
||||||
|
|
||||||
|
def get_conferences():
|
||||||
|
return frappe.get_all("Community Conference", fields=["name", "live_stream_url"])
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
</li>
|
</li>
|
||||||
{% if discussions %}
|
{% if discussions %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" id="discussions-tab" data-toggle="tab" href="#discussions" role="tab" aria-controls="discussions"
|
<a class="nav-link" id="discussions-tab" data-toggle="tab" href="#discussions" role="tab"
|
||||||
aria-selected="false">Discussions</a>
|
aria-controls="discussions" aria-selected="false">Discussions</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -43,7 +43,8 @@
|
|||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
{% for topic in course.topics %}
|
{% for topic in course.topics %}
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<h5><a href="/courses/topic?course={{course.name}}&topic={{topic.name}}">{{topic.title}}</a></h5>
|
<h5><a href="/courses/topic?course={{course.name}}&topic={{topic.name}}">{{topic.title}}</a>
|
||||||
|
</h5>
|
||||||
<div>{{topic.preview | markdown }}</div>
|
<div>{{topic.preview | markdown }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -53,18 +54,28 @@
|
|||||||
<div class="tab-pane fade py-4" role="tabpanel" id="discussions">
|
<div class="tab-pane fade py-4" role="tabpanel" id="discussions">
|
||||||
<div>
|
<div>
|
||||||
{% if batches %}
|
{% if batches %}
|
||||||
<div class="">
|
<div class="dropdown">
|
||||||
<select id="batches-dropdown" class="m-5">
|
<button class="btn btn-default dropdown-toggle mb-5" data-toggle="dropdown" aria-expanded="false">
|
||||||
{% for batch in batches %}
|
<span class="current-batch">{{ batches[0] }}</span>
|
||||||
<option value="{{batch}}">{{ batch }}</option>
|
<b class="caret"></b>
|
||||||
{% endfor %}
|
</button>
|
||||||
</select>
|
<ul class="dropdown-menu dropdown-menu-right" role="menu">
|
||||||
|
{% for batch in batches %}
|
||||||
|
<li>
|
||||||
|
<a class="grey-link dropdown-item list-batch" href="#" onclick="return false;" data-label="{{ batch | urlencode}}">
|
||||||
|
<span class="alt-underline"> {{ batch }} </span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="border p-5">
|
<div class="border p-5">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea class="form-control message-text" rows="3" placeholder="Enter your message here."></textarea>
|
<textarea class="form-control message-text" rows="3"
|
||||||
<button class="btn btn-primary mt-5 send-message" data-author="{{ author | urlencode}}" data-batch="{{ current_batch | urlencode }}">Send</button>
|
placeholder="Enter your message here."></textarea>
|
||||||
|
<button class="btn btn-primary mt-5 send-message" data-author="{{ author | urlencode}}"
|
||||||
|
data-batch="{{ current_batch | urlencode }}">Send</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if discussions %}
|
{% if discussions %}
|
||||||
@@ -75,7 +86,7 @@
|
|||||||
{{ message.message }}
|
{{ message.message }}
|
||||||
<div class="small text-muted text-right">{{ message.creation }}</div>
|
<div class="small text-muted text-right">{{ message.creation }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
frappe.ready(() => {
|
frappe.ready(() => {
|
||||||
var dropdown = document.getElementById("batches-dropdown");
|
$(".list-batch").click((e) => {
|
||||||
if (dropdown) {
|
var batch = decodeURIComponent($(e.currentTarget).attr("data-label"))
|
||||||
dropdown.onchange = () => {
|
$(".current-batch").text(batch)
|
||||||
$(".send-message").attr("data-batch", dropdown.value)
|
$(".send-message").attr("data-batch", batch)
|
||||||
frappe.call("community.www.courses.course.get_messages", { batch: dropdown.value }, (data) => {
|
frappe.call("community.www.courses.course.get_messages", { batch: batch }, (data) => {
|
||||||
if (data.message) {
|
if (data.message) {
|
||||||
$(".discussions").children().remove();
|
$(".discussions").children().remove();
|
||||||
for (var i = 0; i < data.message.length; i++) {
|
for (var i = 0; i < data.message.length; i++) {
|
||||||
var element = add_message(data.message[i])
|
var element = add_message(data.message[i])
|
||||||
$(".discussions").append(element);
|
$(".discussions").append(element);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
}
|
})
|
||||||
$(".send-message").click((e) => {
|
$(".send-message").click((e) => {
|
||||||
var message = $(".message-text").val().trim();
|
var message = $(".message-text").val().trim();
|
||||||
if (message) {
|
if (message) {
|
||||||
@@ -35,7 +34,7 @@ frappe.ready(() => {
|
|||||||
$(".message-text").val("");
|
$(".message-text").val("");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
var add_message = (message, session_user=false) => {
|
var add_message = (message, session_user = false) => {
|
||||||
var author = session_user ? "You" : message.author
|
var author = session_user ? "You" : message.author
|
||||||
return `<div class="list-group-item">
|
return `<div class="list-group-item">
|
||||||
<h6> ${author} </h6>
|
<h6> ${author} </h6>
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
{% block title %}{{ 'Courses' }}{% endblock %}
|
{% block title %}{{ 'Courses' }}{% endblock %}
|
||||||
{% from "www/courses/macros/card.html" import course_card %}
|
{% from "www/courses/macros/card.html" import course_card %}
|
||||||
{% block head_include %}
|
{% block head_include %}
|
||||||
<meta name="description" content="{{ 'Courses' }}" />
|
<meta name="description" content="{{ 'Courses' }}" />
|
||||||
<meta name="keywords" content="Courses" />
|
<meta name="keywords" content="Courses" />
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
<div class='container'>
|
<div class='container'>
|
||||||
<div class="row mt-5">
|
<div class="row mt-5">
|
||||||
{% for course in courses %}
|
{% for course in courses %}
|
||||||
{{ course_card(course) }}
|
{{ course_card(course) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -3,38 +3,38 @@
|
|||||||
{% from "www/hackathons/macros/card.html" import hackathon_card %}
|
{% from "www/hackathons/macros/card.html" import hackathon_card %}
|
||||||
{% from "www/hackathons/macros/card.html" import null_card %}
|
{% from "www/hackathons/macros/card.html" import null_card %}
|
||||||
{% block head_include %}
|
{% block head_include %}
|
||||||
<meta name="description" content="{{ 'Hackathon' }}" />
|
<meta name="description" content="{{ 'Hackathon' }}" />
|
||||||
<meta name="keywords" content="An app that supports Communities." />
|
<meta name="keywords" content="An app that supports Communities." />
|
||||||
<style>
|
<style>
|
||||||
div.card-hero-img {
|
div.card-hero-img {
|
||||||
height: 220px;
|
height: 220px;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-color: rgb(250, 251, 252);
|
background-color: rgb(250, 251, 252);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-image-wrapper {
|
.card-image-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: 220px;
|
height: 220px;
|
||||||
background-color: rgb(250, 251, 252);
|
background-color: rgb(250, 251, 252);
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-body {
|
.image-body {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
color: #d1d8dd;
|
color: #d1d8dd;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
padding: 5rem 0 5rem 0;
|
padding: 5rem 0 5rem 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
@@ -50,12 +50,12 @@
|
|||||||
<div class='container'>
|
<div class='container'>
|
||||||
<div class="row mt-5">
|
<div class="row mt-5">
|
||||||
{% for hackathon in hackathons %}
|
{% for hackathon in hackathons %}
|
||||||
{{ hackathon_card(hackathon) }}
|
{{ hackathon_card(hackathon) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if hackathons %}
|
{% if hackathons %}
|
||||||
{% for n in range( (3 - (hackathons|length)) %3) %}
|
{% for n in range( (3 - (hackathons|length)) %3) %}
|
||||||
{{ null_card() }}
|
{{ null_card() }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user