Skip to content

Commit

Permalink
chore: Update app description and layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tsviz committed Aug 28, 2024
1 parent 5847c87 commit 89ae719
Show file tree
Hide file tree
Showing 11 changed files with 792 additions and 401 deletions.
9 changes: 6 additions & 3 deletions Migrations/RazorPagesMovieContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,24 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("Genre")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18, 2)");
b.Property<string>("Rating")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<DateTime>("ReleaseDate")
.HasColumnType("datetime2");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(60)
.HasColumnType("nvarchar(60)");
b.HasKey("Id");
Expand Down
135 changes: 135 additions & 0 deletions Models/SeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,141 @@ public static void Initialize(IServiceProvider serviceProvider)
Genre = "Western",
Price = 3.99M,
Rating = "NA"
},

new Movie
{
Title = "Inception",
ReleaseDate = DateTime.Parse("2010-7-16"),
Genre = "Sci-Fi",
Price = 9.99M,
Rating = "PG-13"
},

new Movie
{
Title = "The Matrix",
ReleaseDate = DateTime.Parse("1999-3-31"),
Genre = "Action",
Price = 8.99M,
Rating = "R"
},

new Movie
{
Title = "Interstellar",
ReleaseDate = DateTime.Parse("2014-11-7"),
Genre = "Sci-Fi",
Price = 10.99M,
Rating = "PG-13"
},

new Movie
{
Title = "The Dark Knight",
ReleaseDate = DateTime.Parse("2008-7-18"),
Genre = "Action",
Price = 9.99M,
Rating = "PG-13"
},

new Movie
{
Title = "Pulp Fiction",
ReleaseDate = DateTime.Parse("1994-10-14"),
Genre = "Crime",
Price = 7.99M,
Rating = "R"
},

new Movie
{
Title = "Inception",
ReleaseDate = DateTime.Parse("2010-7-16"),
Genre = "Sci-Fi",
Price = 9.99M,
Rating = "PG-13"
},

new Movie
{
Title = "The Matrix",
ReleaseDate = DateTime.Parse("1999-3-31"),
Genre = "Action",
Price = 8.99M,
Rating = "R"
},

new Movie
{
Title = "Interstellar",
ReleaseDate = DateTime.Parse("2014-11-7"),
Genre = "Sci-Fi",
Price = 10.99M,
Rating = "PG-13"
},

new Movie
{
Title = "The Dark Knight",
ReleaseDate = DateTime.Parse("2008-7-18"),
Genre = "Action",
Price = 9.99M,
Rating = "PG-13"
},

new Movie
{
Title = "Pulp Fiction",
ReleaseDate = DateTime.Parse("1994-10-14"),
Genre = "Crime",
Price = 7.99M,
Rating = "R"
},

new Movie
{
Title = "The Shawshank Redemption",
ReleaseDate = DateTime.Parse("1994-9-23"),
Genre = "Drama",
Price = 8.99M,
Rating = "R"
},

new Movie
{
Title = "Forrest Gump",
ReleaseDate = DateTime.Parse("1994-7-6"),
Genre = "Drama",
Price = 7.99M,
Rating = "PG-13"
},

new Movie
{
Title = "The Godfather",
ReleaseDate = DateTime.Parse("1972-3-24"),
Genre = "Crime",
Price = 9.99M,
Rating = "R"
},

new Movie
{
Title = "The Lord of the Rings: The Fellowship of the Ring",
ReleaseDate = DateTime.Parse("2001-12-19"),
Genre = "Fantasy",
Price = 10.99M,
Rating = "PG-13"
},

new Movie
{
Title = "Star Wars: Episode IV - A New Hope",
ReleaseDate = DateTime.Parse("1977-5-25"),
Genre = "Sci-Fi",
Price = 8.99M,
Rating = "PG"
}
);
context.SaveChanges();
Expand Down
23 changes: 19 additions & 4 deletions Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,22 @@
ViewData["Title"] = "Home page";
}

<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
<div class="welcome-container">
<h1 class="display-4">Welcome to RazorPagesMovie</h1>
<p>Discover and manage your favorite movies with ease.</p>
<div class="features">
<div class="feature">
<h2>🎬 <a href="/Movies/Database">Extensive Movie Database</a></h2>
<p>Browse through a vast collection of movies, from classics to the latest releases.</p>
</div>
<div class="feature">
<h2>⭐ <a href="/Movies/Recommendations">Personalized Recommendations</a></h2>
<p>Get movie suggestions tailored to your taste.</p>
</div>
<div class="feature">
<h2>📅 <a href="/Movies/Watchlist">Track Your Watchlist</a></h2>
<p>Keep track of movies you want to watch and those you've already seen.</p>
</div>
</div>
<a href="/Movies/Index" class="btn btn-primary">Browse Movies</a>
</div>
99 changes: 38 additions & 61 deletions Pages/Movies/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,47 @@
@model RazorPagesMovie.Pages.Movies.IndexModel

@{
ViewData["Title"] = "Index";
ViewData["Title"] = "Movies";
}

<h1>Index</h1>
<div class="movies-container">
<h1 class="display-4">Movies</h1>

<p>
<a asp-page="Create">Create New</a>
</p>

<form>
<p>
<select asp-for="MovieGenre" asp-items="Model.Genres">
<option value="">All</option>
</select>
Title: <input type="text" asp-for="SearchString" />
<input type="submit" value="Filter" />
<a asp-page="Create" class="btn btn-primary">Create New</a>
</p>
</form>

<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Movie[0].Title)
</th>
<th>
@Html.DisplayNameFor(model => model.Movie[0].ReleaseDate)
</th>
<th>
@Html.DisplayNameFor(model => model.Movie[0].Genre)
</th>
<th>
@Html.DisplayNameFor(model => model.Movie[0].Price)
</th>
<th>
@Html.DisplayNameFor(model => model.Movie[0].Rating)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Movie) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Title)
</td>
<td>
@Html.DisplayFor(modelItem => item.ReleaseDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.Genre)
</td>
<td>
@Html.DisplayFor(modelItem => item.Price)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rating)
</td>
<td>
<a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
<a asp-page="./Details" asp-route-id="@item.Id">Details</a> |
<a asp-page="./Delete" asp-route-id="@item.Id">Delete</a>
</td>
</tr>
}
</tbody>
</table>
<form method="get" class="form-inline mb-4">
<div class="form-group mr-2">
<label asp-for="MovieGenre" class="mr-2">Genre</label>
<select asp-for="MovieGenre" asp-items="Model.Genres" class="form-control">
<option value="">All</option>
</select>
</div>
<div class="form-group mr-2">
<label asp-for="SearchString" class="mr-2">Title</label>
<input type="text" asp-for="SearchString" class="form-control" />
</div>
<button type="submit" class="btn btn-secondary">Filter</button>
</form>

<div class="movie-list">
@foreach (var item in Model.Movie)
{
<div class="movie-card card mb-4">
<div class="card-body">
<h5 class="card-title">@item.Title</h5>
<p class="card-text"><strong>Release Date:</strong> @item.ReleaseDate.ToShortDateString()</p>
<p class="card-text"><strong>Genre:</strong> @item.Genre</p>
<p class="card-text"><strong>Price:</strong> @item.Price.ToString("c")</p>
<p class="card-text"><strong>Rating:</strong> @item.Rating</p>
<div class="movie-actions">
<a asp-page="./Edit" asp-route-id="@item.Id" class="btn btn-warning btn-sm">Edit</a>
<a asp-page="./Details" asp-route-id="@item.Id" class="btn btn-info btn-sm">Details</a>
<a asp-page="./Delete" asp-route-id="@item.Id" class="btn btn-danger btn-sm">Delete</a>
</div>
</div>
</div>
}
</div>
</div>
31 changes: 29 additions & 2 deletions Pages/Privacy.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<div class="privacy-container">
<h1>@ViewData["Title"]</h1>
<p>Your privacy is important to us. This privacy statement provides information about the personal information that our demo app collects, and the ways in which we use that personal information.</p>

<p>Use this page to detail your site's privacy policy.</p>
<h2>Personal Information Collection</h2>
<p>Our demo app may collect and use the following kinds of personal information:</p>
<ul>
<li>Information about your use of this website (including pages visited, time spent, etc.);</li>
<li>Information that you provide using for the purpose of registering with the website (including name, email address, etc.);</li>
<li>Any other information that you send to us.</li>
</ul>

<h2>Using Personal Information</h2>
<p>Our demo app may use your personal information to:</p>
<ul>
<li>Administer this website;</li>
<li>Personalize the website for you;</li>
<li>Enable your access to and use of the website services;</li>
<li>Send you marketing communications.</li>
</ul>

<h2>Securing Your Data</h2>
<p>We will take reasonable technical and organizational precautions to prevent the loss, misuse, or alteration of your personal information.</p>

<h2>Updating This Statement</h2>
<p>We may update this privacy policy by posting a new version on this website. You should check this page occasionally to ensure you are familiar with any changes.</p>

<h2>Contact Us</h2>
<p>If you have any questions about this privacy policy or our treatment of your personal information, please <a href="mailto:[email protected]">contact us</a>.</p>
</div>
8 changes: 4 additions & 4 deletions Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@
</div>
</nav>
</header>
<div class="container">
<div class="main-content container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>

<footer class="border-top footer text-muted">
@* <footer class="footer text-muted">
<div class="container">
&copy; 2024 - RazorPagesMovie - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>
</footer> *@

<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>

@await RenderSectionAsync("Scripts", required: false)
@RenderSection("Scripts", required: false)
</body>
</html>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dotnet Razor Pages Movie App

This is a sample ASP.NET Core Razor Pages application that demonstrates how to use Razor Pages to create dynamic, data-driven web applications.
RazorPagesMovie is a demo application that allows users to discover, manage, and track their favorite movies. It features an extensive movie database, personalized recommendations, watchlist management, and detailed movie information. The app is built with ASP.NET Core Razor Pages and demonstrates the use of modern web development practices.

## Features

Expand Down
Loading

0 comments on commit 89ae719

Please sign in to comment.