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