Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fc 1511 av #2644

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
24 changes: 6 additions & 18 deletions app/helpers/freecen2_pieces_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,16 @@ def tna(number)
end

def district_link(district)
if district.present? && session[:type] != 'locate_other_pieces'
if district.present?
link_to "#{district.name}", freecen2_district_path(district), class: 'btn btn--small', title:' Displays all of the information about the District to which this Sub District (Piece) is linked'
elsif session[:type] == 'locate_other_pieces'
district.name
else
'There is no district'
end
end

def civil_link(piece)
if piece.present? && session[:type] != 'locate_other_pieces'
if piece.present?
link_to 'Civil Parishes', index_for_piece_freecen2_civil_parishes_path(piece_id: piece.id, type: @type), class: 'btn btn--small', title:' Displays a list of the Civil Parishes which belong to this Sub District (Piece)'
elsif session[:type] == 'locate_other_pieces'
'Civil Parishes'
else
'There is no piece'
end
Expand Down Expand Up @@ -92,30 +88,24 @@ def piece_status(piece)
end

def csv_files_piece_link_unincorporated(piece)
if piece.present? && session[:type] != 'locate_other_pieces'
if piece.present?
link_to 'Unincorporated Freecen CSV Files', freecen_csv_files_path, class: 'btn btn--small', title: 'Csv files for this Piece'
elsif session[:type] == 'locate_other_pieces'
'Unincorporated Freecen CSV Files'
else
'There is no piece'
end
end

def csv_files_piece_link_incorporated(piece)
if piece.present? && session[:type] != 'locate_other_pieces'
if piece.present?
link_to 'Incorporated Freecen CSV Files', freecen_csv_files_path, class: 'btn btn--small', title: 'Csv files for this Piece'
elsif session[:type] == 'locate_other_pieces'
'Incorporated Freecen CSV Files'
else
'There is no piece'
end
end

def vld_files_piece_link(piece)
if piece.present? && session[:type] != 'locate_other_pieces'
if piece.present?
link_to 'Freecen VLD Files', freecen1_vld_files_path, class: 'btn btn--small', title: 'VLD files for this Piece'
elsif session[:type] == 'locate_other_pieces'
'Freecen VLD Files'
else
'There is no piece'
end
Expand All @@ -126,10 +116,8 @@ def individual_civil_link(parish)
end

def place_link(place)
if place.present? && session[:type] != 'locate_other_pieces'
if place.present?
link_to "#{place.place_name}", freecen2_place_path(place.id), class: 'btn btn--small', title: ' Displays all of the information about the place to which this Sub District (Piece) is linked'
elsif session[:type] == 'locate_other_pieces'
place.place_name
else
'There is no place'
end
Expand Down