Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
esi-table-data
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esi-data-scrapping
esi-table-data
Commits
41acec84
Commit
41acec84
authored
Jun 09, 2017
by
Vasyl Bodnaruk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in filter
parent
6c402101
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
27 deletions
+34
-27
script.js
esi/static/js/script.js
+29
-20
list_news.html
esi/templates/list_news.html
+5
-7
No files found.
esi/static/js/script.js
View file @
41acec84
...
@@ -149,28 +149,37 @@ $(document).ready(function() {
...
@@ -149,28 +149,37 @@ $(document).ready(function() {
// console.log(data);
// console.log(data);
// ajaxPost('/news/', data);
// ajaxPost('/news/', data);
});
});
// $(actionView).on('click', function(e) {
// e.preventDefault();
// var data = actionData(this);
// ajaxPost('/news/', data);
// });
//
// $(actionEdit).on('click', function(e) {
// e.preventDefault();
// var data = actionData(this);
// ajaxPost('/news/', data);
// });
});
});
//$('.text-white').on('click', function(e) {
function
getUrlParameter
(
name
)
{
// var getHref = $(this).attr('href');
name
=
name
.
replace
(
/
[\[]
/
,
'
\\
['
).
replace
(
/
[\]]
/
,
'
\\
]'
);
// var url = window.location.href;
var
regex
=
new
RegExp
(
'[
\\
?&]'
+
name
+
'=([^&#]*)'
);
// window.location.href = url + getHref;
var
results
=
regex
.
exec
(
location
.
search
);
// console.log(window.location.search)
return
results
===
null
?
null
:
decodeURIComponent
(
results
[
1
].
replace
(
/
\+
/g
,
' '
));
// e.preventDefault();
};
//
//})
$
(
'.text-white'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
var
from
=
getUrlParameter
(
'from_date'
);
var
to
=
getUrlParameter
(
'to_date'
);
var
media
=
getUrlParameter
(
'media'
);
var
word
=
getUrlParameter
(
'search'
);
var
order
=
getUrlParameter
(
'order_by'
);
var
reverse
=
getUrlParameter
(
'reverse'
);
var
res
=
'?'
;
if
(
from
){
res
+=
'from_date='
+
from
+
'&'
}
if
(
to
){
res
+=
'to_date='
+
to
+
'&'
}
if
(
media
){
res
+=
'media='
+
media
+
'&'
}
if
(
word
){
res
+=
'search='
+
word
+
'&'
}
var
orderName
=
$
(
this
).
attr
(
'href'
).
replace
(
"?order_by="
,
""
)
if
(
order
==
orderName
){
res
+=
'order_by='
+
orderName
+
'&'
+
'reverse='
+
'1&'
}
else
{
res
+=
'order_by='
+
orderName
+
'&'
}
window
.
location
.
href
=
res
;
})
// Index Page
// Index Page
...
...
esi/templates/list_news.html
View file @
41acec84
...
@@ -45,28 +45,26 @@
...
@@ -45,28 +45,26 @@
{% paginate news %}
{% paginate news %}
{{ request.get_full_path }}
{{ request.GET.itervalues }}
<form
class=
"form"
>
<form
class=
"form"
>
<table
class=
"table table-hover"
>
<table
class=
"table table-hover"
>
<thead
class=
"thead-inverse"
>
<thead
class=
"thead-inverse"
>
<tr>
<tr>
<th><a
class=
"text-white"
href=
"
order_by=title{% if request.GET.order_by == 'title' and request.GET.reverse != '1' %}&reverse=1{% endif %}
"
>
<th><a
class=
"text-white"
href=
"
?order_by=title
"
>
Title {% if request.GET.order_by == 'title' and request.GET.reverse != '1' %}
↑
Title {% if request.GET.order_by == 'title' and request.GET.reverse != '1' %}
↑
{% elif request.GET.order_by == 'title' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
{% elif request.GET.order_by == 'title' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
<th><a
class=
"text-white"
href=
"?order_by=media_id
{% if request.GET.order_by == 'media_id' and request.GET.reverse != '1' %}&reverse=1{% endif %}
"
>
<th><a
class=
"text-white"
href=
"?order_by=media_id"
>
Media {% if request.GET.order_by == 'media_id' and request.GET.reverse != '1' %}
↑
Media {% if request.GET.order_by == 'media_id' and request.GET.reverse != '1' %}
↑
{% elif request.GET.order_by == 'media_id' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
{% elif request.GET.order_by == 'media_id' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
<th><a
class=
"text-white"
href=
"?order_by=type_id
{% if request.GET.order_by == 'type_id' and request.GET.reverse != '1' %}&reverse=1{% endif %}
"
>
<th><a
class=
"text-white"
href=
"?order_by=type_id"
>
Type {% if request.GET.order_by == 'type_id' and request.GET.reverse != '1' %}
↑
Type {% if request.GET.order_by == 'type_id' and request.GET.reverse != '1' %}
↑
{% elif request.GET.order_by == 'type_id' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
{% elif request.GET.order_by == 'type_id' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
<th><a
class=
"text-white"
href=
"?order_by=region_id
{% if request.GET.order_by == 'region_id' and request.GET.reverse != '1' %}&reverse=1{% endif %}
"
>
<th><a
class=
"text-white"
href=
"?order_by=region_id"
>
Region {% if request.GET.order_by == 'region_id' and request.GET.reverse != '1' %}
↑
Region {% if request.GET.order_by == 'region_id' and request.GET.reverse != '1' %}
↑
{% elif request.GET.order_by == 'region_id' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
{% elif request.GET.order_by == 'region_id' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
<th><a
class=
"text-white"
href=
"?order_by=publish_date
{% if request.GET.order_by == 'publish_date' and request.GET.reverse != '1' %}&reverse=1{% endif %}
"
>
<th><a
class=
"text-white"
href=
"?order_by=publish_date"
>
Publish date {% if request.GET.order_by == 'publish_date' and request.GET.reverse != '1' %}
↑
Publish date {% if request.GET.order_by == 'publish_date' and request.GET.reverse != '1' %}
↑
{% elif request.GET.order_by == 'publish_date' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
{% elif request.GET.order_by == 'publish_date' and request.GET.reverse == '1' %}
↓
{% endif %}
</a></th>
</tr>
</tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment