Skip to content

Commit 29d0f82

Browse files
authored
Apply unified capitalization to buttons and titles (#3321)
1 parent 5ff8526 commit 29d0f82

21 files changed

+98
-94
lines changed

assets/js/dashboard/datepicker.js

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function renderArrow(query, site, period, prevDate, nextDate) {
101101
);
102102
}
103103

104-
function DatePickerArrows({site, query}) {
104+
function DatePickerArrows({ site, query }) {
105105
if (query.period === "year") {
106106
const prevDate = formatISO(shiftMonths(query.date, -12));
107107
const nextDate = formatISO(shiftMonths(query.date, 12));
@@ -122,7 +122,7 @@ function DatePickerArrows({site, query}) {
122122
return null
123123
}
124124

125-
function DisplayPeriod({query, site}) {
125+
function DisplayPeriod({ query, site }) {
126126
if (query.period === "day") {
127127
if (isToday(site, query.date)) {
128128
return "Today";
@@ -154,7 +154,7 @@ function DisplayPeriod({query, site}) {
154154
return 'Realtime'
155155
}
156156

157-
function DatePicker({query, site, history}) {
157+
function DatePicker({ query, site, history }) {
158158
const [open, setOpen] = useState(false)
159159
const [mode, setMode] = useState('menu')
160160
const dropDownNode = useRef(null)
@@ -208,21 +208,21 @@ function DatePicker({query, site, history}) {
208208
setOpen(false);
209209

210210
const keybindings = {
211-
d: {date: false, period: 'day'},
212-
e: {date: formatISO(shiftDays(nowForSite(site), -1)), period: 'day'},
213-
r: {period: 'realtime'},
214-
w: {date: false, period: '7d'},
215-
m: {date: false, period: 'month'},
216-
y: {date: false, period: 'year'},
217-
t: {date: false, period: '30d'},
218-
s: {date: false, period: '6mo'},
219-
l: {date: false, period: '12mo'},
220-
a: {date: false, period: 'all'},
211+
d: { date: false, period: 'day' },
212+
e: { date: formatISO(shiftDays(nowForSite(site), -1)), period: 'day' },
213+
r: { period: 'realtime' },
214+
w: { date: false, period: '7d' },
215+
m: { date: false, period: 'month' },
216+
y: { date: false, period: 'year' },
217+
t: { date: false, period: '30d' },
218+
s: { date: false, period: '6mo' },
219+
l: { date: false, period: '12mo' },
220+
a: { date: false, period: 'all' },
221221
}
222222

223223
const redirect = keybindings[e.key.toLowerCase()]
224224
if (redirect) {
225-
navigateToQuery(history, query, {...newSearch, ...redirect})
225+
navigateToQuery(history, query, { ...newSearch, ...redirect })
226226
} else if (e.key.toLowerCase() === 'x') {
227227
toggleComparisons(history, query, site)
228228
} else if (e.key.toLowerCase() === 'c') {
@@ -240,7 +240,7 @@ function DatePicker({query, site, history}) {
240240
})
241241

242242
useEffect(() => {
243-
if (mode === 'calendar' && open) {
243+
if (mode === 'calendar' && open) {
244244
openCalendar()
245245
}
246246
}, [mode])
@@ -260,9 +260,9 @@ function DatePicker({query, site, history}) {
260260
[from, to] = [parseNaiveDate(from), parseNaiveDate(to)]
261261

262262
if (from.isSame(to)) {
263-
navigateToQuery( history, query, { period: 'day', date: formatISO(from), from: false, to: false })
263+
navigateToQuery(history, query, { period: 'day', date: formatISO(from), from: false, to: false })
264264
} else {
265-
navigateToQuery( history, query, { period: 'custom', date: false, from: formatISO(from), to: formatISO(to) })
265+
navigateToQuery(history, query, { period: 'custom', date: false, from: formatISO(from), to: formatISO(to) })
266266
}
267267
}
268268

@@ -305,10 +305,10 @@ function DatePicker({query, site, history}) {
305305

306306
return (
307307
<QueryLink
308-
to={{from: false, to: false, period, ...opts}}
308+
to={{ from: false, to: false, period, ...opts }}
309309
onClick={() => setOpen(false)}
310310
query={query}
311-
className={`${boldClass } px-4 py-2 text-sm leading-tight hover:bg-gray-100 hover:text-gray-900
311+
className={`${boldClass} px-4 py-2 text-sm leading-tight hover:bg-gray-100 hover:text-gray-900
312312
dark:hover:bg-gray-900 dark:hover:text-gray-100 flex items-center justify-between`}
313313
>
314314
{text}
@@ -333,12 +333,12 @@ function DatePicker({query, site, history}) {
333333
{renderLink("realtime", "Realtime")}
334334
</div>
335335
<div className="py-1 border-b border-gray-200 dark:border-gray-500 date-option-group">
336-
{renderLink("7d", "Last 7 days")}
337-
{renderLink("30d", "Last 30 days")}
336+
{renderLink("7d", "Last 7 Days")}
337+
{renderLink("30d", "Last 30 Days")}
338338
</div>
339339
<div className="py-1 border-b border-gray-200 dark:border-gray-500 date-option-group">
340-
{ renderLink('month', 'Month to Date') }
341-
{ renderLink('month', 'Last month', {date: lastMonth(site)}) }
340+
{renderLink('month', 'Month to Date')}
341+
{renderLink('month', 'Last Month', { date: lastMonth(site) })}
342342
</div>
343343
<div className="py-1 border-b border-gray-200 dark:border-gray-500 date-option-group">
344344
{renderLink("year", "Year to Date")}
@@ -358,22 +358,22 @@ function DatePicker({query, site, history}) {
358358
aria-expanded="false"
359359
aria-controls="calendar"
360360
>
361-
Custom range
361+
Custom Range
362362
<span className='font-normal'>C</span>
363363
</span>
364364
</div>
365-
{ !COMPARISON_DISABLED_PERIODS.includes(query.period) &&
365+
{!COMPARISON_DISABLED_PERIODS.includes(query.period) &&
366366
<div className="py-1 date-option-group border-t border-gray-200 dark:border-gray-500">
367367
<span
368368
onClick={() => {
369369
toggleComparisons(history, query, site)
370370
setOpen(false)
371371
}}
372372
className="px-4 py-2 text-sm leading-tight hover:bg-gray-100 dark:hover:bg-gray-900 hover:text-gray-900 dark:hover:text-gray-100 cursor-pointer flex items-center justify-between">
373-
{ isComparisonEnabled(query.comparison) ? 'Disable comparison' : 'Compare' }
373+
{isComparisonEnabled(query.comparison) ? 'Disable comparison' : 'Compare'}
374374
<span className='font-normal'>X</span>
375375
</span>
376-
</div> }
376+
</div>}
377377
</div>
378378
</div>
379379
);
@@ -388,7 +388,8 @@ function DatePicker({query, site, history}) {
388388
minDate: site.statsBegin,
389389
showMonths: 1,
390390
static: true,
391-
animate: true}}
391+
animate: true
392+
}}
392393
ref={calendar}
393394
className="invisible"
394395
onClose={setCustomDate}

assets/js/dashboard/site-switcher.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export default class SiteSwitcher extends React.Component {
169169
role="menuitem"
170170
>
171171
<Cog8ToothIcon className="mr-2 h-4 w-4 text-gray-500 dark:text-gray-200 group-hover:text-gray-600 dark:group-hover:text-gray-400 group-focus:text-gray-500 dark:group-focus:text-gray-200" />
172-
Site settings
172+
Site Settings
173173
</a>
174174
</div>
175175
<div className="border-t border-gray-200 dark:border-gray-500"></div>
@@ -217,7 +217,7 @@ export default class SiteSwitcher extends React.Component {
217217
className="flex px-4 py-2 md:text-sm leading-5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-900 hover:text-gray-900 dark:hover:text-gray-100 focus:outline-none focus:bg-gray-100 dark:focus:bg-gray-900 focus:text-gray-900 dark:focus:text-gray-100"
218218
role="menuitem"
219219
>
220-
View all
220+
View All
221221
</a>
222222
</React.Fragment>
223223
)

lib/plausible_web/email.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ defmodule PlausibleWeb.Email do
114114
base_email()
115115
|> to(email)
116116
|> tag("spike-notification")
117-
|> subject("Traffic spike on #{site.domain}")
117+
|> subject("Traffic Spike on #{site.domain}")
118118
|> render("spike_notification.html", %{
119119
site: site,
120120
current_visitors: current_visitors,

lib/plausible_web/live/funnel_settings.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ defmodule PlausibleWeb.Live.FunnelSettings do
5555
id="funnels-list"
5656
funnels={@funnels}
5757
/>
58-
<button type="button" class="button mt-6" phx-click="add-funnel">+ Add funnel</button>
58+
<button type="button" class="button mt-6" phx-click="add-funnel">+ Add Funnel</button>
5959
</div>
6060
6161
<div :if={@goal_count < Funnel.min_steps()}>

lib/plausible_web/live/funnel_settings/form.ex

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,18 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do
4949
phx-target="#funnel-form"
5050
onkeydown="return event.key != 'Enter';"
5151
>
52-
<%= label(f, "Funnel name",
53-
class: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"
54-
) %>
52+
<label
53+
for={f[:name].name}
54+
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"
55+
>
56+
Funnel Name
57+
</label>
5558
<.input field={f[:name]} />
5659
5760
<div id="steps-builder">
58-
<%= label(f, "Funnel Steps",
59-
class: "mt-6 block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"
60-
) %>
61+
<label class="mt-6 block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
62+
Funnel Steps
63+
</label>
6164
6265
<div :for={step_idx <- @step_ids} class="flex mb-3">
6366
<div class="w-2/5 flex-1">
@@ -131,7 +134,7 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do
131134
class="focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-900 dark:text-gray-300 block w-7/12 rounded-md sm:text-sm border-gray-300 dark:border-gray-500"
132135
/>
133136
134-
<.error :for={{msg, _} <- @field.errors}>Funnel name <%= msg %></.error>
137+
<.error :for={{msg, _} <- @field.errors}>Funnel Name <%= msg %></.error>
135138
</div>
136139
"""
137140
end

lib/plausible_web/live/goal_settings/form.ex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
5050
phx-submit="save-goal"
5151
phx-click-away="cancel-add-goal"
5252
>
53-
<h2 class="text-xl font-black dark:text-gray-100">Add goal for <%= @domain %></h2>
53+
<h2 class="text-xl font-black dark:text-gray-100">Add Goal for <%= @domain %></h2>
5454
5555
<.tabs tabs={@tabs} />
5656
@@ -59,7 +59,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
5959
6060
<div class="py-4">
6161
<button type="submit" class="button text-base font-bold w-full">
62-
Add goal
62+
Add Goal
6363
</button>
6464
</div>
6565
</.form>
@@ -75,7 +75,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
7575
~H"""
7676
<div class="py-2">
7777
<.label for="page_path_input">
78-
Page path
78+
Page Path
7979
</.label>
8080
8181
<.live_component
@@ -106,7 +106,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
106106
<div class="my-6">
107107
<div id="event-fields">
108108
<div class="pb-6 text-xs text-gray-700 dark:text-gray-200 text-justify rounded-md">
109-
Custom events are not tracked by default - you have to configure them on your site to be sent to Plausible. See examples and learn more in <a
109+
Custom Events are not tracked by default - you have to configure them on your site to be sent to Plausible. See examples and learn more in <a
110110
class="text-indigo-500 hover:underline"
111111
target="_blank"
112112
rel="noreferrer"
@@ -118,7 +118,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
118118
<.input
119119
autofocus
120120
field={@f[:event_name]}
121-
label="Event name"
121+
label="Event Name"
122122
class="focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-900 dark:text-gray-300 block w-7/12 rounded-md sm:text-sm border-gray-300 dark:border-gray-500 w-full p-2 mt-2"
123123
placeholder="e.g. Signup"
124124
autocomplete="off"
@@ -156,13 +156,13 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
156156
class="ml-3 font-medium text-gray-900 dark:text-gray-200"
157157
id="enable-revenue-tracking"
158158
>
159-
Enable revenue tracking
159+
Enable Revenue Tracking
160160
</span>
161161
</div>
162162
163163
<div class="rounded-md bg-yellow-50 dark:bg-yellow-900 p-4" x-show="active">
164164
<p class="text-xs text-yellow-700 dark:text-yellow-50 text-justify">
165-
Revenue tracking is an upcoming premium feature that's free-to-use
165+
Revenue Tracking is an upcoming premium feature that's free-to-use
166166
during the private preview. Pricing will be announced soon. See
167167
examples and learn more in <a
168168
class="font-medium text-yellow underline hover:text-yellow-600"
@@ -196,7 +196,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
196196

197197
def tabs(assigns) do
198198
~H"""
199-
<div class="mt-6 font-medium dark:text-gray-100">Goal trigger</div>
199+
<div class="mt-6 font-medium dark:text-gray-100">Goal Trigger</div>
200200
<div class="my-3 w-full flex rounded border border-gray-300 dark:border-gray-500">
201201
<.custom_events_tab tabs={@tabs} />
202202
<.pageviews_tab tabs={@tabs} />
@@ -216,7 +216,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
216216
id="event-tab"
217217
phx-click="switch-tab"
218218
>
219-
Custom event
219+
Custom Event
220220
</a>
221221
"""
222222
end

lib/plausible_web/templates/layout/site_settings.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%= render_layout "app.html", assigns do %>
22
<div class="container pt-6">
3-
<%= link("← Back to stats", to: "/#{URI.encode_www_form(@site.domain)}", class: "text-sm text-indigo-600 font-bold") %>
3+
<%= link("← Back to Stats", to: "/#{URI.encode_www_form(@site.domain)}", class: "text-sm text-indigo-600 font-bold") %>
44
<div class="pb-5 border-b border-gray-200 dark:border-gray-500">
55
<h2 class="text-2xl font-bold leading-7 text-gray-900 dark:text-gray-100 sm:text-3xl sm:leading-9 sm:truncate">
66
Settings for <%= @site.domain %>

lib/plausible_web/templates/site/change_domain.html.eex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
</div>
1616

1717
<p class="text-sm sm:text-sm text-gray-700 dark:text-gray-300">
18-
<span class="font-bold dark:text-gray-100">Once you change your domain, you must update the JavaScript snippet on your site within 72 hours to guarantee continuous tracking</span>. If you're using the API, please also make sure to update your API credentials.</p>
18+
<span class="font-bold dark:text-gray-100">Once you change your domain, you must update the JavaScript snippet on your site within 72 hours to guarantee continuous tracking</span>. If you're using the API, please also make sure to update your API credentials.</p>
1919
<p class="text-sm sm:text-sm text-gray-700 dark:text-gray-300 mt-4">
2020
Visit our <a target="_blank" href="https://plausible.io/docs/change-domain-name/" class="text-indigo-500">documentation</a> for details.
2121
</p>
2222

23-
<%= submit "Change domain and add new snippet →", class: "button mt-4 w-full" %>
23+
<%= submit "Change Domain and add new Snippet →", class: "button mt-4 w-full" %>
2424

2525
<div class="text-center mt-8">
26-
<%= link "Back to site settings", to: Routes.site_path(@conn, :settings_general, @site.domain), class: "text-indigo-500 w-full text-center" %>
26+
<%= link "Back to Site Settings", to: Routes.site_path(@conn, :settings_general, @site.domain), class: "text-indigo-500 w-full text-center" %>
2727
</div>
2828
<% end %>
2929
</div>

lib/plausible_web/templates/site/index.html.eex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
<div class="mt-6 pb-5 border-b border-gray-200 dark:border-gray-500 flex items-center justify-between">
2727
<h2 class="text-2xl font-bold leading-7 text-gray-900 dark:text-gray-100 sm:text-3xl sm:leading-9 sm:truncate flex-shrink-0">
28-
My sites
28+
My Sites
2929
</h2>
30-
<a href="/sites/new" class="button my-2 sm:my-0 w-auto">+ Add a website</a>
30+
<a href="/sites/new" class="button my-2 sm:my-0 w-auto">+ Add Website</a>
3131
</div>
3232

3333
<ul class="my-6 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">

lib/plausible_web/templates/site/settings_danger_zone.html.eex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<h2 class="text-lg leading-6 font-medium text-gray-900 dark:text-gray-100">Danger zone</h2>
55
<p class="mt-1 text-sm leading-5 text-gray-500 dark:text-gray-200">Destructive actions below can result in irrecoverable data loss. Be careful.</p>
66
</div>
7-
<%= if @conn.assigns[:current_user_role] == :owner do %>
7+
<%= if @conn.assigns[:current_user_role] == :owner do %>
88
<li class="py-4 flex items-center justify-between space-x-4">
99
<div class="flex flex-col">
1010
<p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">
11-
Transfer site ownership
11+
Transfer Site Ownership
1212
</p>
1313
<p class="text-sm leading-5 text-gray-500 dark:text-gray-200">
1414
Transfer ownership of the site to a different account
@@ -22,7 +22,7 @@
2222
<li class="py-4 flex items-center justify-between space-x-4">
2323
<div class="flex flex-col">
2424
<p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">
25-
Reset stats
25+
Reset Stats
2626
</p>
2727
<p class="text-sm leading-5 text-gray-500 dark:text-gray-200">
2828
Reset all stats but keep the site configuration intact
@@ -35,7 +35,7 @@
3535
<li class="py-4 flex items-center justify-between space-x-4">
3636
<div class="flex max-w-md flex-col">
3737
<p class="text-sm leading-5 font-medium text-gray-900 dark:text-gray-100">
38-
Delete site
38+
Delete Site
3939
</p>
4040
<p class="text-sm leading-5 text-gray-500 dark:text-gray-200">
4141
Permanently remove all stats and the site configuration too

0 commit comments

Comments
 (0)