Add WebCms

This commit is contained in:
2016-11-07 12:56:17 -05:00
parent dfe92218f4
commit 15911f33c0
2750 changed files with 365672 additions and 133 deletions
-1
View File
@@ -1,5 +1,4 @@
using System.Web.Optimization;using System;
using System.Web.Optimization;
using System.Web.Mvc;
using System.Web.Routing;
using LeafWeb.Core.DAL;
+1 -8
View File
@@ -5,8 +5,6 @@ namespace LeafWeb.Web.ViewModels.LeafInput
{
public class ConfirmViewModel
{
private static readonly IMapper Mapper;
[Display(Name = "Your name")]
public string Name { get; set; }
[Display(Name = "Your email")]
@@ -21,12 +19,7 @@ namespace LeafWeb.Web.ViewModels.LeafInput
static ConfirmViewModel()
{
var config =
new MapperConfiguration(cfg =>
{
cfg.CreateMap<CreateViewModel, ConfirmViewModel>();
});
Mapper = config.CreateMapper();
Mapper.CreateMap<CreateViewModel, ConfirmViewModel>();
}
public ConfirmViewModel(CreateViewModel createViewModel, string[] files)
+2 -9
View File
@@ -6,8 +6,6 @@ namespace LeafWeb.Web.ViewModels.LeafInput
{
public class CreateViewModel
{
private static readonly IMapper Mapper;
[Display(Name = "Your name")]
[Required(ErrorMessage = "Name required")]
[RegularExpression(@"[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Please provide your full name")]
@@ -38,13 +36,8 @@ namespace LeafWeb.Web.ViewModels.LeafInput
static CreateViewModel()
{
var config =
new MapperConfiguration(cfg =>
{
cfg.CreateMap<CreateViewModel, Core.Entities.LeafInput>()
.ForMember(dest => dest.PhotosynthesisType, opt => opt.Ignore());
});
Mapper = config.CreateMapper();
Mapper.CreateMap<CreateViewModel, Core.Entities.LeafInput>()
.ForMember(dest => dest.PhotosynthesisType, opt => opt.Ignore());
}
public Core.Entities.LeafInput GetFileInput(DataService db)
+26 -33
View File
@@ -6,8 +6,6 @@ namespace LeafWeb.Web.ViewModels.Results
{
public class ResultStatusViewModel
{
private static readonly IMapper Mapper;
public int LeafInputId { get; set; }
public string LeafInputName { get; set; }
public string LeafInputIdentifier { get; set; }
@@ -21,37 +19,32 @@ namespace LeafWeb.Web.ViewModels.Results
static ResultStatusViewModel()
{
var config =
new MapperConfiguration(cfg =>
{
cfg.CreateMap<Core.Entities.LeafInput, ResultStatusViewModel>()
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.HasLeafChart, opt => opt.ResolveUsing(src => src.OutputFiles.Any(o => o.IsLeafChartFile)))
//.ForMember(dest => dest.LeafOutputFilenames,
// opt => opt.ResolveUsing(
// src =>
// src.OutputFiles?
// .Select(o => o.Filename)
// .ToArray()
// ?? new string[] {}))
//.ForMember(dest => dest.HasLeafChartOutputFile,
// opt => opt.ResolveUsing(
// file => file.OutputFiles?.Any(o => o.IsLeafChartFile)))
.ForMember(dest => dest.LeafInputName, opt => opt.MapFrom(src => src.Name))
.ForMember(dest => dest.LeafInputIdentifier, opt => opt.MapFrom(src => src.Identifier))
.ForMember(dest => dest.LeafInputSiteId, opt => opt.MapFrom(src => src.SiteId))
.ForMember(dest => dest.LeafInputPhotosynthesisType, opt => opt.MapFrom(src => src.PhotosynthesisType.Name))
//.ForMember(dest => dest.ErrorMessages,
// opt => opt.ResolveUsing(
// src =>
// src.StatusHistory?
// .Where(sh => sh.Status == LeafInputStatusType.Exception)
// .Select(sh => sh.Description)
// .ToArray()
// ?? new string[] {}))
;
});
Mapper = config.CreateMapper();
Mapper.CreateMap<Core.Entities.LeafInput, ResultStatusViewModel>()
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.HasLeafChart, opt => opt.ResolveUsing(src => src.OutputFiles.Any(o => o.IsLeafChartFile)))
//.ForMember(dest => dest.LeafOutputFilenames,
// opt => opt.ResolveUsing(
// src =>
// src.OutputFiles?
// .Select(o => o.Filename)
// .ToArray()
// ?? new string[] {}))
//.ForMember(dest => dest.HasLeafChartOutputFile,
// opt => opt.ResolveUsing(
// file => file.OutputFiles?.Any(o => o.IsLeafChartFile)))
.ForMember(dest => dest.LeafInputName, opt => opt.MapFrom(src => src.Name))
.ForMember(dest => dest.LeafInputIdentifier, opt => opt.MapFrom(src => src.Identifier))
.ForMember(dest => dest.LeafInputSiteId, opt => opt.MapFrom(src => src.SiteId))
.ForMember(dest => dest.LeafInputPhotosynthesisType, opt => opt.MapFrom(src => src.PhotosynthesisType.Name))
//.ForMember(dest => dest.ErrorMessages,
// opt => opt.ResolveUsing(
// src =>
// src.StatusHistory?
// .Where(sh => sh.Status == LeafInputStatusType.Exception)
// .Select(sh => sh.Description)
// .ToArray()
// ?? new string[] {}))
;
}
public ResultStatusViewModel(Core.Entities.LeafInput leafInput)
@@ -5,8 +5,6 @@ namespace LeafWeb.Web.ViewModels.ResultsAdmin
{
public class LeafInputViewModel
{
private static readonly IMapper Mapper;
public int LeafInputId { get; set; }
public string LeafInputName { get; set; }
public string LeafInputIdentifier { get; set; }
@@ -20,27 +18,22 @@ namespace LeafWeb.Web.ViewModels.ResultsAdmin
static LeafInputViewModel()
{
var config =
new MapperConfiguration(cfg =>
{
cfg.CreateMap<Core.Entities.LeafInput, LeafInputViewModel>()
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.HasLeafChart, opt => opt.ResolveUsing(src => src.OutputFiles.Any(o => o.IsLeafChartFile)))
.ForMember(dest => dest.LeafInputName, opt => opt.MapFrom(src => src.Name))
.ForMember(dest => dest.LeafInputIdentifier, opt => opt.MapFrom(src => src.Identifier))
.ForMember(dest => dest.LeafInputSiteId, opt => opt.MapFrom(src => src.SiteId))
.ForMember(dest => dest.LeafInputPhotosynthesisType, opt => opt.MapFrom(src => src.PhotosynthesisType.Name))
//.ForMember(dest => dest.ErrorMessages,
// opt => opt.ResolveUsing(
// src =>
// src.StatusHistory?
// .Where(sh => sh.Status == LeafInputStatusType.Exception)
// .Select(sh => sh.Description)
// .ToArray()
// ?? new string[] {}))
;
});
Mapper = config.CreateMapper();
Mapper.CreateMap<Core.Entities.LeafInput, LeafInputViewModel>()
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.HasLeafChart, opt => opt.ResolveUsing(src => src.OutputFiles.Any(o => o.IsLeafChartFile)))
.ForMember(dest => dest.LeafInputName, opt => opt.MapFrom(src => src.Name))
.ForMember(dest => dest.LeafInputIdentifier, opt => opt.MapFrom(src => src.Identifier))
.ForMember(dest => dest.LeafInputSiteId, opt => opt.MapFrom(src => src.SiteId))
.ForMember(dest => dest.LeafInputPhotosynthesisType, opt => opt.MapFrom(src => src.PhotosynthesisType.Name))
//.ForMember(dest => dest.ErrorMessages,
// opt => opt.ResolveUsing(
// src =>
// src.StatusHistory?
// .Where(sh => sh.Status == LeafInputStatusType.Exception)
// .Select(sh => sh.Description)
// .ToArray()
// ?? new string[] {}))
;
}
public LeafInputViewModel(Core.Entities.LeafInput leafInput)
+11 -2
View File
@@ -20,8 +20,17 @@
grid.Column("Total Results: " + Model.Count(), format:
@<div class="btn-group" role="group">
@Html.ActionLink("Details", "Details", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role = "button" })
@Html.ActionLink("Dwnld", "DownloadOutputToUser", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role = "button" })
@Html.ActionLink("Dwnld Input", "DownloadInput", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role = "button" })
<div class="btn-group" role="group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Download
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>@Html.ActionLink("ToUser", "DownloadOutputToUser", new {id = item.LeafInputId})</li>
<li>@Html.ActionLink("Input", "DownloadInput", new {id = item.LeafInputId})</li>
</ul>
</div>
@Html.ActionLink("Delete", "Delete", new { id = item.LeafInputId }, new { @class = "btn btn-default btn-xs", role="button" })
</div>)
),
+14 -4
View File
@@ -45,8 +45,12 @@
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="AutoMapper, Version=4.2.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.4.2.1\lib\net45\AutoMapper.dll</HintPath>
<Reference Include="AutoMapper, Version=3.3.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.3.3.1\lib\net40\AutoMapper.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="AutoMapper.Net4, Version=3.3.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.3.3.1\lib\net40\AutoMapper.Net4.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Backload, Version=2.2.2.0, Culture=neutral, PublicKeyToken=02eaf42ab375d363, processorArchitecture=MSIL">
@@ -624,7 +628,9 @@
<Content Include="Scripts\mdd_styles.css" />
<Content Include="Scripts\mdd_toolbar.png" />
<Content Include="Scripts\validation.js" />
<Content Include="Web.config" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\BootstrapEditorTemplatesConfig.cs" />
@@ -668,7 +674,9 @@
<Compile Include="ViewModels\SelectListViewModel.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\web.config" />
<Content Include="Views\web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="packages.config" />
<Content Include="Views\Pages\Index.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
@@ -710,6 +718,7 @@
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
@@ -756,6 +765,7 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
<Import Project="..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets" Condition="Exists('..\packages\AutoMapper.3.3.1\tools\AutoMapper.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
+1 -1
View File
@@ -2,7 +2,7 @@
<packages>
<package id="AngularJS.Core" version="1.5.5" targetFramework="net45" />
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
<package id="AutoMapper" version="4.2.1" targetFramework="net45" />
<package id="AutoMapper" version="3.3.1" targetFramework="net45" />
<package id="Backload" version="2.2.2.0" targetFramework="net45" />
<package id="Backload.Core" version="2.2.2.0" targetFramework="net45" />
<package id="bootstrap" version="3.3.6" targetFramework="net45" />