diff --git a/Controllers/APIController.cs b/Controllers/APIController.cs index 190a2b2..ae292c0 100644 --- a/Controllers/APIController.cs +++ b/Controllers/APIController.cs @@ -1868,7 +1868,7 @@ namespace CarCareTracker.Controllers { if (documents.Any()) { - List uploadedFiles = new List(); + List uploadedFiles = new List(); string uploadDirectory = "documents/"; string uploadPath = Path.Combine(_webEnv.ContentRootPath, "data", uploadDirectory); if (!Directory.Exists(uploadPath)) @@ -1881,10 +1881,11 @@ namespace CarCareTracker.Controllers { document.CopyTo(stream); } - uploadedFiles.Add(new UploadedFiles + uploadedFiles.Add(new UploadedFileExportModel { Location = Path.Combine("/", uploadDirectory, fileName), - Name = Path.GetFileName(document.FileName) + Name = Path.GetFileName(document.FileName), + UploadType = FileUploadType.File.ToString() }); } return Json(uploadedFiles); diff --git a/Models/Shared/ImportModel.cs b/Models/Shared/ImportModel.cs index 6b5d777..cf92aaf 100644 --- a/Models/Shared/ImportModel.cs +++ b/Models/Shared/ImportModel.cs @@ -172,4 +172,10 @@ namespace CarCareTracker.Models [JsonConverter(typeof(FromBoolOptional))] public string IsRoot { get; set; } } + public class UploadedFileExportModel + { + public string Name { get; set; } + public string Location { get; set; } + public string UploadType { get; set; } + } } diff --git a/Views/Vehicle/_CollisionRecordModal.cshtml b/Views/Vehicle/_CollisionRecordModal.cshtml index 9300158..70f3f2d 100644 --- a/Views/Vehicle/_CollisionRecordModal.cshtml +++ b/Views/Vehicle/_CollisionRecordModal.cshtml @@ -57,26 +57,19 @@
- @if (Model.Files.Any()) + @if (isNew) { -
- @await Html.PartialAsync("_UploadedFiles", Model.Files) - @await Html.PartialAsync("_FileUploader", true) +
+ +
} - else - { - @if (isNew) - { -
- - -
- } - @await Html.PartialAsync("_FileUploader", false) - } +
+ @await Html.PartialAsync("_UploadedFiles", Model.Files) + @await Html.PartialAsync("_FileUploader", Model.Files.Any()) +
@@ -114,7 +107,6 @@ @await Html.PartialAsync("_SupplyRequisitionHistory", new SupplyRequisitionHistory { RequisitionHistory = Model.RequisitionHistory, CostInputId = "collisionRecordCost" }) \ No newline at end of file diff --git a/Views/Vehicle/_GasModal.cshtml b/Views/Vehicle/_GasModal.cshtml index 498a385..ff1a6a2 100644 --- a/Views/Vehicle/_GasModal.cshtml +++ b/Views/Vehicle/_GasModal.cshtml @@ -102,17 +102,10 @@
- @if (Model.GasRecord.Files.Any()) - { -
- @await Html.PartialAsync("_UploadedFiles", Model.GasRecord.Files) - @await Html.PartialAsync("_FileUploader", true) -
- } - else - { - @await Html.PartialAsync("_FileUploader", false) - } +
+ @await Html.PartialAsync("_UploadedFiles", Model.GasRecord.Files) + @await Html.PartialAsync("_FileUploader", Model.GasRecord.Files.Any()) +
@@ -135,7 +128,6 @@ } \ No newline at end of file diff --git a/wwwroot/css/site.css b/wwwroot/css/site.css index 341eaf8..fd87fa5 100644 --- a/wwwroot/css/site.css +++ b/wwwroot/css/site.css @@ -566,3 +566,7 @@ html[data-bs-theme="light"] .api-method:hover { border-top-left-radius: 0; border-bottom-right-radius: 0; } + +.lubelogger-uploader.solid { + border-style: solid; +} \ No newline at end of file diff --git a/wwwroot/defaults/en_US.json b/wwwroot/defaults/en_US.json index c3f293e..96cf866 100644 --- a/wwwroot/defaults/en_US.json +++ b/wwwroot/defaults/en_US.json @@ -1 +1 @@ -{"Garage":"Garage","Settings":"Settings","Admin_Panel":"Admin Panel","Logout":"Logout","Dark_Mode":"Dark Mode","Enable_CSV_Imports":"Enable CSV Imports","Use_Imperial_Calculation_for_Fuel_Economy_Calculations(MPG)":"Use Imperial Calculation for Fuel Economy Calculations(MPG)","This_Will_Also_Change_Units_to_Miles_and_Gallons":"This Will Also Change Units to Miles and Gallons","Use_UK_MPG_Calculation":"Use UK MPG Calculation","Input_Gas_Consumption_in_Liters,_it_will_be_converted_to_UK_Gals_for_MPG_Calculation":"Input Gas Consumption in Liters, it will be converted to UK Gals for MPG Calculation","Sort_lists_in_Descending_Order(Newest_to_Oldest)":"Sort lists in Descending Order(Newest to Oldest)","Replace_$0.00_Costs_with_---":"Replace $0.00 Costs with ---","Use_Three_Decimals_For_Fuel_Cost":"Use Three Decimals For Fuel Cost","Display_Saved_Notes_in_Markdown":"Display Saved Notes in Markdown","Auto_Refresh_Lapsed_Recurring_Reminders":"Auto Refresh Lapsed Recurring Reminders","Auto_Insert_Odometer_Records":"Auto Insert Odometer Records","Only_when_Adding_Service/Repair/Upgrade/Fuel_Record_or_Completing_a_Plan":"Only when Adding Service/Repair/Upgrade/Fuel Record or Completing a Plan","Enable_Authentication":"Enable Authentication","Visible_Tabs":"Visible Tabs","Service_Records":"Service Records","Dashboard":"Dashboard","Repairs":"Repairs","Upgrades":"Upgrades","Fuel":"Fuel","Odometer":"Odometer","Taxes":"Taxes","Notes":"Notes","Reminder":"Reminder","Supplies":"Supplies","Planner":"Planner","Default_Tab":"Default Tab","Service_Record":"Service Record","Tax":"Tax","Reminders":"Reminders","Backups":"Backups","Make":"Make","Restore":"Restore","About":"About","Add_New_Vehicle":"Add New Vehicle","Year":"Year","Year(must_be_after_1900)":"Year(must be after 1900)","Model":"Model","License_Plate":"License Plate","Electric_Vehicle":"Electric Vehicle","Use_Engine_Hours":"Use Engine Hours","Tags(optional)":"Tags(optional)","Upload_a_picture(optional)":"Upload a picture(optional)","Cancel":"Cancel","Edit_Vehicle":"Edit Vehicle","Delete_Vehicle":"Delete Vehicle","Manage_Vehicle":"Manage Vehicle","Expenses_by_Type":"Expenses by Type","Service":"Service","Expenses_by_Month":"Expenses by Month","As_of_Today":"As of Today","\u002B30_Days":"\u002B30 Days","\u002B60_Days":"\u002B60 Days","\u002B90_Days":"\u002B90 Days","Not_Urgent":"Not Urgent","Urgent":"Urgent","Very_Urgent":"Very Urgent","Past_Due":"Past Due","Reminders_by_Category":"Reminders by Category","Reminders_by_Urgency":"Reminders by Urgency","Collaborators":"Collaborators","Username":"Username","Delete":"Delete","Fuel_Mileage_by_Month":"Fuel Mileage by Month","Vehicle_Maintenance_Report":"Vehicle Maintenance Report","Export_Attachments":"Export Attachments","Gasoline":"Gasoline","Last_Reported_Odometer_Reading":"Last Reported Odometer Reading","Average_Fuel_Economy":"Average Fuel Economy","Total_Spent(excl._fuel)":"Total Spent(excl. fuel)","Total_Spent_on_Fuel":"Total Spent on Fuel","Type":"Type","Date":"Date","Description":"Description","Cost":"Cost","Repair":"Repair","Upgrade":"Upgrade","#_of_Odometer_Records":"# of Odometer Records","Add_Odometer_Record":"Add Odometer Record","Import_via_CSV":"Import via CSV","Export_to_CSV":"Export to CSV","Print":"Print","Add_New_Odometer_Record":"Add New Odometer Record","Date_recorded":"Date recorded","Odometer_reading":"Odometer reading","Notes(optional)":"Notes(optional)","Upload_documents(optional)":"Upload documents(optional)","Max_File_Size:_28.6MB":"Max File Size: 28.6MB","#_of_Service_Records":"# of Service Records","Total":"Total","Add_Service_Record":"Add Service Record","No_data_found,_create_reminders_to_see_visualizations_here.":"No data found, create reminders to see visualizations here.","No_data_found,_insert/select_some_data_to_see_visualizations_here.":"No data found, insert/select some data to see visualizations here.","Edit_Odometer_Record":"Edit Odometer Record","Import_Data_from_CSV":"Import Data from CSV","In_order_for_this_utility_to_function_properly,_your_CSV_file_MUST_be_formatted_exactly_like_the_provided_sample._Dates_must_be_supplied_in_a_string._Numbers_must_be_supplied_as_numbers_without_currency_formatting.":"In order for this utility to function properly, your CSV file MUST be formatted exactly like the provided sample. Dates must be supplied in a string. Numbers must be supplied as numbers without currency formatting.","Failure_to_format_the_data_correctly_can_cause_data_corruption._Please_make_sure_you_make_a_copy_of_the_local_database_before_proceeding.":"Failure to format the data correctly can cause data corruption. Please make sure you make a copy of the local database before proceeding.","Download_Sample":"Download Sample","Upload_CSV_File":"Upload CSV File","Import":"Import","Edit_Service_Record":"Edit Service Record","Date_service_was_performed":"Date service was performed","Odometer_reading_when_serviced":"Odometer reading when serviced","Description_of_item(s)_serviced(i.e._Oil_Change)":"Description of item(s) serviced(i.e. Oil Change)","Cost_of_the_service":"Cost of the service","Move_To":"Move To","#_of_Repair_Records":"# of Repair Records","Add_Repair_Record":"Add Repair Record","Add_New_Repair_Record":"Add New Repair Record","Date_repair_was_performed":"Date repair was performed","Odometer_reading_when_repaired":"Odometer reading when repaired","Description_of_item(s)_repaired(i.e._Alternator)":"Description of item(s) repaired(i.e. Alternator)","Cost_of_the_repair":"Cost of the repair","Choose_Supplies":"Choose Supplies","Add_Reminder":"Add Reminder","Select_Supplies":"Select Supplies","No_supplies_with_quantities_greater_than_0_is_found.":"No supplies with quantities greater than 0 is found.","Select":"Select","#_of_Upgrade_Records":"# of Upgrade Records","Add_Upgrade_Record":"Add Upgrade Record","Add_New_Upgrade_Record":"Add New Upgrade Record","Date_upgrade/mods_was_installed":"Date upgrade/mods was installed","Odometer_reading_when_upgraded/modded":"Odometer reading when upgraded/modded","Description_of_item(s)_upgraded/modded":"Description of item(s) upgraded/modded","Cost_of_the_upgrade/mods":"Cost of the upgrade/mods","#_of_Gas_Records":"# of Gas Records","Total_Fuel_Consumed":"Total Fuel Consumed","Total_Cost":"Total Cost","Add_Gas_Record":"Add Gas Record","Date_Refueled":"Date Refueled","Consumption":"Consumption","Fuel_Economy":"Fuel Economy","Unit_Cost":"Unit Cost","#_of_Supply_Records":"# of Supply Records","Add_Supply_Record":"Add Supply Record","Part_#":"Part #","Supplier":"Supplier","Quantity":"Quantity","Add_New_Supply_Record":"Add New Supply Record","Date_purchased":"Date purchased","Part_Number":"Part Number","Part_#/Model_#/SKU_#":"Part #/Model #/SKU #","Description_of_the_Part/Supplies":"Description of the Part/Supplies","Supplier/Vendor":"Supplier/Vendor","Part_Supplier":"Part Supplier","Edit_Supply_Record":"Edit Supply Record","Add_New_Service_Record":"Add New Service Record","In_Stock":"In Stock","Edit_Repair_Record":"Edit Repair Record","Edit_Upgrade_Record":"Edit Upgrade Record","Save_Vehicle":"Save Vehicle","Add_New_Gas_Record":"Add New Gas Record","Date_refueled":"Date refueled","Odometer_Reading":"Odometer Reading","Odometer_reading_when_refueled":"Odometer reading when refueled","Fuel_Consumption":"Fuel Consumption","Amount_of_gas_refueled":"Amount of gas refueled","Is_Filled_To_Full":"Is Filled To Full","Missed_Fuel_Up(Skip_MPG_Calculation)":"Missed Fuel Up(Skip MPG Calculation)","Cost_of_gas_refueled":"Cost of gas refueled","Unit":"Unit","#_of_Tax_Records":"# of Tax Records","Add_Tax_Record":"Add Tax Record","Add_New_Tax_Record":"Add New Tax Record","Date_tax_was_paid":"Date tax was paid","Description_of_tax_paid(i.e._Registration)":"Description of tax paid(i.e. Registration)","Cost_of_tax_paid":"Cost of tax paid","Is_Recurring":"Is Recurring","Month":"Month","1_Month":"1 Month","3_Months":"3 Months","6_Months":"6 Months","1_Year":"1 Year","2_Years":"2 Years","3_Years":"3 Years","5_Years":"5 Years","Edit_Tax_Record":"Edit Tax Record","#_of_Notes":"# of Notes","Add_Note":"Add Note","Note":"Note","Add_New_Note":"Add New Note","Pinned":"Pinned","Description_of_the_note":"Description of the note","Min_Fuel_Economy":"Min Fuel Economy","Max_Fuel_Economy":"Max Fuel Economy","Edit_Gas_Record":"Edit Gas Record","#_of_Plan_Records":"# of Plan Records","Add_Plan_Record":"Add Plan Record","Planned":"Planned","Doing":"Doing","Testing":"Testing","Done":"Done","Add_New_Plan_Record":"Add New Plan Record","Describe_the_Plan":"Describe the Plan","Cost_of_the_Plan":"Cost of the Plan","Priority":"Priority","Critical":"Critical","Normal":"Normal","Low":"Low","Current_Stage":"Current Stage","#_of_Reminders":"# of Reminders","Urgency":"Urgency","Metric":"Metric","Add_New_Reminder":"Add New Reminder","Reminder_Description":"Reminder Description","Remind_me_on":"Remind me on","Future_Date":"Future Date","Future_Odometer_Reading":"Future Odometer Reading","Whichever_comes_first":"Whichever comes first","Other":"Other","Edit_Reminder":"Edit Reminder","Replace_picture(optional)":"Replace picture(optional)","Language":"Language","Manage_Languages":"Manage Languages","Upload":"Upload","Tokens":"Tokens","Generate_User_Token":"Generate User Token","Auto_Notify(via_Email)":"Auto Notify(via Email)","Token":"Token","Issued_To":"Issued To","Users":"Users","Email":"Email","Is_Admin":"Is Admin","An_error_has_occurred,_please_try_again_later":"An error has occurred, please try again later","Edit_Note":"Edit Note","Password":"Password","Remember_Me":"Remember Me","Login":"Login","Forgot_Password":"Forgot Password","Register":"Register","Request":"Request","I_Have_a_Token":"I Have a Token","Back_to_Login":"Back to Login","Email_Address":"Email Address","New_Password":"New Password","Reset_Password":"Reset Password","No_data_found_or_all_records_have_zero_sums,_insert_records_with_non-zero_sums_to_see_visualizations_here.":"No data found or all records have zero sums, insert records with non-zero sums to see visualizations here.","Save_as_Template":"Save as Template","View_Templates":"View Templates","Select_Template":"Select Template","No_templates_are_found.":"No templates are found.","Use":"Use","Edit_Plan_Record":"Edit Plan Record","Date_Created":"Date Created","Last_Modified":"Last Modified","Shop_Supplies":"Shop Supplies","Uploaded_Documents":"Uploaded Documents","Upload_more_documents":"Upload more documents","Database_Migration":"Database Migration","Instructions":"Instructions","To_Postgres":"To Postgres","From_Postgres":"From Postgres","Import_To_Postgres":"Import To Postgres","Export_From_Postgres":"Export From Postgres","Create":"Create","Manage_Extra_Fields":"Manage Extra Fields","Name":"Name","Required":"Required","Add_New_Field":"Add New Field","Close":"Close","Calendar":"Calendar","View_Reminder":"View Reminder","Mark_as_Done":"Mark as Done","Login_via":"Login via","Distance_Traveled_by_Month":"Distance Traveled by Month","Expenses_and_Distance_Traveled_by_Month":"Expenses and Distance Traveled by Month","Select_All":"Select All","Supply_Requisition_History":"Supply Requisition History","No_supply_requisitions_in_history":"No supply requisitions in history","Plan":"Plan","Deselect_All":"Deselect All","Duplicate":"Duplicate","Toggle_Pin":"Toggle Pin","Pin":"Pin","Unpin":"Unpin","Profile":"Profile","Update_Profile":"Update Profile","Account_Username":"Account Username","Send_Token":"Send Token","Update":"Update","Show_Extra_Field_Columns":"Show Extra Field Columns","Enabling_this_may_cause_performance_issues":"Enabling this may cause performance issues","Visible_Columns":"Visible Columns","Edit_Multiple":"Edit Multiple","Edit_Multiple_Records":"Edit Multiple Records","(multiple)":"(multiple)","Tags(use_---_to_clear_all_existing_tags)":"Tags(use --- to clear all existing tags)","Notes(use_---_to_clear_all_existing_notes)":"Notes(use --- to clear all existing notes)","Edit":"Edit","Search":"Search","Delta":"Delta","Vehicle":"Vehicle","Select_Reminder":"Select Reminder","Purchased_Date(optional)":"Purchased Date(optional)","Purchased_Date":"Purchased Date","Sold_Date(optional)":"Sold Date(optional)","Sold_Date":"Sold Date","SOLD":"SOLD","Days":"Days","Statistics":"Statistics","Hide_Sold_Vehicles":"Hide Sold Vehicles","Server-wide_Settings":"Server-wide Settings","Extra_Fields":"Extra Fields","Version":"Version","Configure_Reminder_Urgency_Thresholds":"Configure Reminder Urgency Thresholds","Urgent(Days)":"Urgent(Days)","Very_Urgent(Days)":"Very Urgent(Days)","Urgent(Distance)":"Urgent(Distance)","Very_Urgent(Distance)":"Very Urgent(Distance)","Save":"Save","Initial_Odometer":"Initial Odometer","Distance":"Distance","Initial_Odometer_reading":"Initial Odometer reading","Total_Distance":"Total Distance","Recalculate_Distance":"Recalculate Distance","Edit_Multiple_Odometer_Records":"Edit Multiple Odometer Records","Odometer_Adjustments":"Odometer Adjustments","Odometer_Multiplier":"Odometer Multiplier","Odometer_Difference":"Odometer Difference","Adjust_Odometer":"Adjust Odometer","Edit_Multiple_Gas_Records":"Edit Multiple Gas Records","Multiple":"Multiple","Copy_Attachments":"Copy Attachments","Purchased_Price(optional)":"Purchased Price(optional)","Purchased_Price":"Purchased Price","Sold_Price(optional)":"Sold Price(optional)","Sold_Price":"Sold Price","Purchase/Sold_Information(optional)":"Purchase/Sold Information(optional)","Electric":"Electric","Depreciation":"Depreciation","day":"day","Appreciation":"Appreciation","Incremental_Search":"Incremental Search","Unsaved_Changes":"Unsaved Changes","Edit_Plan_Record_Template":"Edit Plan Record Template","No_Data_Found":"No Data Found","Sponsors":"Sponsors","All_Time":"All Time","Metrics":"Metrics","gallons":"gallons","miles":"miles","liters":"liters","kilometers":"kilometers","Fuel_Type":"Fuel Type","Diesel":"Diesel","Documents_Pending_Upload":"Documents Pending Upload","Vehicle_Cost_Breakdown":"Vehicle Cost Breakdown","Cost_Per_Day":"Cost Per Day","Cost_Per_Mile":"Cost Per Mile","Cost_Per_Kilometer":"Cost Per Kilometer","Cost_Per_Hour":"Cost Per Hour","Dashboard_Metrics":"Dashboard Metrics","Last_Odometer":"Last Odometer","Total_Cost_/_Total_Distance_Driven":"Total Cost / Total Distance Driven","Use_Custom_Thresholds":"Use Custom Thresholds","Disable_Registration":"Disable Registration","Default_Reminder_Email":"Default Reminder Email","Default_Email_for_Reminder":"Default Email for Reminder","Enable_OIDC_for_Root_User":"Enable OIDC for Root User","Adaptive_Color_Mode":"Adaptive Color Mode","Uses_the_Default_Reminder_Email_for_OIDC_Auth":"Uses the Default Reminder Email for OIDC Auth","Odometer_Optional":"Odometer Optional","Manage_Tokens":"Manage Tokens","Generate":"Generate","Notify":"Notify","Start_Recording":"Start Recording","Stop_Recording":"Stop Recording","Current_Odometer":"Current Odometer","Experimental_Feature_-_Do_not_exit_or_minimize_this_app_when_recording._Verify_all_starting_and_ending_odometers._Accuracy_subject_to_hardware_limitations.":"Experimental Feature - Do not exit or minimize this app when recording. Verify all starting and ending odometers. Accuracy subject to hardware limitations.","Identifier":"Identifier","Translation_Editor":"Translation Editor","Save_Translation":"Save Translation","Export_Translation":"Export Translation","Get_Translations":"Get Translations","Available_Translations":"Available Translations","Download_All_Translations":"Download All Translations","Reorder_Tabs":"Reorder Tabs","Reset_Tab_Order":"Reset Tab Order","Save_Tab_Order":"Save Tab Order","Upcoming_Reminder":"Upcoming Reminder","Plans":"Plans","No_records_available_to_display":"No records available to display","Duplicate_To_Vehicle":"Duplicate To Vehicle","Automatically_Format_Decimal_Inputs":"Automatically Format Decimal Inputs","Order_Supplies":"Order Supplies","Missing_Supplies,_Please_Delete_This_Template_and_Recreate_It.":"Missing Supplies, Please Delete This Template and Recreate It.","Additional_Widgets":"Additional Widgets","Custom_Widgets_Editor":"Custom Widgets Editor","No_Vehicles_Available":"No Vehicles Available","Use_this_tool_to_migrate_data_between_LiteDB_and_Postgres":"Use this tool to migrate data between LiteDB and Postgres","Note_that_it_is_recommended_that_the_Postgres_DB_is_empty_when_importing_from_LiteDB_to_prevent_primary_key_errors":"Note that it is recommended that the Postgres DB is empty when importing from LiteDB to prevent primary key errors.","No_Recurring_Reminders_Found":"No Recurring Reminders Found","Use_Three_Decimals_For_Fuel_Consumption":"Use Three Decimals For Fuel Consumption","Choose_Additional_Supplies":"Choose Additional Supplies","Supplies_are_requisitioned_immediately_after_the_record_is_saved.":"Supplies are requisitioned immediately after the record is saved.","Vehicle_Monthly_Cost_Breakdown":"Vehicle Monthly Cost Breakdown","Select_Mode":"Select Mode","hours":"hours","Default_to_Fuel_Unit_Cost":"Default to Fuel Unit Cost","Exclude_Records_with_these_Tags":"Exclude Records with these Tags","Only_Include_Records_with_these_Tags":"Only Include Records with these Tags","Select_Columns":"Select Columns","Filter_by_Tags":"Filter by Tags","Advanced_Filters":"Advanced Filters","Filter_by_Date_Range":"Filter by Date Range","From":"From","Start_Date":"Start Date","To":"To","End_Date":"End Date","Create_Odometer":"Create Odometer","Time":"Time","Attachments":"Attachments","Vehicle_Reminders_From_LubeLogger":"Vehicle Reminders From LubeLogger","Due":"Due","Your_Password_Reset_Token_for_LubeLogger":"Your Password Reset Token for LubeLogger","A_token_has_been_generated_on_your_behalf,_please_reset_your_password_for_LubeLogger_using_the_token":"A token has been generated on your behalf, please reset your password for LubeLogger using the token","Your_Registration_Token_for_LubeLogger":"Your Registration Token for LubeLogger","A_token_has_been_generated_on_your_behalf,_please_complete_your_registration_for_LubeLogger_using_the_token":"A token has been generated on your behalf, please complete your registration for LubeLogger using the token","Your_User_Account_Update_Token_for_LubeLogger":"Your User Account Update Token for LubeLogger","A_token_has_been_generated_on_your_behalf,_please_update_your_account_for_LubeLogger_using_the_token":"A token has been generated on your behalf, please update your account for LubeLogger using the token","Print_Individual_Records":"Print Individual Records","Review_Server_Configurations":"Review Server Configurations","Postgres_Connection":"Postgres Connection","Not_Configured":"Not Configured","Allowed_File_Extensions":"Allowed File Extensions","Logo_URL":"Logo URL","Message_of_the_Day":"Message of the Day","WebHook_URL":"WebHook URL","Custom_Widgets":"Custom Widgets","Invariant_API":"Invariant API","SMTP_Server":"SMTP Server","SMTP_Server_Port":"SMTP Server Port","SMTP_Sender_Address":"SMTP Sender Address","SMTP_Username":"SMTP Username","SMTP_Password":"SMTP Password","OIDC_Provider":"OIDC Provider","OIDC_Client_ID":"OIDC Client ID","OIDC_Client_Secret":"OIDC Client Secret","OIDC_Auth_URL":"OIDC Auth URL","OIDC_Token_URL":"OIDC Token URL","OIDC_Redirect_URL":"OIDC Redirect URL","OIDC_Scope":"OIDC Scope","OIDC_Logout_URL":"OIDC Logout URL","Enabled":"Enabled","Disabled":"Disabled","OIDC_Validate_State":"OIDC Validate State","OIDC_Use_PKCE":"OIDC Use PKCE","OIDC_Login_Only":"OIDC Login Only","Test_Email_from_LubeLogger":"Test Email from LubeLogger","If_you_are_seeing_this_email_it_means_your_SMTP_configuration_is_functioning_correctly":"If you are seeing this email it means your SMTP configuration is functioning correctly","Show_Calendar":"Show Calendar","Text":"Text","Number":"Number","Decimal":"Decimal","Location":"Location","OIDC_UserInfo_URL":"OIDC UserInfo URL","Show_Vehicle_Thumbnail_in_Header":"Show Vehicle Thumbnail in Header","Distance_Traveled":"Distance Traveled","Search_by_Keyword":"Search by Keyword","Case_Sensitive":"Case Sensitive"} \ No newline at end of file +{"Garage":"Garage","Settings":"Settings","Admin_Panel":"Admin Panel","Logout":"Logout","Dark_Mode":"Dark Mode","Enable_CSV_Imports":"Enable CSV Imports","Use_Imperial_Calculation_for_Fuel_Economy_Calculations(MPG)":"Use Imperial Calculation for Fuel Economy Calculations(MPG)","This_Will_Also_Change_Units_to_Miles_and_Gallons":"This Will Also Change Units to Miles and Gallons","Use_UK_MPG_Calculation":"Use UK MPG Calculation","Input_Gas_Consumption_in_Liters,_it_will_be_converted_to_UK_Gals_for_MPG_Calculation":"Input Gas Consumption in Liters, it will be converted to UK Gals for MPG Calculation","Sort_lists_in_Descending_Order(Newest_to_Oldest)":"Sort lists in Descending Order(Newest to Oldest)","Replace_$0.00_Costs_with_---":"Replace $0.00 Costs with ---","Use_Three_Decimals_For_Fuel_Cost":"Use Three Decimals For Fuel Cost","Display_Saved_Notes_in_Markdown":"Display Saved Notes in Markdown","Auto_Refresh_Lapsed_Recurring_Reminders":"Auto Refresh Lapsed Recurring Reminders","Auto_Insert_Odometer_Records":"Auto Insert Odometer Records","Only_when_Adding_Service/Repair/Upgrade/Fuel_Record_or_Completing_a_Plan":"Only when Adding Service/Repair/Upgrade/Fuel Record or Completing a Plan","Enable_Authentication":"Enable Authentication","Visible_Tabs":"Visible Tabs","Service_Records":"Service Records","Dashboard":"Dashboard","Repairs":"Repairs","Upgrades":"Upgrades","Fuel":"Fuel","Odometer":"Odometer","Taxes":"Taxes","Notes":"Notes","Reminder":"Reminder","Supplies":"Supplies","Planner":"Planner","Default_Tab":"Default Tab","Service_Record":"Service Record","Tax":"Tax","Reminders":"Reminders","Backups":"Backups","Make":"Make","Restore":"Restore","About":"About","Add_New_Vehicle":"Add New Vehicle","Year":"Year","Year(must_be_after_1900)":"Year(must be after 1900)","Model":"Model","License_Plate":"License Plate","Electric_Vehicle":"Electric Vehicle","Use_Engine_Hours":"Use Engine Hours","Tags(optional)":"Tags(optional)","Upload_a_picture(optional)":"Upload a picture(optional)","Cancel":"Cancel","Edit_Vehicle":"Edit Vehicle","Delete_Vehicle":"Delete Vehicle","Manage_Vehicle":"Manage Vehicle","Expenses_by_Type":"Expenses by Type","Service":"Service","Expenses_by_Month":"Expenses by Month","As_of_Today":"As of Today","\u002B30_Days":"\u002B30 Days","\u002B60_Days":"\u002B60 Days","\u002B90_Days":"\u002B90 Days","Not_Urgent":"Not Urgent","Urgent":"Urgent","Very_Urgent":"Very Urgent","Past_Due":"Past Due","Reminders_by_Category":"Reminders by Category","Reminders_by_Urgency":"Reminders by Urgency","Collaborators":"Collaborators","Username":"Username","Delete":"Delete","Fuel_Mileage_by_Month":"Fuel Mileage by Month","Vehicle_Maintenance_Report":"Vehicle Maintenance Report","Export_Attachments":"Export Attachments","Gasoline":"Gasoline","Last_Reported_Odometer_Reading":"Last Reported Odometer Reading","Average_Fuel_Economy":"Average Fuel Economy","Total_Spent(excl._fuel)":"Total Spent(excl. fuel)","Total_Spent_on_Fuel":"Total Spent on Fuel","Type":"Type","Date":"Date","Description":"Description","Cost":"Cost","Repair":"Repair","Upgrade":"Upgrade","#_of_Odometer_Records":"# of Odometer Records","Add_Odometer_Record":"Add Odometer Record","Import_via_CSV":"Import via CSV","Export_to_CSV":"Export to CSV","Print":"Print","Add_New_Odometer_Record":"Add New Odometer Record","Date_recorded":"Date recorded","Odometer_reading":"Odometer reading","Notes(optional)":"Notes(optional)","Upload_documents(optional)":"Upload documents(optional)","Max_File_Size:_28.6MB":"Max File Size: 28.6MB","#_of_Service_Records":"# of Service Records","Total":"Total","Add_Service_Record":"Add Service Record","No_data_found,_create_reminders_to_see_visualizations_here.":"No data found, create reminders to see visualizations here.","No_data_found,_insert/select_some_data_to_see_visualizations_here.":"No data found, insert/select some data to see visualizations here.","Edit_Odometer_Record":"Edit Odometer Record","Import_Data_from_CSV":"Import Data from CSV","In_order_for_this_utility_to_function_properly,_your_CSV_file_MUST_be_formatted_exactly_like_the_provided_sample._Dates_must_be_supplied_in_a_string._Numbers_must_be_supplied_as_numbers_without_currency_formatting.":"In order for this utility to function properly, your CSV file MUST be formatted exactly like the provided sample. Dates must be supplied in a string. Numbers must be supplied as numbers without currency formatting.","Failure_to_format_the_data_correctly_can_cause_data_corruption._Please_make_sure_you_make_a_copy_of_the_local_database_before_proceeding.":"Failure to format the data correctly can cause data corruption. Please make sure you make a copy of the local database before proceeding.","Download_Sample":"Download Sample","Upload_CSV_File":"Upload CSV File","Import":"Import","Edit_Service_Record":"Edit Service Record","Date_service_was_performed":"Date service was performed","Odometer_reading_when_serviced":"Odometer reading when serviced","Description_of_item(s)_serviced(i.e._Oil_Change)":"Description of item(s) serviced(i.e. Oil Change)","Cost_of_the_service":"Cost of the service","Move_To":"Move To","#_of_Repair_Records":"# of Repair Records","Add_Repair_Record":"Add Repair Record","Add_New_Repair_Record":"Add New Repair Record","Date_repair_was_performed":"Date repair was performed","Odometer_reading_when_repaired":"Odometer reading when repaired","Description_of_item(s)_repaired(i.e._Alternator)":"Description of item(s) repaired(i.e. Alternator)","Cost_of_the_repair":"Cost of the repair","Choose_Supplies":"Choose Supplies","Add_Reminder":"Add Reminder","Select_Supplies":"Select Supplies","No_supplies_with_quantities_greater_than_0_is_found.":"No supplies with quantities greater than 0 is found.","Select":"Select","#_of_Upgrade_Records":"# of Upgrade Records","Add_Upgrade_Record":"Add Upgrade Record","Add_New_Upgrade_Record":"Add New Upgrade Record","Date_upgrade/mods_was_installed":"Date upgrade/mods was installed","Odometer_reading_when_upgraded/modded":"Odometer reading when upgraded/modded","Description_of_item(s)_upgraded/modded":"Description of item(s) upgraded/modded","Cost_of_the_upgrade/mods":"Cost of the upgrade/mods","#_of_Gas_Records":"# of Gas Records","Total_Fuel_Consumed":"Total Fuel Consumed","Total_Cost":"Total Cost","Add_Gas_Record":"Add Gas Record","Date_Refueled":"Date Refueled","Consumption":"Consumption","Fuel_Economy":"Fuel Economy","Unit_Cost":"Unit Cost","#_of_Supply_Records":"# of Supply Records","Add_Supply_Record":"Add Supply Record","Part_#":"Part #","Supplier":"Supplier","Quantity":"Quantity","Add_New_Supply_Record":"Add New Supply Record","Date_purchased":"Date purchased","Part_Number":"Part Number","Part_#/Model_#/SKU_#":"Part #/Model #/SKU #","Description_of_the_Part/Supplies":"Description of the Part/Supplies","Supplier/Vendor":"Supplier/Vendor","Part_Supplier":"Part Supplier","Edit_Supply_Record":"Edit Supply Record","Add_New_Service_Record":"Add New Service Record","In_Stock":"In Stock","Edit_Repair_Record":"Edit Repair Record","Edit_Upgrade_Record":"Edit Upgrade Record","Save_Vehicle":"Save Vehicle","Add_New_Gas_Record":"Add New Gas Record","Date_refueled":"Date refueled","Odometer_Reading":"Odometer Reading","Odometer_reading_when_refueled":"Odometer reading when refueled","Fuel_Consumption":"Fuel Consumption","Amount_of_gas_refueled":"Amount of gas refueled","Is_Filled_To_Full":"Is Filled To Full","Missed_Fuel_Up(Skip_MPG_Calculation)":"Missed Fuel Up(Skip MPG Calculation)","Cost_of_gas_refueled":"Cost of gas refueled","Unit":"Unit","#_of_Tax_Records":"# of Tax Records","Add_Tax_Record":"Add Tax Record","Add_New_Tax_Record":"Add New Tax Record","Date_tax_was_paid":"Date tax was paid","Description_of_tax_paid(i.e._Registration)":"Description of tax paid(i.e. Registration)","Cost_of_tax_paid":"Cost of tax paid","Is_Recurring":"Is Recurring","Month":"Month","1_Month":"1 Month","3_Months":"3 Months","6_Months":"6 Months","1_Year":"1 Year","2_Years":"2 Years","3_Years":"3 Years","5_Years":"5 Years","Edit_Tax_Record":"Edit Tax Record","#_of_Notes":"# of Notes","Add_Note":"Add Note","Note":"Note","Add_New_Note":"Add New Note","Pinned":"Pinned","Description_of_the_note":"Description of the note","Min_Fuel_Economy":"Min Fuel Economy","Max_Fuel_Economy":"Max Fuel Economy","Edit_Gas_Record":"Edit Gas Record","#_of_Plan_Records":"# of Plan Records","Add_Plan_Record":"Add Plan Record","Planned":"Planned","Doing":"Doing","Testing":"Testing","Done":"Done","Add_New_Plan_Record":"Add New Plan Record","Describe_the_Plan":"Describe the Plan","Cost_of_the_Plan":"Cost of the Plan","Priority":"Priority","Critical":"Critical","Normal":"Normal","Low":"Low","Current_Stage":"Current Stage","#_of_Reminders":"# of Reminders","Urgency":"Urgency","Metric":"Metric","Add_New_Reminder":"Add New Reminder","Reminder_Description":"Reminder Description","Remind_me_on":"Remind me on","Future_Date":"Future Date","Future_Odometer_Reading":"Future Odometer Reading","Whichever_comes_first":"Whichever comes first","Other":"Other","Edit_Reminder":"Edit Reminder","Replace_picture(optional)":"Replace picture(optional)","Language":"Language","Manage_Languages":"Manage Languages","Upload":"Upload","Tokens":"Tokens","Generate_User_Token":"Generate User Token","Auto_Notify(via_Email)":"Auto Notify(via Email)","Token":"Token","Issued_To":"Issued To","Users":"Users","Email":"Email","Is_Admin":"Is Admin","An_error_has_occurred,_please_try_again_later":"An error has occurred, please try again later","Edit_Note":"Edit Note","Password":"Password","Remember_Me":"Remember Me","Login":"Login","Forgot_Password":"Forgot Password","Register":"Register","Request":"Request","I_Have_a_Token":"I Have a Token","Back_to_Login":"Back to Login","Email_Address":"Email Address","New_Password":"New Password","Reset_Password":"Reset Password","No_data_found_or_all_records_have_zero_sums,_insert_records_with_non-zero_sums_to_see_visualizations_here.":"No data found or all records have zero sums, insert records with non-zero sums to see visualizations here.","Save_as_Template":"Save as Template","View_Templates":"View Templates","Select_Template":"Select Template","No_templates_are_found.":"No templates are found.","Use":"Use","Edit_Plan_Record":"Edit Plan Record","Date_Created":"Date Created","Last_Modified":"Last Modified","Shop_Supplies":"Shop Supplies","Uploaded_Documents":"Uploaded Documents","Upload_more_documents":"Upload more documents","Database_Migration":"Database Migration","Instructions":"Instructions","To_Postgres":"To Postgres","From_Postgres":"From Postgres","Import_To_Postgres":"Import To Postgres","Export_From_Postgres":"Export From Postgres","Create":"Create","Manage_Extra_Fields":"Manage Extra Fields","Name":"Name","Required":"Required","Add_New_Field":"Add New Field","Close":"Close","Calendar":"Calendar","View_Reminder":"View Reminder","Mark_as_Done":"Mark as Done","Login_via":"Login via","Distance_Traveled_by_Month":"Distance Traveled by Month","Expenses_and_Distance_Traveled_by_Month":"Expenses and Distance Traveled by Month","Select_All":"Select All","Supply_Requisition_History":"Supply Requisition History","No_supply_requisitions_in_history":"No supply requisitions in history","Plan":"Plan","Deselect_All":"Deselect All","Duplicate":"Duplicate","Toggle_Pin":"Toggle Pin","Pin":"Pin","Unpin":"Unpin","Profile":"Profile","Update_Profile":"Update Profile","Account_Username":"Account Username","Send_Token":"Send Token","Update":"Update","Show_Extra_Field_Columns":"Show Extra Field Columns","Enabling_this_may_cause_performance_issues":"Enabling this may cause performance issues","Visible_Columns":"Visible Columns","Edit_Multiple":"Edit Multiple","Edit_Multiple_Records":"Edit Multiple Records","(multiple)":"(multiple)","Tags(use_---_to_clear_all_existing_tags)":"Tags(use --- to clear all existing tags)","Notes(use_---_to_clear_all_existing_notes)":"Notes(use --- to clear all existing notes)","Edit":"Edit","Search":"Search","Delta":"Delta","Vehicle":"Vehicle","Select_Reminder":"Select Reminder","Purchased_Date(optional)":"Purchased Date(optional)","Purchased_Date":"Purchased Date","Sold_Date(optional)":"Sold Date(optional)","Sold_Date":"Sold Date","SOLD":"SOLD","Days":"Days","Statistics":"Statistics","Hide_Sold_Vehicles":"Hide Sold Vehicles","Server-wide_Settings":"Server-wide Settings","Extra_Fields":"Extra Fields","Version":"Version","Configure_Reminder_Urgency_Thresholds":"Configure Reminder Urgency Thresholds","Urgent(Days)":"Urgent(Days)","Very_Urgent(Days)":"Very Urgent(Days)","Urgent(Distance)":"Urgent(Distance)","Very_Urgent(Distance)":"Very Urgent(Distance)","Save":"Save","Initial_Odometer":"Initial Odometer","Distance":"Distance","Initial_Odometer_reading":"Initial Odometer reading","Total_Distance":"Total Distance","Recalculate_Distance":"Recalculate Distance","Edit_Multiple_Odometer_Records":"Edit Multiple Odometer Records","Odometer_Adjustments":"Odometer Adjustments","Odometer_Multiplier":"Odometer Multiplier","Odometer_Difference":"Odometer Difference","Adjust_Odometer":"Adjust Odometer","Edit_Multiple_Gas_Records":"Edit Multiple Gas Records","Multiple":"Multiple","Copy_Attachments":"Copy Attachments","Purchased_Price(optional)":"Purchased Price(optional)","Purchased_Price":"Purchased Price","Sold_Price(optional)":"Sold Price(optional)","Sold_Price":"Sold Price","Purchase/Sold_Information(optional)":"Purchase/Sold Information(optional)","Electric":"Electric","Depreciation":"Depreciation","day":"day","Appreciation":"Appreciation","Incremental_Search":"Incremental Search","Unsaved_Changes":"Unsaved Changes","Edit_Plan_Record_Template":"Edit Plan Record Template","No_Data_Found":"No Data Found","Sponsors":"Sponsors","All_Time":"All Time","Metrics":"Metrics","gallons":"gallons","miles":"miles","liters":"liters","kilometers":"kilometers","Fuel_Type":"Fuel Type","Diesel":"Diesel","Documents_Pending_Upload":"Documents Pending Upload","Vehicle_Cost_Breakdown":"Vehicle Cost Breakdown","Cost_Per_Day":"Cost Per Day","Cost_Per_Mile":"Cost Per Mile","Cost_Per_Kilometer":"Cost Per Kilometer","Cost_Per_Hour":"Cost Per Hour","Dashboard_Metrics":"Dashboard Metrics","Last_Odometer":"Last Odometer","Total_Cost_/_Total_Distance_Driven":"Total Cost / Total Distance Driven","Use_Custom_Thresholds":"Use Custom Thresholds","Disable_Registration":"Disable Registration","Default_Reminder_Email":"Default Reminder Email","Default_Email_for_Reminder":"Default Email for Reminder","Enable_OIDC_for_Root_User":"Enable OIDC for Root User","Adaptive_Color_Mode":"Adaptive Color Mode","Uses_the_Default_Reminder_Email_for_OIDC_Auth":"Uses the Default Reminder Email for OIDC Auth","Odometer_Optional":"Odometer Optional","Manage_Tokens":"Manage Tokens","Generate":"Generate","Notify":"Notify","Start_Recording":"Start Recording","Stop_Recording":"Stop Recording","Current_Odometer":"Current Odometer","Experimental_Feature_-_Do_not_exit_or_minimize_this_app_when_recording._Verify_all_starting_and_ending_odometers._Accuracy_subject_to_hardware_limitations.":"Experimental Feature - Do not exit or minimize this app when recording. Verify all starting and ending odometers. Accuracy subject to hardware limitations.","Identifier":"Identifier","Translation_Editor":"Translation Editor","Save_Translation":"Save Translation","Export_Translation":"Export Translation","Get_Translations":"Get Translations","Available_Translations":"Available Translations","Download_All_Translations":"Download All Translations","Reorder_Tabs":"Reorder Tabs","Reset_Tab_Order":"Reset Tab Order","Save_Tab_Order":"Save Tab Order","Upcoming_Reminder":"Upcoming Reminder","Plans":"Plans","No_records_available_to_display":"No records available to display","Duplicate_To_Vehicle":"Duplicate To Vehicle","Automatically_Format_Decimal_Inputs":"Automatically Format Decimal Inputs","Order_Supplies":"Order Supplies","Missing_Supplies,_Please_Delete_This_Template_and_Recreate_It.":"Missing Supplies, Please Delete This Template and Recreate It.","Additional_Widgets":"Additional Widgets","Custom_Widgets_Editor":"Custom Widgets Editor","No_Vehicles_Available":"No Vehicles Available","Use_this_tool_to_migrate_data_between_LiteDB_and_Postgres":"Use this tool to migrate data between LiteDB and Postgres","Note_that_it_is_recommended_that_the_Postgres_DB_is_empty_when_importing_from_LiteDB_to_prevent_primary_key_errors":"Note that it is recommended that the Postgres DB is empty when importing from LiteDB to prevent primary key errors.","No_Recurring_Reminders_Found":"No Recurring Reminders Found","Use_Three_Decimals_For_Fuel_Consumption":"Use Three Decimals For Fuel Consumption","Choose_Additional_Supplies":"Choose Additional Supplies","Supplies_are_requisitioned_immediately_after_the_record_is_saved.":"Supplies are requisitioned immediately after the record is saved.","Vehicle_Monthly_Cost_Breakdown":"Vehicle Monthly Cost Breakdown","Select_Mode":"Select Mode","hours":"hours","Default_to_Fuel_Unit_Cost":"Default to Fuel Unit Cost","Exclude_Records_with_these_Tags":"Exclude Records with these Tags","Only_Include_Records_with_these_Tags":"Only Include Records with these Tags","Select_Columns":"Select Columns","Filter_by_Tags":"Filter by Tags","Advanced_Filters":"Advanced Filters","Filter_by_Date_Range":"Filter by Date Range","From":"From","Start_Date":"Start Date","To":"To","End_Date":"End Date","Create_Odometer":"Create Odometer","Time":"Time","Attachments":"Attachments","Vehicle_Reminders_From_LubeLogger":"Vehicle Reminders From LubeLogger","Due":"Due","Your_Password_Reset_Token_for_LubeLogger":"Your Password Reset Token for LubeLogger","A_token_has_been_generated_on_your_behalf,_please_reset_your_password_for_LubeLogger_using_the_token":"A token has been generated on your behalf, please reset your password for LubeLogger using the token","Your_Registration_Token_for_LubeLogger":"Your Registration Token for LubeLogger","A_token_has_been_generated_on_your_behalf,_please_complete_your_registration_for_LubeLogger_using_the_token":"A token has been generated on your behalf, please complete your registration for LubeLogger using the token","Your_User_Account_Update_Token_for_LubeLogger":"Your User Account Update Token for LubeLogger","A_token_has_been_generated_on_your_behalf,_please_update_your_account_for_LubeLogger_using_the_token":"A token has been generated on your behalf, please update your account for LubeLogger using the token","Print_Individual_Records":"Print Individual Records","Review_Server_Configurations":"Review Server Configurations","Postgres_Connection":"Postgres Connection","Not_Configured":"Not Configured","Allowed_File_Extensions":"Allowed File Extensions","Logo_URL":"Logo URL","Message_of_the_Day":"Message of the Day","WebHook_URL":"WebHook URL","Custom_Widgets":"Custom Widgets","Invariant_API":"Invariant API","SMTP_Server":"SMTP Server","SMTP_Server_Port":"SMTP Server Port","SMTP_Sender_Address":"SMTP Sender Address","SMTP_Username":"SMTP Username","SMTP_Password":"SMTP Password","OIDC_Provider":"OIDC Provider","OIDC_Client_ID":"OIDC Client ID","OIDC_Client_Secret":"OIDC Client Secret","OIDC_Auth_URL":"OIDC Auth URL","OIDC_Token_URL":"OIDC Token URL","OIDC_Redirect_URL":"OIDC Redirect URL","OIDC_Scope":"OIDC Scope","OIDC_Logout_URL":"OIDC Logout URL","Enabled":"Enabled","Disabled":"Disabled","OIDC_Validate_State":"OIDC Validate State","OIDC_Use_PKCE":"OIDC Use PKCE","OIDC_Login_Only":"OIDC Login Only","Test_Email_from_LubeLogger":"Test Email from LubeLogger","If_you_are_seeing_this_email_it_means_your_SMTP_configuration_is_functioning_correctly":"If you are seeing this email it means your SMTP configuration is functioning correctly","Show_Calendar":"Show Calendar","Text":"Text","Number":"Number","Decimal":"Decimal","Location":"Location","OIDC_UserInfo_URL":"OIDC UserInfo URL","Show_Vehicle_Thumbnail_in_Header":"Show Vehicle Thumbnail in Header","Distance_Traveled":"Distance Traveled","Search_by_Keyword":"Search by Keyword","Case_Sensitive":"Case Sensitive","Attach_Link":"Attach Link"} \ No newline at end of file diff --git a/wwwroot/js/shared.js b/wwwroot/js/shared.js index 494a5cf..5407649 100644 --- a/wwwroot/js/shared.js +++ b/wwwroot/js/shared.js @@ -583,38 +583,66 @@ function uploadVehicleFilesAsync(event) { } }); } +function uploadVehicleLinksAsync(event) { + event.stopPropagation(); + Swal.fire({ + title: 'Add Link', + html: ` + + + `, + confirmButtonText: 'Add Link', + focusConfirm: false, + preConfirm: () => { + const newLinkName = $("#newLinkName").val(); + const newLinkLocation = $("#newLinkLocation").val(); + if (!newLinkName) { + Swal.showValidationMessage(`Please enter a valid link name`); + } + if (!newLinkLocation) { + Swal.showValidationMessage(`Please enter a valid link location`); + } + return { newLinkName, newLinkLocation } + }, + }).then(function (result) { + if (result.isConfirmed) { + uploadedFiles.push({ name: result.value.newLinkName, location: result.value.newLinkLocation, uploadType: 1, isPending: true }); + $.post('/Vehicle/GetFilesPendingUpload', { uploadedFiles: uploadedFiles }, function (viewData) { + $("#filesPendingUpload").html(viewData); + }); + } + }); +} function deleteFileFromUploadedFiles(fileLocation, event) { event.parentElement.parentElement.parentElement.remove(); uploadedFiles = uploadedFiles.filter(x => x.location != fileLocation); - if (fileLocation.startsWith("/temp/")) { - if ($("#documentsPendingUploadList > li").length == 0) { - $("#documentsPendingUploadLabel").text(""); - } - } else if (fileLocation.startsWith("/documents/")) { - if ($("#uploadedDocumentsList > li").length == 0) { - $("#uploadedDocumentsLabel").text(""); - } + if ($("#documentsPendingUploadList > li").length == 0) { + $("#documentsPendingUploadLabel").text(""); + } + if ($("#uploadedDocumentsList > li").length == 0) { + $("#uploadedDocumentsLabel").text(""); } } function editFileName(fileLocation, event) { + let currentFileName = $(event.parentElement.parentElement).find('a > .text-link').text(); Swal.fire({ - title: 'Rename File', + title: 'Rename File or Link', html: ` - + `, confirmButtonText: 'Rename', focusConfirm: false, preConfirm: () => { const newFileName = $("#newFileName").val(); if (!newFileName) { - Swal.showValidationMessage(`Please enter a valid file name`) + Swal.showValidationMessage(`Please enter a valid name`) } return { newFileName } }, }).then(function (result) { if (result.isConfirmed) { - var linkDisplayObject = $(event.parentElement.parentElement).find('a')[0]; - linkDisplayObject.text = result.value.newFileName; + var linkDisplayObject = $(event.parentElement.parentElement).find('a > .text-link'); + linkDisplayObject.text(result.value.newFileName); var editFileIndex = uploadedFiles.findIndex(x => x.location == fileLocation); uploadedFiles[editFileIndex].name = result.value.newFileName; } @@ -1479,7 +1507,8 @@ function bindModalInputChanges(modalName) { $(e.currentTarget).attr('data-changed', true); }); } -function handleModalPaste(e, recordType) { +function handleModalPaste(e) { + let recordType = getUploaderId().uploaderId; var clipboardFiles = e.clipboardData.files; var acceptableFileFormats = $(`#${recordType}`).attr("accept"); var acceptableFileFormatsArray = acceptableFileFormats.split(','); @@ -1595,4 +1624,40 @@ function populateLocationField(fieldName) { errorToast('Location Services not Enabled'); } } +} +function toggleUploadFileBrowser() { + let uploaderId = getUploaderId().uploaderId; + $(`#${uploaderId}`).trigger('click'); +} +function handlePotentialFileDrop(event) { + event.preventDefault(); + $('.lubelogger-uploader').addClass('solid'); +} +function handleNoFileDrop(event) { + event.preventDefault(); + $('.lubelogger-uploader').removeClass('solid'); +} +function handleEndFileDrop(event) { + event.preventDefault(); + event.stopPropagation(); + $('.lubelogger-uploader').removeClass('solid'); + let recordType = getUploaderId().uploaderId; + let clipboardFiles = event.dataTransfer.files; + let acceptableFileFormats = $(`#${recordType}`).attr("accept"); + let acceptableFileFormatsArray = acceptableFileFormats.split(','); + let acceptableFiles = new DataTransfer(); + if (clipboardFiles.length > 0) { + for (var x = 0; x < clipboardFiles.length; x++) { + if (acceptableFileFormats != "*") { + var fileExtension = `.${clipboardFiles[x].name.split('.').pop()}`; + if (acceptableFileFormatsArray.includes(fileExtension)) { + acceptableFiles.items.add(clipboardFiles[x]); + } + } else { + acceptableFiles.items.add(clipboardFiles[x]); + } + } + $(`#${recordType}`)[0].files = acceptableFiles.files; + $(`#${recordType}`).trigger('change'); + } } \ No newline at end of file