Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
madskristensen committed Aug 18, 2017
1 parent 1021690 commit 22aae88
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 18 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
# ASP.NET Core 2.0 Photo Gallery
# ASP.NET Core Photo Gallery

A photo gallery site implemented in ASP.NET Core 2.0

![Masonry](art/masonry.png)

## Try it out
Website: <https://gallerytemplate.azurewebsites.net/>

Username and password: `demo`

## Features

- High performance. Gets 100/100 points on [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fgallerytemplate.azurewebsites.net%2F)
- Meets highest accessibility standards
- W3C standards compliant HTML and CSS
- Elegant masonry layout of images
- High performance. Gets 100/100 points on Google PageSpeed Insights
- [Run PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fgallerytemplate.azurewebsites.net%2F)
- Meets highest accessibility standards
- [Run accessibility validator](http://wave.webaim.org/report#/https://gallerytemplate.azurewebsites.net)
- W3C standards compliant HTML and CSS
- [Run HTML validator](https://html5.validator.nu/?doc=https%3A%2F%2Fgallerytemplate.azurewebsites.net)
- Automatic thumbnail generation
- Responsive web design
- Responsive image sizes using the `srcset` attribute
- Tagged up using HTML 5 microdata
- OpenGraph support for Facebook, Twitter, Pinterest and more
- [Schema.org](http://schema.org/docs/about.html) support with HTML 5 Microdata
- [Run testing tool](https://search.google.com/structured-data/testing-tool#url=https%3A%2F%2Fgallerytemplate.azurewebsites.net)
- OpenGraph support for Facebook, Twitter, Pinterest and more
- [Check the tags](http://opengraphcheck.com/result.php?url=https%3A%2F%2Fgallerytemplate.azurewebsites.net%2F#.WZdKhbpFzK4)
Binary file added art/masonry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/Models/Photo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public Photo(Album album, FileInfo file)
{
Album = album;
AbsolutePath = file.FullName;
LastModified = file.LastWriteTimeUtc;
}

public string Name
Expand Down Expand Up @@ -46,8 +45,6 @@ public string UrlName

public string AbsolutePath { get; set; }

public DateTime LastModified { get; }

public IPaginator Next
{
get
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/Album.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<h2>@Model.Album.Name</h2>
</div>

<section class="pic photolist">
<div class="pic photolist">
@{
foreach (Photo photo in Model.Album.Photos)
{
Expand All @@ -32,7 +32,7 @@
</a>
}
}
</section>
</div>

@section scripts {
<script if-authorized src="/js/admin.js" async></script>
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<p>There are no albums yet. <a asp-page="Login">Sign in</a> to create new albums and upload photos.</p>
}

<section class="albumlist pic">
<div class="albumlist pic">
@{
foreach (Album album in ac.Albums)
{
Expand All @@ -35,7 +35,7 @@
}
}
}
</section>
</div>

@section head {
<link if-authorized rel="stylesheet" href="/css/admin.scss" />
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/_ViewStart.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

if (!User.Identity.IsAuthenticated)
{
Context.Response.Headers["Cache-Control"] = "public, max-age=3600";
Context.Response.Headers.Add("Cache-Control", "public,max-age=3600");

var responseCachingFeature = Context.Features.Get<Microsoft.AspNetCore.ResponseCaching.IResponseCachingFeature>();
if (responseCachingFeature != null)
Expand Down
2 changes: 1 addition & 1 deletion src/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

app.UseAuthentication();
app.UseWebOptimizer();
app.UseResponseCaching();

app.UseStaticFiles(new StaticFileOptions()
{
Expand All @@ -78,6 +77,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
}
});

app.UseResponseCaching();
app.UseETagger();

app.UseMvc(routes =>
Expand Down
2 changes: 1 addition & 1 deletion src/TagHelpers/PagingTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class PagingTagHelper : TagHelper

public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.TagName = "section";
output.TagName = "nav";
output.TagMode = TagMode.StartTagAndEndTag;
output.Attributes.SetAttribute("aria-label", "Pagination");
output.Attributes.SetAttribute("class", "paging");
Expand Down
4 changes: 2 additions & 2 deletions src/wwwroot/css/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ a {
text-overflow: ellipsis;
}

> section {
> nav {
float: right;
}


> section > :nth-child(2):before {
> nav > :nth-child(2):before {
content: " |";
margin-right: 5px;
text-decoration: none;
Expand Down

0 comments on commit 22aae88

Please sign in to comment.