I18n app/views/campaigns/_settings_modal.html.erb

This commit is contained in:
Eric Schultz 2021-04-26 13:51:49 -05:00 committed by Eric Schultz
parent da5e90d4fd
commit 1a5ae09231
2 changed files with 67 additions and 39 deletions

View file

@ -2,7 +2,7 @@
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE -%> # Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE -%>
<div class='modal fullScreen campaignSettings' id='campaignSettings'> <div class='modal fullScreen campaignSettings' id='campaignSettings'>
<%= render 'common/modal_header', title: 'Campaign Settings' %> <%= render 'common/modal_header', title: t('campaigns.admin.campaign_settings') %>
<form class='form--flatFields' autosubmit action='/nonprofits/<%=@nonprofit.id%>/campaigns/<%=@campaign.id%>' method='put' data-reload-with-slug parsley-validate> <form class='form--flatFields' autosubmit action='/nonprofits/<%=@nonprofit.id%>/campaigns/<%=@campaign.id%>' method='put' data-reload-with-slug parsley-validate>
@ -10,14 +10,14 @@
<div class='modal-body'> <div class='modal-body'>
<div class='u-margin--auto'> <div class='u-margin--auto'>
<fieldset class='col-right-12'> <fieldset class='col-right-12'>
<label>What's your reason for supporting <%= @parent_campaign.name %>?</label> <label><%= t('campaigns.admin.reason_for_supporting_label', @parent_campaign.name) %></label>
<p>Your passion is contagious! Inspire giving by telling your network why youre getting involved in this campaign.</p> <p><%= t('campaigns.admin.your_passion_is_contagious')%></p>
<textarea class='u-marginTop--15' rows='4' name='campaign[reason_for_supporting]' required><%= @campaign.reason_for_supporting %></textarea> <textarea class='u-marginTop--15' rows='4' name='campaign[reason_for_supporting]' required><%= @campaign.reason_for_supporting %></textarea>
</fieldset> </fieldset>
<fieldset class='group u-marginBottom--0'> <fieldset class='group u-marginBottom--0'>
<label class='u-paddingTop--5'>Goal Amount</label> <label class='u-paddingTop--5'><%=t('campaigns.admin.goal_amount_label')%></label>
<div class='prepend--dollar'> <div class='prepend--dollar'>
<input class='input--100 u-marginBottom--5' value='1000' type='number' name='campaign[goal_amount_dollars]' required min='1' value='<%= sprintf("%.2f", @campaign.goal_amount / 100.0) %>'> <input class='input--100 u-marginBottom--5' value='1000' type='number' name='campaign[goal_amount_dollars]' required min='1' value='<%= sprintf("%.2f", @campaign.goal_amount / 100.0) %>'>
</div> </div>
@ -29,12 +29,12 @@
<div class='modal-body'> <div class='modal-body'>
<section class='layout--two'> <section class='layout--two'>
<fieldset> <fieldset>
<label>Title </label> <label><%= t('campaigns.admin.title_label')%></label>
<input type='text' class='u-marginBottom--0' name='campaign[name]' value='<%= @campaign.name %>'> <input type='text' class='u-marginBottom--0' name='campaign[name]' value='<%= @campaign.name %>'>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label class='u-block'>Tagline</label> <label class='u-block'><%= t('campaigns.admin.tagline_label')%> </label>
<input type='text' name='campaign[tagline]' value='<%= @campaign.tagline %>'> <input type='text' name='campaign[tagline]' value='<%= @campaign.tagline %>'>
</fieldset> </fieldset>
</section> </section>
@ -43,17 +43,17 @@
<section class='layout--three'> <section class='layout--three'>
<fieldset> <fieldset>
<label>Goal</label> <label><%= t('campaigns.admin.goal_label')%></label>
<div class='prepend--dollar u-inlineBlock'> <div class='prepend--dollar u-inlineBlock'>
<input type='number' parsley-type='number' class='input--150' name='campaign[goal_amount_dollars]' value='<%= sprintf("%.2f", @campaign.goal_amount / 100.0) %>'> <input type='number' parsley-type='number' class='input--150' name='campaign[goal_amount_dollars]' value='<%= sprintf("%.2f", @campaign.goal_amount / 100.0) %>'>
</div> </div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label>End Date & Time</label> <label><%= t('campaigns.admin.end_date_and_time_label')%></label>
<div pikaday-timepicker='MM/DD/YYYY hh:mm a'> <div pikaday-timepicker='MM/DD/YYYY hh:mm a'>
<input class='u-width--200 u-bold u-inlineBlock' type='text' name='campaign[end_datetime]' required parsley-trigger='change' placeholder='MM/DD/YYYY HH:MM' value='<%= Format::Date.full(@campaign.end_datetime, @nonprofit.timezone) %>'> <input class='u-width--200 u-bold u-inlineBlock' type='text' name='campaign[end_datetime]' required parsley-trigger='change' placeholder='MM/DD/YYYY HH:MM' value='<%= Format::Date.full(@campaign.end_datetime, @nonprofit.timezone) %>'>
<a class='button edit u-inlineBlock'>Set</a> <a class='button edit u-inlineBlock'><%= t('ui.set') %></a>
</div> </div>
</fieldset> </fieldset>
</section> </section>
@ -66,8 +66,8 @@
<section class='layout--three u-overflow--hidden'> <section class='layout--three u-overflow--hidden'>
<fieldset> <fieldset>
<label>Main Image <small>(at least 500x400)</small></label> <label><%= t('campaigns.admin.main_image_label_html') %></label>
<p><small>Used for previews and social media</small></p> <p><small><%= t('campaigns.admin.main_image_label_subdescription') %></small></p>
<div class='image-upload u-inlineBlock' style='background-image: url("<%= @campaign.main_image.attached? <div class='image-upload u-inlineBlock' style='background-image: url("<%= @campaign.main_image.attached?
? rails_storage_proxy_url(@campaign.main_image_by_size(:thumb)) : '' %>");'> ? rails_storage_proxy_url(@campaign.main_image_by_size(:thumb)) : '' %>");'>
<span><i class='fa fa-pencil'></i> Edit</span> <span><i class='fa fa-pencil'></i> Edit</span>
@ -76,39 +76,39 @@
</fieldset> </fieldset>
<fieldset> <fieldset>
<label>Header Image <small>(1000x600)</small></label> <label><%= t('campaigns.admin.header_image_label_html') %></label>
<p><small>Used at top of campaign page</small></p> <p><small><%= t('campaigns.admin.header_image_label_subdescription') %></small></p>
<% if @campaign_background_image %> <% if @campaign_background_image %>
<div class='image-upload u-inlineBlock' style='background-image:url(<%= @campaign_background_image %>)'> <div class='image-upload u-inlineBlock' style='background-image:url(<%= @campaign_background_image %>)'>
<!--= on 'click' (open_modal 'uploadBackgroundImage') --> <!--= on 'click' (open_modal 'uploadBackgroundImage') -->
<span><i class='fa fa-pencil'></i> Edit</span> <span><i class='fa fa-pencil'></i> <%= t('ui.edit') %></span>
</div> </div>
<% else %> <% else %>
<a class='button edit'> <a class='button edit'>
<!--= on 'click' (open_modal 'uploadBackgroundImage') --> <!--= on 'click' (open_modal 'uploadBackgroundImage') -->
<i class='fa fa-plus'></i> Add Image </i> <i class='fa fa-plus'></i> <%= t('campaigns.admin.add_image_label')%> </i>
</a> </a>
<% end %> <% end %>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label>Campaign Video </label> <label><%= t('campaigns.admin.campaign_video_label')%></label>
<p><small>Videos are optional but recommended</small></p> <p><small><%= t('campaigns.admin.campaign_video_label_subdescription')%></small></p>
<% if @campaign.vimeo_video_id || @campaign.youtube_video_id%> <% if @campaign.vimeo_video_id || @campaign.youtube_video_id%>
<% if @campaign.vimeo_video_id %> <% if @campaign.vimeo_video_id %>
<div class='image-upload u-inlineBlock'> <div class='image-upload u-inlineBlock'>
<!--= set_attr 'style' vimeo_image_url --> <!--= set_attr 'style' vimeo_image_url -->
<!--= on 'click' (open_modal 'videoModal') --> <!--= on 'click' (open_modal 'videoModal') -->
<span> <i class='fa fa-pencil'></i> Edit</span> <span> <i class='fa fa-pencil'></i> <%=t('ui.edit')%></span>
</div> </div>
<% else%> <% else%>
<div class='image-upload u-inlineBlock' style="background-image:url('http://img.youtube.com/vi/<%=@campaign.youtube_video_id%>/0.jpg')"> <div class='image-upload u-inlineBlock' style="background-image:url('http://img.youtube.com/vi/<%=@campaign.youtube_video_id%>/0.jpg')">
<!--= on 'click' (open_modal 'videoModal') --> <!--= on 'click' (open_modal 'videoModal') -->
<span> <i class='fa fa-pencil'></i> Edit</span> <span> <i class='fa fa-pencil'></i> <%=t('ui.edit')%></span>
</div> </div>
<% end %> <% end %>
<% else %> <% else %>
<a class='button edit'><i class='fa fa-plus'></i> Add Video</a> <a class='button edit'><i class='fa fa-plus'></i> <%= t('campaigns.admin.add_video_label')%></a>
<!--= on 'click' (open_modal 'videoModal') --> <!--= on 'click' (open_modal 'videoModal') -->
<% end %> <% end %>
</fieldset> </fieldset>
@ -117,17 +117,17 @@
<hr> <hr>
<section class='layout--one'> <section class='layout--one'>
<fieldset> <fieldset>
<label>Banner <small>(1000x120)</small></label> <label><%= t('campaigns.admin.banner_label_html')%></label>
<p><small>Custom image at the very top of the campaign page</small></p> <p><small><%= t('campaigns.admin.banner_label_subdescription')%></small></p>
<% if @campaign.banner_image_url.present? %> <% if @campaign.banner_image_url.present? %>
<div class='image-upload image-upload--banner u-inlineBlock u-marginBottom--15' style='background-image:url(<%= @campaign.banner_image_url %>)'> <div class='image-upload image-upload--banner u-inlineBlock u-marginBottom--15' style='background-image:url(<%= @campaign.banner_image_url %>)'>
<!--= on 'click' (open_modal 'uploadBannerImage') --> <!--= on 'click' (open_modal 'uploadBannerImage') -->
<span><i class='fa fa-pencil'></i> Edit</span> <span><i class='fa fa-pencil'></i> <%= t('ui.edit')%></span>
</div> </div>
<% else %> <% else %>
<a class='button edit u-marginBottom--15'> <a class='button edit u-marginBottom--15'>
<!--= on 'click' (open_modal 'uploadBannerImage') --> <!--= on 'click' (open_modal 'uploadBannerImage') -->
<i class='fa fa-plus'></i> Add Image </i> <span><i class='fa fa-plus'></i> <%= t('campaigns.admin.add_image_label')%></span>
</a> </a>
<% end %> <% end %>
</fieldset> </fieldset>
@ -137,8 +137,8 @@
<hr> <hr>
<section class='layout--two'> <section class='layout--two'>
<fieldset> <fieldset>
<label>Default reason for peer-to-peer campaigns</label> <label><%= t('campaigns.admin.default_reason_for_p2p_label') %></label>
<p><small>Use it to suggest a good, pre-filled reason for campaigners</small></p> <p><small><%= t('campaigns.admin.default_reason_for_p2p_label_subdescription') %></small></p>
<textarea class='u-marginTop--15' rows='4' name='campaign[default_reason_for_supporting]'><%= @campaign.default_reason_for_supporting %></textarea> <textarea class='u-marginTop--15' rows='4' name='campaign[default_reason_for_supporting]'><%= @campaign.default_reason_for_supporting %></textarea>
</fieldset> </fieldset>
</section> </section>
@ -150,45 +150,45 @@
<fieldset> <fieldset>
<input type='hidden' name='campaign[published]' value='false'> <input type='hidden' name='campaign[published]' value='false'>
<input id='campaign-published-input' type='checkbox' name='campaign[published]' <%= @campaign.published ? "checked='checked'" : '' %>> <input id='campaign-published-input' type='checkbox' name='campaign[published]' <%= @campaign.published ? "checked='checked'" : '' %>>
<label class='u-marginBottom--10' for='campaign-published-input'>Published?</label> <label class='u-marginBottom--10' for='campaign-published-input'><%= t('campaigns.admin.published_label') %></label>
</fieldset> </fieldset>
<fieldset> <fieldset>
<input type='hidden' value='false' name='campaign[show_total_raised]'> <input type='hidden' value='false' name='campaign[show_total_raised]'>
<input id='show_total_raised-checkbox' type='checkbox' name='campaign[show_total_raised]' <%= @campaign.show_total_raised ? 'checked="checked"' : '' %>> <input id='show_total_raised-checkbox' type='checkbox' name='campaign[show_total_raised]' <%= @campaign.show_total_raised ? 'checked="checked"' : '' %>>
<label class='u-marginBottom--10' for='show_total_raised-checkbox'>Show total dollars raised?</label> <label class='u-marginBottom--10' for='show_total_raised-checkbox'><%= t('campaigns.admin.show_total_dollars_raised_label') %></label>
</fieldset> </fieldset>
<fieldset> <fieldset>
<input type='hidden' value='false' name='campaign[show_total_count]'> <input type='hidden' value='false' name='campaign[show_total_count]'>
<input id='show_total_count-checkbox' type='checkbox' name='campaign[show_total_count]' <%= @campaign.show_total_count ? 'checked="checked"' : '' %>> <input id='show_total_count-checkbox' type='checkbox' name='campaign[show_total_count]' <%= @campaign.show_total_count ? 'checked="checked"' : '' %>>
<label class='u-marginBottom--10' for='show_total_count-checkbox'>Show total supporters?</label> <label class='u-marginBottom--10' for='show_total_count-checkbox'><%= t('campaigns.admin.show_total_supporters_label') %></label>
</fieldset> </fieldset>
<fieldset> <fieldset>
<input type='hidden' value='false' name='campaign[hide_goal]'> <input type='hidden' value='false' name='campaign[hide_goal]'>
<input id='hide_goal-checkbox' type='checkbox' name='campaign[hide_goal]' <%= @campaign.hide_goal ? 'checked="checked"' : '' %>> <input id='hide_goal-checkbox' type='checkbox' name='campaign[hide_goal]' <%= @campaign.hide_goal ? 'checked="checked"' : '' %>>
<label class='u-marginBottom--10' for='hide_goal-checkbox'>Hide goal amount?</label> <label class='u-marginBottom--10' for='hide_goal-checkbox'><%= t('campaigns.admin.hide_goal_amount_label') %></label>
</fieldset> </fieldset>
<fieldset> <fieldset>
<input type='hidden' value='false' name='campaign[hide_thermometer]'> <input type='hidden' value='false' name='campaign[hide_thermometer]'>
<input id='hide_thermometer-checkbox' type='checkbox' name='campaign[hide_thermometer]' <%= @campaign.hide_thermometer ? 'checked="checked"' : '' %>> <input id='hide_thermometer-checkbox' type='checkbox' name='campaign[hide_thermometer]' <%= @campaign.hide_thermometer ? 'checked="checked"' : '' %>>
<label class='u-marginBottom--10' for='hide_thermometer-checkbox'>Hide thermometer?</label> <label class='u-marginBottom--10' for='hide_thermometer-checkbox'><%= t('campaigns.admin.hide_thermometer_label') %></label>
</fieldset> </fieldset>
<fieldset> <fieldset>
<input type='hidden' value='false' name='campaign[hide_activity_feed]'> <input type='hidden' value='false' name='campaign[hide_activity_feed]'>
<input id='hide_activity_feed-checkbox' type='checkbox' name='campaign[hide_activity_feed]' <%= @campaign.hide_activity_feed ? 'checked="checked"' : '' %>> <input id='hide_activity_feed-checkbox' type='checkbox' name='campaign[hide_activity_feed]' <%= @campaign.hide_activity_feed ? 'checked="checked"' : '' %>>
<label class='u-marginBottom--10' for='hide_activity_feed-checkbox'>Hide activity feed?</label> <label class='u-marginBottom--10' for='hide_activity_feed-checkbox'><%= t('campaigns.admin.hide_activity_feed_label') %></label>
</fieldset> </fieldset>
<% if @campaign_background_image %> <% if @campaign_background_image %>
<fieldset> <fieldset>
<input type='hidden' value='false' name='campaign[hide_title]'> <input type='hidden' value='false' name='campaign[hide_title]'>
<input id='hide_title-checkbox' type='checkbox' name='campaign[hide_title]' <%= @campaign.hide_title ? 'checked="checked"' : '' %>> <input id='hide_title-checkbox' type='checkbox' name='campaign[hide_title]' <%= @campaign.hide_title ? 'checked="checked"' : '' %>>
<label for='hide_title-checkbox'>Hide main title?</label> <label for='hide_title-checkbox'><%= t('campaigns.admin.hide_main_title_label') %></label>
</fieldset> </fieldset>
<% end %> <% end %>
@ -196,7 +196,7 @@
<!--= show_if length gift_options.data --> <!--= show_if length gift_options.data -->
<input type='hidden' value='false' name='campaign[hide_custom_amounts]'> <input type='hidden' value='false' name='campaign[hide_custom_amounts]'>
<input id='hide_custom_amounts' type='checkbox' name='campaign[hide_custom_amounts]' <%= @campaign.hide_custom_amounts ? 'checked="checked"' : '' %>> <input id='hide_custom_amounts' type='checkbox' name='campaign[hide_custom_amounts]' <%= @campaign.hide_custom_amounts ? 'checked="checked"' : '' %>>
<label class='u-marginBottom--10' for='hide_custom_amounts'>Disallow regular contributions during campaign?</label> <label class='u-marginBottom--10' for='hide_custom_amounts'><%= t('campaigns.admin.hide_custom_amounts_label') %></label>
</fieldset> </fieldset>
</section> </section>
@ -204,7 +204,7 @@
<hr> <hr>
<fieldset> <fieldset>
<label>Short Description <small>(used for sharing on social media)</small></label> <label><%= t('campaigns.admin.short_description_label_html') %></label>
<textarea rows='4' name='campaign[summary]'><%= @campaign.summary %></textarea> <textarea rows='4' name='campaign[summary]'><%= @campaign.summary %></textarea>
</fieldset> </fieldset>
@ -216,13 +216,13 @@
<footer class='modal-footer u-padding--15 layout--two'> <footer class='modal-footer u-padding--15 layout--two'>
<span> <span>
<button type='submit' data-loading='Updating...' class='button '>Update Campaign</button> <button type='submit' data-loading='<%= t('campaigns.admin.updating_in_process_label') %>' class='button'><%= t('campaigns.admin.update_campaign_label') %></button>
</span> </span>
<span> <span>
<a class='button blue'>Undelete Campaign</a> <a class='button blue'><%= t('campaigns.admin.undelete_campaign_label') %></a>
<!--= show_if campaign_is_deleted --> <!--= show_if campaign_is_deleted -->
<!--= on 'click' (toggle_soft_delete false)--> <!--= on 'click' (toggle_soft_delete false)-->
<a class='button red '>Delete Campaign</a> <a class='button red '><%= t('campaigns.admin.delete_campaign_label') %></a>
<!--= hide_if campaign_is_deleted --> <!--= hide_if campaign_is_deleted -->
<!--= on 'click' (toggle_soft_delete true) --> <!--= on 'click' (toggle_soft_delete true) -->
</span> </span>

View file

@ -62,4 +62,32 @@ en:
peer_to_peer_personalize_suggestions: Personalize your campaign page with your name and photo to greatly increase the success of your campaign. peer_to_peer_personalize_suggestions: Personalize your campaign page with your name and photo to greatly increase the success of your campaign.
reason_for_supporting_label: What's your reason for supporting %{campaign_name}? reason_for_supporting_label: What's your reason for supporting %{campaign_name}?
your_passion_is_contagious: Your passion is contagious! Inspire giving by telling your network why youre getting involved in this campaign. your_passion_is_contagious: Your passion is contagious! Inspire giving by telling your network why youre getting involved in this campaign.
about_you: About you about_you: About you
campaign_settings: Campaign Settings
title_label: Title
tagline_labe: Tagline
goal_label: Goal
main_image_label_html: Main Image <small>(at least 500x400)</small>
main_image_label_subdescription: Used for previews and social media
header_image_label_html: Header Image <small>(1000x600)</small>
header_image_label_subdescription: Used at top of campaign page
add_image_label: Add Image
campaign_video_label: Campaign Video
campaign_video_label_subdescription: Videos are optional but recommended
add_video_label: Add Video
banner_label_html: Banner <small>(1000x120)</small>
banner_label_subdescription: Custom image at the very top of the campaign page
default_reason_for_p2p_label: Default reason for peer-to-peer campaigns
default_reason_for_p2p_label_subdescription: Use it to suggest a good, pre-filled reason for campaigners
published?_label: Published?
show_total_dollars_raised_label: Show total dollars raised?
show_total_supporters_label: Show total supporters?
hide_goal_amount_label: Hide goal amount?
hide_thermometer_label: Hide thermometer?
hide_activity_feed_label: Hide activity feed?
hide_main_title_label: Hide main title?
hide_custo_amounts_label: Disallow regular contributions during campaign?
updating_in_process_label: Updating...
update_campaign_label: Update Campaign
undelete_campaign_label: Undelete Campaign
delete_campaign_label: Delete Campaign