Bug Fix: Upload attachments required refresh
This commit is contained in:
@@ -117,12 +117,17 @@
|
||||
if (d.Result == 'OK') {
|
||||
var a = d.Attachment;
|
||||
@if (canRemoveAnyAttachments)
|
||||
{<text>buildAttachment(a, true);</text>}
|
||||
{
|
||||
<text>buildAttachment(a, true, quick);</text>
|
||||
}
|
||||
else if (canRemoveOwnAttachments)
|
||||
{<text>buildAttachment(a, (a.AuthorId === '@(CurrentUser.Id)'));</text>}
|
||||
{
|
||||
<text>buildAttachment(a, (a.AuthorId === '@(CurrentUser.Id)'), quick);</text>
|
||||
}
|
||||
else
|
||||
{<text>buildAttachment(a, false);</text>}
|
||||
|
||||
{
|
||||
<text>buildAttachment(a, false, quick);</text>
|
||||
}
|
||||
} else {
|
||||
alert('Unable to add attachment: ' + d.Result);
|
||||
}
|
||||
@@ -132,7 +137,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
function buildAttachment(a, canRemove) {
|
||||
function buildAttachment(a, canRemove, quick) {
|
||||
var t = '<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span>';
|
||||
if (canRemove)
|
||||
t += '<span class="remove"></span>';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18051
|
||||
// Runtime Version:4.0.30319.34003
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -461,49 +461,63 @@ WriteLiteral(@"',
|
||||
#line 119 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canRemoveAnyAttachments)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("buildAttachment(a, true);");
|
||||
|
||||
|
||||
#line 120 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
WriteLiteral("buildAttachment(a, true, quick);");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 122 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
else if (canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
|
||||
|
||||
|
||||
#line 122 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(CurrentUser.Id);
|
||||
#line 125 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(CurrentUser.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\'));");
|
||||
WriteLiteral("\'), quick);");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 122 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
#line 126 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("buildAttachment(a, false);");
|
||||
|
||||
|
||||
#line 124 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"
|
||||
} else {
|
||||
WriteLiteral(" ");
|
||||
|
||||
WriteLiteral("buildAttachment(a, false, quick);");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 130 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@" } else {
|
||||
alert('Unable to add attachment: ' + d.Result);
|
||||
}
|
||||
},
|
||||
@@ -512,7 +526,7 @@ WriteLiteral(@"
|
||||
}
|
||||
});
|
||||
}
|
||||
function buildAttachment(a, canRemove) {
|
||||
function buildAttachment(a, canRemove, quick) {
|
||||
var t = '<a><span");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
@@ -543,7 +557,7 @@ WriteLiteral("></span></a>\';\r\n\r\n var e = $(t);\r
|
||||
"tr(\'href\', \'");
|
||||
|
||||
|
||||
#line 143 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 148 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentDownload()));
|
||||
|
||||
|
||||
@@ -552,7 +566,7 @@ WriteLiteral("></span></a>\';\r\n\r\n var e = $(t);\r
|
||||
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', \'");
|
||||
|
||||
|
||||
#line 144 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 149 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentThumbnail()));
|
||||
|
||||
|
||||
@@ -577,7 +591,7 @@ WriteLiteral(@"/' + a.Id);
|
||||
");
|
||||
|
||||
|
||||
#line 160 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 165 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -586,7 +600,7 @@ WriteLiteral(@"/' + a.Id);
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 161 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 166 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
@@ -618,7 +632,7 @@ WriteLiteral(@"
|
||||
url: '");
|
||||
|
||||
|
||||
#line 185 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 190 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentRemove()));
|
||||
|
||||
|
||||
@@ -650,7 +664,7 @@ WriteLiteral("\',\r\n dataType: \'json\',
|
||||
"egion\r\n ");
|
||||
|
||||
|
||||
#line 218 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 223 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -670,13 +684,13 @@ WriteLiteral(@"
|
||||
");
|
||||
|
||||
|
||||
#line 230 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 235 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 230 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 235 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canAddAttachments)
|
||||
{
|
||||
|
||||
@@ -696,7 +710,7 @@ WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 236 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 241 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -705,7 +719,7 @@ WriteLiteral(">\r\n </div>\r\n </div>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 237 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 242 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
@@ -727,7 +741,7 @@ WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 245 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 250 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -737,7 +751,7 @@ WriteLiteral(" <script>\r\n $(\'#UserDetailTabItems\').append(\'<li><a
|
||||
"b-Resources\" id=\"UserDetailTab-ResourcesLink\">Attachments [");
|
||||
|
||||
|
||||
#line 247 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 252 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Model.User.UserAttachments == null ? 0 : Model.User.UserAttachments.Count);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user