Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Kácha
gal
Commits
30702360
Commit
30702360
authored
Jan 25, 2017
by
ph
Browse files
Options
Downloads
Patches
Plain Diff
Return home link, prev/next pgup/pgdn keybindings, fixed deep pathname
parent
d3cddfcb
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
base.html.jinja
+3
-1
3 additions, 1 deletion
base.html.jinja
image.html.jinja
+2
-2
2 additions, 2 deletions
image.html.jinja
maketn.py
+3
-3
3 additions, 3 deletions
maketn.py
prev_next.js
+13
-0
13 additions, 0 deletions
prev_next.js
with
21 additions
and
6 deletions
base.html.jinja
+
3
−
1
View file @
30702360
...
...
@@ -7,6 +7,7 @@
<link
href=
'https://fonts.googleapis.com/css?family=Patrick+Hand+SC&subset=latin,latin-ext'
rel=
'stylesheet'
type=
'text/css'
>
<meta
name=
"author"
content=
"Pavel Kácha"
/>
<meta
name=
"description"
content=
"Ajka + Pharook = svatba"
/>
<script
type=
"text/javascript"
src=
"/prev_next.js"
></script>
</head>
<body
class=
"main"
>
<div
class=
"gallery_outer"
>
...
...
@@ -15,10 +16,11 @@
</a>
<div
class=
"menubar"
>
<ul
class=
"menu"
>
<li><a
class=
"passive_menu"
href=
"/"
>
←
</a></li>
{% block menu %}{% endblock %}
</ul>
</div>
<div
class=
"main"
>
<div
class=
"
gallery_
main"
>
{% block content %}{% endblock %}
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
image.html.jinja
+
2
−
2
View file @
30702360
...
...
@@ -9,7 +9,7 @@
<table class="img_table"><tr>
<td class="img_table_prev">
{% if prev is not none %}
<a class="img_table_a" href="{{prev|e}}.html"><img class="img_table_img" src="tn_{{prev|urlencode}}"/>
<a
id="prev"
class="img_table_a" href="{{prev|e}}.html"><img class="img_table_img" src="tn_{{prev|urlencode}}"/>
<div class="img_arrow"><</div>
</a>
{% endif %}
...
...
@@ -24,7 +24,7 @@
</td>
<td class="img_table_next">
{% if nxt is not none %}
<a class="img_table_a" href="{{nxt|e}}.html"><img class="img_table_img" src="tn_{{nxt|urlencode}}"/>
<a
id="next"
class="img_table_a" href="{{nxt|e}}.html"><img class="img_table_img" src="tn_{{nxt|urlencode}}"/>
<div class="img_arrow">></div>
</a>
{% endif %}
...
...
This diff is collapsed.
Click to expand it.
maketn.py
+
3
−
3
View file @
30702360
...
...
@@ -39,7 +39,7 @@ def get_list(path):
return
file_list
,
dir_list
def
make_tn
(
fname
,
tnname
,
tnwidth
=
20
0
):
def
make_tn
(
fname
,
tnname
,
tnwidth
=
16
0
):
try
:
img
=
Image
.
open
(
fname
)
width
,
height
=
img
.
size
...
...
@@ -63,7 +63,7 @@ def get_file(f, default=u""):
@render
(
u
"
index.html
"
)
def
gen_index
(
path
=
u
""
,
anchor
=
[]):
mytitle
=
get_file
(
os
.
path
.
join
(
path
,
u
"
title.txt
"
),
default
=
path
or
"
Fotoa
lbum
"
)
mytitle
=
get_file
(
os
.
path
.
join
(
path
,
u
"
title.txt
"
),
default
=
os
.
path
.
basename
(
path
.
rstrip
(
r
"
/
"
))
or
"
A
lbum
"
)
anch
=
anchor
+
[
mytitle
]
file_list
,
dir_list
=
get_list
(
path
)
dirs
=
[]
...
...
@@ -84,7 +84,7 @@ def gen_index(path=u"", anchor=[]):
mid
=
os
.
path
.
join
(
path
,
u
"
mid_
"
+
cur
)
tn
=
os
.
path
.
join
(
path
,
u
"
tn_
"
+
cur
)
if
not
os
.
path
.
isfile
(
mid
):
make_tn
(
os
.
path
.
join
(
path
,
cur
),
mid
,
tnwidth
=
1
280
)
make_tn
(
os
.
path
.
join
(
path
,
cur
),
mid
,
tnwidth
=
1
024
)
gen_image
(
prev
,
cur
,
nxt
,
path
,
anchor
=
anch
,
target
=
os
.
path
.
join
(
path
,
u
"
%s.html
"
%
cur
))
return
dict
(
title
=
mytitle
,
data
=
data
,
dirs
=
dirs
,
anchor
=
anch
)
...
...
This diff is collapsed.
Click to expand it.
prev_next.js
0 → 100644
+
13
−
0
View file @
30702360
document
.
onkeydown
=
function
(
e
)
{
switch
(
e
.
keyCode
)
{
case
33
:
loc
=
document
.
getElementById
(
'
prev
'
);
break
;
case
34
:
loc
=
document
.
getElementById
(
'
next
'
);
break
;
}
if
(
loc
)
{
document
.
location
.
href
=
loc
.
href
;
}
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment