From c7a44a9d7b6a21e079bd99994ca3cd638ee040af Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Mon, 12 Feb 2024 21:30:38 -0500 Subject: [PATCH 1/7] allow 12 projects --- .../acf/group_61398a3f0b3ad.json | 348 +++++++++--------- 1 file changed, 172 insertions(+), 176 deletions(-) diff --git a/wp-content/themes/mediasanctuary/acf/group_61398a3f0b3ad.json b/wp-content/themes/mediasanctuary/acf/group_61398a3f0b3ad.json index 9cc90674d..40c6b01d5 100644 --- a/wp-content/themes/mediasanctuary/acf/group_61398a3f0b3ad.json +++ b/wp-content/themes/mediasanctuary/acf/group_61398a3f0b3ad.json @@ -1,177 +1,173 @@ { - "key": "group_61398a3f0b3ad", - "title": "Stories \/ Projects Section", - "fields": [ - { - "key": "field_61399a04cb51e", - "label": "Headline", - "name": "headline", - "type": "text", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "maxlength": "" - }, - { - "key": "field_61398daadca05", - "label": "Type", - "name": "type", - "type": "radio", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "choices": { - "stories": "Stories", - "projects": "Projects" - }, - "allow_null": 0, - "other_choice": 0, - "default_value": "", - "layout": "vertical", - "return_format": "value", - "save_other_choice": 0 - }, - { - "key": "field_61398e15dca06", - "label": "Projects", - "name": "projects", - "type": "repeater", - "instructions": "", - "required": 0, - "conditional_logic": [ - [ - { - "field": "field_61398daadca05", - "operator": "==", - "value": "projects" - } - ] - ], - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "collapsed": "", - "min": 3, - "max": 9, - "layout": "table", - "button_label": "Add Project", - "sub_fields": [ - { - "key": "field_61398e24dca07", - "label": "Project", - "name": "project", - "type": "post_object", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "post_type": [ - "project" - ], - "taxonomy": "", - "allow_null": 0, - "multiple": 0, - "return_format": "object", - "ui": 1 - } - ] - }, - { - "key": "field_61398e3ddca08", - "label": "Stories", - "name": "stories", - "type": "repeater", - "instructions": "", - "required": 0, - "conditional_logic": [ - [ - { - "field": "field_61398daadca05", - "operator": "==", - "value": "stories" - } - ] - ], - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "collapsed": "", - "min": 4, - "max": 12, - "layout": "table", - "button_label": "Add Story", - "sub_fields": [ - { - "key": "field_61398e3ddca09", - "label": "Story", - "name": "story", - "type": "post_object", - "instructions": "", - "required": 0, - "conditional_logic": [ - [ - { - "field": "field_61398daadca05", - "operator": "==", - "value": "stories" - } - ] - ], - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "post_type": [ - "post" - ], - "taxonomy": "", - "allow_null": 0, - "multiple": 0, - "return_format": "object", - "ui": 1 - } - ] - } - ], - "location": [ - [ - { - "param": "block", - "operator": "==", - "value": "acf\/storiesprojects" - } - ] - ], - "menu_order": 0, - "position": "normal", - "style": "default", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": "", - "active": true, - "description": "", - "modified": 1631164941 -} \ No newline at end of file + "key": "group_61398a3f0b3ad", + "title": "Stories / Projects Section", + "fields": [ + { + "key": "field_61399a04cb51e", + "label": "Headline", + "name": "headline", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "" + }, + { + "key": "field_61398daadca05", + "label": "Type", + "name": "type", + "type": "radio", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "choices": { + "stories": "Stories", + "projects": "Projects" + }, + "allow_null": 0, + "other_choice": 0, + "default_value": "", + "layout": "vertical", + "return_format": "value", + "save_other_choice": 0 + }, + { + "key": "field_61398e15dca06", + "label": "Projects", + "name": "projects", + "type": "repeater", + "instructions": "", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_61398daadca05", + "operator": "==", + "value": "projects" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "collapsed": "", + "min": 3, + "max": 12, + "layout": "table", + "button_label": "Add Project", + "sub_fields": [ + { + "key": "field_61398e24dca07", + "label": "Project", + "name": "project", + "type": "post_object", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "post_type": ["project"], + "taxonomy": "", + "allow_null": 0, + "multiple": 0, + "return_format": "object", + "ui": 1 + } + ] + }, + { + "key": "field_61398e3ddca08", + "label": "Stories", + "name": "stories", + "type": "repeater", + "instructions": "", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_61398daadca05", + "operator": "==", + "value": "stories" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "collapsed": "", + "min": 4, + "max": 12, + "layout": "table", + "button_label": "Add Story", + "sub_fields": [ + { + "key": "field_61398e3ddca09", + "label": "Story", + "name": "story", + "type": "post_object", + "instructions": "", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_61398daadca05", + "operator": "==", + "value": "stories" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "post_type": ["post"], + "taxonomy": "", + "allow_null": 0, + "multiple": 0, + "return_format": "object", + "ui": 1 + } + ] + } + ], + "location": [ + [ + { + "param": "block", + "operator": "==", + "value": "acf/storiesprojects" + } + ] + ], + "menu_order": 0, + "position": "normal", + "style": "default", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "modified": 1631164941 +} From 81f04e36cb8d10f73ff375d3fc332a5867c545cc Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Wed, 13 Mar 2024 13:40:48 -0400 Subject: [PATCH 2/7] add qrcode wp cli command --- .../themes/mediasanctuary/lib/qrcode.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/wp-content/themes/mediasanctuary/lib/qrcode.php b/wp-content/themes/mediasanctuary/lib/qrcode.php index e13f1c6de..589362cc3 100644 --- a/wp-content/themes/mediasanctuary/lib/qrcode.php +++ b/wp-content/themes/mediasanctuary/lib/qrcode.php @@ -121,3 +121,38 @@ function qr_code_url($id) { // Done! return $qr_url; } + +if (class_exists('WP_CLI')) { + WP_CLI::add_command('qrcode', function($args, $assoc_args) { + if (count($args) < 2) { + WP_CLI::error("Usage: wp qrcode \"[QR code post title]\" [Target URL]"); + return false; + } + + list($title, $target_url) = $args; + + $id = wp_insert_post([ + 'post_title' => $title, + 'post_status' => 'publish', + 'post_type' => 'qrcode' + ]); + $redirect_url = get_permalink($id); + $image_url = qr_code_url($id); + + if ($assoc_args['format'] == 'json') { + echo wp_json_encode([ + 'id' => $id, + 'title' => $title, + 'target_url' => $target_url, + 'redirect_url' => $redirect_url, + 'image_url' => $image_url + ], JSON_PRETTY_PRINT); + } else { + WP_CLI::success("Created QR code \"$title\" (post ID $id) redirecting to $target_url"); + WP_CLI::log("Redirect URL: $redirect_url"); + WP_CLI::log("Image URL: $image_url"); + } + + return true; + }); +} From 846814f40cb43e8b368c56effb690fff58a0d6d3 Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Wed, 13 Mar 2024 13:44:59 -0400 Subject: [PATCH 3/7] upgrade node.js used in main workflow --- .github/workflows/main.yml | 66 ++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 296036280..d814229c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,43 +1,39 @@ name: Deploy to dev on: - push: - branches: [ main ] + push: + branches: [main] jobs: - deploy: - runs-on: ubuntu-latest + deploy: + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - name: Install dependencies + run: | + cd wp-content/themes/mediasanctuary + npm install - - uses: actions/setup-node@v2 - with: - node-version: '14' + - name: Build + run: | + cd wp-content/themes/mediasanctuary + npm run build - - name: Install dependencies - run: | - cd wp-content/themes/mediasanctuary - npm install - - - name: Build - run: | - cd wp-content/themes/mediasanctuary - npm run build - - - name: Sync - env: - dest: 'devmediasan@claudette.mayfirst.org:/home/members/nyma/sites/dev.mediasanctuary.org/web/wp-content/' - run: | - echo "${{secrets.DEPLOY_KEY}}" > deploy_key - chmod 600 ./deploy_key - rsync \ - --rsh='ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ - --delete \ - --checksum \ - --recursive \ - --verbose \ - --human-readable \ - --filter='P uploads' \ - --exclude wp-content/uploads \ - ./wp-content/ ${{env.dest}} + - name: Sync + env: + dest: "devmediasan@claudette.mayfirst.org:/home/members/nyma/sites/dev.mediasanctuary.org/web/wp-content/" + run: | + echo "${{secrets.DEPLOY_KEY}}" > deploy_key + chmod 600 ./deploy_key + rsync \ + --rsh='ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ + --delete \ + --checksum \ + --recursive \ + --verbose \ + --human-readable \ + --filter='P uploads' \ + --exclude wp-content/uploads \ + ./wp-content/ ${{env.dest}} From 3f45c829fff4610dbe6fa05952c2e740d67d4698 Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Wed, 13 Mar 2024 13:45:32 -0400 Subject: [PATCH 4/7] upgrade node.js used in production workflow --- .github/workflows/production.yml | 66 +++++++++++++++----------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 70baa47e1..1b0108653 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -1,43 +1,39 @@ name: Deploy to www on: - push: - branches: [ production ] + push: + branches: [production] jobs: - deploy: - runs-on: ubuntu-latest + deploy: + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - name: Install dependencies + run: | + cd wp-content/themes/mediasanctuary + npm install - - uses: actions/setup-node@v2 - with: - node-version: '14' + - name: Build + run: | + cd wp-content/themes/mediasanctuary + npm run build - - name: Install dependencies - run: | - cd wp-content/themes/mediasanctuary - npm install - - - name: Build - run: | - cd wp-content/themes/mediasanctuary - npm run build - - - name: Sync - env: - dest: 'mswww@claudette.mayfirst.org:/home/members/nyma/sites/new.mediasanctuary.org/web/wp-content/' - run: | - echo "${{secrets.PROD_DEPLOY_KEY}}" > deploy_key - chmod 600 ./deploy_key - rsync \ - --rsh='ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ - --delete \ - --checksum \ - --recursive \ - --verbose \ - --human-readable \ - --filter='P uploads' \ - --exclude wp-content/uploads \ - ./wp-content/ ${{env.dest}} + - name: Sync + env: + dest: "mswww@claudette.mayfirst.org:/home/members/nyma/sites/new.mediasanctuary.org/web/wp-content/" + run: | + echo "${{secrets.PROD_DEPLOY_KEY}}" > deploy_key + chmod 600 ./deploy_key + rsync \ + --rsh='ssh -i ./deploy_key -o StrictHostKeyChecking=no' \ + --delete \ + --checksum \ + --recursive \ + --verbose \ + --human-readable \ + --filter='P uploads' \ + --exclude wp-content/uploads \ + ./wp-content/ ${{env.dest}} From 028669d93221c5d4e0ee20e593312ac1d48c7e90 Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Wed, 13 Mar 2024 15:03:32 -0400 Subject: [PATCH 5/7] wp cli format option for qr codes --- .../themes/mediasanctuary/lib/qrcode.php | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/wp-content/themes/mediasanctuary/lib/qrcode.php b/wp-content/themes/mediasanctuary/lib/qrcode.php index 589362cc3..02fdf22be 100644 --- a/wp-content/themes/mediasanctuary/lib/qrcode.php +++ b/wp-content/themes/mediasanctuary/lib/qrcode.php @@ -139,18 +139,28 @@ function qr_code_url($id) { $redirect_url = get_permalink($id); $image_url = qr_code_url($id); - if ($assoc_args['format'] == 'json') { + if (empty($assoc_args['format'])) { + WP_CLI::success("Created QR code \"$title\" (post ID $id)"); + WP_CLI::log("Image URL: $image_url"); + WP_CLI::log("Redirect URL: $redirect_url"); + WP_CLI::log("Target URL: $target_url"); + } else if ($assoc_args['format'] == 'json') { echo wp_json_encode([ 'id' => $id, 'title' => $title, - 'target_url' => $target_url, + 'image_url' => $image_url, 'redirect_url' => $redirect_url, - 'image_url' => $image_url + 'target_url' => $target_url ], JSON_PRETTY_PRINT); - } else { - WP_CLI::success("Created QR code \"$title\" (post ID $id) redirecting to $target_url"); - WP_CLI::log("Redirect URL: $redirect_url"); - WP_CLI::log("Image URL: $image_url"); + } else if ($assoc_args['format'] == 'csv') { + $stdout = fopen('php://output', 'w'); + fputcsv($stdout, [ + $id, + $title, + $image_url, + $redirect_url, + $target_url + ]); } return true; From 9ff1c6dfdfe3cf450e554264280ea3ad98c3a8c4 Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Wed, 13 Mar 2024 21:29:48 -0400 Subject: [PATCH 6/7] actually set the qr target url --- wp-content/themes/mediasanctuary/lib/qrcode.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-content/themes/mediasanctuary/lib/qrcode.php b/wp-content/themes/mediasanctuary/lib/qrcode.php index 02fdf22be..4700e2595 100644 --- a/wp-content/themes/mediasanctuary/lib/qrcode.php +++ b/wp-content/themes/mediasanctuary/lib/qrcode.php @@ -136,6 +136,8 @@ function qr_code_url($id) { 'post_status' => 'publish', 'post_type' => 'qrcode' ]); + update_post_meta($id, 'redirect_url', $target_url); + $redirect_url = get_permalink($id); $image_url = qr_code_url($id); From e143e63fbd80cc317e89dbf86ee027b30b499615 Mon Sep 17 00:00:00 2001 From: Dan Phiffer Date: Wed, 13 Mar 2024 21:30:12 -0400 Subject: [PATCH 7/7] styled eat template page --- .../css/pages/_eco-art-trail.scss | 10 +++++ .../mediasanctuary/css/pages/_pages.scss | 1 + .../page-templates/eco-art-trail.php | 45 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 wp-content/themes/mediasanctuary/css/pages/_eco-art-trail.scss create mode 100644 wp-content/themes/mediasanctuary/page-templates/eco-art-trail.php diff --git a/wp-content/themes/mediasanctuary/css/pages/_eco-art-trail.scss b/wp-content/themes/mediasanctuary/css/pages/_eco-art-trail.scss new file mode 100644 index 000000000..bd1679820 --- /dev/null +++ b/wp-content/themes/mediasanctuary/css/pages/_eco-art-trail.scss @@ -0,0 +1,10 @@ +body.page-template-eco-art-trail { + background-color: $c-asphalt; + color: $c-white; + + .content { + max-width: 700px; + margin-left: auto; + margin-right: auto; + } +} \ No newline at end of file diff --git a/wp-content/themes/mediasanctuary/css/pages/_pages.scss b/wp-content/themes/mediasanctuary/css/pages/_pages.scss index 17206ba46..fc671beb0 100644 --- a/wp-content/themes/mediasanctuary/css/pages/_pages.scss +++ b/wp-content/themes/mediasanctuary/css/pages/_pages.scss @@ -4,3 +4,4 @@ @import 'search'; @import '404'; @import 'events'; +@import 'eco-art-trail'; \ No newline at end of file diff --git a/wp-content/themes/mediasanctuary/page-templates/eco-art-trail.php b/wp-content/themes/mediasanctuary/page-templates/eco-art-trail.php new file mode 100644 index 000000000..55e9e31d2 --- /dev/null +++ b/wp-content/themes/mediasanctuary/page-templates/eco-art-trail.php @@ -0,0 +1,45 @@ + + + + + + + + + + + + + > +
+
+
+
+
+ +

+ + +
+
+
+
+ +
+ + \ No newline at end of file