From 96ffc669d7db7ccca291ea9d49002b2af4775671 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Mon, 24 Apr 2023 16:07:14 +0200 Subject: [PATCH] Add logo of popular brands --- assets/img/brands/gitea.svg | 12 ++++++++++++ assets/img/brands/github.svg | 1 + assets/img/brands/gitlab.svg | 1 + assets/img/brands/google.svg | 1 + assets/img/brands/microsoft.svg | 1 + src/data/provider.rs | 14 ++++++++++++++ templates/settings/providers_list.html | 12 +++++++++++- 7 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 assets/img/brands/gitea.svg create mode 100644 assets/img/brands/github.svg create mode 100644 assets/img/brands/gitlab.svg create mode 100644 assets/img/brands/google.svg create mode 100644 assets/img/brands/microsoft.svg diff --git a/assets/img/brands/gitea.svg b/assets/img/brands/gitea.svg new file mode 100644 index 0000000..b07d2ed --- /dev/null +++ b/assets/img/brands/gitea.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/img/brands/github.svg b/assets/img/brands/github.svg new file mode 100644 index 0000000..d5e6491 --- /dev/null +++ b/assets/img/brands/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/brands/gitlab.svg b/assets/img/brands/gitlab.svg new file mode 100644 index 0000000..95a22f1 --- /dev/null +++ b/assets/img/brands/gitlab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/brands/google.svg b/assets/img/brands/google.svg new file mode 100644 index 0000000..37bcbbc --- /dev/null +++ b/assets/img/brands/google.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/brands/microsoft.svg b/assets/img/brands/microsoft.svg new file mode 100644 index 0000000..13307b7 --- /dev/null +++ b/assets/img/brands/microsoft.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/data/provider.rs b/src/data/provider.rs index ab51109..ea237cb 100644 --- a/src/data/provider.rs +++ b/src/data/provider.rs @@ -27,6 +27,20 @@ pub struct Provider { pub configuration_url: String, } +impl Provider { + /// Get the URL where the logo can be located + pub fn logo_url(&self) -> &str { + match self.logo.as_str() { + "gitea" => "/assets/img/brands/gitea.svg", + "gitlab" => "/assets/img/brands/gitlab.svg", + "github" => "/assets/img/brands/github.svg", + "microsoft" => "/assets/img/brands/microsoft.svg", + "google" => "/assets/img/brands/google.svg", + s => s, + } + } +} + impl PartialEq for Provider { fn eq(&self, other: &Self) -> bool { self.id.eq(&other.id) diff --git a/templates/settings/providers_list.html b/templates/settings/providers_list.html index 74ec61e..f463b0b 100644 --- a/templates/settings/providers_list.html +++ b/templates/settings/providers_list.html @@ -1,9 +1,16 @@ {% extends "base_settings_page.html" %} {% block content %} - + + +
+ @@ -13,6 +20,9 @@ {% for c in providers %} +
ID Name Configuration URL
+ {{ c.name }} logo + {{ c.id.0 }} {{ c.name }}