Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ gem "trilogy", "~> 2.9"

# Features
gem "bcrypt", "~> 3.1.7"
gem "rails-i18n", "~> 8.0" # Vietnamese locale support for Rails
gem "geared_pagination", "~> 1.2"
gem "rqrcode"
gem "redcarpet"
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ GEM
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails-i18n (8.1.0)
i18n (>= 0.7, < 2)
railties (>= 8.0.0, < 9)
rainbow (3.1.1)
rake (13.3.1)
rdoc (6.16.1)
Expand Down Expand Up @@ -528,6 +531,7 @@ DEPENDENCIES
puma (>= 5.0)
rack-mini-profiler
rails!
rails-i18n (~> 8.0)
redcarpet
rouge
rqrcode
Expand Down
12 changes: 6 additions & 6 deletions app/views/account/exports/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<% if @export.present? %>
<% @page_title = "Download Export" %>
<% @page_title = t("account.export.download_title") %>
<% else %>
<% @page_title = "Download Expired" %>
<% @page_title = t("account.export.expired_title") %>
<% end %>

<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to "Account Settings", account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
<%= back_link_to t("account.settings.title"), account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>

<div class="panel panel--wide shadow center flex flex-column gap">
<h2 class="txt-large margin-none font-weight-black"><%= @page_title %></h2>

<% if @export.present? %>
<p class="margin-none-block-start">Your export is ready. The download should start automatically.</p>
<p class="margin-none-block-start"><%= t("account.export.ready_message") %></p>

<%= link_to rails_blob_path(@export.file, disposition: "attachment"),
id: "download-link",
class: "btn btn--link",
data: { turbo: false, controller: "auto-click" } do %>
Download your data
<%= t("account.export.download_data") %>
<% end %>
<% else %>
<p class="margin-none-block-start">That download link has expired. You’ll need to <%= link_to "request a new export", account_settings_path, class: "txt-lnk" %>.</p>
<p class="margin-none-block-start"><%= t("account.export.expired_message_html", link: link_to(t("account.export.request_new"), account_settings_path, class: "txt-lnk")).html_safe %></p>
<% end %>

</div>
12 changes: 6 additions & 6 deletions app/views/account/join_codes/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<% @page_title = "Change usage limit" %>
<% @page_title = t("account.join_codes.change_limit_title") %>

<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to "Invite link", account_join_code_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
<%= back_link_to t("account.join_codes.invite_link"), account_join_code_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>

<article class="panel panel--wide center shadow flex flex-column gap-half" style="view-transition-name: <%= dom_id(@join_code) %>">
<header class="margin-block-end-half">
<h2 class="txt-large margin-none font-weight-black"><%= @page_title %></h2>
<p class="txt-medium margin-none">How many times can this link be used to join the account?</p>
<p class="txt-medium margin-none"><%= t("account.join_codes.change_limit_label") %></p>
</header>

<%= form_with model: @join_code, url: account_join_code_path, method: :patch, data: { controller: "form" }, html: { class: "flex flex-column gap" } do |form| %>
Expand All @@ -19,13 +19,13 @@
data: { action: "keydown.esc@document->form#cancel focus->form#select" } %>

<p class="margin-none txt-subtle">
This code has been used <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> times.
<%= t("account.join_codes.used_times") %> <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> <%= t("account.join_codes.times") %>.
</p>

<%= form.button type: :submit, class: "btn btn--link center txt-medium", data: { form_target: "submit" } do %>
<span>Save changes</span>
<span><%= t("common.buttons.save_changes") %></span>
<% end %>

<%= link_to "Go back", account_join_code_path, data: { form_target: "cancel" }, hidden: true %>
<%= link_to t("account.join_codes.go_back"), account_join_code_path, data: { form_target: "cancel" }, hidden: true %>
<% end %>
</article>
24 changes: 12 additions & 12 deletions app/views/account/join_codes/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<% @page_title = "Add people" %>
<% @page_title = t("account.join_codes.title") %>

<% content_for :header do %>
<div class="header__actions header__actions--start">
<%= back_link_to "Account Settings", account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
<%= back_link_to t("account.settings.title"), account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
</div>
<% end %>

<div class="panel panel--wide shadow center flex flex-column gap" style="view-transition-name: <%= dom_id(@join_code) %>">
<header>
<h2 class="txt-large margin-none font-weight-black"><%= @page_title %></h2>
<p class="txt-medium margin-none">Share the link below to invite people to this account</p>
<p class="txt-medium margin-none"><%= t("account.join_codes.description") %></p>
</header>

<% url = join_url(code: @join_code.code, script_name: Current.account.slug) %>
Expand All @@ -18,9 +18,9 @@

<% if Current.user.admin? %>
<%= button_to account_join_code_path, method: :delete, class: "btn btn--circle txt-small", data: {
turbo_confirm: "Are you sure you want to generate a new link? The previous code will stop working." } do %>
turbo_confirm: t("account.join_codes.generate_confirm") } do %>
<%= icon_tag "refresh" %>
<span class="for-screen-reader">Generate a new code</span>
<span class="for-screen-reader"><%= t("account.join_codes.generate_new") %></span>
<% end %>
<% end %>
</div>
Expand All @@ -30,23 +30,23 @@
controller: "copy-to-clipboard", action: "copy-to-clipboard#copy",
copy_to_clipboard_success_class: "btn--success", copy_to_clipboard_content_value: url } do %>
<%= icon_tag "copy-paste" %>
<span class="txt-nowrap">Copy invite link</span>
<span class="txt-nowrap"><%= t("account.join_codes.copy_link") %></span>
<% end %>

<div data-controller="dialog" data-dialog-modal-value="true" class="flex-inline">
<%= tag.button class: "btn", data: { action: "dialog#open" } do %>
<%= icon_tag "qr-code" %>
<span>Get QR code</span>
<span><%= t("account.join_codes.get_qr") %></span>
<% end %>

<dialog class="dialog panel shadow" data-dialog-target="dialog">
<p class="margin-none-block-start"><strong>Scan this code with the camera on your mobile device</strong></p>
<p class="margin-none-block-start"><strong><%= t("account.join_codes.qr_instruction") %></strong></p>

<%= qr_code_image(url) %>

<form method="dialog" class="margin-block-start flex justify-center">
<button class="btn">
<span>Done</span>
<span><%= t("account.join_codes.done") %></span>
</button>
</form>
</dialog>
Expand All @@ -57,12 +57,12 @@
<hr class="separator--horizontal full-width margin-block" style="--border-color: var(--color-ink-lighter)">

<p class="margin-none <%= "txt-negative" if !@join_code.active? %>">
This code has been used <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> times
(<%= @join_code.active? ? @join_code.usage_limit - @join_code.usage_count : "none" %> remaining)
<%= t("account.join_codes.used_times") %> <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> <%= t("account.join_codes.times") %>
(<%= @join_code.active? ? @join_code.usage_limit - @join_code.usage_count : t("account.join_codes.none") %> <%= t("account.join_codes.remaining") %>)

<% if Current.user.admin? %>
<%= link_to edit_account_join_code_path, class: @join_code.active? ? "txt-link" : "txt-negative txt-underline" do %>
<span>Change limit</span>
<span><%= t("account.join_codes.change_limit") %></span>
<% end %>
<% end %>
</p>
Expand Down
4 changes: 2 additions & 2 deletions app/views/account/settings/_entropy.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<header>
<h2 class="divider txt-large">Auto close</h2>
<p class="margin-none-block-start">Fizzy doesn’t let stale cards stick around forever. Cards automatically move to “Not Now” if there is no activity for specific period of time. <em>This is the default, global setting — you can override it on each board.</em></p>
<h2 class="divider txt-large"><%= t("account.entropy.title") %></h2>
<p class="margin-none-block-start"><%= t("account.entropy.description") %></p>
</header>

<%= render "entropy/auto_close", model: account.entropy, url: account_entropy_path, disabled: !Current.user.admin? %>
Expand Down
16 changes: 8 additions & 8 deletions app/views/account/settings/_export.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<header class="margin-block-start-double">
<h2 class="divider txt-large">Export your data</h2>
<p class="margin-none-block">Download an archive of your Fizzy data.</p>
<h2 class="divider txt-large"><%= t("account.export.title") %></h2>
<p class="margin-none-block"><%= t("account.export.description") %></p>
</header>

<div data-controller="dialog" data-dialog-modal-value="true">
<button type="button" class="btn" data-action="dialog#open">Begin export...</button>
<button type="button" class="btn" data-action="dialog#open"><%= t("account.export.button") %></button>

<dialog class="dialog panel panel--wide shadow" data-dialog-target="dialog">
<h2 class="margin-none txt-large">Export your account data</h2>
<p class="margin-none-block-start">This will kick off a request to generate a ZIP archive of all the data in boards you have access to.</p>
<p>When the file is ready, we’ll email you a link to download it. The link will expire after 24 hours.</p>
<h2 class="margin-none txt-large"><%= t("account.export.dialog_title") %></h2>
<p class="margin-none-block-start"><%= t("account.export.dialog_body_1") %></p>
<p><%= t("account.export.dialog_body_2") %></p>

<div class="flex gap justify-center">
<%= button_to "Start export", account_exports_path, method: :post, class: "btn btn--link", form: { data: { action: "submit->dialog#close" } } %>
<button type="button" class="btn" data-action="dialog#close">Cancel</button>
<%= button_to t("account.export.start_button"), account_exports_path, method: :post, class: "btn btn--link", form: { data: { action: "submit->dialog#close" } } %>
<button type="button" class="btn" data-action="dialog#close"><%= t("account.export.cancel") %></button>
</div>
</dialog>
</div>
4 changes: 2 additions & 2 deletions app/views/account/settings/_name.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<%= form_with model: account, url: account_settings_path, method: :put, scope: :account, data: { controller: "form" }, class: "flex gap-half" do |form| %>
<strong class="full-width"><%= form.text_field :name, required: true, class: "input input--transparent full-width txt-medium", placeholder: "Account name…", data: { action: "input->form#disableSubmitWhenInvalid" }, readonly: !Current.user.admin? %></strong>
<strong class="full-width"><%= form.text_field :name, required: true, class: "input input--transparent full-width txt-medium", placeholder: t("account.settings.name_placeholder"), data: { action: "input->form#disableSubmitWhenInvalid" }, readonly: !Current.user.admin? %></strong>

<% if Current.user.admin? %>
<%= form.button class: "btn btn--circle btn--link txt-medium", data: { form_target: "submit" }, disabled: form.object do %>
<%= icon_tag "arrow-right" %>
<span class="for-screen-reader">Save changes</span>
<span class="for-screen-reader"><%= t("common.buttons.save_changes") %></span>
<% end %>
<% end %>
<% end %>
8 changes: 4 additions & 4 deletions app/views/account/settings/_user.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<%= form_with model: user, url: user_role_path(user), data: { controller: "form" }, method: :patch do | form | %>
<span title="<%= role_display_name(user) %>">
<label class="btn btn--circle" for="<%= dom_id(user, :role) %>" aria-label="Role: <%= role_display_name(user) %>">
<label class="btn btn--circle" for="<%= dom_id(user, :role) %>" aria-label="<%= t("account.people.role_label", role: role_display_name(user)) %>">
<%= icon_tag "crown" %>
<span class="for-screen-reader">Role: <%= role_display_name(user) %></span>
<span class="for-screen-reader"><%= t("account.people.role_label", role: role_display_name(user)) %></span>
<%= form.check_box :role, { data: { action: "form#submit" }, disabled: !Current.user.can_administer?(user), checked: user.admin?, hidden: true, id: dom_id(user, :role) }, "admin", "member" %>
</label>
</span>
Expand All @@ -22,8 +22,8 @@
<%# FIXME: Move this Current.user check to a stimulus controller that just checks for admin? or the like we so we can cache user list %>
<%= button_to user, method: :delete, class: "btn btn--circle btn--negative",
disabled: !Current.user.can_administer?(user),
data: { turbo_confirm: "Are you sure you want to permanently remove this person from the account?" } do %>
data: { turbo_confirm: t("account.people.remove_confirm") } do %>
<%= icon_tag "minus" %>
<span class="for-screen-reader">Remove <%= user.name %> from the account</span>
<span class="for-screen-reader"><%= t("account.people.remove_user", name: user.name) %></span>
<% end %>
</li>
6 changes: 3 additions & 3 deletions app/views/account/settings/_users.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<header>
<h2 class="divider txt-medium margin-block-start">People on this account</h2>
<h2 class="divider txt-medium margin-block-start"><%= t("account.people.title") %></h2>
</header>

<%= tag.div class: "flex flex-column gap settings__user-filter", data: {
Expand All @@ -10,7 +10,7 @@
} do %>

<div class="settings__user-filter">
<input placeholder="Filter…" class="input input--transparent full-width txt-small" type="search" autocorrect="off" autocomplete="off" data-1p-ignore="true" data-filter-target="input" data-action="input->filter#filter">
<input placeholder="<%= t("common.forms.filter_placeholder") %>" class="input input--transparent full-width txt-small" type="search" autocorrect="off" autocomplete="off" data-1p-ignore="true" data-filter-target="input" data-action="input->filter#filter">

<ul class="settings__user-list margin-block-half" data-filter-target="list">
<%= render partial: "account/settings/user", collection: users %>
Expand All @@ -19,6 +19,6 @@

<%= link_to account_join_code_path, class: "btn btn--link center txt-small" do %>
<%= icon_tag "add" %>
<span>Invite people</span>
<span><%= t("account.people.invite") %></span>
<% end %>
<% end %>
4 changes: 2 additions & 2 deletions app/views/account/settings/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<% @page_title = "Account Settings" %>
<% @page_title = t("account.settings.title") %>

<% content_for :header do %>
<h1 class="header__title">
<%= @page_title %>
<% unless Current.user.admin? %>
<div class="txt-normal font-weight-normal">Only admins can change these settings</div>
<div class="txt-normal font-weight-normal"><%= t("account.settings.subtitle") %></div>
<% end %>
</h1>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/bar/_bar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="flex justify-center bar__placeholder" data-bar-target="buttonsContainer">
<%= tag.button class: "btn btn--plain", data: {
controller: "hotkey", action: "bar#search keydown.k@document->hotkey#click" } do %>
<span class="display-contents">Search <kbd class="hide-on-touch">K</kbd></span>
<span class="display-contents"><%= t("search.placeholder") %> <kbd class="hide-on-touch">K</kbd></span>
<% end %>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/boards/columns/_empty_placeholder.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="cards__list" data-drag-drop-item-container>
<div class="blank-slate blank-slate--drag card card--hide-unless-empty">
<p>Drag cards here</p>
<p><%= t("columns.drag_cards_here") %></p>
</div>
<div class="blank-slate blank-slate--empty card--hide-unless-empty">No cards here</div>
<div class="blank-slate blank-slate--empty card--hide-unless-empty"><%= t("columns.no_cards_here") %></div>
</div>
2 changes: 1 addition & 1 deletion app/views/boards/columns/closeds/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% @page_title = "Column: Done" %>
<% @page_title = t("columns.done_title") %>

<% content_for :header do %>
<div class="header__actions header__actions--start">
Expand Down
2 changes: 1 addition & 1 deletion app/views/boards/columns/not_nows/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% @page_title = "Column: Not Now" %>
<% @page_title = t("columns.not_now_title") %>

<% content_for :header do %>
<div class="header__actions header__actions--start">
Expand Down
10 changes: 5 additions & 5 deletions app/views/boards/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% @page_title = "Board Settings" %>
<% @page_title = t("boards.edit.title") %>

<% content_for :header do %>
<div class="header__actions header__actions--start">
Expand All @@ -8,7 +8,7 @@
<h1 class="header__title">
<div><%= @page_title %></div>
<% unless Current.user.can_administer_board?(@board) %>
<div class="txt-normal font-weight-normal">Only admins can change these settings</div>
<div class="txt-normal font-weight-normal"><%= t("boards.edit.subtitle") %></div>
<% end %>
</h1>
<% end %>
Expand All @@ -17,16 +17,16 @@
<div class="settings__panel settings__panel--users panel shadow center">
<%= form_with model: @board, class: "display-contents", data: {
controller: "form boards-form",
boards_form_self_removal_prompt_message_value: "Are you sure you want to remove yourself from this board? You won’t be able to get back in unless someone invites you.",
boards_form_self_removal_prompt_message_value: t("boards.access.self_removal_warning"),
action: "turbo:submit-start->boards-form#submitWithWarning" } do |form| %>
<%= render "boards/edit/name", form: form, board: @board %>
<%= render "boards/edit/users", board: @board, selected_users: @selected_users, unselected_users: @unselected_users, form: form %>

<button type="submit" id="log_in" class="btn btn--link center txt-normal" <%= "disabled" unless Current.user.can_administer_board?(@board) %>>
<span>Save changes</span>
<span><%= t("boards.edit.submit") %></span>
</button>

<%= link_to "Cancel and go back", @board, data: { form_target: "cancel", turbo_frame: "_top" }, hidden: true %>
<%= link_to t("common.buttons.go_back"), @board, data: { form_target: "cancel", turbo_frame: "_top" }, hidden: true %>
<% end %>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/boards/edit/_auto_close.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= turbo_frame_tag @board, :entropy do %>
<div class="margin-block-end">
<h2 class="divider txt-large">Auto close</h2>
<p class="margin-none-block-start">Fizzy doesn’t let stale cards stick around forever. Cards automatically move to “Not now” if no one updates, comments, or moves a card for…</p>
<h2 class="divider txt-large"><%= t("boards.auto_close.title") %></h2>
<p class="margin-none-block-start"><%= t("boards.auto_close.description") %></p>
<%= render "entropy/auto_close", model: board, url: board_entropy_path(board), disabled: !Current.user.can_administer_board?(@board) %>
</div>
<% end %>
Loading