Update: New User UI (Initial)
This commit is contained in:
@@ -0,0 +1,482 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.User.UserParts
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/User/UserParts/_Resources.cshtml")]
|
||||
public partial class Resources : System.Web.Mvc.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
{
|
||||
public Resources()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"UserDetailTab-Resources\"");
|
||||
|
||||
WriteLiteral(" class=\"UserPart\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" id=\"userShowResources\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <td");
|
||||
|
||||
WriteLiteral(" id=\"Attachments\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"attachmentOutput\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 12 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 12 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (Model.User.UserAttachments != null)
|
||||
{
|
||||
foreach (var ua in Model.User.UserAttachments)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 618), Tuple.Create("\"", 676)
|
||||
|
||||
#line 16 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 625), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentDownload(ua.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 625), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-attachmentid=\"");
|
||||
|
||||
|
||||
#line 16 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-mimetype=\"");
|
||||
|
||||
|
||||
#line 16 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.MimeType);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 782), Tuple.Create("\"", 802)
|
||||
|
||||
#line 17 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 790), Tuple.Create<System.Object, System.Int32>(ua.Filename
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 790), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 869), Tuple.Create("\"", 929)
|
||||
|
||||
#line 18 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 875), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 875), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" /></span>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 992), Tuple.Create("\"", 1012)
|
||||
|
||||
#line 19 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1000), Tuple.Create<System.Object, System.Int32>(ua.Comments
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1000), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 20 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 20 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (!string.IsNullOrEmpty(ua.DocumentTemplateId))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 21 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.DocumentTemplate.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 21 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.Comments);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </span><span");
|
||||
|
||||
WriteLiteral(" class=\"author\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.TechUser.ToString());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span><span");
|
||||
|
||||
WriteLiteral(" class=\"remove\"");
|
||||
|
||||
WriteLiteral("></span>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1432), Tuple.Create("\"", 1470)
|
||||
|
||||
#line 25 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1440), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1440), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 25 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.Timestamp.ToFuzzy());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>\r\n </a> \r\n");
|
||||
|
||||
|
||||
#line 27 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"attachmentInput clearfix\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"action upload\"");
|
||||
|
||||
WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"action photo\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </div>\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n Shadowbox.init({\r\n skipSetup: true," +
|
||||
"\r\n modal: true\r\n });\r\n " +
|
||||
" $(function () {\r\n if (!document.DiscoFunctions) {\r\n " +
|
||||
" document.DiscoFunctions = {};\r\n " +
|
||||
" }\r\n document.DiscoFunctions.addAttachment = addAttachmen" +
|
||||
"t;\r\n\r\n $Attachments = $(\'#Attachments\');\r\n " +
|
||||
" $attachmentOutput = $Attachments.find(\'.attachmentOutput\');\r\n\r\n " +
|
||||
" $attachmentOutput.find(\'span.remove\').click(removeAttachment);\r\n" +
|
||||
"\r\n $(\'#dialogUpload\').dialog({\r\n " +
|
||||
" autoOpen: false,\r\n draggable: false,\r\n " +
|
||||
" modal: true,\r\n resizable: false,\r\n " +
|
||||
" width: 860,\r\n height: 550,\r\n" +
|
||||
" close: function () {\r\n " +
|
||||
" silverlightUploadAttachment.content.Navigator.Navigate(\'/Hidden\');\r\n " +
|
||||
" }\r\n });\r\n\r\n $(\'#" +
|
||||
"dialogRemoveAttachment\').dialog({\r\n resizable: false," +
|
||||
"\r\n height: 140,\r\n modal: t" +
|
||||
"rue,\r\n autoOpen: false\r\n });\r\n" +
|
||||
"\r\n var onLoadNavigation = null;\r\n " +
|
||||
"var isLoaded = null;\r\n Silverlight.createObject(\r\n " +
|
||||
" \'");
|
||||
|
||||
|
||||
#line 71 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
$('#silverlightHostUploadAttachment').get(0),
|
||||
'silverlightUploadAttachment',
|
||||
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
|
||||
{
|
||||
onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
'UploadUrl=");
|
||||
|
||||
|
||||
#line 83 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentUpload(Model.User.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"'
|
||||
);
|
||||
|
||||
$attachmentInput = $Attachments.find('.attachmentInput');
|
||||
$attachmentInput.find('.photo').click(function () {
|
||||
showDialog('/WebCam');
|
||||
});
|
||||
$attachmentInput.find('.upload').click(function () {
|
||||
showDialog('/File');
|
||||
});
|
||||
|
||||
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
|
||||
function showDialog(navigationPath) {
|
||||
$('#dialogUpload').dialog('open');
|
||||
if (isLoaded) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
|
||||
} else {
|
||||
onLoadNavigation = navigationPath;
|
||||
}
|
||||
};
|
||||
function addAttachment(id, quick) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 106 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.Attachment()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.Result == 'OK') {
|
||||
var a = d.Attachment;
|
||||
|
||||
var e = $('<a><span class=""icon""><img alt=""Attachment Thumbnail"" /></span><span class=""comments""></span><span class=""author""></span><span class=""remove""></span><span class=""timestamp""></span></a>');
|
||||
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
|
||||
|
||||
|
||||
#line 115 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentDownload()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', " +
|
||||
"\'");
|
||||
|
||||
|
||||
#line 116 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentThumbnail()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.Comme" +
|
||||
"nts);\r\n e.find(\'.author\').text(a.Author);\r\n " +
|
||||
" e.find(\'.timestamp\').text(a.TimestampFuzzy).at" +
|
||||
"tr(\'title\', a.TimestampFull);\r\n e.find(\'.remo" +
|
||||
"ve\').click(removeAttachment);\r\n if (!quick)\r\n" +
|
||||
" e.hide();\r\n " +
|
||||
" $attachmentOutput.append(e);\r\n if (!qu" +
|
||||
"ick)\r\n e.show(\'slow\');\r\n " +
|
||||
" if (a.MimeType.toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" e.shadowbox({ gallery: \'attachments\', player: \'" +
|
||||
"img\', title: a.Comments });\r\n } else {\r\n " +
|
||||
" alert(\'Unable to add attachment: \' + d.Result);\r\n " +
|
||||
" }\r\n },\r\n " +
|
||||
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to add attachment: \' + textStatus);\r\n " +
|
||||
" }\r\n });\r\n }\r\n " +
|
||||
" function removeAttachment() {\r\n $this = $(this)." +
|
||||
"closest(\'a\');\r\n\r\n var data = { id: $this.attr(\'data-attac" +
|
||||
"hmentid\') };\r\n var $dialogRemoveAttachment = $(\'#dialogRe" +
|
||||
"moveAttachment\');\r\n $dialogRemoveAttachment.dialog(\"enabl" +
|
||||
"e\");\r\n $dialogRemoveAttachment.dialog(\'option\', \'buttons\'" +
|
||||
", {\r\n \"Remove\": function () {\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"disable\");\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 148 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentRemove()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
|
||||
" data: data,\r\n success: function" +
|
||||
" (d) {\r\n if (d == \'OK\') {\r\n " +
|
||||
" $this.hide(300).delay(300).queue(function () {\r\n " +
|
||||
" var $this = $(this);\r\n " +
|
||||
" if ($this.attr(\'data-mimetype\').toLowerCase(" +
|
||||
").indexOf(\'image/\') == 0)\r\n S" +
|
||||
"hadowbox.removeCache(this);\r\n $th" +
|
||||
"is.remove();\r\n });\r\n " +
|
||||
" } else {\r\n ale" +
|
||||
"rt(\'Unable to remove attachment: \' + d);\r\n " +
|
||||
" }\r\n $dialogRemoveAttachment.dialog(\"clo" +
|
||||
"se\");\r\n },\r\n " +
|
||||
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to remove attachment: \' + textStatus);\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" }\r\n });\r\n " +
|
||||
" },\r\n Cancel: function () {\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" }\r\n });\r\n\r\n $dialogRem" +
|
||||
"oveAttachment.dialog(\'open\');\r\n\r\n return false;\r\n " +
|
||||
" }\r\n $attachmentOutput.children(\'a\').each(function" +
|
||||
" () {\r\n $this = $(this);\r\n if ($th" +
|
||||
"is.attr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" $this.shadowbox({ gallery: \'attachments\', player: \'img\', title: $thi" +
|
||||
"s.find(\'.comments\').text() });\r\n });\r\n });\r\n " +
|
||||
" </script>\r\n </td>\r\n </tr>\r\n </table>\r\n <di" +
|
||||
"v");
|
||||
|
||||
WriteLiteral(" id=\"dialogUpload\"");
|
||||
|
||||
WriteLiteral(" title=\"Upload Attachment\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogRemoveAttachment\"");
|
||||
|
||||
WriteLiteral(" title=\"Remove this Attachment?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n </div>\r\n <script>\r\n " +
|
||||
" $(\'#UserDetailTabItems\').append(\'<li><a href=\"#UserDetailTab-Resources\" id=\"" +
|
||||
"UserDetailTab-ResourcesLink\">Attachments [");
|
||||
|
||||
|
||||
#line 200 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Model.User.UserAttachments == null ? 0 : Model.User.UserAttachments.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
Reference in New Issue
Block a user