Skip to content

Commit eb266b6

Browse files
committed
Minor stuff
1 parent 277b814 commit eb266b6

File tree

6 files changed

+40
-32
lines changed

6 files changed

+40
-32
lines changed

src/Libraries/SmartStore.Services/Orders/OrderProcessingService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ public virtual PlaceOrderResult PlaceOrder(
13211321
// notes, messages
13221322
_orderService.AddOrderNote(order, T("Admin.OrderNotice.OrderPlaced"));
13231323

1324-
//send email notifications
1324+
// send email notifications
13251325
var msg = _messageFactory.SendOrderPlacedStoreOwnerNotification(order, _localizationSettings.DefaultAdminLanguageId);
13261326
if (msg?.Email?.Id != null)
13271327
{

src/Presentation/SmartStore.Web.Framework/UI/Breadcrumb.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ namespace SmartStore.Web.Framework.UI
55
{
66
public interface IBreadcrumb
77
{
8-
void Track(MenuItem item);
8+
void Track(MenuItem item, bool prepend = false);
99
IReadOnlyList<MenuItem> Trail { get; }
1010
}
1111

1212
public class DefaultBreadcrumb : IBreadcrumb
1313
{
1414
private List<MenuItem> _trail;
1515

16-
public void Track(MenuItem item)
16+
public void Track(MenuItem item, bool prepend = false)
1717
{
1818
Guard.NotNull(item, nameof(item));
1919

@@ -22,7 +22,14 @@ public void Track(MenuItem item)
2222
_trail = new List<MenuItem>();
2323
}
2424

25-
_trail.Add(item);
25+
if (prepend)
26+
{
27+
_trail.Insert(0, item);
28+
}
29+
else
30+
{
31+
_trail.Add(item);
32+
}
2633
}
2734

2835
public IReadOnlyList<MenuItem> Trail

src/Presentation/SmartStore.Web.Framework/UI/Extensions/NavigatableExtensions.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ public static bool HasValue(this INavigatable navigatable)
2727

2828
public static bool IsCurrent(this INavigatable navigatable, ControllerContext controllerContext)
2929
{
30-
var url = navigatable.GenerateUrl(controllerContext.RequestContext);
31-
var compare = GetCurrentPathInfo(controllerContext);
30+
var url = navigatable.GenerateUrl(controllerContext.RequestContext)?.ToLower();
3231

33-
if (url.IsCaseInsensitiveEqual(compare.RequestPath))
32+
if (url.IsEmpty())
3433
{
35-
return true;
34+
return false;
3635
}
3736

38-
if (compare.RoutePath.HasValue() && url.IsCaseInsensitiveEqual(compare.RoutePath))
37+
var compare = GetCurrentPathInfo(controllerContext);
38+
39+
if (url == compare.RequestPath || url == compare.RoutePath)
3940
{
4041
return true;
4142
}
@@ -53,7 +54,7 @@ private static PathInfo GetCurrentPathInfo(ControllerContext controllerContext)
5354
var request = controllerContext.HttpContext.Request;
5455
var info = new PathInfo
5556
{
56-
RequestPath = request.RawUrl
57+
RequestPath = request.RawUrl.ToLower()
5758
};
5859

5960
// Path generated by Routing
@@ -69,13 +70,13 @@ private static PathInfo GetCurrentPathInfo(ControllerContext controllerContext)
6970
// Also SeName has been pushed to current RouteValues in GenericPathRoute class
7071
if (routeValues.ContainsKey("SeName"))
7172
{
72-
info.RoutePath = new UrlHelper(requestContext).RouteUrl(routeName, new { SeName = routeValues["SeName"] });
73+
info.RoutePath = new UrlHelper(requestContext).RouteUrl(routeName, new { SeName = routeValues["SeName"] })?.ToLower();
7374
}
7475
}
7576
}
7677
else
7778
{
78-
info.RoutePath = new UrlHelper(requestContext).RouteUrl(routeValues);
79+
info.RoutePath = new UrlHelper(requestContext).RouteUrl(routeValues)?.ToLower();
7980
}
8081

8182
return info;

src/Presentation/SmartStore.Web.Framework/UI/SiteMap/SiteMapService.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class SiteMapService : ISiteMapService
1010
{
1111
private readonly IEnumerable<ISiteMap> _siteMaps;
1212
private TreeNode<MenuItem> _currentNode;
13+
private bool _currentNodeResolved;
1314

1415
public SiteMapService(IEnumerable<ISiteMap> siteMaps)
1516
{
@@ -31,10 +32,10 @@ public TreeNode<MenuItem> GetRootNode(string mapName)
3132

3233
public TreeNode<MenuItem> GetCurrentNode(string mapName, ControllerContext controllerContext)
3334
{
34-
if (_currentNode == null)
35+
if (!_currentNodeResolved)
3536
{
36-
var map = GetSiteMap(mapName);
37-
_currentNode = map.Root.SelectNode(x => x.Value.IsCurrent(controllerContext), true) ?? map.Root;
37+
_currentNode = GetSiteMap(mapName).Root.SelectNode(x => x.Value.IsCurrent(controllerContext), true);
38+
_currentNodeResolved = true;
3839
}
3940

4041
return _currentNode;

src/Presentation/SmartStore.Web/Themes/Flex/theme.config

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@
77
<Var name="gray-200" type="Color">#e9ecef</Var>
88
<Var name="gray-300" type="Color">#dee2e6</Var>
99
<Var name="gray-400" type="Color">#ced4da</Var>
10-
<Var name="gray-500" type="Color">#b0bac3</Var>
11-
<Var name="gray-600" type="Color">#8d9ba9</Var>
12-
<Var name="gray-700" type="Color">#596167</Var>
13-
<Var name="gray-800" type="Color">#393f46</Var>
14-
<Var name="gray-900" type="Color">#22262a</Var>
10+
<Var name="gray-500" type="Color">#b0bac3</Var>
11+
<Var name="gray-600" type="Color">#8d9ba9</Var>
12+
<Var name="gray-700" type="Color">#596167</Var>
13+
<Var name="gray-800" type="Color">#393f46</Var>
14+
<Var name="gray-900" type="Color">#22262a</Var>
1515

1616
<Var name="red" type="Color">#f44336</Var>
1717
<Var name="orange" type="Color">#ee9B00</Var>
1818
<Var name="yellow" type="Color">#ffeb3b</Var>
1919
<Var name="green" type="Color">#4caf50</Var>
2020
<!--Var name="blue" type="Color">#2196f3</Var-->
21-
<Var name="blue" type="Color">#37a0e6</Var>
21+
<Var name="blue" type="Color">#37a0e6</Var>
2222
<Var name="bluegrey" type="Color">#78909c</Var>
2323
<Var name="indigo" type="Color">#3f51b5</Var>
2424
<Var name="teal" type="Color">#009688</Var>
25-
<Var name="cyan" type="Color">#00bcd4</Var>
26-
<Var name="purple" type="Color">#ff5b77</Var>
25+
<Var name="cyan" type="Color">#00bcd4</Var>
26+
<Var name="purple" type="Color">#ff5b77</Var>
2727
<Var name="pink" type="Color">#ff5b77</Var>
2828

2929
<!-- Brand Colors -->
3030
<Var name="primary" type="Color">$indigo</Var>
31-
<Var name="secondary" type="Color">$gray-600</Var>
31+
<Var name="secondary" type="Color">$gray-600</Var>
3232
<Var name="warning" type="Color">$orange</Var>
3333
<Var name="danger" type="Color">$red</Var>
3434
<Var name="info" type="Color">$blue</Var>
3535
<Var name="success" type="Color">$green</Var>
36-
<Var name="light" type="Color">lighten($gray-200, 2%)</Var>
36+
<Var name="light" type="Color">lighten($gray-200, 2%)</Var>
3737
<Var name="dark" type="Color">$gray-900</Var>
3838

3939
<!-- Common variables -->
@@ -48,14 +48,14 @@
4848
<Var name="site-bg" type="Color">$gray-100</Var>
4949
<Var name="body-bg" type="Color">#fff</Var>
5050
<Var name="body-color" type="Color">$gray-800</Var>
51-
<Var name="yiq-text-dark" type="Color">$gray-900</Var>
52-
<Var name="yiq-text-light" type="Color">#fff</Var>
51+
<Var name="yiq-text-dark" type="Color">$gray-900</Var>
52+
<Var name="yiq-text-light" type="Color">#fff</Var>
5353
<Var name="text-muted" type="Color">$gray-600</Var>
5454
<Var name="link-color" type="Color">#0066c0</Var>
5555

56-
<!-- Secondary Button -->
57-
<Var name="btn-secondary-bg" type="Color">#fff</Var>
58-
<Var name="btn-secondary-border" type="Color">$gray-400</Var>
56+
<!-- Secondary Button -->
57+
<Var name="btn-secondary-bg" type="Color">#fff</Var>
58+
<Var name="btn-secondary-border" type="Color">$gray-400</Var>
5959

6060
<!-- Footer -->
6161
<Var name="inverse-footer" type="Boolean">false</Var>
@@ -142,7 +142,7 @@
142142
<!-- Dropdowns -->
143143
<Var name="dropdown-bg" type="Color">#fff</Var>
144144
<Var name="dropdown-border-color" type="Color">rgba(#000, .075)</Var>
145-
<Var name="dropdown-border-radius" type="Color">$border-radius</Var>
145+
<Var name="dropdown-border-radius" type="Color">$border-radius</Var>
146146
<Var name="dropdown-divider-bg" type="Color">$gray-200</Var>
147147
<Var name="dropdown-box-shadow" type="String">0 3px 12px rgba(27,31,35, 0.15)</Var>
148148
<Var name="dropdown-link-color" type="Color">$gray-900</Var>

src/Presentation/SmartStore.Web/Themes/FlexBlue/theme.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<Theme baseTheme="Flex" title="Flex Blue" previewText="'Flex Blue' default theme" author="SmartStore AG" version="1.0">
3-
43
<Vars>
54
<Var name="blue" type="Color">#1565c0</Var>
65
<Var name="indigo" type="Color">#3f51b5</Var>

0 commit comments

Comments
 (0)