@ -1,15 +1,37 @@ | |||||
using System.Web.Mvc; | |||||
using Microsoft.AspNet.Identity.EntityFramework; | |||||
using Sevomin.Models; | |||||
using Sevomin.Models.Helpers; | |||||
using System.Threading.Tasks; | |||||
using System.Web.Mvc; | |||||
namespace Sevomin.WebFrontend.Controllers | namespace Sevomin.WebFrontend.Controllers | ||||
{ | { | ||||
public class HomeController : BaseController | public class HomeController : BaseController | ||||
{ | { | ||||
public ActionResult Index() | |||||
public HomeController() | |||||
: this(new SevominUserManager(new UserStore<User>(SevominDbContext.Current))) | |||||
{ | |||||
} | |||||
public HomeController(SevominUserManager userManager) | |||||
{ | |||||
UserManager = userManager; | |||||
} | |||||
public SevominUserManager UserManager { get; private set; } | |||||
public async Task<ActionResult> Index() | |||||
{ | { | ||||
if (!Request.IsAuthenticated) | if (!Request.IsAuthenticated) | ||||
return View("Intro"); | return View("Intro"); | ||||
else | else | ||||
return View("Intro"); | |||||
{ | |||||
User user = await UserManager.FindByNameAsync(User.Identity.Name); | |||||
if(user is Avalin) | |||||
return View("AvalinIndex"); | |||||
else | |||||
return View("DovominIndex"); | |||||
} | |||||
} | } | ||||
} | } |
@ -0,0 +1,13 @@ | |||||
@{ | |||||
ViewBag.Title = "خانه"; | |||||
} | |||||
<nav> | |||||
<div class="btn-toolbar"> | |||||
<div class="btn-group"> | |||||
<a href="@Url.Action("NewJob", "Job")" class="btn btn-default">انتشار آگهی</a> | |||||
<a href="#" class="btn btn-default">آگهی های شما</a> | |||||
<a href="#" class="btn btn-default">وضعیت آگهی های جاری</a> | |||||
</div> | |||||
</div> | |||||
</nav> |
@ -0,0 +1,8 @@ | |||||
@{ | |||||
ViewBag.Title = "خانه"; | |||||
} | |||||
<section> | |||||
<div class="row"> | |||||
@Html.Action("LatestJobList", "Job", new { count = 15 }) | |||||
</div> | |||||
</section> |
@ -0,0 +1,17 @@ | |||||
@model IList<Sevomin.Models.JobMiniViewModel> | |||||
<div class="col-md-12"> | |||||
@foreach (var job in Model) | |||||
{ | |||||
<div class="panel panel-default"> | |||||
<div class="panel-body"> | |||||
<p class="rtl"> کارشناس برنامه ریزی و کنترل پروژه | |||||
@foreach (var param in job.Parameters) | |||||
{ | |||||
@MvcHtmlString.Create(string.Format(param.Item1, param.Item2) + " ") | |||||
} | |||||
</p> | |||||
</div> | |||||
</div> | |||||
} | |||||
</div> |