WIP: MVP with shadcn sidebar

- csat
- SLA
- email notification templates
This commit is contained in:
Abhinav Raut
2025-01-06 02:39:44 +05:30
parent 48e89dc4b9
commit caf8e7d34d
212 changed files with 9141 additions and 2222 deletions

View File

@@ -1,15 +0,0 @@
{{ define "conversation-assigned" }}
{{ template "header" . }}
<p>A new conversation has been assigned to you:</p>
<p>
{{ if .Conversation.Subject }}Subject: {{ .Conversation.Subject }}{{ end }}
</p>
<p> You can view the conversation by clicking the link below:</p>
<a href="{{ RootURL }}/conversations/{{ .Conversation.UUID }}">View Conversation</a>
</p>
{{ template "footer" . }}
{{ end }}

View File

@@ -0,0 +1,236 @@
* {
box-sizing: border-box;
}
html,
body {
padding: 0;
margin: 0;
min-width: 320px;
}
body {
background: #f9f9f9;
font-family: 'Inter', 'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
line-height: 26px;
color: #111;
}
a {
color: #18181b;
text-decoration-color: #abcbfb;
}
a:hover {
color: #111;
}
label {
cursor: pointer;
color: #444;
}
h1,
h2,
h3,
h4 {
font-weight: 400;
}
.section {
margin-bottom: 45px;
}
input[type='text'],
input[type='email'],
input[type='password'],
select {
padding: 10px 15px;
border: 1px solid #888;
border-radius: 3px;
width: 100%;
box-shadow: 2px 2px 0 #f3f3f3;
border: 1px solid #ddd;
font-size: 1em;
}
input:focus {
border-color: #18181b;
}
input:focus::placeholder {
color: transparent;
}
input[disabled] {
opacity: 0.5;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
.error {
color: #ff5722;
}
.button {
background: #18181b;
padding: 15px 30px;
border-radius: 3px;
border: 0;
cursor: pointer;
text-decoration: none;
color: #ffff;
display: inline-block;
min-width: 150px;
font-size: 1.1em;
text-align: center;
}
.button:hover {
background: #333;
color: #fff;
}
.button.button-outline {
background: #fff;
border: 1px solid #18181b;
color: #18181b;
}
.button.button-outline:hover {
border-color: #333;
background-color: #333;
color: #fff;
}
.container {
margin: 60px auto 15px auto;
max-width: 550px;
}
.wrap {
background: #fff;
padding: 40px;
box-shadow: 2px 2px 0 #f3f3f3;
border: 1px solid #eee;
}
.header {
border-bottom: 1px solid #eee;
padding-bottom: 15px;
margin-bottom: 30px;
}
.header .logo img {
width: auto;
max-width: 150px;
}
.unsub-all {
margin-top: 30px;
padding-top: 30px;
border-top: 1px solid #eee;
}
.row {
margin-bottom: 20px;
}
.lists {
list-style-type: none;
padding: 0;
}
.lists li {
margin: 0 0 5px 0;
}
.lists .description {
margin: 0 0 15px 0;
font-size: 0.875em;
line-height: 1.3rem;
color: #888;
margin-left: 25px;
}
.form .nonce {
display: none;
}
.form .captcha {
margin-top: 30px;
}
.archive {
list-style-type: none;
margin: 25px 0 0 0;
padding: 0;
}
.archive .date {
display: block;
color: #666;
font-size: 0.875em;
}
.archive li {
margin-bottom: 15px;
}
.feed {
margin-right: 15px;
}
.home-options {
margin-top: 30px;
}
.home-options a {
margin: 0 7px;
}
.pagination {
margin-top: 30px;
text-align: center;
}
.pg-page {
display: inline-block;
padding: 0 10px;
text-decoration: none;
}
.pg-page.pg-selected {
text-decoration: underline;
font-weight: bold;
}
.login .submit {
margin-top: 20px;
}
.login button {
width: 100%;
vertical-align: middle;
display: flex;
align-items: center;
justify-content: center;
}
.login button img {
max-width: 24px;
margin-right: 10px;
}
#btn-back {
display: none;
}
footer.container {
margin-top: 15px;
text-align: center;
color: #aaa;
font-size: 0.775em;
margin-top: 30px;
margin-bottom: 30px;
}
footer a {
color: #aaa;
text-decoration: none;
}
footer a:hover {
color: #111;
}
@media screen and (max-width: 650px) {
.wrap {
margin: 0;
padding: 30px;
max-width: none;
}
}
.green {
color: green;
}

View File

@@ -0,0 +1,300 @@
{{ define "csat" }}
{{ template "header" . }}
<div class="csat-container">
<div class="csat-header">
<h1>How was your experience?</h1>
<p class="conversation-subject">Re: {{ .conversation.subject }}</p>
</div>
<form action="{{ .RootURL }}/csat/{{ .csat.uuid }}" method="POST" class="csat-form">
<div class="rating-container">
<label class="rating-label">How would you rate your interaction?</label>
<div class="rating-options">
<input type="radio" id="rating-1" name="rating" value="1" required>
<label for="rating-1" class="rating-option">
<div class="emoji-wrapper">
<span class="emoji">😢</span>
</div>
<span class="rating-text">Very Dissatisfied</span>
</label>
<input type="radio" id="rating-2" name="rating" value="2">
<label for="rating-2" class="rating-option">
<div class="emoji-wrapper">
<span class="emoji">😕</span>
</div>
<span class="rating-text">Dissatisfied</span>
</label>
<input type="radio" id="rating-3" name="rating" value="3">
<label for="rating-3" class="rating-option">
<div class="emoji-wrapper">
<span class="emoji">😊</span>
</div>
<span class="rating-text">Neutral</span>
</label>
<input type="radio" id="rating-4" name="rating" value="4">
<label for="rating-4" class="rating-option">
<div class="emoji-wrapper">
<span class="emoji">😃</span>
</div>
<span class="rating-text">Satisfied</span>
</label>
<input type="radio" id="rating-5" name="rating" value="5">
<label for="rating-5" class="rating-option">
<div class="emoji-wrapper">
<span class="emoji">🤩</span>
</div>
<span class="rating-text">Very Satisfied</span>
</label>
</div>
</div>
<div class="feedback-container">
<label for="feedback" class="feedback-label">What made you feel this way? (optional)</label>
<textarea id="feedback" name="feedback" placeholder="Help us understand your experience better..." rows="4"
maxlength="1000" onkeyup="updateCharCount(this)"></textarea>
<div class="char-counter">
<span id="charCount">0</span>/1000 characters
</div>
<script>
function updateCharCount (textarea) {
const counter = document.getElementById('charCount');
const count = textarea.value.length;
counter.textContent = count;
// Add visual feedback as user approaches limit
const charCounter = counter.parentElement;
if (count > 900) {
charCounter.classList.add('near-limit');
} else {
charCounter.classList.remove('near-limit');
}
}
</script>
</div>
<button type="submit" class="button submit-button">
Submit Feedback
</button>
</form>
</div>
<style>
.csat-container {
background: #fff;
max-width: 700px;
margin: 30px auto 15px auto;
}
.csat-header {
text-align: center;
margin-bottom: 40px;
}
.csat-header h1 {
font-size: 2em;
color: #1a1a1a;
margin-bottom: 10px;
}
.conversation-subject {
color: #666;
font-size: 1.1em;
}
.csat-form {
max-width: 600px;
margin: 0 auto;
}
.rating-container {
margin-bottom: 40px;
}
.rating-label {
display: block;
font-size: 1.1em;
margin-bottom: 20px;
color: #333;
text-align: center;
}
.rating-options {
display: flex;
justify-content: center;
gap: 25px;
flex-wrap: wrap;
margin-top: 30px;
}
.rating-options input[type="radio"] {
display: none;
}
.rating-option {
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
transition: all 0.3s ease;
padding: 15px;
position: relative;
width: 110px;
}
.rating-option:hover {
transform: translateY(-3px);
}
.rating-options input[type="radio"]:checked+.rating-option {
transform: translateY(-3px);
}
.rating-options input[type="radio"]:checked+.rating-option::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 40px;
height: 3px;
background-color: #0055d4;
border-radius: 2px;
}
.emoji-wrapper {
background: #f8f9ff;
border-radius: 50%;
width: 70px;
height: 70px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 12px;
transition: all 0.3s ease;
border: 2px solid transparent;
}
.rating-option:hover .emoji-wrapper {
transform: scale(1.1);
background: #f0f5ff;
border-color: #0055d4;
}
.rating-options input[type="radio"]:checked+.rating-option .emoji-wrapper {
transform: scale(1.1);
background: #e8f0ff;
border-color: #0055d4;
}
.emoji {
font-size: 2.2em;
line-height: 1;
transform: translateY(1px);
}
.rating-text {
font-size: 0.9em;
text-align: center;
color: #666;
font-weight: 500;
}
.feedback-container {
margin-bottom: 30px;
}
.feedback-label {
display: block;
margin-bottom: 10px;
font-size: 1.1em;
color: #333;
}
textarea {
width: 100%;
padding: 15px;
border: 2px solid #e0e0e0;
border-radius: 8px;
font-size: 1em;
line-height: 1.5;
resize: vertical;
transition: border-color 0.3s ease;
}
textarea:focus {
border-color: #0055d4;
outline: none;
}
.char-counter {
margin-top: 8px;
text-align: right;
color: #666;
font-size: 0.9em;
}
.char-counter.near-limit {
color: #ff5722;
font-weight: 500;
}
@media screen and (max-width: 650px) {
.char-counter {
font-size: 0.85em;
}
.submit-button {
width: 100%;
margin-top: 20px;
padding: 15px 30px;
font-size: 1.1em;
font-weight: 500;
transition: all 0.3s ease;
}
.submit-button:hover {
background-color: #004bb8;
transform: translateY(-1px);
}
@media screen and (max-width: 650px) {
.csat-container {
margin: 0;
padding: 30px;
border-radius: 0;
}
.rating-options {
flex-direction: column;
}
.rating-option {
flex-direction: row;
justify-content: flex-start;
gap: 15px;
width: 100%;
padding: 15px;
}
.emoji-wrapper {
margin-bottom: 0;
width: 50px;
height: 50px;
}
.emoji {
font-size: 1.8em;
}
.rating-text {
text-align: left;
}
}
</style>
{{ template "footer" . }}
{{ end }}

View File

@@ -0,0 +1,11 @@
{{ define "error" }}
{{ template "header" . }}
<section class="center">
{{ if .error_message }}
<p class="error">{{ .error_message }}</p>
{{ end }}
</section>
{{ template "footer" . }}
{{ end }}

View File

@@ -0,0 +1,42 @@
{{ define "header" }}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{ .Data.Title }} - {{ .SiteName }}</title>
<meta name="description" content="{{ .Data.Description }}" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<link href="/static/public/static/style.css?v={{ .AssetVersion }}" rel="stylesheet" type="text/css" />
<link href="/public/custom.css?v={{ .AssetVersion }}" rel="stylesheet" type="text/css">
<script src="/public/custom.js?v={{ .AssetVersion }}" async defer></script>
{{ if ne .FaviconURL "" }}
<link rel="icon" href="{{ .FaviconURL }}" type="image/x-icon" />
{{ else }}
<link rel="icon" href="/public/static/favicon.png?v={{ .AssetVersion }}" type="image/png" />
{{ end }}
</head>
<body>
<div class="container wrap">
<header class="header">
<div class="logo">
{{ if ne .LogoURL "" }}
<img src="{{ LogoURL }}" alt="{{ .Data.Title }}" /></a>
{{ else }}
<img src="/public/static/logo.svg?v={{ .AssetVersion }}" alt="{{ .Data.Title }}" />
{{ end }}
</a>
</div>
</header>
{{ end }}
{{ define "footer" }}
</div>
<footer class="container">
Powered by <a target="_blank" rel="noreferrer" href="#">Artemis</a>
</footer>
</body>
</html>
{{ end }}

View File

@@ -0,0 +1,11 @@
{{ define "info" }}
{{ template "header" . }}
<section class="center">
{{ if .message }}
<p class="green">{{ .message }}</p>
{{ end }}
</section>
{{ template "footer" . }}
{{ end }}