* Estimate.aspx: from backoffice
* CatalogManager.cs: Uses GetDefaultProvider * Catalog.cs: the Catalog object now should support a unique id in the system : UID, exposed as one of its properties. * AccountController.cs: new static method te get an user profile by its name. * AdminController.cs: Uses the Yavsc.Admin namespace (refactoring) * Web.csproj: * BlogManager.cs: * BackOfficeController.cs: refactoring * BlogsController.cs: Fixes the Blog title * FrontOfficeController.cs: Changes on the go for the Command object * AddRole.aspx: minor syntax change * UserPosts.aspx: show the blog title * style.css: black transparent for the background of posts * Profile.cs: Method FromProfileBase became a constructor * Commande.cs: nothing * Estimate.aspx: moved to the frontoffice views * CatalogHelper.cs: Writting GetDefaultProvider
This commit is contained in:
parent
b5d19c5da6
commit
c22be7f6b5
17 changed files with 104 additions and 46 deletions
|
|
@ -17,6 +17,7 @@ using Yavsc;
|
|||
using Yavsc.Model;
|
||||
using Yavsc.Model.Blogs;
|
||||
using Yavsc.ApiControllers;
|
||||
using Yavsc.Model.RolesAndMembers;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
|
|
@ -82,7 +83,9 @@ namespace Yavsc.Controllers
|
|||
if (u.UserName == user)
|
||||
sf |= FindBlogEntryFlags.MatchInvisible;
|
||||
BlogEntryCollection c = BlogManager.FindPost (user, sf, pageIndex, pageSize, out tr);
|
||||
ViewData ["BlogTitle"] = BlogTitle (user);
|
||||
Profile bupr = AccountController.GetProfile (user);
|
||||
ViewData ["BlogUserProfile"] = bupr;
|
||||
ViewData ["BlogTitle"] = bupr.BlogTitle;
|
||||
ViewData ["PageIndex"] = pageIndex;
|
||||
ViewData ["PageSize"] = pageSize;
|
||||
ViewData ["RecordCount"] = tr;
|
||||
|
|
@ -109,16 +112,23 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
if (e == null)
|
||||
return View ("TitleNotFound");
|
||||
Profile pr = AccountController.GetProfile (e.UserName);
|
||||
if (pr==null)
|
||||
return View ("TitleNotFound");
|
||||
ViewData ["BlogUserProfile"] = pr;
|
||||
ViewData ["BlogTitle"] = pr.BlogTitle;
|
||||
MembershipUser u = Membership.GetUser ();
|
||||
if (u != null)
|
||||
ViewData ["UserName"] = u.UserName;
|
||||
if (!e.Visible) {
|
||||
if (!e.Visible || !pr.BlogVisible) {
|
||||
if (u==null)
|
||||
return View ("TitleNotFound");
|
||||
else if (u.UserName!=e.UserName)
|
||||
else {
|
||||
if (u.UserName!=e.UserName)
|
||||
if (!Roles.IsUserInRole(u.UserName,"Admin"))
|
||||
return View ("TitleNotFound");
|
||||
}
|
||||
}
|
||||
ViewData ["BlogTitle"] = BlogTitle (e.UserName);
|
||||
ViewData ["Comments"] = BlogManager.GetComments (e.Id);
|
||||
return View ("UserPost", e);
|
||||
}
|
||||
|
|
@ -183,7 +193,9 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
if (model != null) {
|
||||
string user = Membership.GetUser ().UserName;
|
||||
ViewData ["BlogTitle"] = this.BlogTitle (user);
|
||||
Profile pr = new Profile (HttpContext.Profile);
|
||||
|
||||
ViewData ["BlogTitle"] = pr.BlogTitle;
|
||||
ViewData ["UserName"] = user;
|
||||
if (model.UserName == null) {
|
||||
model.UserName = user;
|
||||
|
|
@ -202,10 +214,6 @@ namespace Yavsc.Controllers
|
|||
return View (model);
|
||||
}
|
||||
|
||||
private string BlogTitle (string user)
|
||||
{
|
||||
return string.Format ("{0}'s blog", user);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult Comment (BlogEditCommentModel model) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue