From 680dd9354d6fe549d0235205be94eacbe02e73d9 Mon Sep 17 00:00:00 2001 From: Rich McMillen Date: Mon, 13 Sep 2021 23:50:57 -0400 Subject: [PATCH 01/14] feat(nav): add open organizing positions link --- html-templates/includes/site.nav-sitelinks.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/html-templates/includes/site.nav-sitelinks.tpl b/html-templates/includes/site.nav-sitelinks.tpl index 18d3d382..48b07dba 100644 --- a/html-templates/includes/site.nav-sitelinks.tpl +++ b/html-templates/includes/site.nav-sitelinks.tpl @@ -23,6 +23,7 @@ {_ "Mission"} {_ "Code of Conduct"} {_ "Organizing Team"} + {_ "Join the Organizing Team"} {_ "Contact Us"} \ No newline at end of file From dda72ad0825b9b01e0ccc10ccb70959cff403218 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Tue, 14 Sep 2021 02:08:14 +0000 Subject: [PATCH 02/14] fix(script): update case syntax --- script/studio | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/studio b/script/studio index ab59bc49..2aa1312a 100755 --- a/script/studio +++ b/script/studio @@ -42,16 +42,17 @@ if [ "$(docker ps -aq -f name="${STUDIO_NAME}")" ]; then echo docker attach "${STUDIO_NAME}" launch_studio=false - break;; + ;; s|S) echo "==> studio: stopping existing container…" docker stop "${STUDIO_NAME}" > /dev/null - break;; + ;; n|N) echo "==> studio: doing nothing with existing container… an error is likely to occur" - break ;; + ;; *) - echo "==> studio: $choice is invalid";; + echo "==> studio: $choice is invalid" + ;; esac done fi From dc2a76e18021599f733f3d7cf9ea922a2a88630f Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Tue, 14 Sep 2021 04:40:08 +0000 Subject: [PATCH 03/14] feat(discourse): add env config --- php-config/DiscourseKids.config.php | 3 +++ php-config/DiscourseSteering.config.php | 3 +++ php-config/Emergence/Connectors/Discourse.config.php | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 php-config/DiscourseKids.config.php create mode 100644 php-config/DiscourseSteering.config.php create mode 100644 php-config/Emergence/Connectors/Discourse.config.php diff --git a/php-config/DiscourseKids.config.php b/php-config/DiscourseKids.config.php new file mode 100644 index 00000000..297987db --- /dev/null +++ b/php-config/DiscourseKids.config.php @@ -0,0 +1,3 @@ + Date: Tue, 14 Sep 2021 14:51:06 +0000 Subject: [PATCH 04/14] feat: configure meetup group slug --- php-config/Emergence/Meetup/Connector.config.php | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 php-config/Emergence/Meetup/Connector.config.php diff --git a/php-config/Emergence/Meetup/Connector.config.php b/php-config/Emergence/Meetup/Connector.config.php new file mode 100644 index 00000000..fd86aff9 --- /dev/null +++ b/php-config/Emergence/Meetup/Connector.config.php @@ -0,0 +1,9 @@ + Date: Tue, 14 Sep 2021 18:59:54 +0000 Subject: [PATCH 05/14] feat: add mailchimp event handler --- .../registerComplete/mailchimp.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 event-handlers/Emergence/People/RegistrationRequestHandler/registerComplete/mailchimp.php diff --git a/event-handlers/Emergence/People/RegistrationRequestHandler/registerComplete/mailchimp.php b/event-handlers/Emergence/People/RegistrationRequestHandler/registerComplete/mailchimp.php new file mode 100644 index 00000000..96d25d12 --- /dev/null +++ b/event-handlers/Emergence/People/RegistrationRequestHandler/registerComplete/mailchimp.php @@ -0,0 +1,16 @@ + '411e7bdbef', + 'email' => [ + 'email' => $_EVENT['User']->Email + ], + 'merge_vars' => [ + 'FNAME' => $_EVENT['User']->FirstName, + 'LNAME' => $_EVENT['User']->LastName + ], + 'double_optin' => false, + 'replace_interests' => false, + 'send_welcome' => false +]); From 32b083d22ea77e8733ce9fc63932284e0b168cdb Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Tue, 14 Sep 2021 19:49:34 +0000 Subject: [PATCH 06/14] refactor: update projects.csv upstream in laddr --- site-root/projects.csv.php | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 site-root/projects.csv.php diff --git a/site-root/projects.csv.php b/site-root/projects.csv.php deleted file mode 100644 index 9d2f9d0b..00000000 --- a/site-root/projects.csv.php +++ /dev/null @@ -1,24 +0,0 @@ - array_map(function($Project) { - preg_match('/^\s*[^*#]\s*\w.*/m', $Project->README, $matches); - return array( - 'name' => $Project->Title - ,'description' => trim($matches[0]) - ,'link_url' => $Project->UsersUrl - ,'code_url' => $Project->DevelopersUrl - ,'chat_channel' => $Project->ChatChannel - ,'tags' => implode(',', - array_map( - function($Tag) { - return $Tag->UnprefixedTitle; - } - ,$Project->TopicTags - ) - ) - ,'status' => $Project->Stage - ); - }, Laddr\Project::getAll()) -)); \ No newline at end of file From 773c9e4c925aa901cbc220bc138aa79b68d3b022 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Tue, 14 Sep 2021 19:49:58 +0000 Subject: [PATCH 07/14] feat: add discoure topic wrapping prototype --- html-templates/discourse/topic.tpl | 32 ++++++++++++++++++++++++++++++ site-root/discourse/topic.php | 15 ++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 html-templates/discourse/topic.tpl create mode 100644 site-root/discourse/topic.php diff --git a/html-templates/discourse/topic.tpl b/html-templates/discourse/topic.tpl new file mode 100644 index 00000000..acfc69b9 --- /dev/null +++ b/html-templates/discourse/topic.tpl @@ -0,0 +1,32 @@ +{extends designs/site.tpl} + +{block title}{$fancy_title|escape} — {$dwoo.parent}{/block} + +{block content} +

{$fancy_title|escape}

+ {$post_stream.posts[0].cooked} + +
+ {$url = "http://forum.codeforphilly.org/t/$slug/$id"} + Edit or discuss this page at {$url|escape} + + +
+ +
+ + + +{/block} diff --git a/site-root/discourse/topic.php b/site-root/discourse/topic.php new file mode 100644 index 00000000..2310a8dc --- /dev/null +++ b/site-root/discourse/topic.php @@ -0,0 +1,15 @@ + Date: Tue, 14 Sep 2021 19:50:05 +0000 Subject: [PATCH 08/14] feat: enable cors --- php-config/Site.config.d/cors.php | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 php-config/Site.config.d/cors.php diff --git a/php-config/Site.config.d/cors.php b/php-config/Site.config.d/cors.php new file mode 100644 index 00000000..736c07fc --- /dev/null +++ b/php-config/Site.config.d/cors.php @@ -0,0 +1,4 @@ + Date: Tue, 14 Sep 2021 19:50:15 +0000 Subject: [PATCH 09/14] feat: enable ActiveRecord caching in production --- php-config/ActiveRecord.config.php | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 php-config/ActiveRecord.config.php diff --git a/php-config/ActiveRecord.config.php b/php-config/ActiveRecord.config.php new file mode 100644 index 00000000..aaf049c8 --- /dev/null +++ b/php-config/ActiveRecord.config.php @@ -0,0 +1,4 @@ + Date: Tue, 14 Sep 2021 19:50:26 +0000 Subject: [PATCH 10/14] feat: configure contact form email target --- php-config/ContactRequestHandler.config.d/email-alerts.php | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 php-config/ContactRequestHandler.config.d/email-alerts.php diff --git a/php-config/ContactRequestHandler.config.d/email-alerts.php b/php-config/ContactRequestHandler.config.d/email-alerts.php new file mode 100644 index 00000000..e2b8483b --- /dev/null +++ b/php-config/ContactRequestHandler.config.d/email-alerts.php @@ -0,0 +1,3 @@ + Date: Tue, 14 Sep 2021 20:12:54 +0000 Subject: [PATCH 11/14] feat: configure commenting to require staff access --- .../Emergence/Comments/CommentsRequestHandler.config.php | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 php-config/Emergence/Comments/CommentsRequestHandler.config.php diff --git a/php-config/Emergence/Comments/CommentsRequestHandler.config.php b/php-config/Emergence/Comments/CommentsRequestHandler.config.php new file mode 100644 index 00000000..266d654f --- /dev/null +++ b/php-config/Emergence/Comments/CommentsRequestHandler.config.php @@ -0,0 +1,4 @@ + Date: Tue, 14 Sep 2021 20:13:07 +0000 Subject: [PATCH 12/14] feat: configure twitter links --- php-config/RemoteSystems/Twitter.config.php | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 php-config/RemoteSystems/Twitter.config.php diff --git a/php-config/RemoteSystems/Twitter.config.php b/php-config/RemoteSystems/Twitter.config.php new file mode 100644 index 00000000..b0277346 --- /dev/null +++ b/php-config/RemoteSystems/Twitter.config.php @@ -0,0 +1,4 @@ + Date: Tue, 14 Sep 2021 20:13:34 +0000 Subject: [PATCH 13/14] feat: add manual newsletter sender --- site-root/send-newsletter.php | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 site-root/send-newsletter.php diff --git a/site-root/send-newsletter.php b/site-root/send-newsletter.php new file mode 100644 index 00000000..11ae7e62 --- /dev/null +++ b/site-root/send-newsletter.php @@ -0,0 +1,71 @@ +requireAccountLevel('Developer'); + +#if ($_SERVER['REQUEST_METHOD'] != 'POST') { +# die('must be post'); +#} + +header('X-Accel-Buffering: no'); +header('Content-Type: text/plain; charset=utf-8'); +ob_end_flush(); +set_time_limit(0); + + +// select newsletter +$newsletterDate = '2018-05-21'; + + +// get body markup +if (!$mjmlNode = Site::resolvePath("newsletters/$newsletterDate/index.mjml")) { + RequestHandler::throwNotFoundError('Newsletter markup not found'); +} + +$html = shell_exec('hab pkg exec jarvus/mjml mjml -r '.escapeshellarg($mjmlNode->RealPath)); + +$url = Emergence\Util\Url::buildAbsolute(['newsletters', $newsletterDate, '']); +$html = str_replace('[[SHORT_PERMALINK]]', $url, $html); + + +// get recipients +$Users = Emergence\People\User::getAllByWhere([ + 'Newsletter' => true, + 'Email IS NOT NULL' + + // toggle to test: + ,'Username' => [ + 'values' => ['chris', 'a_priori_rainbows', 'rmcmillen50', 'Tonimacattack'] + ] +]); +printf("Found %u subscribed users\n\n", count($Users)); + + +// send to each recipient +foreach ($Users as $i => $User) { + printf("Sending #%u to %s\n", $i+1, $User->EmailRecipient); + +# Emergence\Mailer\Mailer::send( +# $User->EmailRecipient, +## '🔔 Open Data, Open Source, Open this email! 🔔', +## '🚀 This weekend: Help a project lift off at our Civic Engagement Launchpad 🚀', +# '🎉 Celebrate a successful launch: it’s time for demo night! 🎉', +# $html, +# 'Code for Philly ' +# ); + + ob_flush(); + flush(); +} + + +printf("\n\nDone\n"); From 3b5d85053e2f502e6b023849190089868de28a26 Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Tue, 28 Sep 2021 03:01:14 +0000 Subject: [PATCH 14/14] chore(deps): bump laddr to v3.0.9 --- .holo/sources/laddr.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.holo/sources/laddr.toml b/.holo/sources/laddr.toml index 1bf03115..ff6db4b6 100644 --- a/.holo/sources/laddr.toml +++ b/.holo/sources/laddr.toml @@ -1,3 +1,3 @@ [holosource] url = "https://github.com/CodeForPhilly/laddr" -ref = "refs/tags/v3.0.7" +ref = "refs/tags/v3.0.9"