From 50dd696a1bd7034cfedcb85d304639023f05a61b Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Thu, 16 May 2024 22:30:18 -0600 Subject: [PATCH] Upload ruck --- .gitignore | 368 ++++++++++++++++++ RecordMyRuck.sln | 25 ++ RecordMyRuck/Controllers/HomeController.cs | 12 + RecordMyRuck/Controllers/RuckController.cs | 67 ++++ .../20240517025819_CreateRuck.Designer.cs | 46 +++ .../Migrations/20240517025819_CreateRuck.cs | 36 ++ .../RecordMyRuckDbContextModelSnapshot.cs | 43 ++ RecordMyRuck/Models/IRuckRepository.cs | 9 + RecordMyRuck/Models/RecordMyRuckDbContext.cs | 11 + RecordMyRuck/Models/Ruck.cs | 25 ++ RecordMyRuck/Models/RuckRepository.cs | 28 ++ RecordMyRuck/Models/RuckUpload.cs | 22 ++ RecordMyRuck/Program.cs | 22 ++ RecordMyRuck/Properties/launchSettings.json | 38 ++ RecordMyRuck/RecordMyRuck.csproj | 18 + RecordMyRuck/Views/Home/Index.cshtml | 1 + RecordMyRuck/Views/Ruck/Edit.cshtml | 13 + RecordMyRuck/Views/Ruck/Index.cshtml | 5 + RecordMyRuck/Views/Ruck/New.cshtml | 21 + RecordMyRuck/Views/Shared/_Layout.cshtml | 22 ++ RecordMyRuck/Views/_ViewImports.cshtml | 3 + RecordMyRuck/Views/_ViewStart.cshtml | 3 + RecordMyRuck/appsettings.Development.json | 8 + RecordMyRuck/appsettings.json | 12 + 24 files changed, 858 insertions(+) create mode 100644 .gitignore create mode 100644 RecordMyRuck.sln create mode 100644 RecordMyRuck/Controllers/HomeController.cs create mode 100644 RecordMyRuck/Controllers/RuckController.cs create mode 100644 RecordMyRuck/Migrations/20240517025819_CreateRuck.Designer.cs create mode 100644 RecordMyRuck/Migrations/20240517025819_CreateRuck.cs create mode 100644 RecordMyRuck/Migrations/RecordMyRuckDbContextModelSnapshot.cs create mode 100644 RecordMyRuck/Models/IRuckRepository.cs create mode 100644 RecordMyRuck/Models/RecordMyRuckDbContext.cs create mode 100644 RecordMyRuck/Models/Ruck.cs create mode 100644 RecordMyRuck/Models/RuckRepository.cs create mode 100644 RecordMyRuck/Models/RuckUpload.cs create mode 100644 RecordMyRuck/Program.cs create mode 100644 RecordMyRuck/Properties/launchSettings.json create mode 100644 RecordMyRuck/RecordMyRuck.csproj create mode 100644 RecordMyRuck/Views/Home/Index.cshtml create mode 100644 RecordMyRuck/Views/Ruck/Edit.cshtml create mode 100644 RecordMyRuck/Views/Ruck/Index.cshtml create mode 100644 RecordMyRuck/Views/Ruck/New.cshtml create mode 100644 RecordMyRuck/Views/Shared/_Layout.cshtml create mode 100644 RecordMyRuck/Views/_ViewImports.cshtml create mode 100644 RecordMyRuck/Views/_ViewStart.cshtml create mode 100644 RecordMyRuck/appsettings.Development.json create mode 100644 RecordMyRuck/appsettings.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52c9ab1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,368 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# App database +*.db +*.db-shm +*.db-wal \ No newline at end of file diff --git a/RecordMyRuck.sln b/RecordMyRuck.sln new file mode 100644 index 0000000..5d20098 --- /dev/null +++ b/RecordMyRuck.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RecordMyRuck", "RecordMyRuck\RecordMyRuck.csproj", "{B21703D9-9E6E-4335-BD79-81B8D059A0BC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B21703D9-9E6E-4335-BD79-81B8D059A0BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B21703D9-9E6E-4335-BD79-81B8D059A0BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B21703D9-9E6E-4335-BD79-81B8D059A0BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B21703D9-9E6E-4335-BD79-81B8D059A0BC}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E2B251E8-17E6-438D-B7A3-3D91847CF586} + EndGlobalSection +EndGlobal diff --git a/RecordMyRuck/Controllers/HomeController.cs b/RecordMyRuck/Controllers/HomeController.cs new file mode 100644 index 0000000..763661d --- /dev/null +++ b/RecordMyRuck/Controllers/HomeController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; + +namespace RecordMyRuck.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + } +} diff --git a/RecordMyRuck/Controllers/RuckController.cs b/RecordMyRuck/Controllers/RuckController.cs new file mode 100644 index 0000000..8eed057 --- /dev/null +++ b/RecordMyRuck/Controllers/RuckController.cs @@ -0,0 +1,67 @@ +using Microsoft.AspNetCore.Mvc; +using RecordMyRuck.Models; + +namespace RecordMyRuck.Controllers +{ + public class RuckController : Controller + { + private const string DateTimeFormat = "u"; + + private readonly IRuckRepository _ruckRepository; + + public RuckController(IRuckRepository ruckRepository) + { + _ruckRepository = ruckRepository; + } + + public IActionResult Index() + { + return View(); + } + + public IActionResult New() + { + return View(); + } + + [HttpPost] + public IActionResult New(RuckUpload ruckUpload) + { + if (!ModelState.IsValid) + { + return View(ruckUpload); + } + + var gpxStream = ruckUpload.Route.OpenReadStream(); + var reader = new StreamReader(gpxStream); + var gpxData = reader.ReadToEnd(); + _ruckRepository.CreateRuck(new Ruck + { + DateTime = ruckUpload.DateTime, + Route = gpxData, + WeightPounds = ruckUpload.WeightPounds, + Notes = ruckUpload.Notes ?? "", + }); + return RedirectToAction("Edit", new { dateTimeString = ruckUpload.DateTime.ToString(DateTimeFormat) }); + } + + public IActionResult Edit(string dateTimeString) + { + DateTime dateTime; + try + { + dateTime = DateTime.ParseExact(dateTimeString, DateTimeFormat, null); + } + catch + { + return NotFound(); + } + var ruck = _ruckRepository.Get(dateTime); + if (ruck == null) + { + return NotFound(); + } + return View(ruck); + } + } +} diff --git a/RecordMyRuck/Migrations/20240517025819_CreateRuck.Designer.cs b/RecordMyRuck/Migrations/20240517025819_CreateRuck.Designer.cs new file mode 100644 index 0000000..147fd1d --- /dev/null +++ b/RecordMyRuck/Migrations/20240517025819_CreateRuck.Designer.cs @@ -0,0 +1,46 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using RecordMyRuck.Models; + +#nullable disable + +namespace RecordMyRuck.Migrations +{ + [DbContext(typeof(RecordMyRuckDbContext))] + [Migration("20240517025819_CreateRuck")] + partial class CreateRuck + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); + + modelBuilder.Entity("RecordMyRuck.Models.Ruck", b => + { + b.Property("DateTime") + .HasColumnType("TEXT"); + + b.Property("Notes") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Route") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("WeightPounds") + .HasColumnType("REAL"); + + b.HasKey("DateTime"); + + b.ToTable("Rucks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/RecordMyRuck/Migrations/20240517025819_CreateRuck.cs b/RecordMyRuck/Migrations/20240517025819_CreateRuck.cs new file mode 100644 index 0000000..f701e43 --- /dev/null +++ b/RecordMyRuck/Migrations/20240517025819_CreateRuck.cs @@ -0,0 +1,36 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace RecordMyRuck.Migrations +{ + /// + public partial class CreateRuck : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Rucks", + columns: table => new + { + DateTime = table.Column(type: "TEXT", nullable: false), + Route = table.Column(type: "TEXT", nullable: false), + WeightPounds = table.Column(type: "REAL", nullable: false), + Notes = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Rucks", x => x.DateTime); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Rucks"); + } + } +} diff --git a/RecordMyRuck/Migrations/RecordMyRuckDbContextModelSnapshot.cs b/RecordMyRuck/Migrations/RecordMyRuckDbContextModelSnapshot.cs new file mode 100644 index 0000000..73997fd --- /dev/null +++ b/RecordMyRuck/Migrations/RecordMyRuckDbContextModelSnapshot.cs @@ -0,0 +1,43 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using RecordMyRuck.Models; + +#nullable disable + +namespace RecordMyRuck.Migrations +{ + [DbContext(typeof(RecordMyRuckDbContext))] + partial class RecordMyRuckDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); + + modelBuilder.Entity("RecordMyRuck.Models.Ruck", b => + { + b.Property("DateTime") + .HasColumnType("TEXT"); + + b.Property("Notes") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Route") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("WeightPounds") + .HasColumnType("REAL"); + + b.HasKey("DateTime"); + + b.ToTable("Rucks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/RecordMyRuck/Models/IRuckRepository.cs b/RecordMyRuck/Models/IRuckRepository.cs new file mode 100644 index 0000000..1fd303b --- /dev/null +++ b/RecordMyRuck/Models/IRuckRepository.cs @@ -0,0 +1,9 @@ +namespace RecordMyRuck.Models +{ + public interface IRuckRepository + { + Ruck? Get(DateTime dateTime); + IEnumerable GetAll(); + void CreateRuck(Ruck ruck); + } +} diff --git a/RecordMyRuck/Models/RecordMyRuckDbContext.cs b/RecordMyRuck/Models/RecordMyRuckDbContext.cs new file mode 100644 index 0000000..0549282 --- /dev/null +++ b/RecordMyRuck/Models/RecordMyRuckDbContext.cs @@ -0,0 +1,11 @@ +using Microsoft.EntityFrameworkCore; + +namespace RecordMyRuck.Models +{ + public class RecordMyRuckDbContext : Microsoft.EntityFrameworkCore.DbContext + { + public RecordMyRuckDbContext(DbContextOptions options) : base(options) { } + + public DbSet Rucks { get; set; } + } +} diff --git a/RecordMyRuck/Models/Ruck.cs b/RecordMyRuck/Models/Ruck.cs new file mode 100644 index 0000000..be69014 --- /dev/null +++ b/RecordMyRuck/Models/Ruck.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace RecordMyRuck.Models +{ + [PrimaryKey(nameof(DateTime))] + public class Ruck + { + [Required] + [Display(Name = "Date/Time")] + [DataType(DataType.DateTime)] + public DateTime DateTime { get; set; } + + [Required] + public string Route { get; set; } + + [Required] + [Display(Name = "Weigh (lb)")] + + public float WeightPounds { get; set; } + + [DataType(DataType.MultilineText)] + public string Notes { get; set; } = ""; + } +} diff --git a/RecordMyRuck/Models/RuckRepository.cs b/RecordMyRuck/Models/RuckRepository.cs new file mode 100644 index 0000000..2db9665 --- /dev/null +++ b/RecordMyRuck/Models/RuckRepository.cs @@ -0,0 +1,28 @@ +namespace RecordMyRuck.Models +{ + public class RuckRepository : IRuckRepository + { + RecordMyRuckDbContext _dbContext; + + public RuckRepository(RecordMyRuckDbContext dbContext) + { + _dbContext = dbContext; + } + + public void CreateRuck(Ruck ruck) + { + _dbContext.Rucks.Add(ruck); + _dbContext.SaveChanges(); + } + + public Ruck? Get(DateTime dateTime) + { + return _dbContext.Rucks.FirstOrDefault(r => r.DateTime == dateTime); + } + + public IEnumerable GetAll() + { + return _dbContext.Rucks; + } + } +} diff --git a/RecordMyRuck/Models/RuckUpload.cs b/RecordMyRuck/Models/RuckUpload.cs new file mode 100644 index 0000000..96fbcb1 --- /dev/null +++ b/RecordMyRuck/Models/RuckUpload.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; + +namespace RecordMyRuck.Models +{ + public class RuckUpload + { + [Required] + [Display(Name = "Date/Time")] + [DataType(DataType.DateTime)] + public DateTime DateTime { get; set; } + + [Required] + public IFormFile Route { get; set; } + + [Required] + [Display(Name = "Weigh (lb)")] + public float WeightPounds { get; set; } + + [DataType(DataType.MultilineText)] + public string Notes { get; set; } = ""; + } +} diff --git a/RecordMyRuck/Program.cs b/RecordMyRuck/Program.cs new file mode 100644 index 0000000..2b98f22 --- /dev/null +++ b/RecordMyRuck/Program.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore; +using RecordMyRuck.Models; + +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllersWithViews(); +builder.Services.AddDbContext(options => +{ + options.UseSqlite(builder.Configuration["ConnectionStrings:AppDb"]); +}); +builder.Services.AddScoped(); + +var app = builder.Build(); + +if (app.Environment.IsDevelopment()) +{ + app.UseDeveloperExceptionPage(); +} + +app.MapDefaultControllerRoute(); + +app.Run(); diff --git a/RecordMyRuck/Properties/launchSettings.json b/RecordMyRuck/Properties/launchSettings.json new file mode 100644 index 0000000..8cca50e --- /dev/null +++ b/RecordMyRuck/Properties/launchSettings.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:46321", + "sslPort": 44397 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5201", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7197;http://localhost:5201", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/RecordMyRuck/RecordMyRuck.csproj b/RecordMyRuck/RecordMyRuck.csproj new file mode 100644 index 0000000..aebf667 --- /dev/null +++ b/RecordMyRuck/RecordMyRuck.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + enable + enable + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/RecordMyRuck/Views/Home/Index.cshtml b/RecordMyRuck/Views/Home/Index.cshtml new file mode 100644 index 0000000..bd67e43 --- /dev/null +++ b/RecordMyRuck/Views/Home/Index.cshtml @@ -0,0 +1 @@ +

Hello world!

\ No newline at end of file diff --git a/RecordMyRuck/Views/Ruck/Edit.cshtml b/RecordMyRuck/Views/Ruck/Edit.cshtml new file mode 100644 index 0000000..fd0b909 --- /dev/null +++ b/RecordMyRuck/Views/Ruck/Edit.cshtml @@ -0,0 +1,13 @@ +@model Ruck + +

Date/Time

+@Model.DateTime + +

Weight

+@Model.WeightPounds lb + +

Notes

+

@Model.Notes

+ +

GPX data

+
@Model.Route
\ No newline at end of file diff --git a/RecordMyRuck/Views/Ruck/Index.cshtml b/RecordMyRuck/Views/Ruck/Index.cshtml new file mode 100644 index 0000000..ca81a64 --- /dev/null +++ b/RecordMyRuck/Views/Ruck/Index.cshtml @@ -0,0 +1,5 @@ +@* + For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 +*@ +@{ +} diff --git a/RecordMyRuck/Views/Ruck/New.cshtml b/RecordMyRuck/Views/Ruck/New.cshtml new file mode 100644 index 0000000..eb75141 --- /dev/null +++ b/RecordMyRuck/Views/Ruck/New.cshtml @@ -0,0 +1,21 @@ +@model RuckUpload + +

Record new ruck

+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
\ No newline at end of file diff --git a/RecordMyRuck/Views/Shared/_Layout.cshtml b/RecordMyRuck/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..f128860 --- /dev/null +++ b/RecordMyRuck/Views/Shared/_Layout.cshtml @@ -0,0 +1,22 @@ + + + + + Record My Ruck + + +
+

Record My Ruck

+ +
+
+ + @RenderBody() + + + \ No newline at end of file diff --git a/RecordMyRuck/Views/_ViewImports.cshtml b/RecordMyRuck/Views/_ViewImports.cshtml new file mode 100644 index 0000000..b40e0cd --- /dev/null +++ b/RecordMyRuck/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using RecordMyRuck.Models + +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers \ No newline at end of file diff --git a/RecordMyRuck/Views/_ViewStart.cshtml b/RecordMyRuck/Views/_ViewStart.cshtml new file mode 100644 index 0000000..cbd575c --- /dev/null +++ b/RecordMyRuck/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} \ No newline at end of file diff --git a/RecordMyRuck/appsettings.Development.json b/RecordMyRuck/appsettings.Development.json new file mode 100644 index 0000000..ff66ba6 --- /dev/null +++ b/RecordMyRuck/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/RecordMyRuck/appsettings.json b/RecordMyRuck/appsettings.json new file mode 100644 index 0000000..df4ece2 --- /dev/null +++ b/RecordMyRuck/appsettings.json @@ -0,0 +1,12 @@ +{ + "ConnectionStrings": { + "AppDb": "Data Source=RecordMyRuck.db" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}