--HG--
branch : autoroute
This commit is contained in:
randompete 2012-01-31 21:06:44 +00:00
commit b392c26cad
6 changed files with 28 additions and 10 deletions

View File

@ -1,4 +1,4 @@
cac46d72cc61f2c5f3d3d3dde3229f61edc56f8e src/Orchard.Web/Modules/Orchard.Alias
d91108343ff1259cd3e35b2c080eb166d024711b src/Orchard.Web/Modules/Orchard.Alias
547b36a689a1f75c90eba578e6c409cf4be62a92 src/Orchard.Web/Modules/Orchard.Autoroute
67bf9897ee9dd9483369aece729ad7c6f042941c src/Orchard.Web/Modules/Orchard.Forms
6033664adc404a22f311029b69fbf1e34dc4ff2a src/Orchard.Web/Modules/Orchard.Projections

View File

@ -54,9 +54,9 @@
widget create HtmlWidget /Title:"Third Leader Aside" /Zone:"TripelThird" /Position:"5" /Layer:"TheHomepage" /Identity:"SetupHtmlWidget3" /UseLoremIpsumText:true
site setting set baseurl
theme activate "The Theme Machine"
autoroute create "Page" "Title" "{Content.Slug}" "http://website.com/about-us" true
autoroute create "Blog" "Title" "{Content.Slug}" "http://website.com/my-blog" true
autoroute create "BlogPost" "Blog and Title" "{Content.Container.Slug}/{Content.Slug}" "http://website.com/my-blog/a-blog-post" true
autoroute create "Page" "Title" "{Content.Slug}" "about-us" true
autoroute create "Blog" "Title" "{Content.Slug}" "my-blog" true
autoroute create "BlogPost" "Blog and Title" "{Content.Container.Path}/{Content.Slug}" "my-blog/a-blog-post" true
blog create /Title:"Blog" /Homepage:true /Description:"This is your Orchard Blog."
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
</Command>

View File

@ -26,7 +26,7 @@
<Migration features="*" />
<Command>
autoroute create "Page" "Title" "{Content.Slug}" "http://website.com/about-us" true
autoroute create "Page" "Title" "{Content.Slug}" "about-us" true
page create /Slug:"welcome-to-orchard" /Title:"Welcome to Orchard!" /Path:"welcome-to-orchard" /Homepage:true /Publish:true /Text:"Welcome To Orchard!"
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
</Command>

View File

@ -49,9 +49,9 @@
widget create HtmlWidget /Title:"Second Leader Aside" /Zone:"TripelSecond" /Position:"5" /Layer:"TheHomepage" /Identity:"SetupHtmlWidget2" /UseLoremIpsumText:true
widget create HtmlWidget /Title:"Third Leader Aside" /Zone:"TripelThird" /Position:"5" /Layer:"TheHomepage" /Identity:"SetupHtmlWidget3" /UseLoremIpsumText:true
site setting set baseurl
autoroute create "Page" "Title" "{Content.Slug}" "http://website.com/about-us" true
autoroute create "Blog" "Title" "{Content.Slug}" "http://website.com/my-blog" true
autoroute create "BlogPost" "Blog and Title" "{Content.Container.Slug}/{Content.Slug}" "http://website.com/my-blog/a-blog-post" true
autoroute create "Page" "Title" "{Content.Slug}" "about-us" true
autoroute create "Blog" "Title" "{Content.Slug}" "my-blog" true
autoroute create "BlogPost" "Blog and Title" "{Content.Container.Path}/{Content.Slug}" "my-blog/a-blog-post" true
page create /Slug:"welcome-to-orchard" /Title:"Welcome to Orchard!" /Path:"welcome-to-orchard" /Homepage:true /Publish:true /UseWelcomeText:true
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
theme activate "The Theme Machine"

View File

@ -688,7 +688,7 @@ button, .button, a.button {
cursor: pointer;
display: inline-block;
font: 12px Arial,Helvetica,sans-serif;
padding: 4px 14px 4px 14px;
padding: 5px 14px 5px 14px;
/*position: relative;*/
text-align: center;

View File

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web.Routing;
@ -20,7 +22,7 @@ namespace Orchard.Utility.Extensions {
return newDictionary;
}
public static bool Compare(this RouteValueDictionary x, RouteValueDictionary y) {
public static bool Match(this RouteValueDictionary x, RouteValueDictionary y) {
if(x == y) {
return true;
}
@ -36,5 +38,21 @@ namespace Orchard.Utility.Extensions {
// keys can be different in case
return x.Keys.All(key => x[key].ToString().Equals(y[key].ToString(), StringComparison.OrdinalIgnoreCase));
}
public static RouteValueDictionary ToRouteValueDictionary(this IEnumerable<KeyValuePair<string, string>> routeValues) {
if (routeValues == null)
return null;
var result = new RouteValueDictionary();
foreach (var routeValue in routeValues) {
if (routeValue.Key.EndsWith("-")) {
result.Add(routeValue.Key.Substring(0, routeValue.Key.Length - 1), routeValue.Value);
}
else {
result.Add(routeValue.Key, routeValue.Value);
}
}
return result;
}
}
}