Skip to content

Commit

Permalink
#619 Customer-My Account page - added empty reviews View
Browse files Browse the repository at this point in the history
  • Loading branch information
OAlekhina committed Sep 10, 2019
1 parent b9a993b commit ccaaf57
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Grand.Core/Domain/Customers/CustomerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ public class CustomerSettings : ISettings
/// </summary>
public int PasswordLifetime { get; set; }

/// <summary>
/// Gets or sets a value indicating whether to hide 'Reviews' tab on 'My account' page
/// </summary>
public bool HideReviews { get; set; }

#region Form fields

/// <summary>
Expand Down
17 changes: 17 additions & 0 deletions Grand.Web/Controllers/CustomerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,5 +1388,22 @@ public virtual async Task<IActionResult> Documents()
}

#endregion

#region My account / Reviews

public virtual async Task<IActionResult> Reviews()
{
if (!_workContext.CurrentCustomer.IsRegistered())
return Challenge();

if (_customerSettings.HideReviews)
return RedirectToRoute("CustomerInfo");

//var model = await _customerViewModelService.PrepareAuctions(_workContext.CurrentCustomer);

return View(/*model*/);
}

#endregion
}
}
3 changes: 3 additions & 0 deletions Grand.Web/Infrastructure/RouteProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ public void RegisterRoutes(IRouteBuilder routeBuilder)
routeBuilder.MapLocalizedRoute("AccountActivation",
"customer/activation",
new { controller = "Customer", action = "AccountActivation" });
routeBuilder.MapLocalizedRoute("CustomerReviews",
"customer/reviews",
new { controller = "Customer", action = "Reviews" });
routeBuilder.MapLocalizedRoute("CustomerForumSubscriptions",
"boards/forumsubscriptions",
new { controller = "Boards", action = "CustomerForumSubscriptions" });
Expand Down
1 change: 1 addition & 0 deletions Grand.Web/Views/Customer/Reviews.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit ccaaf57

Please sign in to comment.