refactoring

This commit is contained in:
2017-01-19 14:32:03 +01:00
parent 8f0a2439b7
commit 7f9d0e946b
7 changed files with 30 additions and 29 deletions

View File

@ -1,7 +1,6 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Data.Entity;
using Yavsc.Models;
using Yavsc.Models.Relationship;

View File

@ -1,7 +1,6 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Data.Entity;
using Yavsc.Models;
using Yavsc.Models.Relationship;

View File

@ -3,11 +3,12 @@ using System.IO;
using Microsoft.AspNet.Authorization;
using Yavsc.Models;
namespace Yavsc {
namespace Yavsc.ViewModel.Auth {
public class FileSpotInfo : IAuthorizationRequirement
{
public DirectoryInfo PathInfo { get; private set; }
public DirectoryInfo PathInfo { get; private set; }
public FileSpotInfo(string path, Blog b) {
PathInfo = new DirectoryInfo(path);
AuthorId = b.AuthorId;

View File

@ -1,5 +1,6 @@
using System.Security.Claims;
using Microsoft.AspNet.Authorization;
using Yavsc.ViewModel.Auth;
namespace Yavsc.ViewModels.Auth.Handlers
{

View File

@ -7,7 +7,7 @@
@foreach (var profile in Model) {
<hr/>
await Html.RenderPartialAsync("PerformerProfile", profile) ;
@Html.DisplayFor(m=>m)
<form action="~/Command/Create" >
<input type="hidden" name="id" value="@profile.PerformerId" />
<input type="hidden" name="activityCode" value="@ViewBag.Activity.Code" />

View File

@ -0,0 +1,21 @@
@model ApplicationUser
blah
<img src="~/Avatars/@(Model.UserName).xs.png" alt="avatar">
@Model.UserName
@if (Model.Posts!=null) {
<li> <a asp-controller="Blogspot" asp-action="UserPosts"
asp-route-id="@Model.UserName">@SR["His blog"]</a>
</li>
}
@if (!string.IsNullOrEmpty(
Model.DedicatedGoogleCalendar))
{
<li> @SR["Exposes his Google calendar!"]
</li>
}
@if (Model.Devices?.Count>0)
{
<li> @SR["Uses the mobile application, and receives push notifications"]
</li>
}
}

View File

@ -2,9 +2,7 @@
<div class="performer @(Model.Active?"active":"inactive")">
<img src="~/Avatars/@(Model.Performer?.UserName).xs.png" alt="avatar">
@Model.Performer?.UserName
@Html.DisplayFor(m=>m.Performer)
<ul>
<li> @SR["Rating"]: @Model.Rate % </li>
@ -17,25 +15,7 @@
@if (Model.WebSite!=null) {
<li>@SR["WebSite"]: @Model.WebSite</li>
}
@if (Model.Performer != null) {
@if (Model.Performer.Posts!=null) {
<li> <a asp-controller="Blogspot" asp-action="UserPosts"
asp-route-id="@Model.Performer.UserName">@SR["His blog"]</a>
</li>
}
@if (!string.IsNullOrEmpty(
Model.Performer.DedicatedGoogleCalendar))
{
<li> @SR["Exposes his Google calendar!"]
</li>
}
@if (Model.Performer.Devices?.Count>0)
{
<li> @SR["Uses the mobile application, and receives push notifications"]
</li>
}
}
</ul>
</div>