From 8614e2f12bcd65f338b689c1532c4e51f03cea22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A2u=20Cao?=
Date: Sun, 13 Aug 2023 17:24:10 +0200
Subject: [PATCH] Use service configs on dashboard
Only show enabled services, and use the URLs from the various configs.
---
app/views/dashboard/index.html.erb | 169 ++++++++++++++++-------------
1 file changed, 92 insertions(+), 77 deletions(-)
diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb
index a1ac038..5d22d42 100644
--- a/app/views/dashboard/index.html.erb
+++ b/app/views/dashboard/index.html.erb
@@ -7,73 +7,85 @@
services:
-
- <%= link_to services_chat_path,
- class: "block h-full px-6 py-6 rounded-md" do %>
-
Chat
-
- Federated chat rooms and instant messaging
-
- <% end %>
-
-
- <%= link_to "#{Setting.discourse_public_url}/session/sso?return_path=/",
- class: "block h-full px-6 py-6 rounded-md" do %>
-
Discourse
-
- Kosmos community forums and user support/help site
-
- <% end %>
-
-
-
- <%= link_to services_lightning_index_path,
- class: "block h-full px-6 py-6 rounded-md" do %>
-
Lightning Network
-
- Send and receive sats over the Bitcoin Lightning Network
-
- <% end %>
-
-
- <%= link_to "https://gitea.kosmos.org",
- class: "block h-full px-6 py-6 rounded-md" do %>
-
Gitea
-
- Code hosting and collaboration for software projects
-
- <% end %>
-
-
- <%= link_to "https://drone.kosmos.org",
- class: "block h-full px-6 py-6 rounded-md" do %>
-
Drone CI
-
- Continuous integration for software projects on Gitea
-
- <% end %>
-
- <% if Setting.remotestorage_enabled? && Flipper.enabled?(:remotestorage, current_user) %>
+ <% if Setting.ejabberd_enabled? %>
+
+ <%= link_to services_chat_path,
+ class: "block h-full px-6 py-6 rounded-md" do %>
+
Chat
+
+ Federated chat rooms and instant messaging
+
+ <% end %>
+
+ <% end %>
+ <% if Setting.mastodon_enabled? %>
+
+ <%= link_to services_mastodon_path, class: "block h-full px-6 py-6 rounded-md" do %>
+
Mastodon
+
+ Your account on the Open Social Web
+
+ <% end %>
+
+ <% end %>
+ <% if Setting.discourse_enabled? %>
+
+ <%= link_to "#{Setting.discourse_public_url}/session/sso?return_path=/",
+ class: "block h-full px-6 py-6 rounded-md" do %>
+
Discourse
+
+ Kosmos community forums and user support/help site
+
+ <% end %>
+
+ <% end %>
+ <% if Setting.lndhub_enabled? %>
+
+ <%= link_to services_lightning_index_path,
+ class: "block h-full px-6 py-6 rounded-md" do %>
+
Lightning Network
+
+ Send and receive sats over the Bitcoin Lightning Network
+
+ <% end %>
+
+ <% end %>
+ <% if Setting.gitea_enabled? %>
+
+ <%= link_to Setting.gitea_public_url,
+ class: "block h-full px-6 py-6 rounded-md" do %>
+
Gitea
+
+ Code hosting and collaboration for software projects
+
+ <% end %>
+
+ <% end %>
+ <% if Setting.droneci_enabled? %>
+
+ <%= link_to Setting.droneci_public_url,
+ class: "block h-full px-6 py-6 rounded-md" do %>
+
Drone CI
+
+ Continuous integration for software projects on Gitea
+
+ <% end %>
+
+ <% end %>
+ <% if Setting.remotestorage_enabled? &&
+ Flipper.enabled?(:remotestorage, current_user) %>
<%= link_to services_storage_path,
class: "block h-full px-6 py-6 rounded-md" do %>
@@ -84,16 +96,19 @@
<% end %>
<% end %>
-
-
-
-
-
-
-
-
-
-
+ <% if Setting.mediawiki_enabled? %>
+
+ <% end %>
<% end %>