Skip to content

Commit

Permalink
some tweaks to the coc
Browse files Browse the repository at this point in the history
  • Loading branch information
joeaudette committed Mar 1, 2016
1 parent 6faff33 commit 93a0048
Show file tree
Hide file tree
Showing 16 changed files with 169 additions and 24 deletions.
17 changes: 5 additions & 12 deletions code_of_conduct.md
@@ -1,6 +1,6 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of
As maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
Expand Down Expand Up @@ -31,20 +31,13 @@ fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
This Code of Conduct applies only within project spaces and is not intended to impose a political philosophy on anyone or limit their ability to express themselves in other environments.

You do not have to agree to this document in order to participate in this community, it is not a contract, we are only expressing the expected behavior within this project space. Basically we expect everyone to treat everyone else politely and with respect in project related interactions. If you feel that is too much to ask, you have the freedom also to not participate in this project. We don't need help bad enough to accept any mean or abusive behavior in this project.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at abuse@cloudscribe.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
is deemed necessary and appropriate to the circumstances (not to be interpreted as heavy handed). Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.


This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/
9 changes: 9 additions & 0 deletions notes/CssFrameworks.txt
Expand Up @@ -2,6 +2,15 @@
http://benfoster.io/blog/asp-net-core-themes-and-multi-tenancy


http://www.sitepoint.com/understanding-bootstraps-affix-scrollspy-plugins/
nav bar stuff
http://jsfiddle.net/SchmalzyB/vNecy/4/
http://codepen.io/norcal82/pen/ahegw


wireframing
https://balsamiq.com/

http://www.developerdrive.com/2015/12/what-you-need-to-know-about-bootstrap-4/

desktop design tool for bootstrap
Expand Down
10 changes: 10 additions & 0 deletions notes/Identity.txt
Expand Up @@ -79,6 +79,16 @@ https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNet.Authentication/
https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNet.Authentication/AuthenticationHandler%601.cs

HttpAuthenticationFeature implements IHttpAuthenticationFeature contains ref to IAuthenticationHandler and ClaimsPrincipal User



http://blog.dudak.me/2015/non-linear-middleware-chains-in-asp-net-5/

https://github.com/OrchardCMS/Orchard2/blob/5342a792dbac9fb70a7d76c2e17bfee7b9c0ba2c/src/Orchard.Hosting.Web/Routing/Routes/TenantRoute.cs




https://github.com/aspnet/HttpAbstractions/blob/dev/src/Microsoft.AspNet.Http/Features/Authentication/HttpAuthenticationFeature.cs

abstract AuthenticationManager
Expand Down
52 changes: 52 additions & 0 deletions notes/MVC.txt
@@ -1,4 +1,56 @@

Walkthrough: Organizing an ASP.NET MVC Application using Areas
.NET Framework 4

The MVC pattern separates the model (data) logic of an application from its presentation logic and business logic. In ASP.NET MVC, this logical separation is also implemented physically in the project structure, where controllers and views are kept in folders that use naming conventions to define relationships. This structure supports the needs of most Web applications.

However, some applications can have a large number of controllers, and each controller can be associated with several views. For these types of applications, the default ASP.NET MVC project structure can become unwieldy.

To accommodate large projects, ASP.NET MVC lets you partition Web applications into smaller units that are referred to as areas. Areas provide a way to separate a large MVC Web application into smaller functional groupings. An area is effectively an MVC structure inside an application. An application could contain several MVC structures (areas).

For example, a single large e-commerce application might be divided into areas that represent the storefront, product reviews, user account administration, and the purchasing system. Each area represents a separate function of the overall application.

This walkthrough demonstrates how to implement areas in an ASP.NET MVC application. The walkthrough creates the functional framework for a blog site that has the following areas:

Main. This is entry point to the Web application. This area includes the landing page and a log-in feature.

Blog. This area is used to display blog posts and to search the archive.

Dashboard. This area is used to create and edit blog posts.

To keep this tutorial simple, the areas do not contain logic to perform the actual tasks for the blog.

A Visual Studio project with source code is available to accompany this topic: Download.
https://msdn.microsoft.com/en-us/library/ee671793%28v=vs.100%29.aspx

http://stackoverflow.com/questions/7271592/mvc3-when-to-use-areas

http://arunendapally.com/post/how-to-use-a-mvc-area-in-multiple-applications

public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "MainApplication1.Controllers" }
);
}

19. Similarly go to BlogAppAreaRegistration.cs in MainApplication1 > Areas > BlogApp and add namespace as shown below.

public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Blog_default",
"Blog/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional },
new string[] { "BlogApp.Controllers" }
);
}


http://www.strathweb.com/2015/04/asp-net-mvc-6-discovers-controllers/

Expand Down
2 changes: 2 additions & 0 deletions notes/analytics.txt
@@ -0,0 +1,2 @@

http://googledevelopers.blogspot.com/2016/02/introducing-autotrack-for-analyticsjs.html
3 changes: 3 additions & 0 deletions notes/documentation-frameworks.txt
@@ -0,0 +1,3 @@


http://reynders.co/docfx-helps-us-make-documentation-easier-for-net/
10 changes: 10 additions & 0 deletions notes/html.txt
@@ -0,0 +1,10 @@


http://www.brucelawson.co.uk/2012/best-of-time/

hr element now means thematic break
https://www.w3.org/TR/html-markup/hr.html
Some examples of thematic breaks that can be marked up using the hr element include a scene change in a story, or a transition to another topic within a section of a reference book.


http://prideparrot.com/blog/archive/2014/4/blog_template_using_twitter_bootstrap3_part1
6 changes: 6 additions & 0 deletions notes/owin-middleware.txt
@@ -1,3 +1,9 @@


https://github.com/OrchardCMS/Orchard2/blob/5342a792dbac9fb70a7d76c2e17bfee7b9c0ba2c/src/Orchard.Hosting.Web/OrchardShell.cs#L36-L63



owin middleware

http://coding.abel.nu/2014/06/asp-net-identity-and-owin-overview/
Expand Down
1 change: 1 addition & 0 deletions notes/routing.txt
@@ -1,4 +1,5 @@

http://www.inversionofcontrol.co.uk/asp-net-core-1-0-routing-under-the-hood/

https://github.com/aspnet/Routing

Expand Down
40 changes: 40 additions & 0 deletions notes/seo.txt
@@ -0,0 +1,40 @@


http://www.dailyblogtips.com/change-wordpress-permalinks/

https://www.elegantthemes.com/blog/tips-tricks/wordpress-permalinks

http://www.wpbeginner.com/opinion/why-you-should-not-remove-dates-from-your-wordpress-blog-posts/

http://webmasters.stackexchange.com/questions/49781/benefit-of-date-in-url-segments

//[Route("date/{pubdate:datetime:regex(\\d{4}-\\d{2}-\\d{2})}")]
//[Route("date/{*pubdate:datetime:regex(\\d{4}/\\d{2}/\\d{2})}")] // new
http://www.asp.net/web-api/overview/web-api-routing-and-actions/create-a-rest-api-with-attribute-routing


http://weblogs.asp.net/jongalloway/looking-at-asp-net-mvc-5-1-and-web-api-2-1-part-2-attribute-routing-with-custom-constraints
routes.MapRoute("blog", "{year}/{month}/{day}",
new { controller = "blog", action = "index" },
new { year = @"\d{4}", month = @"\d{2}", day = @"\d{2}" });


Do dates in URLs determine freshness?
https://www.youtube.com/watch?v=lIfCERXLlDM

http://blog.2partsmagic.com/restful-uri-design/

This is a good URL design.

The URLs are can be persistent (they contain no parts that are likely to change; name changes are rare).
The URLs are descriptive (users can read the URL and they�ll get an idea what the page is about).
The URLs are browsable (users can remove path segments from right to left, and they�ll get no 404).

It�s also good that they don�t contain any "unnecessary" parts (like, for example, cryptic IDs for person/gallery names). Which, of course, means that you have to take care of edge cases like duplicate person names (maybe append an integer) or same person�s duplicate gallery names (maybe forbid these).

I assume that users get some kind of list of all teachers/students when visiting /teacher resp. /student. In this case, I�d probably use the plural forms /teachers* and /students*:

/teachers
/teachers/john-doe
/teachers/john-doe/biography

2 changes: 2 additions & 0 deletions notes/web-api.txt
@@ -1,5 +1,7 @@


https://royaljay.com/development/angular2-tutorial/

http://www.strathweb.com/2016/02/formatfilter-and-mediatypemappings-in-asp-net-core-1-0-mvc/

https://github.com/chsakell/aspnet5-angular2-typescript
Expand Down
11 changes: 11 additions & 0 deletions src/cloudscribe.Core.Identity/ClaimsPrincipalExtensions.cs
Expand Up @@ -7,6 +7,7 @@

using System;
using System.Security.Claims;
using Microsoft.AspNet.Identity;

namespace cloudscribe.Core.Identity
{
Expand Down Expand Up @@ -64,5 +65,15 @@ public static string GetEmail(this ClaimsPrincipal principal)
var claim = principal.FindFirst(ClaimTypes.Email);
return claim != null ? claim.Value : null;
}

//public static string GetUserId(this ClaimsPrincipal principal)
//{
// if (principal == null)
// {
// throw new ArgumentNullException(nameof(principal));
// }
// var claim = principal.FindFirst(ClaimTypes.NameIdentifier);
// return claim != null ? claim.Value : null;
//}
}
}
8 changes: 7 additions & 1 deletion src/cloudscribe.Core.Web/Controllers/UserAdminController.cs
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Author: Joe Audette
// Created: 2014-12-08
// Last Modified: 2016-02-12
// Last Modified: 2016-02-19
//

using cloudscribe.Core.Identity;
Expand Down Expand Up @@ -348,6 +348,7 @@ public async Task<IActionResult> NewUser(RegisterViewModel model)
SiteGuid = selectedSite.SiteGuid,
UserName = model.LoginName,
Email = model.Email,
NormalizedEmail = model.Email.ToLowerInvariant(),
FirstName = model.FirstName,
LastName = model.LastName,
DisplayName = model.DisplayName
Expand Down Expand Up @@ -463,6 +464,11 @@ public async Task<IActionResult> UserEdit(EditUserViewModel model)
ISiteUser user = await UserManager.Fetch(selectedSite.SiteId, model.UserId);
if (user != null)
{
if(user.NormalizedEmail != model.Email.ToLowerInvariant())
{
user.NormalizedEmail = model.Email.ToLowerInvariant();
}

user.Email = model.Email;
user.FirstName = model.FirstName;
user.LastName = model.LastName;
Expand Down
17 changes: 8 additions & 9 deletions src/cloudscribe.Web.Common/TagHelpers/GravatarTagHelper.cs
Expand Up @@ -14,9 +14,9 @@
namespace cloudscribe.Web.Common.TagHelpers
{
/// <summary>
/// <cs-gravatar email="@User.GetEmail()" size="30"></cs-gravatar>
/// <img gravatar-email="@User.GetEmail()" gravatar-size="30" />
/// </summary>
[HtmlTargetElement("cs-gravatar", Attributes = EmailAttributeName)]
[HtmlTargetElement("img", Attributes = EmailAttributeName)]
public class GravatarTagHelper : TagHelper
{
public GravatarTagHelper(IHttpContextAccessor contextAccessor)
Expand All @@ -26,10 +26,10 @@ public GravatarTagHelper(IHttpContextAccessor contextAccessor)

protected internal IHttpContextAccessor contextAccessor { get; set; }

private const string EmailAttributeName = "email";
private const string SizeAttributeName = "size";
private const string DefaultAttributeName = "default-image";
private const string RatingAttributeName = "rating";
private const string EmailAttributeName = "gravatar-email";
private const string SizeAttributeName = "gravatar-size";
private const string DefaultAttributeName = "gravatar-default-image";
private const string RatingAttributeName = "gravatar-rating";

private const string httpEndpointFormat = "http://gravatar.com/avatar/{0}?s={1}&d={2}&r={3}";
private const string httpsEndpointFormat = "https://secure.gravatar.com/avatar/{0}?s={1}&d={2}&r={3}";
Expand All @@ -48,8 +48,7 @@ public GravatarTagHelper(IHttpContextAccessor contextAccessor)

public override void Process(TagHelperContext context, TagHelperOutput output)
{
//change the cs-pager element into a
output.TagName = "img";

string emailHash;
using (var md5 = MD5.Create())
{
Expand Down Expand Up @@ -85,7 +84,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
Rating
);

output.Attributes.Clear();
output.Attributes.Remove("gravatar-email");

output.Attributes.Add("src", url);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cloudscribe.Web.Common/project.json
@@ -1,5 +1,5 @@
{
"version": "1.0.0-beta1",
"version": "1.0.0-beta2",
"description": "cloudscribe.Web.Common Class Library",
"summary": "Multi-tenant MVC and WebApi application foundation with management for sites, users, roles, and geographic data",
"authors": [ "Joe Audette" ],
Expand Down
3 changes: 2 additions & 1 deletion src/example.WebApp/Views/Sys/Shared/_LoginPartial.cshtml
Expand Up @@ -6,7 +6,8 @@
<ul class="nav navbar-nav navbar-right">
<li>
<div class="pull-right navbar-text navbar-gravatar">
<a asp-controller="Manage" asp-action="Index" title="Manage"><cs-gravatar email="@User.GetEmail()" size="30"></cs-gravatar></a>
<a asp-controller="Manage" asp-action="Index" title="Manage">
<img gravatar-email="@User.GetEmail()" gravatar-size="30" /></a>
</div>
</li>
<li>
Expand Down

0 comments on commit 93a0048

Please sign in to comment.