Skip to content

BugID-1194#2852

Open
Gev1990123 wants to merge 4 commits intoFreeUKGen:masterfrom
Gev1990123:BugID-1194
Open

BugID-1194#2852
Gev1990123 wants to merge 4 commits intoFreeUKGen:masterfrom
Gev1990123:BugID-1194

Conversation

@Gev1990123
Copy link
Collaborator

modified: app/views/freereg1_csv_files/_form_for_relocate.html.erb

Relocate form for non-admin users and pre-select current location

  • Non-admin users can now see Country and County fields as read-only when accessing the relocate form.
  • Country, Place, and Church fields are pre-selected with the current values, enabling quick relocation between register types.

    - adjusted code to be more readable
    - added include_blank: false to each of the menu options

- freereg1_csv_files_controller.rb
    - From each of the menu options removed the insert of 'Select *'
    - changed UI styling
    - updated page to use dropdown boxes
    - javascript is present here and could be moved to a seperate file

- freereg1_csv_files_controller.rb
    - added in JSON to JS to populate dropdown boxes
	modified:   app/views/freereg1_csv_files/_form_for_relocate.html.erb

Relocate form for non-admin users and pre-select current location
- Non-admin users can now see Country and County fields as read-only when accessing the relocate form.
- Country, Place, and Church fields are pre-selected with the current values, enabling quick relocation between register types.
# Load Lists for dropdown
@countries = ['England', 'Islands', 'Scotland', 'Wales']
@counties = ChapmanCode::CODES[@selected_country].map { |name, code| [name, code] }
#@placenames = Place.where(county: @selected_county).map { |p| [p.place_name, p.id.to_s] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete commented code

if session[:selectcounty].blank?
#means we are a DM selecting the county
session[:selectcounty] = ChapmanCode::CODES[session[:selectcountry]][params[:county]]
#session[:selectcounty] = ChapmanCode::CODES[session[:selectcountry]][params[:county]]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can delete this line

# @message_file.close if @project.type_of_project == "individual"
user = UseridDetail.where(userid: 'REGManager').first
UserMailer.update_report_to_freereg_manager(file, user).deliver_now
#UserMailer.update_report_to_freereg_manager(file, user).deliver_now
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes to this file intended?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much code for me to review here so I will wait to test this when Vino merges it. You might consider adding some comments to help devs in future (we have been bad about not commenting the MyopicVicar code but I think we should start adding lots of comments as we figure out what this code does, because none of the original devs are with us any more).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants