Packages

phoenix_kit

1.7.24
1.7.208 1.7.207 1.7.206 1.7.205 1.7.204 1.7.203 1.7.202 1.7.201 1.7.200 1.7.199 1.7.198 1.7.197 1.7.196 1.7.194 1.7.193 1.7.192 1.7.191 1.7.190 1.7.189 1.7.187 1.7.186 1.7.185 1.7.184 1.7.183 1.7.182 1.7.181 1.7.180 1.7.179 1.7.178 1.7.177 1.7.176 1.7.175 1.7.174 1.7.173 1.7.172 1.7.171 1.7.170 1.7.169 1.7.168 1.7.167 1.7.166 1.7.165 1.7.164 1.7.162 1.7.161 1.7.160 1.7.159 1.7.157 1.7.156 1.7.155 1.7.154 1.7.153 1.7.152 1.7.151 1.7.150 1.7.149 1.7.146 1.7.145 1.7.144 1.7.143 1.7.138 1.7.133 1.7.132 1.7.131 1.7.130 1.7.128 1.7.126 1.7.125 1.7.121 1.7.120 1.7.119 1.7.118 1.7.117 1.7.116 1.7.115 1.7.114 1.7.113 1.7.112 1.7.111 1.7.110 1.7.109 1.7.108 1.7.107 1.7.106 1.7.105 1.7.104 1.7.103 1.7.102 1.7.101 1.7.100 1.7.99 1.7.98 1.7.97 1.7.96 1.7.95 1.7.94 1.7.93 1.7.92 1.7.91 1.7.90 1.7.89 1.7.88 1.7.87 1.7.86 1.7.85 1.7.84 1.7.83 1.7.82 1.7.81 1.7.80 1.7.79 1.7.78 1.7.77 1.7.76 1.7.75 1.7.74 1.7.71 1.7.70 1.7.69 1.7.66 1.7.65 1.7.64 1.7.63 1.7.62 1.7.61 1.7.59 1.7.58 1.7.57 1.7.56 1.7.55 1.7.54 1.7.53 1.7.52 1.7.51 1.7.49 1.7.44 1.7.43 1.7.42 1.7.41 1.7.39 1.7.38 1.7.37 1.7.36 1.7.34 1.7.33 1.7.31 1.7.30 1.7.29 1.7.28 1.7.27 1.7.26 1.7.25 1.7.24 1.7.23 1.7.22 1.7.21 1.7.20 1.7.19 1.7.18 1.7.17 1.7.16 1.7.15 1.7.14 1.7.13 1.7.12 1.7.11 1.7.10 1.7.9 1.7.8 1.7.7 1.7.6 1.7.5 1.7.4 1.7.3 1.7.2 1.7.1 1.7.0 1.6.20 1.6.19 1.6.18 1.6.17 1.6.16 1.6.15 1.6.14 1.6.13 1.6.12 1.6.11 1.6.10 1.6.9 1.6.8 1.6.7 1.6.6 1.6.5 1.6.4 1.6.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.2 1.3.1 1.3.0 1.2.10 1.2.9 1.2.8 1.2.7 1.2.5 1.2.4 1.2.2 1.2.1 1.2.0 1.1.0 1.0.0

A foundation for building Elixir Phoenix apps — SaaS, social networks, ERP systems, marketplaces, and more

Current section

Files

Jump to
phoenix_kit lib modules sitemap web settings.html.heex
Raw

lib/modules/sitemap/web/settings.html.heex

<PhoenixKitWeb.Components.LayoutWrapper.app_layout
flash={@flash}
phoenix_kit_current_scope={assigns[:phoenix_kit_current_scope]}
page_title="Sitemap Settings"
current_path={@current_path}
project_title={@project_title}
current_locale={@current_locale}
>
<div class="container flex flex-col mx-auto px-4 py-6">
<%!-- Header Section --%>
<header class="w-full relative mb-6">
<%!-- Back Button --%>
<.link
navigate={Routes.path("/admin/modules", locale: @current_locale)}
class="btn btn-outline btn-primary btn-sm absolute left-0 top-0 -mb-12"
>
<.icon name="hero-arrow-left" class="w-4 h-4" /> Back to Modules
</.link>
<%!-- Title Section --%>
<div class="text-center">
<h1 class="text-4xl font-bold text-base-content mb-3">Sitemap Settings</h1>
<p class="text-lg text-base-content">Configure sitemap generation and scheduling</p>
</div>
<%!-- Enable/Disable Toggle --%>
<div class="absolute right-0 top-0">
<label class="label cursor-pointer gap-2">
<span class="label-text font-medium">
{if @config.enabled, do: "Enabled", else: "Disabled"}
</span>
<input
type="checkbox"
class="toggle toggle-primary"
checked={@config.enabled}
phx-click="toggle_sitemap"
/>
</label>
</div>
</header>
<div class="max-w-6xl mx-auto space-y-6">
<%!-- Stats Cards --%>
<div class="stats shadow w-full">
<div class="stat">
<div class="stat-figure text-primary">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-8 w-8"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
/>
</svg>
</div>
<div class="stat-title">Total URLs</div>
<div class="stat-value text-primary">{@config.url_count || 0}</div>
</div>
<div class="stat">
<div class="stat-figure text-secondary">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-8 w-8"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
</div>
<div class="stat-title">Last Generated</div>
<div class="stat-value text-secondary text-lg">
{format_timestamp(@config.last_generated)}
</div>
</div>
<div class="stat">
<div class="stat-figure text-accent">
<button
class={"btn btn-circle btn-accent #{if @generating, do: "loading"}"}
phx-click="regenerate"
disabled={@generating || !@config.enabled}
>
<svg
:if={!@generating}
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
/>
</svg>
</button>
</div>
<div class="stat-title">Actions</div>
<div class="stat-value text-lg">
<button class="btn btn-sm btn-ghost" phx-click="regenerate" disabled={@generating}>
Regenerate
</button>
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<%!-- Configuration Card --%>
<div class="card bg-base-200 shadow-md">
<div class="card-body">
<h2 class="card-title">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
/>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
/>
</svg>
Configuration
</h2>
<div class="space-y-4 mt-4">
<%!-- Site URL (read-only, from main Settings) --%>
<div class="form-control">
<label class="label">
<span class="label-text font-medium">Site URL</span>
</label>
<div class="flex gap-2">
<input
type="url"
class="input input-bordered w-full bg-base-200"
value={@site_url || ""}
disabled
readonly
/>
<.link
navigate={Routes.path("/admin/settings", locale: @current_locale)}
class="btn btn-outline btn-sm"
title="Edit in Settings"
>
<.icon name="hero-pencil" class="w-4 h-4" />
</.link>
</div>
</div>
<%!-- XSL Styling --%>
<label class="flex items-center justify-between cursor-pointer">
<div>
<span class="label-text font-medium">Browser Display Styling</span>
<span class="text-xs text-base-content/60 block">
Style XML with XSL for beautiful browser display
</span>
</div>
<input
type="checkbox"
class="toggle toggle-sm toggle-primary"
checked={@config.html_enabled}
phx-click="toggle_html"
/>
</label>
<%!-- Display Style --%>
<form phx-change="update_style" class="form-control">
<label class="label">
<span class="label-text font-medium">Display Style</span>
</label>
<select
class="select select-bordered w-full"
name="style"
disabled={!@config.html_enabled}
>
<option value="table" selected={@config.html_style in ["table", "grouped"]}>
Table (Clean table layout)
</option>
<option value="cards" selected={@config.html_style in ["cards", "hierarchical"]}>
Cards (Grouped by category)
</option>
<option value="minimal" selected={@config.html_style in ["minimal", "flat"]}>
Minimal (Simple list)
</option>
</select>
</form>
</div>
</div>
</div>
<%!-- Scheduling Card --%>
<div class="card bg-base-200 shadow-md">
<div class="card-body">
<div class="flex items-center justify-between">
<h2 class="card-title">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
Scheduled Generation
</h2>
<input
type="checkbox"
class="toggle toggle-primary"
checked={@config.schedule_enabled}
phx-click="toggle_schedule"
/>
</div>
<form phx-change="update_interval" class="flex items-center gap-4 mt-4">
<span class="text-sm">Regenerate every</span>
<select
class="select select-bordered select-sm"
name="interval"
disabled={!@config.schedule_enabled}
>
<option value="1" selected={@config.schedule_interval_hours == 1}>1 hour</option>
<option value="6" selected={@config.schedule_interval_hours == 6}>6 hours</option>
<option value="12" selected={@config.schedule_interval_hours == 12}>
12 hours
</option>
<option value="24" selected={@config.schedule_interval_hours == 24}>
24 hours
</option>
<option value="48" selected={@config.schedule_interval_hours == 48}>
48 hours
</option>
<option value="168" selected={@config.schedule_interval_hours == 168}>
Weekly
</option>
</select>
</form>
</div>
</div>
<%!-- Quick Actions Card (spans full width) --%>
<div class="card bg-base-200 shadow-md lg:col-span-2">
<div class="card-body">
<h2 class="card-title">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-5 w-5"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13 10V3L4 14h7v7l9-11h-7z"
/>
</svg>
Quick Actions
</h2>
<div class="flex flex-wrap gap-3 mt-4">
<button class="btn btn-outline btn-sm" phx-click="preview" phx-value-type="xml">
<.icon name="hero-code-bracket" class="w-4 h-4 mr-1" /> Preview Source
</button>
<button class="btn btn-outline btn-sm btn-warning" phx-click="invalidate_cache">
<.icon name="hero-trash" class="w-4 h-4 mr-1" /> Clear Sitemap
</button>
<.link
href={Routes.path("/sitemap.xml", locale: :none)}
target="_blank"
class="btn btn-outline btn-sm"
>
<.icon name="hero-arrow-top-right-on-square" class="w-4 h-4 mr-1" /> Sitemap
</.link>
</div>
<p class="text-xs text-base-content/60 mt-3">
<.icon name="hero-information-circle" class="w-3 h-3 inline" />
The sitemap.xml file is styled with XSL for beautiful browser display
</p>
</div>
</div>
</div>
</div>
<%!-- Preview Modal --%>
<div :if={@show_preview} class="modal modal-open">
<div class="modal-box max-w-4xl max-h-[80vh]">
<div class="flex justify-between items-center mb-4">
<h3 class="font-bold text-lg">XML Sitemap Source</h3>
<button class="btn btn-ghost btn-sm btn-circle" phx-click="close_preview"></button>
</div>
<div class="overflow-auto max-h-[60vh] bg-base-300 rounded-lg p-4">
<pre class="text-xs whitespace-pre-wrap break-all"><code>{@preview_content}</code></pre>
</div>
<div class="modal-action">
<.link
href={Routes.path("/sitemap.xml", locale: :none)}
target="_blank"
class="btn btn-primary"
>
<.icon name="hero-arrow-top-right-on-square" class="w-4 h-4 mr-1" /> Open in Browser
</.link>
<button class="btn" phx-click="close_preview">Close</button>
</div>
</div>
<div class="modal-backdrop" phx-click="close_preview"></div>
</div>
</div>
</PhoenixKitWeb.Components.LayoutWrapper.app_layout>