Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
376b87da
Commit
376b87da
authored
Feb 28, 2017
by
Leigh B Stoller
Browse files
Couple of tweaks for Mike.
parent
223c1989
Changes
3
Hide whitespace changes
Inline
Side-by-side
www/aptui/images.php
View file @
376b87da
<?php
#
# Copyright (c) 2000-201
6
University of Utah and the Flux Group.
# Copyright (c) 2000-201
7
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -151,6 +151,7 @@ while ($row = mysql_fetch_array($query_result)) {
$blob
[
"imageid"
]
=
$imageid
;
$blob
[
"description"
]
=
$row
[
"description"
];
$blob
[
"imagename"
]
=
$row
[
"imagename"
];
$blob
[
"created"
]
=
DateStringGMT
(
$row
[
"created"
]);
$blob
[
"pid"
]
=
$row
[
"pid"
];
$blob
[
"pid_idx"
]
=
$row
[
"pid_idx"
];
$blob
[
"global"
]
=
$row
[
"global"
];
...
...
@@ -162,7 +163,7 @@ while ($row = mysql_fetch_array($query_result)) {
CreateURL
(
"showimageid"
,
URLARG_IMAGEID
,
$imageid
);
$images
[
$imageid
]
=
$blob
;
$images
[]
=
$blob
;
}
echo
"<script type='text/plain' id='images-json'>
\n
"
;
echo
htmlentities
(
json_encode
(
$images
))
.
"
\n
"
;
...
...
www/aptui/js/images.js
View file @
376b87da
...
...
@@ -21,6 +21,13 @@ $(function ()
});
$
(
'
#main-body
'
).
html
(
html
);
// Format dates with moment before display.
$
(
'
.format-date
'
).
each
(
function
()
{
var
date
=
$
.
trim
(
$
(
this
).
html
());
if
(
date
!=
""
)
{
$
(
this
).
html
(
moment
(
$
(
this
).
html
()).
format
(
"
lll
"
));
}
});
// This activates the popover subsystem.
$
(
'
[data-toggle="popover"]
'
).
popover
({
placement
:
'
auto
'
,
...
...
@@ -71,8 +78,8 @@ $(function ()
filter_liveSearch
:
true
,
},
headers
:
{
3
:
{
sorter
:
false
},
4
:
{
sorter
:
false
},
5
:
{
sorter
:
false
},
},
});
...
...
@@ -104,8 +111,8 @@ $(function ()
var
filters
=
$
.
tablesorter
.
getFilters
(
$
(
'
#images-table
'
));
// The "any" filter needs a value or everything disappears.
// If there is a term in the search box, it will have a value.
if
(
filters
[
6
]
===
undefined
)
{
filters
[
6
]
=
""
;
if
(
filters
[
7
]
===
undefined
)
{
filters
[
7
]
=
""
;
}
if
(
$
(
'
#my-images
'
).
is
(
"
:checked
"
))
{
tmp
.
push
(
"
creator
"
);
...
...
@@ -126,11 +133,11 @@ $(function ()
}
if
(
tmp
.
length
)
{
// regex search, plain | does not work.
filters
[
5
]
=
"
/
"
+
tmp
.
join
(
"
|
"
)
+
"
/
"
;
filters
[
6
]
=
"
/
"
+
tmp
.
join
(
"
|
"
)
+
"
/
"
;
}
else
{
// Hmm, an empty string will get everything.
filters
[
5
]
=
"
WHY
"
;
filters
[
6
]
=
"
WHY
"
;
}
console
.
info
(
"
SetFilters
"
,
filters
);
$
.
tablesorter
.
setFilters
(
$
(
'
#images-table
'
),
filters
,
true
);
...
...
www/aptui/template/images.html
View file @
376b87da
...
...
@@ -77,6 +77,7 @@
<th>
Name
</th>
<th>
Creator
</th>
<th>
Project
</th>
<th>
Created
</th>
<th
class=
"sorter-false"
>
Description
</th>
<th
class=
"sorter-false"
>
URN
</th>
<th
class=
"hidden-column"
>
Filters
</th>
...
...
@@ -85,7 +86,7 @@
<tbody>
<
%
var
creator_re =
/(creator|project)/;
%
>
<
%
var
project_re =
/project/;
%
>
<
%
_.each
(
images
,
function
(
value
,
i
mageid
)
{
%
>
<
%
_.each
(
images
,
function
(
value
,
i
ndex
)
{
%
>
<tr>
<
%
if
(
isadmin
)
{
%
>
<td><a
href=
"<%- value.url %>"
><
%=
value.imagename
%
></a></td>
...
...
@@ -104,6 +105,7 @@
<
%
}
else
{
%
>
<td><
%=
value.pid
%
></td>
<
%
}
%
>
<td
class=
"format-date"
><
%
-
value.created
%
></td>
<td><
%
-
value.description
%
></td>
<td
align=
"center"
>
<a
href=
"#"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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