2020-06-12 20:03:43 +00:00
|
|
|
<%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
|
|
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE -%>
|
2018-03-25 17:30:42 +00:00
|
|
|
<div class='modal fullScreen campaignSettings' id='campaignSettings'>
|
|
|
|
|
2021-04-26 18:51:49 +00:00
|
|
|
<%= render 'common/modal_header', title: t('campaigns.admin.campaign_settings') %>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2019-02-07 21:46:16 +00:00
|
|
|
<form class='form--flatFields' autosubmit action='/nonprofits/<%=@nonprofit.id%>/campaigns/<%=@campaign.id%>' method='put' data-reload-with-slug parsley-validate>
|
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<% if @campaign.child_campaign? %>
|
2019-01-22 17:11:47 +00:00
|
|
|
<div class='modal-body'>
|
|
|
|
<div class='u-margin--auto'>
|
|
|
|
<fieldset class='col-right-12'>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.reason_for_supporting_label', @parent_campaign.name) %></label>
|
|
|
|
<p><%= t('campaigns.admin.your_passion_is_contagious')%></p>
|
2019-01-22 17:11:47 +00:00
|
|
|
|
|
|
|
<textarea class='u-marginTop--15' rows='4' name='campaign[reason_for_supporting]' required><%= @campaign.reason_for_supporting %></textarea>
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
<fieldset class='group u-marginBottom--0'>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-paddingTop--5'><%=t('campaigns.admin.goal_amount_label')%></label>
|
2019-01-22 17:11:47 +00:00
|
|
|
<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) %>'>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-30 17:45:51 +00:00
|
|
|
|
|
|
|
<% else %>
|
2018-03-25 17:30:42 +00:00
|
|
|
<div class='modal-body'>
|
2018-05-30 17:45:51 +00:00
|
|
|
<section class='layout--two'>
|
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.title_label')%></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
<input type='text' class='u-marginBottom--0' name='campaign[name]' value='<%= @campaign.name %>'>
|
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-block'><%= t('campaigns.admin.tagline_label')%> </label>
|
2018-05-30 17:45:51 +00:00
|
|
|
<input type='text' name='campaign[tagline]' value='<%= @campaign.tagline %>'>
|
|
|
|
</fieldset>
|
|
|
|
</section>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<hr>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<section class='layout--three'>
|
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.goal_label')%></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
<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) %>'>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.end_date_and_time_label')%></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
<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) %>'>
|
2021-04-26 18:51:49 +00:00
|
|
|
<a class='button edit u-inlineBlock'><%= t('ui.set') %></a>
|
2018-05-30 17:45:51 +00:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
|
|
|
<%= render 'components/forms/slug_field', fundraiser: @campaign, url: @nonprofit.url + '/campaigns' %>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
|
|
|
<section class='layout--three u-overflow--hidden'>
|
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.main_image_label_html') %></label>
|
|
|
|
<p><small><%= t('campaigns.admin.main_image_label_subdescription') %></small></p>
|
2020-05-15 19:01:59 +00:00
|
|
|
<div class='image-upload u-inlineBlock' style='background-image: url("<%= @campaign.main_image.attached?
|
2021-01-05 21:57:24 +00:00
|
|
|
? rails_storage_proxy_url(@campaign.main_image_by_size(:thumb)) : '' %>");'>
|
2018-05-30 15:35:37 +00:00
|
|
|
<span><i class='fa fa-pencil'></i> Edit</span>
|
2018-05-30 17:45:51 +00:00
|
|
|
<input type='file' name='campaign[main_image]'>
|
2018-05-30 15:35:37 +00:00
|
|
|
</div>
|
2018-05-30 17:45:51 +00:00
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.header_image_label_html') %></label>
|
|
|
|
<p><small><%= t('campaigns.admin.header_image_label_subdescription') %></small></p>
|
2018-05-30 17:45:51 +00:00
|
|
|
<% if @campaign_background_image %>
|
|
|
|
<div class='image-upload u-inlineBlock' style='background-image:url(<%= @campaign_background_image %>)'>
|
|
|
|
<!--= on 'click' (open_modal 'uploadBackgroundImage') -->
|
2021-04-26 18:51:49 +00:00
|
|
|
<span><i class='fa fa-pencil'></i> <%= t('ui.edit') %></span>
|
2018-05-30 17:45:51 +00:00
|
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<a class='button edit'>
|
|
|
|
<!--= on 'click' (open_modal 'uploadBackgroundImage') -->
|
2021-04-26 18:51:49 +00:00
|
|
|
<i class='fa fa-plus'></i> <%= t('campaigns.admin.add_image_label')%> </i>
|
2018-05-30 17:45:51 +00:00
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.campaign_video_label')%></label>
|
|
|
|
<p><small><%= t('campaigns.admin.campaign_video_label_subdescription')%></small></p>
|
2018-05-30 17:45:51 +00:00
|
|
|
<% if @campaign.vimeo_video_id || @campaign.youtube_video_id%>
|
|
|
|
<% if @campaign.vimeo_video_id %>
|
|
|
|
<div class='image-upload u-inlineBlock'>
|
|
|
|
<!--= set_attr 'style' vimeo_image_url -->
|
|
|
|
<!--= on 'click' (open_modal 'videoModal') -->
|
2021-04-26 18:51:49 +00:00
|
|
|
<span> <i class='fa fa-pencil'></i> <%=t('ui.edit')%></span>
|
2018-05-30 17:45:51 +00:00
|
|
|
</div>
|
|
|
|
<% else%>
|
|
|
|
<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') -->
|
2021-04-26 18:51:49 +00:00
|
|
|
<span> <i class='fa fa-pencil'></i> <%=t('ui.edit')%></span>
|
2018-05-30 17:45:51 +00:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2021-04-26 18:51:49 +00:00
|
|
|
<a class='button edit'><i class='fa fa-plus'></i> <%= t('campaigns.admin.add_video_label')%></a>
|
2018-05-30 17:45:51 +00:00
|
|
|
<!--= on 'click' (open_modal 'videoModal') -->
|
|
|
|
<% end %>
|
|
|
|
</fieldset>
|
|
|
|
</section>
|
2018-05-30 14:49:48 +00:00
|
|
|
|
2018-05-30 15:35:37 +00:00
|
|
|
<hr>
|
2018-05-30 17:45:51 +00:00
|
|
|
<section class='layout--one'>
|
2018-05-30 15:35:37 +00:00
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.banner_label_html')%></label>
|
|
|
|
<p><small><%= t('campaigns.admin.banner_label_subdescription')%></small></p>
|
2018-05-30 17:45:51 +00:00
|
|
|
<% 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 %>)'>
|
|
|
|
<!--= on 'click' (open_modal 'uploadBannerImage') -->
|
2021-04-26 18:51:49 +00:00
|
|
|
<span><i class='fa fa-pencil'></i> <%= t('ui.edit')%></span>
|
2018-05-30 17:45:51 +00:00
|
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<a class='button edit u-marginBottom--15'>
|
|
|
|
<!--= on 'click' (open_modal 'uploadBannerImage') -->
|
2021-04-26 18:51:49 +00:00
|
|
|
<span><i class='fa fa-plus'></i> <%= t('campaigns.admin.add_image_label')%></span>
|
2018-05-30 17:45:51 +00:00
|
|
|
</a>
|
|
|
|
<% end %>
|
2018-05-30 15:35:37 +00:00
|
|
|
</fieldset>
|
|
|
|
</section>
|
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<% if !@campaign.child_campaign? %>
|
|
|
|
<hr>
|
|
|
|
<section class='layout--two'>
|
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.default_reason_for_p2p_label') %></label>
|
|
|
|
<p><small><%= t('campaigns.admin.default_reason_for_p2p_label_subdescription') %></small></p>
|
2018-05-30 17:45:51 +00:00
|
|
|
<textarea class='u-marginTop--15' rows='4' name='campaign[default_reason_for_supporting]'><%= @campaign.default_reason_for_supporting %></textarea>
|
|
|
|
</fieldset>
|
|
|
|
</section>
|
|
|
|
<% end %>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<hr>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<section class='layout--two'>
|
|
|
|
<fieldset>
|
|
|
|
<input type='hidden' name='campaign[published]' value='false'>
|
|
|
|
<input id='campaign-published-input' type='checkbox' name='campaign[published]' <%= @campaign.published ? "checked='checked'" : '' %>>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-marginBottom--10' for='campaign-published-input'><%= t('campaigns.admin.published_label') %></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<fieldset>
|
|
|
|
<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"' : '' %>>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-marginBottom--10' for='show_total_raised-checkbox'><%= t('campaigns.admin.show_total_dollars_raised_label') %></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<fieldset>
|
|
|
|
<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"' : '' %>>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-marginBottom--10' for='show_total_count-checkbox'><%= t('campaigns.admin.show_total_supporters_label') %></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<fieldset>
|
|
|
|
<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"' : '' %>>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-marginBottom--10' for='hide_goal-checkbox'><%= t('campaigns.admin.hide_goal_amount_label') %></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<fieldset>
|
|
|
|
<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"' : '' %>>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-marginBottom--10' for='hide_thermometer-checkbox'><%= t('campaigns.admin.hide_thermometer_label') %></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
|
|
|
<fieldset>
|
2018-05-30 17:45:51 +00:00
|
|
|
<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"' : '' %>>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-marginBottom--10' for='hide_activity_feed-checkbox'><%= t('campaigns.admin.hide_activity_feed_label') %></label>
|
2018-03-25 17:30:42 +00:00
|
|
|
</fieldset>
|
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<% if @campaign_background_image %>
|
|
|
|
<fieldset>
|
|
|
|
<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"' : '' %>>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label for='hide_title-checkbox'><%= t('campaigns.admin.hide_main_title_label') %></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
</fieldset>
|
|
|
|
<% end %>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<fieldset>
|
|
|
|
<!--= show_if length gift_options.data -->
|
|
|
|
<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"' : '' %>>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label class='u-marginBottom--10' for='hide_custom_amounts'><%= t('campaigns.admin.hide_custom_amounts_label') %></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
|
|
|
<fieldset>
|
2021-04-26 18:51:49 +00:00
|
|
|
<label><%= t('campaigns.admin.short_description_label_html') %></label>
|
2018-05-30 17:45:51 +00:00
|
|
|
<textarea rows='4' name='campaign[summary]'><%= @campaign.summary %></textarea>
|
|
|
|
</fieldset>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<div><p class='error'></p></div>
|
|
|
|
</div>
|
2018-11-07 16:58:41 +00:00
|
|
|
|
2018-05-30 17:45:51 +00:00
|
|
|
<% end %>
|
2018-03-25 17:30:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
<footer class='modal-footer u-padding--15 layout--two'>
|
|
|
|
<span>
|
2021-04-26 18:51:49 +00:00
|
|
|
<button type='submit' data-loading='<%= t('campaigns.admin.updating_in_process_label') %>' class='button'><%= t('campaigns.admin.update_campaign_label') %></button>
|
2018-03-25 17:30:42 +00:00
|
|
|
</span>
|
|
|
|
<span>
|
2021-04-26 18:51:49 +00:00
|
|
|
<a class='button blue'><%= t('campaigns.admin.undelete_campaign_label') %></a>
|
2018-03-25 17:30:42 +00:00
|
|
|
<!--= show_if campaign_is_deleted -->
|
|
|
|
<!--= on 'click' (toggle_soft_delete false)-->
|
2021-04-26 18:51:49 +00:00
|
|
|
<a class='button red '><%= t('campaigns.admin.delete_campaign_label') %></a>
|
2018-03-25 17:30:42 +00:00
|
|
|
<!--= hide_if campaign_is_deleted -->
|
|
|
|
<!--= on 'click' (toggle_soft_delete true) -->
|
|
|
|
</span>
|
|
|
|
</footer>
|
|
|
|
</form>
|
|
|
|
</div>
|