From 76a3279e9a885664624e9d9aa5cf39a1fc06f1d7 Mon Sep 17 00:00:00 2001 From: lwolff98 Date: Fri, 29 Nov 2024 14:44:04 -0500 Subject: [PATCH] add resource fields to listings --- .../Airtable/Sync/ListingController.php | 8 ++++ ...185200_add_resource_fields_to_listings.php | 38 +++++++++++++++++++ resources/views/projects/single.blade.php | 27 +++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 database/migrations/2024_11_29_185200_add_resource_fields_to_listings.php diff --git a/app/Http/Controllers/Airtable/Sync/ListingController.php b/app/Http/Controllers/Airtable/Sync/ListingController.php index 9af053a..c76bb00 100644 --- a/app/Http/Controllers/Airtable/Sync/ListingController.php +++ b/app/Http/Controllers/Airtable/Sync/ListingController.php @@ -109,6 +109,14 @@ public function syncListing () { $list->founded = @$l["fields"]["Founded"]; $list->closed = @$l["fields"]["Closed"]; + $list->mastodon = @$l["fields"]["Mastodon"]; + $list->rss = @$l["fields"]["RSS"]; + $list->bluesky_url = @$l["fields"]["Bluesky URL"]; + $list->threads = @$l["fields"]["Threads"]; + $list->whatsapp_community_url = @$l["fields"]["Whatsapp Community URL"]; + $list->telegram_community_url = @$l["fields"]["Telegram Community URL"]; + $list->discord_url = @$l["fields"]["Discord URL"]; + $list->shutdown_reason = @$l["fields"]["If shutdown,what happened?"]; $list->postmortem = @$l["fields"]["Postmortem"]; $list->host_organization_url = @$l["fields"]["Host organization URL"]; diff --git a/database/migrations/2024_11_29_185200_add_resource_fields_to_listings.php b/database/migrations/2024_11_29_185200_add_resource_fields_to_listings.php new file mode 100644 index 0000000..2af3b3c --- /dev/null +++ b/database/migrations/2024_11_29_185200_add_resource_fields_to_listings.php @@ -0,0 +1,38 @@ +string('mastodon')->after('blog_url')->nullable(); + $table->string('rss')->after('blog_url')->nullable(); + $table->string('bluesky_url')->after('blog_url')->nullable(); + $table->string('threads')->after('blog_url')->nullable(); + $table->string('whatsapp_community_url')->after('blog_url')->nullable(); + $table->string('telegram_community_url')->after('blog_url')->nullable(); + $table->string('discord_url')->after('blog_url')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('listings', function (Blueprint $table) { + // + }); + } +}; diff --git a/resources/views/projects/single.blade.php b/resources/views/projects/single.blade.php index ab85bc5..f7c2506 100644 --- a/resources/views/projects/single.blade.php +++ b/resources/views/projects/single.blade.php @@ -433,6 +433,33 @@ @if(!empty(@$project->blog_url))
  • Blog: {{ @$project->blog_url }}
  • @endif + @if(!empty(@$project->tiktok_url)) +
  • TikTok: {{ @$project->tiktok_url }}
  • + @endif + @if(!empty(@$project->slack_url)) +
  • Slack: {{ @$project->slack_url }}
  • + @endif + @if(!empty(@$project->mastodon)) +
  • Mastodon: {{ @$project->mastodon }}
  • + @endif + @if(!empty(@$project->threads)) +
  • Threads: {{ @$project->threads }}
  • + @endif + @if(!empty(@$project->bluesky_url)) +
  • BlueSky: {{ @$project->bluesky_url }}
  • + @endif + @if(!empty(@$project->rss)) +
  • RSS: {{ @$project->rss }}
  • + @endif + @if(!empty(@$project->whatsapp_community_url)) +
  • Whatsapp: {{ @$project->whatsapp_community_url }}
  • + @endif + @if(!empty(@$project->telegram_community_url)) +
  • Telegram: {{ @$project->telegram_community_url }}
  • + @endif + @if(!empty(@$project->discord_url)) +
  • Discord: {{ @$project->discord_url }}
  • + @endif @if(!empty(@$project->parent_id))
  • Parent Org: {{ @$project->parent->name }}
  • @endif