Adds dark mode to entire dashboard (#467)
* Adds New Dark Mode Assets * Moves triangle for dropdown to a reasonable position * Majority .eex dark implementation * Fixes Logo Positioning * Adds theme flag to user schema, uses it * Uses correct variables for theme applicator script * Minor missed theme changes/fallbacks * Individual Component Support + Theme Context * Sources Tab Support This was a pain to test D: * Partial Stats Sections Support * More of stats modules supported * Modal +table support * Improves some Flatpickr in light theme, supports dark theme * Fixes missed settings tab colors * Finishes Devices module support * Fixes bar graph colors * Better colorizes maps module * Undoes colorized bars (they looked bad, on second thought) * Fixes loading indicator * Finishes conversions module * Adds changelog entry The PR number could be wrong, will double check * Fixes missed header color * Fixes naming of migration and removes static alter * Does migration correctly As I said, my Elixir is pretty weak heh * Adds support for spike notifications setting * Improves contrast and visibility for email settings * Resolves @ukutaht's comments on #467 * Fixes missing dark style * Found one more missed dark element (shared links) * Formatting fixespull/484/head
parent
a50fd555cf
commit
425975efec
@ -0,0 +1,110 @@
|
||||
/* Because Flatpickr offers zero support for dynamic theming on its own (outside of third-party plugins) */
|
||||
.dark .flatpickr-calendar {
|
||||
background-color: #1f2937;
|
||||
}
|
||||
|
||||
.dark .flatpickr-weekday {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.dark .flatpickr-prev-month {
|
||||
fill: #f3f4f6 !important;
|
||||
}
|
||||
|
||||
.dark .flatpickr-next-month {
|
||||
fill: #f3f4f6 !important;
|
||||
}
|
||||
|
||||
.dark .flatpickr-monthDropdown-months {
|
||||
color: #f3f4f6 !important;
|
||||
}
|
||||
|
||||
.dark .numInputWrapper {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.prevMonthDay {
|
||||
color: #94a3af;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day {
|
||||
color: #E5E7EB;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.prevMonthDay {
|
||||
color: #9CA3AF;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.nextMonthDay {
|
||||
color: #9CA3AF;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day:hover {
|
||||
background-color: #374151;
|
||||
}
|
||||
|
||||
.dark :not(.startRange):not(.endRange).flatpickr-day.nextMonthDay:hover {
|
||||
background-color: #374151;
|
||||
}
|
||||
|
||||
.dark :not(.startRange):not(.endRange).flatpickr-day.prevMonthDay:hover {
|
||||
background-color: #374151;
|
||||
}
|
||||
|
||||
.dark .flatpickr-next-month {
|
||||
fill: #f3f4f6;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.flatpickr-disabled {
|
||||
color: #4B5563;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.flatpickr-disabled:hover {
|
||||
color: #4B5563;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.today {
|
||||
background-color: rgba(167, 243, 208, 0.5);
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.today {
|
||||
border-color: #34D399;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.inRange {
|
||||
background-color: #374151;
|
||||
box-shadow: -5px 0 0 #374151,5px 0 0 #374151;
|
||||
border-color: #374151;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.prevMonthDay.inRange {
|
||||
background-color: #374151;
|
||||
box-shadow: -5px 0 0 #374151,5px 0 0 #374151;
|
||||
border-color: #374151;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.nextMonthDay.inRange {
|
||||
background-color: #374151;
|
||||
box-shadow: -5px 0 0 #374151,5px 0 0 #374151;
|
||||
border-color: #374151;
|
||||
}
|
||||
|
||||
.flatpickr-day.startRange {
|
||||
background: #6574cd !important;
|
||||
border-color: #6574cd !important;
|
||||
}
|
||||
|
||||
.flatpickr-day.endRange {
|
||||
background: #6574cd !important;
|
||||
border-color: #6574cd !important;
|
||||
}
|
||||
|
||||
.dark .flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
|
||||
-webkit-box-shadow: -10px 0 0 #4556c3 !important;
|
||||
box-shadow: -10px 0 0 #4556c3 !important;
|
||||
}
|
||||
|
||||
.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
|
||||
-webkit-box-shadow: -10px 0 0 #4556c3 !important;
|
||||
box-shadow: -10px 0 0 #4556c3 !important;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import { ThemeContext } from './theme-context'
|
||||
|
||||
export const withThemeConsumer = (WrappedComponent) => {
|
||||
return class extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<ThemeContext.Consumer>
|
||||
{theme => (
|
||||
<WrappedComponent darkTheme={theme} {...this.props} />
|
||||
)}
|
||||
</ThemeContext.Consumer>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
export const ThemeContext = React.createContext({
|
||||
dark: false
|
||||
});
|
||||
@ -0,0 +1,37 @@
|
||||
import React from 'react';
|
||||
import { ThemeContext } from './theme-context'
|
||||
|
||||
export const withThemeProvider = (WrappedComponent) => {
|
||||
return class extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
dark: document.querySelector('html').classList.contains('dark') || false
|
||||
};
|
||||
|
||||
this.mutationObserver = new MutationObserver((mutationsList, observer) => {
|
||||
mutationsList.forEach(mutation => {
|
||||
if (mutation.attributeName === 'class') {
|
||||
this.setState({ dark: mutation.target.classList.contains('dark') });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.mutationObserver.observe(document.querySelector('html'), { attributes: true });
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.mutationObserver.disconnect();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<ThemeContext.Provider value={this.state.dark}>
|
||||
<WrappedComponent {...this.props}/>
|
||||
</ThemeContext.Provider>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,37 @@
|
||||
var pref = document.currentScript.dataset.pref;
|
||||
|
||||
function reapplyTheme() {
|
||||
var userPref = pref || "system";
|
||||
var mediaPref = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
var htmlRef = document.querySelector('html');
|
||||
var hcaptchaRefs = document.getElementsByClassName('h-captcha');
|
||||
|
||||
htmlRef.classList.remove('dark');
|
||||
for (let i = 0; i < hcaptchaRefs.length; i++) {
|
||||
hcaptchaRefs[i].dataset.theme = "light";
|
||||
}
|
||||
|
||||
switch (userPref) {
|
||||
case "dark":
|
||||
htmlRef.classList.add('dark');
|
||||
for (let i = 0; i < hcaptchaRefs.length; i++) {
|
||||
hcaptchaRefs[i].dataset.theme = "dark";
|
||||
}
|
||||
break;
|
||||
case "system":
|
||||
if (mediaPref) {
|
||||
htmlRef.classList.add('dark');
|
||||
for (let i = 0; i < hcaptchaRefs.length; i++) {
|
||||
hcaptchaRefs[i].dataset.theme = "dark";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
reapplyTheme();
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addListener(reapplyTheme);
|
||||
|
||||
window.onload = function() {
|
||||
reapplyTheme();
|
||||
};
|
||||
@ -0,0 +1,11 @@
|
||||
defmodule Plausible.Themes do
|
||||
@options [
|
||||
[key: "Follow System Theme", value: "system"],
|
||||
[key: "Light", value: "light"],
|
||||
[key: "Dark", value: "dark"]
|
||||
]
|
||||
|
||||
def options() do
|
||||
@options
|
||||
end
|
||||
end
|
||||
@ -1,14 +1,14 @@
|
||||
<%= form_for @conn, "/password", [class: "bg-white max-w-md w-full mx-auto shadow-md rounded px-8 py-6 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black">Set your password</h2>
|
||||
<%= form_for @conn, "/password", [class: "bg-white dark:bg-gray-800 max-w-md w-full mx-auto shadow-md rounded px-8 py-6 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Set your password</h2>
|
||||
<div class="my-4">
|
||||
<p class="text-gray-600 text-sm mt-1 mb-2">Min 6 characters</p>
|
||||
<%= password_input f, :password, class: "transition bg-gray-100 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:bg-white focus:border-gray-300" %>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-sm mt-1 mb-2">Min 6 characters</p>
|
||||
<%= password_input f, :password, class: "transition bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal appearance-none focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500" %>
|
||||
<%= if @conn.assigns[:changeset] do %>
|
||||
<%= error_tag @changeset, :password %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= submit "Set password →", class: "button mt-4 w-full" %>
|
||||
<p class="text-center text-gray-600 text-xs mt-4">
|
||||
Don't have an account? <%= link("Register", to: "/register") %> instead.
|
||||
<p class="text-center text-gray-500 text-xs mt-4">
|
||||
Don't have an account? <%= link("Register", to: "/register", class: "underline text-gray-800 dark:text-gray-200") %> instead.
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
<%= form_for @conn, "/password/reset", [class: "bg-white max-w-md w-full mx-auto shadow-md rounded px-8 py-6 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black">Reset your password</h2>
|
||||
<%= form_for @conn, "/password/reset", [class: "bg-white dark:bg-gray-800 max-w-md w-full mx-auto shadow-md rounded px-8 py-6 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Reset your password</h2>
|
||||
<div class="my-4">
|
||||
<p class="text-gray-600 text-sm mt-1 mb-2">Min 6 characters</p>
|
||||
<%= password_input f, :password, class: "transition bg-gray-100 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:bg-white focus:border-gray-300" %>
|
||||
<p class="text-gray-600 dark:text-gray-400 text-sm mt-1 mb-2">Min 6 characters</p>
|
||||
<%= password_input f, :password, class: "transition bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal appearance-none focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500" %>
|
||||
<%= if @conn.assigns[:changeset] do %>
|
||||
<%= error_tag @changeset, :password %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= hidden_input f, :token, value: @token %>
|
||||
<%= submit "Set password →", class: "button mt-4 w-full" %>
|
||||
<p class="text-center text-gray-600 text-xs mt-4">
|
||||
Don't have an account? <%= link("Register", to: "/register") %> instead.
|
||||
<p class="text-center text-gray-500 text-xs mt-4">
|
||||
Don't have an account? <%= link("Register", to: "/register", class: "underline text-gray-800 dark:text-gray-200") %> instead.
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<div class="bg-white max-w-md w-full mx-auto shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8">
|
||||
<h2 class="text-xl font-black">Success!</h2>
|
||||
<div class="my-4 leading-tight">
|
||||
<div class="bg-white dark:bg-gray-800 max-w-md w-full mx-auto shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8">
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Success!</h2>
|
||||
<div class="my-4 leading-tight dark:text-gray-100">
|
||||
We have sent an email with password reset instructions to <b><%= @email %></b> if it exists in our database.
|
||||
</div>
|
||||
<div class="mt-8 text-sm">
|
||||
<div class="mt-8 text-sm dark:text-gray-100">
|
||||
Didn't receive an email?
|
||||
</div>
|
||||
<div class="mt-2 text-sm text-gray-600 leading-tight">
|
||||
Please check your spam folder and contact <a href="mailto:support@plausible.io">support@plausible.io</a> if the problem persists
|
||||
<div class="mt-2 text-sm text-gray-600 dark:text-gray-400 leading-tight">
|
||||
Please check your spam folder and contact <a href="mailto:support@plausible.io" class="text-indigo-500">support@plausible.io</a> if the problem persists
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<%= if is_current_tab(@conn, @this_tab) do %>
|
||||
<a href="/<%= URI.encode_www_form(@site.domain) %>/settings/<%= @this_tab %>" class="flex items-center px-3 py-2 text-sm leading-5 font-medium text-gray-900 rounded-md bg-gray-100 hover:text-gray-900 hover:bg-gray-100 focus:outline-none focus:bg-gray-200 transition ease-in-out duration-150 <%= if @this_tab != "general", do: "mt-1" %>"><%= @text %></a>
|
||||
<a href="/<%= URI.encode_www_form(@site.domain) %>/settings/<%= @this_tab %>" class="flex items-center px-3 py-2 text-sm leading-5 font-medium text-gray-900 dark:text-gray-100 rounded-md bg-gray-100 dark:bg-gray-900 hover:text-gray-900 hover:bg-gray-100 outline-none focus:outline-none focus:bg-gray-200 dark:focus:bg-gray-800 transition ease-in-out duration-150 cursor-default <%= if @this_tab != "general", do: "mt-1" %>"><%= @text %></a>
|
||||
<% else %>
|
||||
<a href="/<%= URI.encode_www_form(@site.domain) %>/settings/<%= @this_tab %>" class="flex items-center px-3 py-2 text-sm leading-5 font-medium text-gray-600 rounded-md hover:text-gray-900 hover:bg-gray-50 focus:outline-none focus:text-gray-900 focus:bg-gray-50 transition ease-in-out duration-150 <%= if @this_tab != "general", do: "mt-1" %>"><%= @text %></a>
|
||||
<a href="/<%= URI.encode_www_form(@site.domain) %>/settings/<%= @this_tab %>" class="flex items-center px-3 py-2 text-sm leading-5 font-medium text-gray-600 dark:text-gray-400 rounded-md hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800 outline-none focus:outline-none focus:text-gray-900 focus:bg-gray-50 dark:focus:text-gray-100 dark:focus:bg-gray-800 transition ease-in-out duration-150 <%= if @this_tab != "general", do: "mt-1" %>"><%= @text %></a>
|
||||
<% end %>
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
<div class="relative bg-gray-50 overflow-hidden text-center">
|
||||
<div class="relative bg-gray-50 dark:bg-gray-800 overflow-hidden text-center dark:text-gray-100">
|
||||
You will be redirected... If it doesn't work, please click login.
|
||||
</div>
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
<%= form_for @conn, "/", [class: "max-w-md w-full mx-auto bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black">Update javascript snippet</h2>
|
||||
<%= form_for @conn, "/", [class: "max-w-md w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Update javascript snippet</h2>
|
||||
<div class="my-4">
|
||||
<p>
|
||||
<p class="dark:text-gray-100">
|
||||
Allow up to 4 hours for DNS changes to propagate and for us to obtain an SSL certificate for <code><%= @site.custom_domain.domain %></code>
|
||||
</p>
|
||||
<p class="mt-4">
|
||||
<p class="mt-4 dark:text-gray-100">
|
||||
The setup is working when <a href="//<%= @site.custom_domain.domain %>/js/index.js" target="_blank" class="text-indigo-500"><%= @site.custom_domain.domain %>/js/index.js</a> loads the javascript tracker.
|
||||
</p>
|
||||
<p class="mt-4">
|
||||
<p class="mt-4 dark:text-gray-100">
|
||||
To finish your setup, please replace the tracking snippet on your site with the following.
|
||||
</p>
|
||||
|
||||
<div class="relative">
|
||||
<%= textarea f, :domain, id: "snippet_code", class: "transition overflow-hidden bg-gray-100 appearance-none border border-transparent rounded w-full p-2 pr-6 text-gray-700 leading-normal appearance-none focus:outline-none focus:bg-white focus:border-gray-300 text-xs mt-4 resize-none", value: snippet(@site), rows: 3, readonly: "readonly" %>
|
||||
<%= textarea f, :domain, id: "snippet_code", class: "transition overflow-hidden bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 pr-6 text-gray-700 dark:text-gray-300 leading-normal appearance-none focus:outline-none focus:bg-white dark:focus:bg-gray-900 focus:border-gray-300 dark:focus:border-gray-500 text-xs mt-4 resize-none", value: snippet(@site), rows: 3, readonly: "readonly" %>
|
||||
<a onclick="var textarea = document.getElementById('snippet_code'); textarea.focus(); textarea.select(); document.execCommand('copy');" href="javascript:void(0)" class="no-underline text-indigo-500 text-sm hover:underline">
|
||||
<svg class="absolute text-indigo-500" style="top: 24px; right: 12px;" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<%= link("Back to settings →", class: "button mt-4 w-full", to: "/#{URI.encode_www_form(@site.domain)}/settings/custom-domain") %>
|
||||
<p class="mt-4 text-gray-600 text-sm">
|
||||
Problems? <%= link("Get help via email", to: "mailto:support@plausible.io", class: "text-indigo-800 underline") %>
|
||||
<p class="mt-4 text-gray-600 text-sm dark:text-gray-400">
|
||||
Problems? <%= link("Get help via email", to: "mailto:support@plausible.io", class: "text-indigo-500 underline") %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
<%= form_for @changeset, "/sites/#{URI.encode_www_form(@site.domain)}/custom-domains", [class: "max-w-md w-full mx-auto bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black">Setup custom domain</h2>
|
||||
<div class="my-4">
|
||||
<%= form_for @changeset, "/sites/#{URI.encode_www_form(@site.domain)}/custom-domains", [class: "max-w-md w-full mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 pt-6 pb-8 mb-4 mt-8"], fn f -> %>
|
||||
<h2 class="text-xl font-black dark:text-gray-100">Setup custom domain</h2>
|
||||
<div class="my-4 dark:text-gray-100">
|
||||
We recommend using a subdomain of the website you're running Plausible on.
|
||||
If your site is on <code>example.com</code> you can use <code>stats.example.com</code>.
|
||||
<br /><br /> The name of the subdomain can be anything, it doesn't have to be <code>stats</code>.
|
||||
</div>
|
||||
<div class="my-4">
|
||||
<%= label f, :domain, class: "block text-sm font-bold" %>
|
||||
<%= text_input f, :domain, class: "transition mt-3 bg-gray-100 appearance-none border border-transparent rounded w-full p-2 text-gray-700 leading-normal appearance-none focus:outline-none focus:bg-white focus:border-gray-300", placeholder: "stats.[yourdomain].com" %>
|
||||
<%= label f, :domain, class: "block text-sm font-bold dark:text-gray-100" %>
|
||||
<%= text_input f, :domain, class: "transition mt-3 bg-gray-100 dark:bg-gray-900 outline-none appearance-none border border-transparent rounded w-full p-2 text-gray-700 dark:text-gray-300 leading-normal focus:outline-none focus:bg-white dark:focus:bg-gray-800 focus:border-gray-300 dark:focus:border-gray-500", placeholder: "stats.[yourdomain].com" %>
|
||||
<%= error_tag f, :domain %>
|
||||
</div>
|
||||
|
||||
<%= submit "DNS setup ->", class: "button mt-4 w-full" %>
|
||||
<%= submit "DNS setup →", class: "button mt-4 w-full dark:text-gray-100" %>
|
||||
<% end %>
|
||||
|
||||
@ -1,32 +1,32 @@
|
||||
<div class="sm:rounded-md sm:overflow-hidden shadow">
|
||||
<div class="bg-white py-6 px-4 space-y-6 sm:p-6">
|
||||
<div class="bg-white dark:bg-gray-800 py-6 px-4 space-y-6 sm:p-6">
|
||||
<div>
|
||||
<h2 class="text-lg leading-6 font-medium text-gray-900">Danger zone</h2>
|
||||
<p class="mt-1 text-sm leading-5 text-gray-500">Desctructive actions below can result in irrecoverable data loss. Be careful.</p>
|
||||
<h2 class="text-lg leading-6 font-medium text-gray-900 dark:text-gray-100">Danger zone</h2>
|
||||
<p class="mt-1 text-sm leading-5 text-gray-500 dark:text-gray-200">Desctructive actions below can result in irrecoverable data loss. Be careful.</p>
|
||||
</div>
|
||||
<li class="py-4 flex items-center justify-between space-x-4">
|
||||
<div class="flex flex-col">
|
||||
<p class="text-sm leading-5 font-medium text-gray-900">
|
||||
<p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">
|
||||
Reset stats
|
||||
</p>
|
||||
<p class="text-sm leading-5 text-gray-500">
|
||||
<p class="text-sm leading-5 text-gray-500 dark:text-gray-200">
|
||||
Removes all pageviews but keeps the site configuration
|
||||
</p>
|
||||
</div>
|
||||
<%= link("Reset #{@site.domain} stats", to: "/#{URI.encode_www_form(@site.domain)}/stats", method: :delete, class: "inline-block px-4 py-2 border border-gray-300 text-sm leading-5 font-medium rounded-md text-red-700 bg-white hover:text-red-500 focus:outline-none focus:border-blue-300 focus:ring active:text-red-800 active:bg-gray-50 transition ease-in-out duration-150", data: [confirm: "Resetting the stats cannot be reversed. Are you sure?"]) %>
|
||||
<%= link("Reset #{@site.domain} stats", to: "/#{URI.encode_www_form(@site.domain)}/stats", method: :delete, class: "inline-block mt-4 px-4 py-2 border border-gray-300 dark:border-gray-500 text-sm leading-5 font-medium rounded-md text-red-700 bg-white dark:bg-gray-800 hover:text-red-500 dark:hover:text-red-400 focus:outline-none focus:border-blue-300 focus:ring active:text-red-800 active:bg-gray-50 transition ease-in-out duration-150", data: [confirm: "Resetting the stats cannot be reversed. Are you sure?"]) %>
|
||||
</li>
|
||||
<div class="border-b border-gray-200"></div>
|
||||
<div class="border-b border-gray-200 dark:border-gray-500"></div>
|
||||
|
||||
<li class="py-4 flex items-center justify-between space-x-4">
|
||||
<div class="flex flex-col">
|
||||
<p class="text-sm leading-5 font-medium text-gray-900">
|
||||
<p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">
|
||||
Delete site
|
||||
</p>
|
||||
<p class="text-sm leading-5 text-gray-500">
|
||||
<p class="text-sm leading-5 text-gray-500 dark:text-gray-200">
|
||||
Removes all stats along with the site configuration
|
||||
</p>
|
||||
</div>
|
||||
<%= link "Delete #{@site.domain}", to: "/#{URI.encode_www_form(@site.domain)}", method: :delete, class: "inline-block px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-50 focus:outline-none focus:border-red-300 focus:ring active:bg-red-200 transition ease-in-out duration-150 sm:text-sm sm:leading-5", data: [confirm: "Deleting the site data cannot be reversed. Are you sure?"] %>
|
||||
<%= link "Delete #{@site.domain}", to: "/#{URI.encode_www_form(@site.domain)}", method: :delete, class: "inline-block px-4 py-2 border border-transparent font-medium rounded-md text-red-700 dark:text-red-800 bg-red-100 dark:bg-red-200 hover:bg-red-50 dark:hover:bg-red-300 focus:outline-none focus:border-red-300 focus:ring active:bg-red-200 transition ease-in-out duration-150 sm:text-sm sm:leading-5", data: [confirm: "Deleting the site data cannot be reversed. Are you sure?"] %>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="w-full max-w-md mx-auto bg-white shadow-md rounded px-8 py-6 mt-8"]>
|
||||
<h2>Unsubscribe successful</h2>
|
||||
<p class="mt-4">You will no longer receive a <%= @interval %> analytics report for <%= @site %></p>
|
||||
<div class="w-full max-w-md mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 py-6 mt-8"]>
|
||||
<h2 class="dark:text-gray-100">Unsubscribe successful</h2>
|
||||
<p class="mt-4 dark:text-gray-100">You will no longer receive a <%= @interval %> analytics report for <%= @site %></p>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
defmodule Plausible.Repo.Migrations.AddThemePrefToUsers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:users) do
|
||||
add_if_not_exists :theme, :string, default: "system"
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue