#478 refactoring
This commit is contained in:
parent
1dd1a39ba1
commit
c803cef0bc
@ -106,7 +106,7 @@
|
||||
گنجور » مشارکتهای کاربران
|
||||
</h2>
|
||||
|
||||
<div id="wordcounts-placeholder">
|
||||
<div id="days-placeholder">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -136,20 +136,20 @@
|
||||
|
||||
<script>
|
||||
function loadGroupedByDate(dataType) {
|
||||
var divParent = document.getElementById('wordcounts-placeholder');
|
||||
var divParent = document.getElementById('days-placeholder');
|
||||
var imgElementId = 'loadingwordcountsimg';
|
||||
divParent.innerHTML = divParent.innerHTML + '<div class="bnumdiv" id="remove-this-wordcounts"><img id="' + imgElementId + '" src="/image/loading.gif" alt="بارگذاری"/></div>';
|
||||
divParent.innerHTML = divParent.innerHTML + '<div class="bnumdiv" id="remove-days-placeholder"><img id="' + imgElementId + '" src="/image/loading.gif" alt="بارگذاری"/></div>';
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '?Handler=GroupedByDate&dataType=' + dataType,
|
||||
error: function () {
|
||||
if (document.getElementById("remove-this-wordcounts") != null) {
|
||||
document.getElementById("remove-this-wordcounts").remove();
|
||||
if (document.getElementById("remove-days-placeholder") != null) {
|
||||
document.getElementById("remove-days-placeholder").remove();
|
||||
}
|
||||
},
|
||||
success: function (data) {
|
||||
if (document.getElementById("remove-this-wordcounts") != null) {
|
||||
document.getElementById("remove-this-wordcounts").remove();
|
||||
if (document.getElementById("remove-days-placeholder") != null) {
|
||||
document.getElementById("remove-days-placeholder").remove();
|
||||
if (document.getElementById("load-word-counts") != null) {
|
||||
document.getElementById("load-word-counts").remove();
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ namespace GanjooRazor.Pages
|
||||
{
|
||||
Model = new _GroupedByDateViewPartialModel()
|
||||
{
|
||||
Array = result.ToArray()
|
||||
Days = result.ToArray()
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -5,7 +5,7 @@ namespace GanjooRazor.Pages
|
||||
{
|
||||
public class _GroupedByDateViewPartialModel : PageModel
|
||||
{
|
||||
public GroupedByDateViewModel[] Array { get; set; }
|
||||
public GroupedByDateViewModel[] Days { get; set; }
|
||||
|
||||
public _GroupedByDateViewTablePartialModel TableModel
|
||||
{
|
||||
@ -13,7 +13,7 @@ namespace GanjooRazor.Pages
|
||||
{
|
||||
return new _GroupedByDateViewTablePartialModel()
|
||||
{
|
||||
Array = Array
|
||||
Days = Days
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
@using System.Globalization
|
||||
@{
|
||||
}
|
||||
@if (Model.Array == null || Model.Array.Length == 0) return;
|
||||
@if (Model.Days == null || Model.Days.Length == 0) return;
|
||||
|
||||
<table class="stats" id="grouped-by-date">
|
||||
<thead>
|
||||
@ -14,14 +14,14 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (int i = 0; i < Model.Array.Length; i++)
|
||||
@for (int i = 0; i < Model.Days.Length; i++)
|
||||
{
|
||||
@if (i % 2 == 0)
|
||||
{
|
||||
<tr class="e">
|
||||
<td class="c1">@((i+1).ToPersianNumbers())</td>
|
||||
<td class="c2">@RMuseum.Services.Implementation.LanguageUtils.FormatInShortDate(DateTime.Parse(Model.Array[i].Date))</td>
|
||||
<td class="c3">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Array[i].Number)</td>
|
||||
<td class="c2">@RMuseum.Services.Implementation.LanguageUtils.FormatInShortDate(DateTime.Parse(Model.Days[i].Date))</td>
|
||||
<td class="c3">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Days[i].Number)</td>
|
||||
</tr>
|
||||
|
||||
}
|
||||
@ -29,8 +29,8 @@
|
||||
{
|
||||
<tr>
|
||||
<td class="c1">@((i + 1).ToPersianNumbers())</td>
|
||||
<td class="c2">@RMuseum.Services.Implementation.LanguageUtils.FormatInShortDate(DateTime.Parse(Model.Array[i].Date))</td>
|
||||
<td class="c3">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Array[i].Number)</td>
|
||||
<td class="c2">@RMuseum.Services.Implementation.LanguageUtils.FormatInShortDate(DateTime.Parse(Model.Days[i].Date))</td>
|
||||
<td class="c3">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Days[i].Number)</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,6 @@ namespace GanjooRazor.Pages
|
||||
{
|
||||
public class _GroupedByDateViewTablePartialModel : PageModel
|
||||
{
|
||||
public GroupedByDateViewModel[] Array { get; set; }
|
||||
public GroupedByDateViewModel[] Days { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user