Skip to content

Commit

Permalink
Fix saving and deleting megaphone feed config
Browse files Browse the repository at this point in the history
  • Loading branch information
kookster committed Nov 27, 2024
1 parent 9f5bfc1 commit 484c193
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
6 changes: 5 additions & 1 deletion app/models/feeds/megaphone_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def integration_type
end

def set_defaults
self.slug ||= "megaphone"
self.slug ||= "Megaphone"
self.title ||= "Megaphone"
self.private = true

super
end

def publish_integration?
Expand Down
4 changes: 0 additions & 4 deletions app/views/feeds/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<% end %>
<% elsif megaphone_feed?(feed) %>
<%= render "form_megaphone_config", podcast: podcast, feed: feed, form: form %>
<% if feed.persisted? %>
<%= render "form_audio_format", podcast: podcast, feed: feed, form: form %>
<%= render "form_ad_zones", podcast: podcast, feed: feed, form: form %>
<% end %>
<% else %> <%# custom feeds %>
<%= render "form_main", podcast: podcast, feed: feed, form: form %>
<%= render "form_auth", podcast: podcast, feed: feed, form: form %>
Expand Down
35 changes: 12 additions & 23 deletions app/views/feeds/_form_megaphone_config.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,20 @@
<%= field_help_text t(".help.network_name") %>
</div>
</div>
<% if config_form.object.persisted? %>
<div class="col-12 mt-4">
<div class="form-check">
<%= config_form.check_box :publish_enabled %>
<div class="d-flex align-items-center">
<%= config_form.label :publish_enabled %>
<%= help_text t(".help.publish_enabled") %>
</div>
</div>
<div class="form-check">
<%= config_form.check_box :sync_blocks_rss %>
<div class="d-flex align-items-center">
<%= config_form.label :sync_blocks_rss %>
<%= help_text t(".help.sync_blocks_rss") %>
</div>
<div class="col-12 mt-4">
<div class="form-check">
<%= config_form.check_box :publish_enabled %>
<div class="d-flex align-items-center">
<%= config_form.label :publish_enabled %>
<%= help_text t(".help.publish_enabled") %>
</div>
</div>
<% end %>
<% end %>
<% if form.object.megaphone_config&.persisted? %>
<div class="col-6 mt-4">
<div class="form-floating input-group">
<%= form.number_field :display_episodes_count %>
<%= form.label :display_episodes_count %>
<%= field_help_text t(".help.display_episodes_count") %>
<div class="form-check">
<%= config_form.check_box :sync_blocks_rss %>
<div class="d-flex align-items-center">
<%= config_form.label :sync_blocks_rss %>
<%= help_text t(".help.sync_blocks_rss") %>
</div>
</div>
</div>
<% end %>
Expand Down

0 comments on commit 484c193

Please sign in to comment.