-
Notifications
You must be signed in to change notification settings - Fork 644
/
ReportAbuse.cshtml.orig
101 lines (93 loc) · 4.3 KB
/
ReportAbuse.cshtml.orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
@using PoliteCaptcha
@model ReportAbuseViewModel
@{
ViewBag.Tab = "Packages";
string returnUrl = ViewData.ContainsKey(Constants.ReturnUrlViewDataKey) ? (string)ViewData[Constants.ReturnUrlViewDataKey] : Request.RawUrl;
}
<h1 class="page-heading">Report Abuse</h1>
<p class="message">
<strong>Important: Please do not use this form to report a bug in a package you are using!</strong><br />
This form is for reporting <em>abusive</em> packages such as
packages containing <em>malicious code</em> or spam. If "@Model.PackageId" simply doesn't
work, or if you need help getting the package installed, please
<a href="@Url.Action(MVC.Packages.ContactOwners(Model.PackageId))" title="contact the owners">contact the owners instead.</a>
</p>
<p>Please provide a detailed abuse report. Include exactly what the package did, for example if you are reporting a package with a virus or malicious code,
<em>please provide evidence to support your claim!</em> We cannot delete packages without evidence that they exhibit malicious behavior.</p>
@if (!Model.ConfirmedUser)
{
<p>Note: if you are the owner of @Model.PackageId, please
<a href="@Url.LogOn(returnUrl)">sign in now before you complete this form.</a>
</p>
}
@using (Html.BeginForm())
{
<fieldset id="report-abuse-form" class="form">
<legend>Report Abuse</legend>
@Html.AntiForgeryToken()
<div class="form-field">
@if (!Model.ConfirmedUser)
{
@Html.LabelFor(m => m.Email)
@Html.EditorFor(m => m.Email)
<span class="field-hint-message">Provide your email address so we can follow up with you.</span>
@Html.ValidationMessageFor(m => m.Email)
}
else
{
<input type="hidden" name="Email" value="test@example.com" />
}
</div>
<div id="form-field-reason" class="form-field">
@Html.LabelFor(m => m.Reason)
@Html.EnumDropDownListFor(m => m.Reason, Model.ReasonChoices, "<Choose a Reason>")
@Html.ValidationMessageFor(m => m.Reason)
</div>
<div class="form-field">
@Html.CheckBoxFor(m => m.AlreadyContactedOwner)
@Html.LabelFor(m => m.AlreadyContactedOwner, "Yes! I have already tried to contact the package owner about this problem.",
new Dictionary<string, object>
{
{ "style", "display: inline" },
})<br/>
</div>
<div class="form-field">
@Html.LabelFor(m => m.Message, "Abuse Report")
<p>In addition to selecting the reason for reporting the package, you must provide details of the problem here.</p>
@Html.TextAreaFor(m => m.Message, 10, 50, null)
@Html.ValidationMessageFor(m => m.Message, null, new { id = "report-abuse-message" })
</div>
<<<<<<< HEAD
<img src="@Url.Content("~/content/images/required.png")" alt="Blue border on left means required." />
=======
<div class="form-field" >
@Html.CheckBoxFor(m => m.CopySender)
@Html.LabelFor(m => m.CopySender, new { @class = "checkbox" })
</div>
<img src="@Url.Content("~/Content/images/required.png")" alt="Blue border on left means required." />
>>>>>>> 1be02a7... Merge branch 'master' of https://github.com/NuGet/NuGetGallery
@Html.SpamPreventionFields()
<input id="form-submit" type="submit" value="Report" title="Report '@Model.PackageId' for abuse" />
</fieldset>
}
@section BottomScripts {
@Html.SpamPreventionScript()
<script>
function reasonSelected() {
var $form = $('#Reason').parents('form');
var val = $(this).val();
if (val) {
$form.validate().element($('#Reason'));
}
if (val === 'HasABugOrFailedToInstall') {
$form.find("input, textarea, select").not('#form-field-reason *').attr('disabled', 'disabled');
} else {
$form.find("input, textarea, select").not('#form-field-reason').removeAttr('disabled');
}
}
$(function () {
$('#Reason').change(reasonSelected);
reasonSelected(); // Run once in case it starts with the bad selection
});
</script>
}