147 lines
5.6 KiB
C#
147 lines
5.6 KiB
C#
#pragma warning disable 1591
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
// Runtime Version:4.0.30319.42000
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace Disco.Web.Views.Shared
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Helpers;
|
|
using System.Web.Mvc;
|
|
using System.Web.Mvc.Ajax;
|
|
using System.Web.Mvc.Html;
|
|
using System.Web.Routing;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.WebPages;
|
|
using Disco;
|
|
using Disco.Models.Repository;
|
|
using Disco.Services;
|
|
using Disco.Services.Authorization;
|
|
using Disco.Services.Web;
|
|
using Disco.Web;
|
|
using Disco.Web.Extensions;
|
|
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
|
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Shared/_GenerateDocumentControl.cshtml")]
|
|
public partial class _GenerateDocumentControl : Disco.Services.Web.WebViewPage<Disco.Web.Models.Shared.GenerateDocumentControlModel>
|
|
{
|
|
public _GenerateDocumentControl()
|
|
{
|
|
}
|
|
public override void Execute()
|
|
{
|
|
|
|
#line 2 "..\..\Views\Shared\_GenerateDocumentControl.cshtml"
|
|
if (Model.Templates.Count > 0 || Model.TemplatePackages.Count > 0)
|
|
{
|
|
var selectListItems = new List<SelectListItem>();
|
|
selectListItems.Add(new SelectListItem() { Selected = true, Value = string.Empty, Text = "Generate Document" });
|
|
selectListItems.AddRange(Model.Templates.ToSelectListItems());
|
|
selectListItems.AddRange(Model.TemplatePackages.ToSelectListItems());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Document_Generation_Container\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 9 "..\..\Views\Shared\_GenerateDocumentControl.cshtml"
|
|
Write(Html.DropDownList("Document_Generate", selectListItems));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Document_Generation_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Generate Document\"");
|
|
|
|
WriteLiteral(">\r\n </div>\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n var generatePdfUrl = \'");
|
|
|
|
|
|
#line 15 "..\..\Views\Shared\_GenerateDocumentControl.cshtml"
|
|
Write(Url.Action(MVC.API.DocumentTemplate.Generate()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("/\';\r\n var generatePackageUrl = \'");
|
|
|
|
|
|
#line 16 "..\..\Views\Shared\_GenerateDocumentControl.cshtml"
|
|
Write(Url.Action(MVC.API.DocumentTemplatePackage.Generate()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("/\';\r\n var generateTargetId = \'");
|
|
|
|
|
|
#line 17 "..\..\Views\Shared\_GenerateDocumentControl.cshtml"
|
|
Write(HttpUtility.UrlEncode(Model.Target.AttachmentReferenceId));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\';\r\n var $control = $(\'#Document_Generate\');\r\n var $generat" +
|
|
"ionHost;\r\n\r\n var downloadDocument = function (templateId) {\r\n\r\n " +
|
|
" var url;\r\n if (templateId.lastIndexOf(\'Package:\', 0) ==" +
|
|
"= 0)\r\n url = generatePackageUrl + templateId.substring(8);\r\n " +
|
|
" else\r\n url = generatePdfUrl + templateId;\r\n " +
|
|
" url = url + \'?TargetId=\' + generateTargetId;\r\n\r\n if " +
|
|
"($.connection && $.connection.hub && $.connection.hub.transport &&\r\n " +
|
|
" $.connection.hub.transport.name == \'foreverFrame\') {\r\n " +
|
|
" // SignalR active with foreverFrame transport - use popup window\r\n " +
|
|
" window.open(url, \'_blank\', \'height=150,width=250,location=no,menubar=no," +
|
|
"resizable=no,scrollbars=no,status=no,toolbar=no\');\r\n } else {\r\n " +
|
|
" // use iFrame\r\n if (!$generationHost) {\r\n " +
|
|
" $generationHost = $(\'<iframe>\')\r\n " +
|
|
" .attr({ \'src\': url, \'title\': \'Document Generation Host\' })\r\n " +
|
|
" .addClass(\'hidden\')\r\n .appendTo(\'body\')\r\n " +
|
|
" .contents();\r\n } else {\r\n " +
|
|
" $generationHost[0].location.href = url;\r\n }\r\n " +
|
|
" }\r\n }\r\n\r\n $control.change(function () {\r\n " +
|
|
" var templateId = $control.val();\r\n if (templateId) " +
|
|
"{\r\n downloadDocument(templateId);\r\n\r\n $con" +
|
|
"trol.val(\'\').blur();\r\n }\r\n });\r\n });\r\n </scr" +
|
|
"ipt>\r\n");
|
|
|
|
|
|
#line 58 "..\..\Views\Shared\_GenerateDocumentControl.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|