Skip to content
Merged
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
29 changes: 0 additions & 29 deletions .env

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ yarn-debug.log*
/.env*.local

/config/credentials/production.key

/config/credentials/development.key
2 changes: 0 additions & 2 deletions Procfile

This file was deleted.

26 changes: 0 additions & 26 deletions app/admin/location_connection_steps.rb

This file was deleted.

53 changes: 0 additions & 53 deletions app/admin/location_events.rb

This file was deleted.

18 changes: 0 additions & 18 deletions app/admin/location_prayers.rb

This file was deleted.

17 changes: 0 additions & 17 deletions app/admin/location_services.rb

This file was deleted.

22 changes: 0 additions & 22 deletions app/admin/locations.rb

This file was deleted.

44 changes: 0 additions & 44 deletions app/admin/resource_articles.rb

This file was deleted.

12 changes: 6 additions & 6 deletions app/admin/resource_sermons.rb → app/admin/sermons.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

# rubocop:disable Metrics/BlockLength
ActiveAdmin.register Resource::Sermon do
menu parent: 'Resources', label: 'Sermons'
ActiveAdmin.register Sermon do
menu label: 'Sermons'
config.sort_order = 'published_at_desc'

order_by :published_at do |order_clause|
Expand All @@ -12,7 +12,7 @@
permit_params :name, :snippet, :content, :video, :audio, :youtube_url, :audio_url, :published_at, :featured_at,
:sermon_notes, :connect_group_notes,
topic_ids: [], author_ids: [], scripture_ids: [], series_ids: [],
connection_scriptures_attributes: %i[id resource_id scripture_id range _destroy]
sermon_scriptures_attributes: %i[id sermon_id scripture_id range _destroy]

filter :name
filter :snippet
Expand All @@ -22,12 +22,12 @@
filter :series, collection: proc { Series.order(:name).all }

batch_action :publish do |ids|
Resource::Sermon.batch_publish(ids)
Sermon.batch_publish(ids)
redirect_to collection_path, notice: "#{ids.size} sermon(s) published"
end

batch_action :unpublish do |ids|
Resource::Sermon.batch_unpublish(ids)
Sermon.batch_unpublish(ids)
redirect_to collection_path, notice: "#{ids.size} sermon(s) unpublished"
end

Expand All @@ -54,7 +54,7 @@
f.input :audio, as: :file
f.input :topics, collection: Category::Topic.all, multiple: true
f.input :authors, collection: Author.all, multiple: true
f.has_many :connection_scriptures, heading: 'Bible Passage', new_record: 'Add Passage Range' do |a|
f.has_many :sermon_scriptures, heading: 'Bible Passage', new_record: 'Add Passage Range' do |a|
a.input :scripture, collection: Scripture.all, label: 'Book'
a.input :range
end
Expand Down
63 changes: 0 additions & 63 deletions app/admin/steps.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/constraints/resource_type_constraint.rb

This file was deleted.

9 changes: 2 additions & 7 deletions app/controllers/resources/authors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ def show
def load_resources
return @resources if @resources

@resources = Resource.order(published_at: :desc).joins(:authors).where(authors: { id: [@author.id] })
if params[:resource_type].present?
@resources = @resources.where(type: Resource::TYPES[params[:resource_type].to_sym])
end
@resources = Sermon.order(published_at: :desc).joins(:authors).where(authors: { id: [@author.id] })
@resources = @resources.published.page params[:page]
end

Expand All @@ -43,8 +40,6 @@ def alphabetized_authors
end

def scope
return ::Author unless params[:resource_type]

::Author.joins(:resources).where(resources: { type: Resource::TYPES[params[:resource_type].to_sym] }).distinct
::Author
end
end
9 changes: 2 additions & 7 deletions app/controllers/resources/scriptures_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ def show
def load_resources
return @resources if @resources

@resources = Resource.order(published_at: :desc).joins(:scriptures).where(scriptures: { id: [@scripture.id] })
if params[:resource_type].present?
@resources = @resources.where(type: Resource::TYPES[params[:resource_type].to_sym])
end
@resources = Sermon.order(published_at: :desc).joins(:scriptures).where(scriptures: { id: [@scripture.id] })
@resources = @resources.published.page params[:page]
end

Expand All @@ -43,8 +40,6 @@ def alphabetized_scripture
end

def scope
return ::Scripture unless params[:resource_type]

::Scripture.joins(:resources).where(resources: { type: Resource::TYPES[params[:resource_type].to_sym] }).distinct
::Scripture
end
end
Loading
Loading