39 changed files with 628 additions and 638 deletions
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Web; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Status.ViewModels |
||||
{ |
||||
public class BillViewModel : TransactionViewModel |
||||
{ |
||||
public string Recipient { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Web; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Status.ViewModels |
||||
{ |
||||
public class DonationViewModel : TransactionViewModel |
||||
{ |
||||
public string Sender { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Web; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Status.ViewModels |
||||
{ |
||||
public class OneTimeViewModel : TransactionViewModel |
||||
{ |
||||
public string Recipient { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Web; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Status.ViewModels |
||||
{ |
||||
public class TakedownViewModel : ViewModelBase |
||||
{ |
||||
public string Requester { get; set; } |
||||
|
||||
public string RequesterContact { get; set; } |
||||
|
||||
public string Reason { get; set; } |
||||
|
||||
public string ActionTaken { get; set; } |
||||
|
||||
public DateTime DateRequested { get; set; } |
||||
|
||||
public DateTime DateActionTaken { get; set; } |
||||
|
||||
public virtual ICollection<Upload.Models.Upload> Attachments { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Web; |
||||
using Teknik.Areas.Status.Models; |
||||
using Teknik.Utilities; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Status.ViewModels |
||||
{ |
||||
public class TransactionViewModel : ViewModelBase |
||||
{ |
||||
public decimal Amount { get; set; } |
||||
|
||||
public CurrencyType Currency { get; set; } |
||||
|
||||
public string Reason { get; set; } |
||||
|
||||
public DateTime DateSent { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Web; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Status.ViewModels |
||||
{ |
||||
public class TransactionsViewModel : ViewModelBase |
||||
{ |
||||
public decimal CurrentMonthBills { get; set; } |
||||
|
||||
public decimal CurrentMonthIncome { get; set; } |
||||
|
||||
public decimal TotalBills { get; set; } |
||||
|
||||
public decimal TotalOneTimes { get; set; } |
||||
|
||||
public decimal TotalDonations { get; set; } |
||||
|
||||
public decimal TotalNet { get; set; } |
||||
|
||||
public List<BillViewModel> Bills { get; set; } |
||||
|
||||
public List<OneTimeViewModel> OneTimes { get; set; } |
||||
|
||||
public List<DonationViewModel> Donations { get; set; } |
||||
|
||||
public TransactionsViewModel() |
||||
{ |
||||
TotalBills = 0; |
||||
TotalOneTimes = 0; |
||||
TotalDonations = 0; |
||||
TotalNet = 0; |
||||
Bills = new List<BillViewModel>(); |
||||
OneTimes = new List<OneTimeViewModel>(); |
||||
Donations = new List<DonationViewModel>(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
๏ปฟ@model List<Teknik.Areas.Status.ViewModels.BillViewModel> |
||||
|
||||
@using Teknik.Areas.Status.ViewModels |
||||
|
||||
@if (Model != null && Model.Any()) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<h3>Bills</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#bills-section">View Bills</button> |
||||
</div> |
||||
</div> |
||||
<br /> |
||||
<div id="bills-section" class="collapse in"> |
||||
<table class="table table-condensed table-bordered table-hover"> |
||||
<tr> |
||||
<th><strong>Date</strong></th> |
||||
<th><strong>Amount</strong></th> |
||||
<th><strong>Description</strong></th> |
||||
</tr> |
||||
@foreach (BillViewModel bill in Model) |
||||
{ |
||||
<tr> |
||||
<td>@bill.DateSent.ToString("MMMM dd, yyyy")</td> |
||||
<td>@bill.Amount <var>@bill.Currency.ToString()</var></td> |
||||
<td>@bill.Reason</td> |
||||
</tr> |
||||
} |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
} |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
๏ปฟ@model List<Teknik.Areas.Status.ViewModels.DonationViewModel> |
||||
|
||||
@using Teknik.Areas.Status.ViewModels |
||||
|
||||
@if (Model != null && Model.Any()) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<h3>Donations</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#donations-section">View Donations</button> |
||||
</div> |
||||
</div> |
||||
<br /> |
||||
<div id="donations-section" class="collapse in"> |
||||
<table class="table table-condensed table-bordered table-hover"> |
||||
<tr> |
||||
<th><strong>Date</strong></th> |
||||
<th><strong>Amount</strong></th> |
||||
<th><strong>Donor</strong></th> |
||||
<th><strong>Reason for Donation</strong></th> |
||||
</tr> |
||||
@foreach (DonationViewModel donation in Model) |
||||
{ |
||||
<tr> |
||||
<td>@donation.DateSent.ToString("MMMM dd, yyyy")</td> |
||||
<td>@donation.Amount <var>@donation.Currency.ToString()</var></td> |
||||
<td>@donation.Sender</td> |
||||
<td>@donation.Reason</td> |
||||
</tr> |
||||
} |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
} |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
๏ปฟ@model List<Teknik.Areas.Status.ViewModels.OneTimeViewModel> |
||||
|
||||
@using Teknik.Areas.Status.ViewModels |
||||
|
||||
@if (Model != null && Model.Any()) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<h3>One Time Payments</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#oneTime-section">View Payments</button> |
||||
</div> |
||||
</div> |
||||
<br /> |
||||
<div id="oneTime-section" class="collapse in"> |
||||
<table class="table table-condensed table-bordered table-hover"> |
||||
<tr> |
||||
<th><strong>Date</strong></th> |
||||
<th><strong>Amount</strong></th> |
||||
<th><strong>Reason for Payment</strong></th> |
||||
</tr> |
||||
@foreach (OneTimeViewModel oneTime in Model) |
||||
{ |
||||
<tr> |
||||
<td>@oneTime.DateSent.ToString("MMMM dd, yyyy")</td> |
||||
<td>@oneTime.Amount <var>@oneTime.Currency.ToString()</var></td> |
||||
<td>@oneTime.Reason</td> |
||||
</tr> |
||||
} |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
} |
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
๏ปฟ@model List<Teknik.Areas.Status.ViewModels.TakedownViewModel> |
||||
|
||||
@using Teknik.Areas.Status.ViewModels |
||||
|
||||
@if (Model != null && Model.Any()) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<h2 class="text-center"><b>Takedowns</b></h2> |
||||
<hr> |
||||
@if (Model != null && Model.Any()) |
||||
{ |
||||
<table class="table table-hover table-bordered table-condensed"> |
||||
<tr> |
||||
<th><strong>Requester</strong></th> |
||||
<th><strong>Contact</strong></th> |
||||
<th><strong>Date Requested</strong></th> |
||||
<th><strong>Date Of Action</strong></th> |
||||
<th><strong>Reason</strong></th> |
||||
<th><strong>Action Taken</strong></th> |
||||
</tr> |
||||
@foreach (TakedownViewModel takedown in Model) |
||||
{ |
||||
<tr> |
||||
<td>@takedown.Requester</td> |
||||
<td>@takedown.RequesterContact</td> |
||||
<td>@takedown.DateRequested.ToString("MMMM dd, yyyy")</td> |
||||
<td>@takedown.DateActionTaken.ToString("MMMM dd, yyyy")</td> |
||||
<td>@takedown.Reason</td> |
||||
<td>@takedown.ActionTaken</td> |
||||
</tr> |
||||
} |
||||
</table> |
||||
} |
||||
</div> |
||||
</div> |
||||
} |
@ -0,0 +1,60 @@
@@ -0,0 +1,60 @@
|
||||
๏ปฟ@model Teknik.Areas.Status.ViewModels.TransactionsViewModel |
||||
|
||||
@using Teknik.Areas.Status.ViewModels |
||||
|
||||
@{ |
||||
decimal totalBills = Model.CurrentMonthBills; |
||||
decimal totalIncome = Model.CurrentMonthIncome; |
||||
int incomePercentage = 100; |
||||
if (totalIncome != 0 && totalBills != 0) |
||||
{ |
||||
incomePercentage = (int)Math.Max((Math.Floor(totalBills / totalIncome) * 100), 100); |
||||
} |
||||
|
||||
string processStyle = "progress-bar progress-bar-success"; |
||||
if (incomePercentage < 100) |
||||
{ |
||||
processStyle += " progress-bar-striped"; |
||||
} |
||||
} |
||||
|
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<h2 class="text-center"><b>Transactions</b></h2> |
||||
<hr> |
||||
<div class="row"> |
||||
<div class="col-sm-10 col-sm-offset-1"> |
||||
<h3 class="text-center">Monthly Donation Target</h3> |
||||
<div class="progress"> |
||||
<div class="@processStyle" role="progressbar" style="width: @incomePercentage%"></div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-sm-12 text-center">$@totalIncome Donated / $@totalBills Bills</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<h3 class="text-center">Transaction Totals</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-3 text-center"> |
||||
<h4>Donations</h4> |
||||
<p>$@Math.Round(Model.TotalDonations, 2)</p> |
||||
</div> |
||||
<div class="col-sm-3 text-center"> |
||||
<h4>Bills</h4> |
||||
<p>$@Math.Round(Model.TotalBills, 2)</p> |
||||
</div> |
||||
<div class="col-sm-3 text-center"> |
||||
<h4>One-Time Payments</h4> |
||||
<p>$@Math.Round(Model.TotalOneTimes, 2)</p> |
||||
</div> |
||||
<div class="col-sm-3 text-center"> |
||||
<h4>Net Profit</h4> |
||||
<p>$@Math.Round(Model.TotalNet, 2)</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
@Html.Partial("~/Areas/Status/Views/Status/Bills.cshtml", Model.Bills) |
||||
@Html.Partial("~/Areas/Status/Views/Status/OneTimes.cshtml", Model.OneTimes) |
||||
@Html.Partial("~/Areas/Status/Views/Status/Donations.cshtml", Model.Donations) |
@ -1,130 +0,0 @@
@@ -1,130 +0,0 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Web; |
||||
using System.Web.Mvc; |
||||
using Teknik.Areas.Transparency.Models; |
||||
using Teknik.Areas.Transparency.ViewModels; |
||||
using Teknik.Attributes; |
||||
using Teknik.Controllers; |
||||
using Teknik.Filters; |
||||
using Teknik.Models; |
||||
using Teknik.Piwik; |
||||
|
||||
namespace Teknik.Areas.Transparency.Controllers |
||||
{ |
||||
[TeknikAuthorize] |
||||
public class TransparencyController : DefaultController |
||||
{ |
||||
private TeknikEntities db = new TeknikEntities(); |
||||
|
||||
[TrackPageView] |
||||
[AllowAnonymous] |
||||
public ActionResult Index() |
||||
{ |
||||
ViewBag.Title = "Transparency - " + Config.Title; |
||||
ViewBag.Description = "Teknik transparency and statistics."; |
||||
TransparencyViewModel model = new TransparencyViewModel(); |
||||
|
||||
if (Config.TransparencyConfig.Enabled) |
||||
{ |
||||
model.TotalNet = new Dictionary<string, double>(); |
||||
|
||||
var billSums = db.Transactions.OfType<Bill>().GroupBy(b => b.Currency).Select(b => new { currency = b.Key, total = b.Sum(c => c.Amount) }).ToList(); |
||||
model.TotalBills = new Dictionary<string, double>(); |
||||
foreach (var sum in billSums) |
||||
{ |
||||
model.TotalBills.Add(sum.currency, sum.total); |
||||
if (model.TotalNet.ContainsKey(sum.currency)) |
||||
{ |
||||
model.TotalNet[sum.currency] += sum.total; |
||||
} |
||||
else |
||||
{ |
||||
model.TotalNet.Add(sum.currency, sum.total); |
||||
} |
||||
} |
||||
|
||||
var oneSums = db.Transactions.OfType<OneTime>().GroupBy(b => b.Currency).Select(b => new { currency = b.Key, total = b.Sum(c => c.Amount) }).ToList(); |
||||
model.TotalOneTimes = new Dictionary<string, double>(); |
||||
foreach (var sum in oneSums) |
||||
{ |
||||
model.TotalOneTimes.Add(sum.currency, sum.total); |
||||
if (model.TotalNet.ContainsKey(sum.currency)) |
||||
{ |
||||
model.TotalNet[sum.currency] += sum.total; |
||||
} |
||||
else |
||||
{ |
||||
model.TotalNet.Add(sum.currency, sum.total); |
||||
} |
||||
} |
||||
|
||||
var donationSums = db.Transactions.OfType<Donation>().GroupBy(b => b.Currency).Select(b => new { currency = b.Key, total = b.Sum(c => c.Amount) }).ToList(); |
||||
model.TotalDonations = new Dictionary<string, double>(); |
||||
foreach (var sum in donationSums) |
||||
{ |
||||
model.TotalDonations.Add(sum.currency, sum.total); |
||||
if (model.TotalNet.ContainsKey(sum.currency)) |
||||
{ |
||||
model.TotalNet[sum.currency] += sum.total; |
||||
} |
||||
else |
||||
{ |
||||
model.TotalNet.Add(sum.currency, sum.total); |
||||
} |
||||
} |
||||
|
||||
List<Bill> bills = db.Transactions.OfType<Bill>().OrderByDescending(b => b.DateSent).ToList(); |
||||
model.Bills = (bills != null) ? bills : new List<Bill>(); |
||||
|
||||
List<OneTime> oneTimes = db.Transactions.OfType<OneTime>().OrderByDescending(b => b.DateSent).ToList(); |
||||
model.OneTimes = (oneTimes != null) ? oneTimes : new List<OneTime>(); |
||||
|
||||
List<Donation> donations = db.Transactions.OfType<Donation>().OrderByDescending(b => b.DateSent).ToList(); |
||||
model.Donations = (donations != null) ? donations : new List<Donation>(); |
||||
|
||||
|
||||
List<Takedown> takedowns = db.Takedowns.OrderByDescending(b => b.DateRequested).ToList(); |
||||
model.Takedowns = (takedowns != null) ? takedowns : new List<Takedown>(); |
||||
|
||||
// Grab canary file
|
||||
if (System.IO.File.Exists(Config.TransparencyConfig.CanaryPath)) |
||||
{ |
||||
model.Canary = System.IO.File.ReadAllText(Config.TransparencyConfig.CanaryPath); |
||||
} |
||||
else |
||||
{ |
||||
model.Canary = string.Empty; |
||||
} |
||||
} |
||||
return View(model); |
||||
} |
||||
|
||||
[HttpGet] |
||||
[AllowAnonymous] |
||||
public ActionResult GetVisitorData() |
||||
{ |
||||
// Get the data from the Piwik
|
||||
if (!string.IsNullOrEmpty(Config.PiwikConfig.API)) |
||||
{ |
||||
List<VisitorData> dataList = Reporting.GetVisitSummaryByDays(Config, 31); |
||||
|
||||
List<object> uniqueData = new List<object>(); |
||||
List<object> totalData = new List<object>(); |
||||
|
||||
foreach (VisitorData data in dataList.OrderBy(d => d.Date)) |
||||
{ |
||||
object uniqueDay = new { x = Convert.ToInt64((data.Date.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds), y = data.UniqueVisitors }; |
||||
uniqueData.Add(uniqueDay); |
||||
object totalDay = new { x = Convert.ToInt64((data.Date.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds), y = data.Visits }; |
||||
totalData.Add(totalDay); |
||||
} |
||||
|
||||
return Json(new { result = new { uniqueVisitors = uniqueData.ToArray(), totalVisitors = totalData.ToArray() } }, JsonRequestBehavior.AllowGet); |
||||
} |
||||
return Json(new { error = new { message = "Piwik not configured" } }, JsonRequestBehavior.AllowGet); |
||||
} |
||||
} |
||||
} |
@ -1,69 +0,0 @@
@@ -1,69 +0,0 @@
|
||||
๏ปฟvar visitChart; |
||||
|
||||
$(document).ready(function () { |
||||
$('#bills-section').collapse('hide'); |
||||
$('#oneTime-section').collapse('hide'); |
||||
$('#donations-section').collapse('hide'); |
||||
$('#takedowns-section').collapse('hide'); |
||||
|
||||
visitChart = new Highcharts.chart({ |
||||
chart: { |
||||
renderTo: 'visitor-chart' |
||||
}, |
||||
title: { |
||||
text: 'Daily Visitors' |
||||
}, |
||||
xAxis: { |
||||
type: 'datetime', |
||||
dateTimeLabelFormats: { // don't display the dummy year
|
||||
month: '%e. %b', |
||||
year: '%b' |
||||
}, |
||||
title: { |
||||
text: 'Date' |
||||
} |
||||
}, |
||||
yAxis: { |
||||
title: { |
||||
text: 'Visitors' |
||||
} |
||||
}, |
||||
tooltip: { |
||||
shared: true, |
||||
crosshairs: true, |
||||
headerFormat: '<span style="font-size: 10px">{point.key:%B %e, %Y}</span><br/>', |
||||
pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>' |
||||
}, |
||||
series: [ |
||||
{ |
||||
name: 'All Visitors', |
||||
data: [] |
||||
}, |
||||
{ |
||||
name: 'Unique Visitors', |
||||
data: [] |
||||
} |
||||
] |
||||
}); |
||||
|
||||
if (statsEnabled) { |
||||
$.ajax({ |
||||
type: "GET", |
||||
url: getVisitorDataURL, |
||||
success: function (response) { |
||||
if (response.result) { |
||||
visitChart.series[0].setData(response.result.totalVisitors); |
||||
visitChart.series[1].setData(response.result.uniqueVisitors); |
||||
} |
||||
else { |
||||
var err = response; |
||||
if (response.error) { |
||||
err = response.error.message; |
||||
} |
||||
$("#top_msg").css('display', 'inline', 'important'); |
||||
$("#top_msg").html('<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>' + err + '</div>'); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
}); |
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
๏ปฟusing System.Collections.Generic; |
||||
using System.Web.Mvc; |
||||
using System.Web.Optimization; |
||||
using Teknik.Configuration; |
||||
using Teknik.Utilities; |
||||
|
||||
namespace Teknik.Areas.Transparency |
||||
{ |
||||
public class TransparencyAreaRegistration : AreaRegistration |
||||
{ |
||||
public override string AreaName |
||||
{ |
||||
get |
||||
{ |
||||
return "Transparency"; |
||||
} |
||||
} |
||||
|
||||
public override void RegisterArea(AreaRegistrationContext context) |
||||
{ |
||||
Config config = Config.Load(); |
||||
context.MapSubdomainRoute( |
||||
"Transparency.Index", |
||||
new List<string>() { "transparency" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"", |
||||
new { controller = "Transparency", action = "Index" }, |
||||
new[] { typeof(Controllers.TransparencyController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Transparency.Action", |
||||
new List<string>() { "transparency" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Action/{controller}/{action}", |
||||
new { controller = "Transparency", action = "Index" }, |
||||
new[] { typeof(Controllers.TransparencyController).Namespace } |
||||
); |
||||
|
||||
// Register Script Bundle
|
||||
BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/transparency", config.CdnHost).Include( |
||||
"~/Scripts/Highcharts/highcharts.js", |
||||
"~/Areas/Transparency/Scripts/Transparency.js")); |
||||
} |
||||
} |
||||
} |
@ -1,31 +0,0 @@
@@ -1,31 +0,0 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
using Teknik.Areas.Transparency.Models; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Transparency.ViewModels |
||||
{ |
||||
public class TransparencyViewModel : ViewModelBase |
||||
{ |
||||
public string Canary { get; set; } |
||||
|
||||
public Dictionary<string, double> TotalBills { get; set; } |
||||
|
||||
public Dictionary<string, double> TotalOneTimes { get; set; } |
||||
|
||||
public Dictionary<string, double> TotalDonations { get; set; } |
||||
|
||||
public Dictionary<string, double> TotalNet { get; set; } |
||||
|
||||
public List<Bill> Bills { get; set; } |
||||
|
||||
public List<OneTime> OneTimes { get; set; } |
||||
|
||||
public List<Donation> Donations { get; set; } |
||||
|
||||
public List<Takedown> Takedowns { get; set; } |
||||
} |
||||
} |
@ -1,255 +0,0 @@
@@ -1,255 +0,0 @@
|
||||
๏ปฟ@model Teknik.Areas.Transparency.ViewModels.TransparencyViewModel |
||||
|
||||
@using Teknik.Utilities |
||||
@using Teknik.Areas.Transparency.Models |
||||
|
||||
@Scripts.Render("~/bundles/transparency") |
||||
|
||||
<script type="text/javascript"> |
||||
var statsEnabled = @(Model.Config.PiwikConfig.Enabled.ToString().ToLower()); |
||||
var getVisitorDataURL = '@Url.SubRouteUrl("transparency", "Transparency.Action", new { action = "GetVisitorData" })'; |
||||
</script> |
||||
|
||||
<div class="container"> |
||||
@if (Model.Config.TransparencyConfig.Enabled) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-10 col-sm-offset-1"> |
||||
<h2 class="text-center"><b>Behind the Scenes</b></h2> |
||||
<hr> |
||||
<p> |
||||
Here you can view all of Teknik's financial information, takedown requests and the actions we took. |
||||
</p> |
||||
<p> |
||||
If you would like to request additional information about Teknik, please feel free to contact us through our <a href="@Url.SubRouteUrl("contact", "Contact.Index")" target="_blank">Contact Form</a> or by emailing us at <a href="mailto:@Model.Config.SupportEmail">@Model.Config.SupportEmail</a>. |
||||
</p> |
||||
<br /> |
||||
<h2 class="text-center"><b>Transactions</b></h2> |
||||
<hr> |
||||
<h3 class="text-center">Total Amounts</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-3 text-center"> |
||||
<h4>Donations</h4> |
||||
@foreach (var val in Model.TotalDonations) |
||||
{ |
||||
<p>@Math.Round(val.Value, 2) @val.Key</p> |
||||
} |
||||
</div> |
||||
<div class="col-sm-3 text-center"> |
||||
<h4>Bills</h4> |
||||
@foreach (var val in Model.TotalBills) |
||||
{ |
||||
<p>@Math.Round(val.Value, 2) @val.Key</p> |
||||
} |
||||
</div> |
||||
<div class="col-sm-3 text-center"> |
||||
<h4>One-Time Payments</h4> |
||||
@foreach (var val in Model.TotalOneTimes) |
||||
{ |
||||
<p>@Math.Round(val.Value, 2) @val.Key</p> |
||||
} |
||||
</div> |
||||
<div class="col-sm-3 text-center"> |
||||
<h4>Net Profit</h4> |
||||
@foreach (var val in Model.TotalNet) |
||||
{ |
||||
<p>@Math.Round(val.Value, 2) @val.Key</p> |
||||
} |
||||
</div> |
||||
</div> |
||||
@if (Model.Bills != null && Model.Bills.Any()) |
||||
{ |
||||
<h3>Bills</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#bills-section">View Bills</button> |
||||
</div> |
||||
</div> |
||||
<br /> |
||||
<div id="bills-section" class="collapse in"> |
||||
<div class="row"> |
||||
<div class="col-sm-3"> |
||||
<h4><strong>Date</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Amount</strong></h4> |
||||
</div> |
||||
<div class="col-sm-7"> |
||||
<h4><strong>Description</strong></h4> |
||||
</div> |
||||
</div> |
||||
@foreach (Bill bill in Model.Bills) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-3"> |
||||
@bill.DateSent.ToString("MMMM dd, yyyy") |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@bill.Amount <var>@bill.Currency</var> |
||||
</div> |
||||
<div class="col-sm-7"> |
||||
@bill.Reason |
||||
</div> |
||||
</div> |
||||
} |
||||
</div> |
||||
} |
||||
@if (Model.OneTimes != null && Model.OneTimes.Any()) |
||||
{ |
||||
<h3>One Time Payments</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#oneTime-section">View Payments</button> |
||||
</div> |
||||
</div> |
||||
<br /> |
||||
<div id="oneTime-section" class="collapse in"> |
||||
<div class="row"> |
||||
<div class="col-sm-3"> |
||||
<h4><strong>Date</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Amount</strong></h4> |
||||
</div> |
||||
<div class="col-sm-7"> |
||||
<h4><strong>Reason for Payment</strong></h4> |
||||
</div> |
||||
</div> |
||||
@foreach (OneTime oneTime in Model.OneTimes) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-3"> |
||||
@oneTime.DateSent.ToString("MMMM dd, yyyy") |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@oneTime.Amount <var>@oneTime.Currency</var> |
||||
</div> |
||||
<div class="col-sm-7"> |
||||
@oneTime.Reason |
||||
</div> |
||||
</div> |
||||
} |
||||
</div> |
||||
} |
||||
@if (Model.Donations != null && Model.Donations.Any()) |
||||
{ |
||||
<h3>Donations</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#donations-section">View Donations</button> |
||||
</div> |
||||
</div> |
||||
<br /> |
||||
<div id="donations-section" class="collapse in"> |
||||
<div class="row"> |
||||
<div class="col-sm-3"> |
||||
<h4><strong>Date</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Amount</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Donor</strong></h4> |
||||
</div> |
||||
<div class="col-sm-5"> |
||||
<h4><strong>Reason for Donation</strong></h4> |
||||
</div> |
||||
</div> |
||||
@foreach (Donation donation in Model.Donations) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-3"> |
||||
@donation.DateSent.ToString("MMMM dd, yyyy") |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@donation.Amount <var>@donation.Currency</var> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@donation.Sender |
||||
</div> |
||||
<div class="col-sm-5"> |
||||
@donation.Reason |
||||
</div> |
||||
</div> |
||||
} |
||||
</div> |
||||
} |
||||
<br /> |
||||
<h2 class="text-center"><b>Takedowns</b></h2> |
||||
<hr> |
||||
@if (Model.Takedowns != null && Model.Takedowns.Any()) |
||||
{ |
||||
<h3>Takedowns</h3> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#takedowns-section">View Takedowns</button> |
||||
</div> |
||||
</div> |
||||
<br /> |
||||
<div id="takedowns-section" class="collapse in"> |
||||
<div class="row"> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Requester</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Contact</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Reason</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Action Taken</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Date Requested</strong></h4> |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
<h4><strong>Date Of Action</strong></h4> |
||||
</div> |
||||
</div> |
||||
@foreach (Takedown takedown in Model.Takedowns) |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-2"> |
||||
@takedown.Requester |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@takedown.RequesterContact |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@takedown.Reason |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@takedown.ActionTaken |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@takedown.DateRequested.ToString("MMMM dd, yyyy") |
||||
</div> |
||||
<div class="col-sm-2"> |
||||
@takedown.DateActionTaken.ToString("MMMM dd, yyyy") |
||||
</div> |
||||
</div> |
||||
} |
||||
</div> |
||||
} |
||||
<br /> |
||||
</div> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-sm-8 col-sm-offset-2"> |
||||
@if (!string.IsNullOrEmpty(Model.Canary)) |
||||
{ |
||||
<pre>@Model.Canary</pre> |
||||
} |
||||
</div> |
||||
</div> |
||||
} |
||||
else |
||||
{ |
||||
<div class="row"> |
||||
<div class="col-sm-8 col-sm-offset-2 text-center"> |
||||
<h3>Transparency Information has been disabled</h3> |
||||
</div> |
||||
</div> |
||||
} |
||||
</div> |
@ -1,3 +0,0 @@
@@ -1,3 +0,0 @@
|
||||
๏ปฟ@{ |
||||
Layout = "~/Views/Shared/_Layout.cshtml"; |
||||
} |
@ -1,36 +0,0 @@
@@ -1,36 +0,0 @@
|
||||
๏ปฟ<?xml version="1.0"?> |
||||
|
||||
<configuration> |
||||
<configSections> |
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> |
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> |
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> |
||||
</sectionGroup> |
||||
</configSections> |
||||
|
||||
<system.web.webPages.razor> |
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage"> |
||||
<namespaces> |
||||
<add namespace="System.Web.Mvc" /> |
||||
<add namespace="System.Web.Mvc.Ajax" /> |
||||
<add namespace="System.Web.Mvc.Html" /> |
||||
<add namespace="System.Web.Routing" /> |
||||
<add namespace="System.Web.Optimization" /> |
||||
<add namespace="Teknik" /> |
||||
|
||||
</namespaces> |
||||
</pages> |
||||
</system.web.webPages.razor> |
||||
|
||||
<appSettings> |
||||
<add key="webpages:Enabled" value="false" /> |
||||
</appSettings> |
||||
|
||||
<system.webServer> |
||||
<handlers> |
||||
<remove name="BlockViewHandler"/> |
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /> |
||||
</handlers> |
||||
</system.webServer> |
||||
</configuration> |
Binary file not shown.