-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
53 changed files
with
442 additions
and
506 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
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
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,66 +1,46 @@ | ||
ActiveAdmin.register Recipient do | ||
permit_params :name, :contact_number, :website, :street_address, :city, | ||
:region, :postal_code, :country, :charity_number, | ||
:company_number, :founded_on, :registered_on, :mission, :status, | ||
:registered, :active_on_beehive, organisation_ids: [] | ||
permit_params :category_name, :charity_number, :company_number, :country, | ||
:description, :district, :income_band_name, :name, | ||
:operating_for_name, :website | ||
|
||
controller do | ||
def scoped_collection | ||
end_of_association_chain.includes(:country) | ||
end | ||
|
||
def find_resource | ||
scoped_collection.where(slug: params[:id]).first! | ||
scoped_collection.find_by_hashid(params[:id]) | ||
end | ||
end | ||
|
||
filter :name | ||
filter :charity_number | ||
filter :company_number | ||
filter :country | ||
filter :registered | ||
filter :founded_on | ||
filter :category_code | ||
filter :created_at | ||
filter :updated_at | ||
|
||
index do | ||
selectable_column | ||
column :name | ||
column :website | ||
column :category_name | ||
column :country | ||
column :org_type | ||
column :street_address | ||
column :postal_code | ||
column :latitude | ||
column :longitude | ||
column :created_at | ||
actions | ||
end | ||
|
||
show do | ||
tabs do | ||
tab 'Overview' do | ||
attributes_table do | ||
row :id | ||
row :name | ||
row :mission | ||
row :status | ||
row :founded_on | ||
row(:registered) { status_tag(recipient.registered) } | ||
row :registered_on | ||
row :contact_number | ||
row :website | ||
row :charity_number | ||
row :company_number | ||
row('Users') do |recipient| | ||
recipient.users.each.map{|user| "<li><a href=\"#{admin_user_path(user)}\">#{user.email}</a> | Authorised: #{user.authorised}</li>"}.join("").html_safe | ||
end | ||
end | ||
end | ||
|
||
tab 'Address' do | ||
attributes_table do | ||
row :street_address | ||
row :city | ||
row :region | ||
row :postal_code | ||
row :country | ||
end | ||
end | ||
attributes_table do | ||
row :id | ||
row :name | ||
row :category_name | ||
row :description | ||
row :charity_number | ||
row :company_number | ||
row :country | ||
row :district | ||
row :income_band_name | ||
row :operating_for_name | ||
row :website | ||
row :user | ||
end | ||
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module BreadcrumbsHelper | ||
def breadcrumbs(hash = {}, color: 'white') | ||
items = [] | ||
|
||
hash.each_with_index do |(text, link), i| | ||
items << tag.div('›', class: "crumb #{color}") | ||
|
||
opts = link.blank? ? "disabled #{color}" : color | ||
|
||
items << tag.a( | ||
tag.div(text, class: 'truncate'), | ||
class: "bread #{opts}", href: link | ||
) | ||
end | ||
|
||
return if items.empty? | ||
|
||
items.last.sub!('bread', 'bold bread') | ||
|
||
"<div class='maxw1050 mx-auto px15 fs14 lh18 mb30'>" \ | ||
"<a href='#{root_path}' class='bread #{color}'>Home</a>" \ | ||
"#{items.join}</div>".html_safe | ||
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
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
Oops, something went wrong.