-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Favor semantic html, extract component, add localization
- Loading branch information
Showing
8 changed files
with
125 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
value='1' | ||
<%= checked ? 'checked' : '' %> | ||
<%= required ? 'required' : '' %> | ||
<%= attrs %> | ||
/> |
29 changes: 29 additions & 0 deletions
29
app/components/onboarding_channels_checkboxes/onboarding_channels_checkboxes.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.OnboardingChannelsCheckboxes { | ||
border: 0; | ||
} | ||
|
||
.OnboardingChannelsCheckboxes-legend { | ||
display: block; | ||
font-weight: 600; | ||
font-size: var(--font-size); | ||
} | ||
|
||
.OnboardingChannelsCheckboxes-helpText { | ||
font-size: var(--font-size-s); | ||
color: var(--color-text-light); | ||
} | ||
|
||
.OnboardingChannelsCheckboxes-list { | ||
list-style: none; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.OnboardingChannelsCheckboxes-listItem { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.OnboardingChannelsCheckboxes-listItem > .Checkbox { | ||
margin-right: var(--spacing-unit-xs); | ||
} |
16 changes: 16 additions & 0 deletions
16
app/components/onboarding_channels_checkboxes/onboarding_channels_checkboxes.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<fieldset <%= attrs %>> | ||
<legend class="OnboardingChannelsCheckboxes-legend"> | ||
<%= t '.legend' %> | ||
</legend> | ||
<p class="OnboardingChannelsCheckboxes-helpText"> | ||
<%= t '.help_text' %> | ||
</p> | ||
<ul class="OnboardingChannelsCheckboxes-list"> | ||
<% Setting.channels.each do |key, value| %> | ||
<li class="OnboardingChannelsCheckboxes-listItem"> | ||
<%= c 'checkbox', id: "setting[channels][#{key}]", checked: value %> | ||
<label for=<%= "setting[channels][#{key}]" %>><%= key.to_s.camelize %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</fieldset> |
5 changes: 5 additions & 0 deletions
5
app/components/onboarding_channels_checkboxes/onboarding_channels_checkboxes.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module OnboardingChannelsCheckboxes | ||
class OnboardingChannelsCheckboxes < ApplicationComponent; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.SettingsForm { | ||
padding-left: var(--limit-max-inner-width); | ||
padding-right: var(--limit-max-inner-width); | ||
margin: var(--spacing-unit) 0; | ||
} | ||
|
||
.SettingsForm .Section { | ||
padding-left: 0; | ||
padding-right: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,76 @@ | ||
<%= c 'form', model: Setting.new, multipart: true do %> | ||
<%= c 'stack', space: :xlarge do %> | ||
<%= c 'form', model: Setting.new, multipart: true, **attrs do %> | ||
<%= c 'section' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.project_settings') } %> | ||
<%= c('settings_field', type: :input, attr: :project_name) %> | ||
<% end %> | ||
|
||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.project_settings') } %> | ||
<%= c('settings_field', type: :input, attr: :project_name) %> | ||
<%= c 'section' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.onboarding') } %> | ||
<%= c('settings_field', type: :image_input, attr: :onboarding_logo) %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_byline) %> | ||
<%= c('settings_field', type: :image_input, attr: :onboarding_hero) %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_title) %> | ||
<%= c('settings_field', type: :textarea, attr: :onboarding_page) %> | ||
<% if current_user.admin? %> | ||
<%= c 'onboarding_channels_checkboxes' %> | ||
<%= c('settings_field', type: :url_input, attr: :onboarding_data_protection_link) %> | ||
<%= c('settings_field', type: :textarea, attr: :onboarding_data_processing_consent_additional_info) %> | ||
<%= c('settings_field', type: :url_input, attr: :onboarding_imprint_link) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if current_user.admin? %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.onboarding') } %> | ||
<%= c('settings_field', type: :image_input, attr: :onboarding_logo) %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_byline) %> | ||
<%= c('settings_field', type: :image_input, attr: :onboarding_hero) %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_title) %> | ||
<%= c('settings_field', type: :textarea, attr: :onboarding_page) %> | ||
<%= c 'section', styles: [:noHorizontalPadding] do %> | ||
<%= c 'heading', styles: [:beta] do %> | ||
Channels | ||
<% end %> | ||
<%= c 'flex' do %> | ||
<% Setting.channels.each do |key, value| %> | ||
<%= c('field', | ||
object: Setting.new, | ||
attr: :channels, | ||
styles: [:leftAligned], | ||
label: key.to_s.camelize | ||
) do |field| %> | ||
<%= c 'checkbox', id: "setting[channels][#{key}]", checked: value %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% if current_user.admin? %> | ||
<%= c('settings_field', type: :url_input, attr: :onboarding_data_protection_link) %> | ||
<%= c('settings_field', type: :textarea, attr: :onboarding_data_processing_consent_additional_info) %> | ||
<%= c('settings_field', type: :url_input, attr: :onboarding_imprint_link) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if current_user.admin? %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t 'setting.form.groups.onboarding_additional_consent' } %> | ||
|
||
<%= c('field', | ||
object: Setting.new, | ||
attr: :onboarding_ask_for_additional_consent, | ||
styles: [:horizontal, :leftAligned], | ||
) do |field| %> | ||
<%= c 'checkbox', **field.input_defaults, checked: Setting.onboarding_ask_for_additional_consent %> | ||
<% end %> | ||
<%= c('heading', tag: :h2) { t 'setting.form.groups.onboarding_additional_consent' } %> | ||
|
||
<%= c('settings_field', type: :input, attr: :onboarding_additional_consent_heading) %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_additional_consent_text) %> | ||
<%= c('field', | ||
object: Setting.new, | ||
attr: :onboarding_ask_for_additional_consent, | ||
styles: [:horizontal, :leftAligned], | ||
) do |field| %> | ||
<%= c 'checkbox', **field.input_defaults, checked: Setting.onboarding_ask_for_additional_consent %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.onboarding_success') } %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_success_heading) %> | ||
<%= c('settings_field', type: :textarea, attr: :onboarding_success_text) %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_additional_consent_heading) %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_additional_consent_text) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.onboarding_unauthorized') } %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_unauthorized_heading) %> | ||
<%= c('settings_field', type: :textarea, attr: :onboarding_unauthorized_text) %> | ||
<% end %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.onboarding_success') } %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_success_heading) %> | ||
<%= c('settings_field', type: :textarea, attr: :onboarding_success_text) %> | ||
<% end %> | ||
|
||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.signal') } %> | ||
<%= c('settings_field', type: :textarea, attr: :signal_unknown_content_message) %> | ||
<% end %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.onboarding_unauthorized') } %> | ||
<%= c('settings_field', type: :input, attr: :onboarding_unauthorized_heading) %> | ||
<%= c('settings_field', type: :textarea, attr: :onboarding_unauthorized_text) %> | ||
<% end %> | ||
|
||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.telegram') } %> | ||
<%= c('settings_field', type: :textarea, attr: :telegram_unknown_content_message) %> | ||
<%= c('settings_field', type: :textarea, attr: :telegram_contributor_not_found_message) %> | ||
<% end %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.signal') } %> | ||
<%= c('settings_field', type: :textarea, attr: :signal_unknown_content_message) %> | ||
<% end %> | ||
|
||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.threema') } %> | ||
<%= c('settings_field', type: :textarea, attr: :threema_unknown_content_message) %> | ||
<% end %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.telegram') } %> | ||
<%= c('settings_field', type: :textarea, attr: :telegram_unknown_content_message) %> | ||
<%= c('settings_field', type: :textarea, attr: :telegram_contributor_not_found_message) %> | ||
<% end %> | ||
|
||
<% if current_user.admin? %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.all') } %> | ||
<%= c('settings_field', type: :image_input, attr: :channel_image) %> | ||
<%= c('settings_field', type: :textarea, attr: :about) %> | ||
<% end %> | ||
<% end %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.threema') } %> | ||
<%= c('settings_field', type: :textarea, attr: :threema_unknown_content_message) %> | ||
<% end %> | ||
|
||
<%= c 'submit_button', label: t('save') %> | ||
<% if current_user.admin? %> | ||
<%= c 'stack' do %> | ||
<%= c('heading', tag: :h2) { t('setting.form.groups.all') } %> | ||
<%= c('settings_field', type: :image_input, attr: :channel_image) %> | ||
<%= c('settings_field', type: :textarea, attr: :about) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= c 'submit_button', label: t('save') %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters