63 lines
2.4 KiB
Plaintext
63 lines
2.4 KiB
Plaintext
@model EnVisage.Models.ReportListModel
|
|
@{
|
|
ViewBag.Title = "List";
|
|
Layout = "~/Views/Shared/_Layout.cshtml";
|
|
}
|
|
<style type="text/css">
|
|
.reports {
|
|
margin-bottom: 6px;
|
|
width:600px;
|
|
}
|
|
|
|
.buttonSeparator {
|
|
margin-right: 6px;
|
|
width:100px;
|
|
}
|
|
|
|
.left {
|
|
float: left;
|
|
}
|
|
</style>
|
|
<h2>Report Catalog</h2>
|
|
|
|
@using (Html.BeginForm("", "", FormMethod.Post, new { id = "editForm" }))
|
|
{
|
|
<span>Use the form below to manage reports in the catalog.</span><br />
|
|
@Html.DropDownListFor(t=>t.SelectedReportId, new System.Web.Mvc.SelectList(Model.Reports, "Id", "Name"), new {@name="reportsList", @class="reports" })
|
|
<button type="submit" name="viewReport" cpUrl="@Url.Action("Viewer", "Reporting")" class="buttonSeparator">View</button>
|
|
<button type="submit" name="editReport" cpUrl="@Url.Action("Edit", "Reporting")" class="buttonSeparator">Edit</button>
|
|
<button type="submit" name="deleteReport" cpUrl="@Url.Action("Delete", "Reporting")" class="buttonSeparator">Delete</button>
|
|
}
|
|
|
|
<hr />
|
|
|
|
<button type="submit" name="addReport" cpUrl="@Url.Action("Add", "Reporting")" class="left buttonSeparator">New Report</button>
|
|
@Html.Label("newReportName", "New Report Name")
|
|
@Html.TextBox("newReportName")
|
|
@section scripts {
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
var patchFormSubitUrl = function (e) {
|
|
var value = $('#SelectedReportId').val();
|
|
var isValid = value != null && value !== 0;
|
|
if (isValid) {
|
|
//debugger;
|
|
document.getElementById('editForm').action = $(this).attr('cpUrl') + '/' + encodeURIComponent(value);
|
|
}
|
|
};
|
|
$('[name=editReport]').on('click', patchFormSubitUrl);
|
|
$('[name=deleteReport]').on('click', patchFormSubitUrl);
|
|
$('[name=viewReport]').on('click', patchFormSubitUrl);
|
|
$('[name=addReport]').on('click', function (e) {
|
|
var value = $('#newReportName').val();
|
|
var isValid = value != null && value !== '';
|
|
//e.processOnServer = isValid;
|
|
if (isValid) {
|
|
//document.getElementById('addForm').action = addReport.cpUrl + '?name=' + encodeURIComponent(value);
|
|
//$('#addForm').attr('action', addReport.cpUrl + '?name=' + encodeURIComponent(value));
|
|
window.location = $(this).attr('cpUrl') + '?name=' + encodeURIComponent(value);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
} |