+ <%= form_for @conn, "/sites/#{URI.encode_www_form(@site.domain)}/monthly-report/recipients", [class: "lg:hidden"], fn f -> %>
+ <%= select f, :tab, settings_tabs(), class: "mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md", onchange: "location.href = location.href.replace(/[^\/\/]*$/, event.target.value)", selected: List.last(@conn.path_info) %>
+ <% end %>
- <%= render("_settings_tab.html", this_tab: "general", text: "General", site: @site, conn: @conn) %>
- <%= render("_settings_tab.html", this_tab: "visibility", text: "Visibility", site: @site, conn: @conn) %>
- <%= render("_settings_tab.html", this_tab: "goals", text: "Goals", site: @site, conn: @conn) %>
- <%= render("_settings_tab.html", this_tab: "search-console", text: "Search Console", site: @site, conn: @conn) %>
- <%= render("_settings_tab.html", this_tab: "email-reports", text: "Email reports", site: @site, conn: @conn) %>
- <%= render("_settings_tab.html", this_tab: "custom-domain", text: "Custom domain", site: @site, conn: @conn) %>
- <%= render("_settings_tab.html", this_tab: "danger-zone", text: "Danger zone", site: @site, conn: @conn) %>
+ <%= for [key: key, value: val] <- settings_tabs() do %>
+ <%= render("_settings_tab.html", this_tab: val, text: key, site: @site, conn: @conn) %>
+ <% end %>
diff --git a/lib/plausible_web/views/layout_view.ex b/lib/plausible_web/views/layout_view.ex
index e3b6f5f6e..d8a776bba 100644
--- a/lib/plausible_web/views/layout_view.ex
+++ b/lib/plausible_web/views/layout_view.ex
@@ -21,6 +21,19 @@ defmodule PlausibleWeb.LayoutView do
end
end
+ def settings_tabs() do
+ [
+ [key: "General", value: "general"],
+ [key: "Visibility", value: "visibility"],
+ [key: "Goals", value: "goals"],
+ [key: "Search Console", value: "search-console"],
+ [key: "Email reports", value: "email-reports"],
+ [key: "Custom domain", value: "custom-domain"],
+ [key: "Danger zone", value: "danger-zone"],
+ ]
+ end
+
+
def trial_notificaton(user) do
case Plausible.Billing.trial_days_left(user) do
days when days > 1 ->