Add Mastodon service page

This commit is contained in:
Râu Cao
2023-08-10 14:52:03 +02:00
parent e4242333d9
commit 3c1fe3396d
13 changed files with 1456 additions and 4 deletions

View File

@@ -0,0 +1,14 @@
class Services::MastodonController < Services::BaseController
before_action :authenticate_user!
before_action :require_service_available
def show
@service_enabled = current_user.services_enabled.include?(:mastodon)
end
private
def require_service_available
http_status :not_found unless Setting.ejabberd_enabled?
end
end

View File

@@ -3,7 +3,7 @@
<%= render MainSimpleComponent.new do %>
<section>
<p class="mb-6">
Chat with anyone on the open Jabber network. Message people directly, or
Chat with anyone on the open Jabber (XMPP) network. Message people directly, or
join public channels or private rooms.
</p>
</section>
@@ -37,9 +37,9 @@
<section>
<h3>Chat Apps</h3>
<p>
Use your Kosmos account with many different apps, and on any devices
you wish! When opening an app for the first time, just enter your
user address and password to log in.
Use your account with many different apps, and on any devices you wish!
When opening an app for the first time, just enter your user address and
password to log in.
</p>
</section>
<section>

View File

@@ -0,0 +1,206 @@
<%= render HeaderComponent.new(title: "Social") %>
<%= render MainSimpleComponent.new do %>
<section>
<p class="mb-6">
Follow and interact with anyone on the open social web, from your Kosmos Mastodon account.
</p>
</section>
<section data-controller="modal">
<h3>Your User Address</h3>
<p class="mb-6">
Others can follow you under this address:
</p>
<p data-controller="clipboard" class="flex gap-1 sm:w-2/5">
<input type="text" id="user_address" class="grow"
value=<%= current_user.address %> disabled="disabled"
data-clipboard-target="source" />
<button id="copy-user-address" class="btn-md btn-icon btn-outline shrink-0"
data-clipboard-target="trigger" data-action="clipboard#copy"
title="Copy to clipboard">
<span class="content-initial">
<%= render partial: "icons/copy", locals: { custom_class: "text-blue-600 h-4 w-4 inline" } %>
</span>
<span class="content-active hidden">
<%= render partial: "icons/check", locals: { custom_class: "text-blue-600 h-4 w-4 inline" } %>
</span>
</button>
<button class="btn-md btn-icon btn-outline shrink-0 w-auto"
data-action="click->modal#open" title="Show QR code">
<%= render partial: "icons/qr_code", locals: { custom_class: "text-blue-600 h-4 w-4 inline" } %>
</button>
</p>
<%= render QrCodeModalComponent.new(qr_content: current_user.address) %>
</section>
<section>
<h3>Social Apps</h3>
<p>
Use your Mastodon account with many different apps, and on any devices
you wish! When adding your account to an app, you will log in via <a
href="https://kosmos.social">kosmos.social</a>.
</p>
</section>
<section>
<h3>Recommended Apps</h3>
<div data-controller="tabs"
data-tabs-active-tab="-mb-px border-gray-200 border-l border-t border-r rounded-t text-indigo-600 hover:text-indigo-600"
data-tabs-inactive-tab="text-gray-500 hover:text-gray-700"
class="mb-12">
<ul class="list-reset flex mb-8 border-gray-200 border-b">
<li class="mr-2" data-tabs-target="tab" data-action="click->tabs#change">
<a href="#" class="bg-white inline-block py-2 px-4 font-semibold no-underline">
Web
</a>
</li>
<li class="mr-2" data-tabs-target="tab" data-action="click->tabs#change">
<a href="#" class="bg-white inline-block py-2 px-5 font-semibold no-underline">
Android
</a>
</li>
<li class="mr-2" data-tabs-target="tab" data-action="click->tabs#change">
<a href="#" class="bg-white inline-block py-2 px-4 font-semibold no-underline">
iOS
</a>
</li>
<li class="mr-2" data-tabs-target="tab" data-action="click->tabs#change">
<a href="#" class="bg-white inline-block py-2 px-4 font-semibold no-underline">
Linux
</a>
</li>
<li class="mr-2" data-tabs-target="tab" data-action="click->tabs#change">
<a href="#" class="bg-white inline-block py-2 px-4 font-semibold no-underline">
Windows
</a>
</li>
<li class="mr-2" data-tabs-target="tab" data-action="click->tabs#change">
<a href="#" class="bg-white inline-block py-2 px-4 font-semibold no-underline">
macOS
</a>
</li>
</ul>
<div class="hidden grid grid-cols-1 gap-6" data-tabs-target="panel">
<%= render AppInfoComponent.new(
name: "kosmos.social",
description: "The official Web app",
icon_path: "/img/logos/icon_mastodon-2.svg",
links: [
["Launch", "https://kosmos.social"]
]
) %>
<%= render AppInfoComponent.new(
name: "Elk",
description: " A nimble Mastodon web client",
icon_path: "/img/logos/icon_elk.svg",
links: [
["Launch", "https://elk.zone"],
["GitHub", "https://github.com/elk-zone/elk"]
]
) %>
<%= render AppInfoComponent.new(
name: "Sengi",
description: "A cross-platform app, inspired by TweetDeck",
icon_path: "/img/logos/icon_sengi.png",
links: [
["Website", "https://nicolasconstant.github.io/sengi/"],
["GitHub", "https://github.com/NicolasConstant/sengi"]
]
) %>
</div>
<div class="hidden grid grid-cols-1 gap-6" data-tabs-target="panel">
<%= render AppInfoComponent.new(
name: "Mastodon for Android",
description: "Android client by the Mastodon core team",
icon_path: "/img/logos/icon_mastodon-2.svg",
links: [
["Website", "https://joinmastodon.org/apps"],
["Google Play", "https://play.google.com/store/apps/details?id=org.joinmastodon.android"]
]
) %>
<%= render AppInfoComponent.new(
name: "Fedilab",
description: "Android client with many features",
icon_path: "/img/logos/icon_fedilab.png",
links: [
["Website", "https://fedilab.app"],
["Google Play", "https://play.google.com/store/apps/details?id=app.fedilab.android"],
["F-Droid", "https://f-droid.org/packages/fr.gouv.etalab.mastodon"],
]
) %>
<%= render AppInfoComponent.new(
name: "Megalodon",
description: "A popular fork of the official Android app",
icon_path: "/img/logos/icon_megalodon.png",
icon_fill_box: true,
links: [
["Website", "https://sk22.github.io/megalodon/"],
["Google Play", "https://play.google.com/store/apps/details?id=org.joinmastodon.android.sk"]
]
) %>
</div>
<div class="hidden grid grid-cols-1 gap-6" data-tabs-target="panel">
<%= render AppInfoComponent.new(
name: "Mastodon for iOS",
description: "iOS client by the Mastodon core team",
icon_path: "/img/logos/icon_mastodon-2.svg",
links: [
["Website", "https://joinmastodon.org/apps"],
["App Store", "https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974"]
]
) %>
<%= render AppInfoComponent.new(
name: "Ice Cubes",
description: "Slick, fast, open source, and with customizable UI",
icon_path: "/img/logos/icon_icecubes.png",
icon_fill_box: true,
links: [
["App Store", "https://apps.apple.com/us/app/ice-cubes-for-mastodon/id6444915884"],
["GitHub", "https://github.com/Dimillian/IceCubesApp"]
]
) %>
<%= render AppInfoComponent.new(
name: "Mammoth",
description: " Powerful, fast, feature-rich",
icon_path: "/img/logos/icon_mammoth.png",
links: [
["Website", "https://getmammoth.app/"],
["App Store", "https://apps.apple.com/app/mammoth-for-mastodon/id1667573899"]
]
) %>
</div>
<div class="hidden grid grid-cols-1 gap-6" data-tabs-target="panel">
<%= render AppInfoComponent.new(
name: "Tuba",
description: "A simple, fast Mastodon app for Linux (good on GNOME)",
icon_path: "/img/logos/icon_tuba.svg",
links: [
["Website", "https://tuba.geopjr.dev"],
["Flathub", "https://flathub.org/apps/dev.geopjr.Tuba"],
]
) %>
</div>
<div class="hidden grid grid-cols-1 gap-6" data-tabs-target="panel">
<%= render AppInfoComponent.new(
name: "Sengi",
description: "A cross-platform app, inspired by TweetDeck",
icon_path: "/img/logos/icon_sengi.png",
links: [
["Website", "https://nicolasconstant.github.io/sengi/"],
["GitHub", "https://github.com/NicolasConstant/sengi"]
]
) %>
</div>
<div class="hidden grid grid-cols-1 gap-6" data-tabs-target="panel">
<%= render AppInfoComponent.new(
name: "Mastonaut",
description: "Simple, elegant, and native Mastodon client for Mac",
icon_path: "/img/logos/icon_mastonaut.png",
links: [
["Launch", "https://www.mastonaut.app"],
["Mac App Store", "https://apps.apple.com/app/mastonaut/id1450757574"]
]
) %>
</div>
</div>
</section>
<% end %>