Compare commits

..

No commits in common. "3c365c08249fbc67decb6d4dfc5a9219e5cc9638" and "a54b1b1108341c1fecfa4db4728ae9152e7b2e23" have entirely different histories.

9 changed files with 44 additions and 108 deletions

View file

@ -80,13 +80,6 @@ class Service(ServalaModelMixin, models.Model):
def __str__(self): def __str__(self):
return self.name return self.name
@property
def featured_links(self):
"""Return external links marked as featured."""
if not self.external_links:
return []
return [link for link in self.external_links if link.get("featured")]
def validate_dict(data, required_fields=None, allow_empty=True): def validate_dict(data, required_fields=None, allow_empty=True):
if not data: if not data:

View file

@ -1,22 +1,21 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% load static i18n %} {% load static i18n %}
{% load allauth account socialaccount %} {% load allauth account socialaccount %}
{% block html_title %} {% block html_title %}
{% translate "Sign in" %} {% translate "Sign in" %}
{% endblock html_title %} {% endblock html_title %}
{% block page_title %} {% block page_title %}
{% translate "Welcome to Servala" %} {% translate "Welcome to Servala" %}
{% endblock page_title %} {% endblock page_title %}
{% block card_header %} {% block card_header %}
<div class="card-header text-center py-4" <div class="card-header text-center py-4" style="background: linear-gradient(135deg, var(--bs-primary), #8B5CF6); border-radius: 0.5rem 0.5rem 0 0;">
style="background: linear-gradient(135deg, var(--bs-primary), #8B5CF6); <img src="{% static 'img/Servala-4.png' %}" alt="Servala" class="mb-3" style="height: 70px;">
border-radius: 0.5rem 0.5rem 0 0">
<img src="{% static 'img/Servala-4.png' %}"
alt="Servala"
class="mb-3"
style="height: 70px">
</div> </div>
{% endblock card_header %} {% endblock card_header %}
{% block card_content %} {% block card_content %}
<!-- Main Sign In Section --> <!-- Main Sign In Section -->
{% if SOCIALACCOUNT_ENABLED %} {% if SOCIALACCOUNT_ENABLED %}
@ -25,10 +24,9 @@
<div class="mb-4"> <div class="mb-4">
<div class="text-center mb-4"> <div class="text-center mb-4">
<h5 class="text-primary mb-2">{% translate "Ready to get started?" %}</h5> <h5 class="text-primary mb-2">{% translate "Ready to get started?" %}</h5>
<p class="text-muted mb-0"> <p class="text-muted mb-0">{% translate "Sign in to access your managed service instances and the Servala service catalog" %}</p>
{% translate "Sign in to access your managed service instances and the Servala service catalog" %}
</p>
</div> </div>
{% for provider in socialaccount_providers %} {% for provider in socialaccount_providers %}
{% provider_login_url provider process=process scope=scope auth_params=auth_params as href %} {% provider_login_url provider process=process scope=scope auth_params=auth_params as href %}
<form method="post" action="{{ href }}"> <form method="post" action="{{ href }}">
@ -37,9 +35,7 @@
<button type="submit" <button type="submit"
class="btn btn-primary btn-lg w-100 py-3 mb-4 fw-semibold" class="btn btn-primary btn-lg w-100 py-3 mb-4 fw-semibold"
title="{{ provider.name }}" title="{{ provider.name }}"
style="border-radius: 12px; style="border-radius: 12px; box-shadow: 0 4px 15px rgba(154, 99, 236, 0.2); background: linear-gradient(135deg, var(--bs-primary), #8B5CF6);">
box-shadow: 0 4px 15px rgba(154, 99, 236, 0.2);
background: linear-gradient(135deg, var(--bs-primary), #8B5CF6)">
<span>{% translate "Sign in with VSHN Account" %}</span> <span>{% translate "Sign in with VSHN Account" %}</span>
</button> </button>
</form> </form>
@ -47,6 +43,7 @@
</div> </div>
{% endif %} {% endif %}
{% endif %} {% endif %}
<!-- Feature Preview & Learn More Section --> <!-- Feature Preview & Learn More Section -->
<div class="mt-4 pt-3 border-top"> <div class="mt-4 pt-3 border-top">
<div class="row g-3 text-center"> <div class="row g-3 text-center">
@ -75,8 +72,8 @@
<i class="bi bi-info-circle" style="font-size: 1.2rem;"></i> <i class="bi bi-info-circle" style="font-size: 1.2rem;"></i>
</div> </div>
<small class="text-muted fw-medium"> <small class="text-muted fw-medium">
<a href="https://servala.com" <a href="https://servala.com"
target="_blank" target="_blank"
class="text-decoration-none text-muted"> class="text-decoration-none text-muted">
{% translate "Learn more" %} {% translate "Learn more" %}
<i class="bi bi-arrow-up-right ms-1" style="font-size: 0.7rem;"></i> <i class="bi bi-arrow-up-right ms-1" style="font-size: 0.7rem;"></i>
@ -85,6 +82,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Alternative Login Options (Admin) --> <!-- Alternative Login Options (Admin) -->
<div class="mt-4 pt-3 border-top text-center"> <div class="mt-4 pt-3 border-top text-center">
<small class="text-muted"> <small class="text-muted">
@ -98,6 +96,7 @@
</a> </a>
</small> </small>
</div> </div>
<div class="collapse mt-3" id="login-form"> <div class="collapse mt-3" id="login-form">
<div class="card bg-light border-0 shadow-sm" style="border-radius: 12px;"> <div class="card bg-light border-0 shadow-sm" style="border-radius: 12px;">
<div class="card-body p-4"> <div class="card-body p-4">

View file

@ -5,18 +5,13 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{% static 'mazer/compiled/css/app.css' %}"> <link rel="stylesheet" href="{% static 'mazer/compiled/css/app.css' %}">
<link rel="stylesheet" <link rel="stylesheet" href="{% static 'mazer/compiled/css/app-dark.css' %}">
href="{% static 'mazer/compiled/css/app-dark.css' %}">
<link rel="stylesheet" href="{% static 'mazer/compiled/css/iconly.css' %}"> <link rel="stylesheet" href="{% static 'mazer/compiled/css/iconly.css' %}">
<link rel="stylesheet" href="{% static 'css/servala.css' %}"> <link rel="stylesheet" href="{% static 'css/servala.css' %}">
<link rel="icon" type="image/x-icon" href="{% static 'img/favicon.ico' %}"> <link rel="icon" type="image/x-icon" href="{% static 'img/favicon.ico' %}">
<script src="{% static "js/htmx.min.js" %}" defer></script> <script src="{% static "js/htmx.min.js" %}" defer></script>
</head> </head>
<title> <title>{% block html_title %}Dashboard{% endblock html_title %} Servala</title>
{% block html_title %}
Dashboard
{% endblock html_title %}
Servala</title>
</head> </head>
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'> <body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
<script src="{% static 'mazer/static/js/initTheme.js' %}"></script> <script src="{% static 'mazer/static/js/initTheme.js' %}"></script>

View file

@ -26,24 +26,6 @@
<div class="row"> <div class="row">
<p>{{ service.description|default:"No description available."|urlize }}</p> <p>{{ service.description|default:"No description available."|urlize }}</p>
</div> </div>
{% if service.external_links %}
<div class="row mt-3">
<div class="col-12">
<h6 class="mb-3">{% translate "External Links" %}</h6>
<div class="d-flex flex-wrap gap-2">
{% for link in service.external_links %}
<a href="{{ link.url }}"
target="_blank"
rel="noopener noreferrer"
class="btn btn-outline-primary btn-sm">
{{ link.title }}
<i class="bi bi-box-arrow-up-right ms-1"></i>
</a>
{% endfor %}
</div>
</div>
</div>
{% endif %}
</div> </div>
</div> </div>
<div class="row"> <div class="row">

View file

@ -16,10 +16,10 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row service-cards-container"> <div class="row">
{% for service in services %} {% for service in services %}
<div class="col-6 col-lg-3 col-md-4"> <div class="col-6 col-lg-3 col-md-4">
<div class="card h-100 d-flex flex-column"> <div class="card">
<div class="card-header d-flex align-items-center"> <div class="card-header d-flex align-items-center">
{% if service.logo %} {% if service.logo %}
<img src="{{ service.logo.url }}" <img src="{{ service.logo.url }}"
@ -33,23 +33,11 @@
<small class="text-muted">{{ service.category }}</small> <small class="text-muted">{{ service.category }}</small>
</div> </div>
</div> </div>
<div class="card-body flex-grow-1"> <div class="card-body">
{% if service.description %}<p class="card-text">{{ service.description|urlize }}</p>{% endif %} {% if service.description %}<p class="card-text">{{ service.description|urlize }}</p>{% endif %}
</div> </div>
<div class="card-footer d-flex justify-content-between align-items-center gap-2"> <div class="card-footer d-flex justify-content-between">
{% if service.featured_links %} <span></span>
{% with featured_link=service.featured_links.0 %}
<a href="{{ featured_link.url }}"
target="_blank"
rel="noopener noreferrer"
class="btn btn-outline-primary">
{{ featured_link.title }}
<i class="bi bi-box-arrow-up-right ms-1"></i>
</a>
{% endwith %}
{% else %}
<span></span>
{% endif %}
<a href="{{ service.slug }}/" class="btn btn-light-primary">{% translate "View Availability" %}</a> <a href="{{ service.slug }}/" class="btn btn-light-primary">{% translate "View Availability" %}</a>
</div> </div>
</div> </div>

View file

@ -116,8 +116,7 @@
{% endblocktranslate %} {% endblocktranslate %}
</p> </p>
<div> <div>
<a href="{{ account_href }}" <a href="{{ account_href }}" target="_blank"
target="_blank"
class="btn btn-primary btn-lg icon icon-left btn-keycloak"> class="btn btn-primary btn-lg icon icon-left btn-keycloak">
<span class="mx-1">{% translate "VSHN Account Console" %}</span> <span class="mx-1">{% translate "VSHN Account Console" %}</span>
</a> </a>

View file

@ -1,29 +1,28 @@
<div class="alert alert-{{ message.tags }} alert-dismissible" <div class="alert alert-{{ message.tags }} alert-dismissible" id="auto-dismiss-alert-{{ forloop.counter0|default:'0' }}">
id="auto-dismiss-alert-{{ forloop.counter0|default:'0' }}">
{{ message }} {{ message }}
<button type="button" <button type="button"
class="btn-close" class="btn-close"
data-bs-dismiss="alert" data-bs-dismiss="alert"
aria-label="Close"></button> aria-label="Close"></button>
</div> </div>
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const alert = document.getElementById('auto-dismiss-alert-{{ forloop.counter0|default:' const alert = document.getElementById('auto-dismiss-alert-{{ forloop.counter0|default:'0' }}');
0 ' }}'); if (alert) {
if (alert) { setTimeout(function() {
setTimeout(function() { let opacity = 1;
let opacity = 1; const fadeOutInterval = setInterval(function() {
const fadeOutInterval = setInterval(function() { if (opacity > 0.05) {
if (opacity > 0.05) { opacity -= 0.05;
opacity -= 0.05; alert.style.opacity = opacity;
alert.style.opacity = opacity; } else {
} else { clearInterval(fadeOutInterval);
clearInterval(fadeOutInterval); const bsAlert = new bootstrap.Alert(alert);
const bsAlert = new bootstrap.Alert(alert); bsAlert.close();
bsAlert.close(); }
} }, 25);
}, 25); }, 5000);
}, 5000); }
} });
}); </script>
</script>

View file

@ -51,8 +51,7 @@ class SupportView(OrganizationViewMixin, FormView):
self.request, self.request,
mark_safe( mark_safe(
_( _(
"There was an error submitting your support request. " 'There was an error submitting your support request. Please try again or contact us directly at <a href="mailto:servala-support@vshn.ch">servala-support@vshn.ch</a>.'
"Please try again or contact us directly at <a href=\"mailto:servala-support@vshn.ch\">servala-support@vshn.ch</a>."
) )
), ),
) )

View file

@ -174,21 +174,3 @@ a.btn-keycloak {
margin-top: -16px; margin-top: -16px;
padding-right: 28px; padding-right: 28px;
} }
/* Service cards equal height styling */
.service-cards-container .card {
height: 100%;
display: flex;
flex-direction: column;
}
.service-cards-container .card-body {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.service-cards-container .card-footer {
margin-top: auto;
}