pageviews

This commit is contained in:
anon 2022-07-20 10:41:30 -03:00
parent 8af1c91745
commit ce2cf82de6
3 changed files with 331 additions and 120 deletions

View file

@ -17,7 +17,9 @@ from datetime import date, timedelta
###########################################
def articles(request):
update_visitors(False)
if request.user.username != "Administrador" and request.user.username != "Morpheus":
update_visitors(False)
articles = Article.objects.filter(status="Published").order_by('-id')
first = True
thumbnail = ''
@ -57,7 +59,9 @@ def articles(request):
return render(request, 'articles/articles.html', context)
def article(request, identification):
update_visitors(False)
if request.user.username != "Administrador" and request.user.username != "Morpheus":
update_visitors(False)
try:
article = Article.objects.get(id=identification)
except:
@ -85,13 +89,11 @@ def article(request, identification):
@login_required
def images(request):
update_visitors(False)
context = {'page': 'article'}
return render(request, 'articles/images.html', context)
@login_required
def write(request):
update_visitors(False)
articles = Article.objects.filter(author=request.user).order_by('-id')
for article in articles:
try:
@ -156,7 +158,6 @@ def write(request):
@login_required
def new_article(request):
update_visitors(False)
if request.method != 'POST':
#create new page with blank form
form = ArticleForm()
@ -185,7 +186,6 @@ def new_article(request):
@login_required
def edit_article(request, identification):
update_visitors(False)
try:
article = Article.objects.get(id=identification)
except:
@ -214,7 +214,6 @@ def edit_article(request, identification):
@login_required
def delete_article(request, identification):
update_visitors(False)
try:
article = Article.objects.get(id=identification)
except:
@ -227,7 +226,6 @@ def delete_article(request, identification):
@login_required
def publish_article(request, identification):
update_visitors(False)
try:
article = Article.objects.get(id=identification)
except:

View file

@ -19,7 +19,7 @@
<div class="card" id="graph1">
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between text-white">
<h6 class="m-0 text-light">Pageviews (linear)</h6>
<h6 class="m-0 text-light">Total Pageviews and Unique Visitors (Moneroj.net, linear)</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button"
onclick="$('#graph1').toggleClass('fullscreen');window.dispatchEvent(new Event('resize'));">
@ -183,7 +183,7 @@ var layout = {
yaxis: {
type: "linear",
title: {
text: 'Number of users',
text: 'Unique visitors',
font: {
size: 20,
color: 'white'
@ -200,7 +200,7 @@ var layout = {
yaxis2: {
type: "linear",
title: {
text: 'Transactions',
text: 'Total pageviews',
font: {
size: 20,
color: 'white'
@ -226,7 +226,6 @@ var layout = {
,size: 13
}
,gridcolor: "#333333"
,range: ['2014-05-01', '2023-01-01']
,zeroline: true
},
margin: {
@ -291,7 +290,7 @@ var layout_mobile = {
,size: 7
}
,gridcolor: "#444444"
,range: ['2014-05-01', '2023-01-01']
,range: ['2022-07-01', '2023-01-01']
,zeroline: true
},
margin: {

File diff suppressed because it is too large Load diff