Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
panikweb
Commits
7d3bff4d
Commit
7d3bff4d
authored
Aug 14, 2013
by
fred
Browse files
fix vertical stacking in grid
parent
669a7371
Changes
1
Hide whitespace changes
Inline
Side-by-side
panikweb/views.py
View file @
7d3bff4d
...
...
@@ -26,7 +26,9 @@ class TimeCell:
w
=
1
h
=
1
def
__init__
(
self
):
def
__init__
(
self
,
i
,
j
):
self
.
x
=
i
self
.
y
=
j
self
.
emissions
=
[]
def
add_emission
(
self
,
emission
):
...
...
@@ -67,7 +69,7 @@ class Grid(TemplateView):
for
i
in
range
(
nb_lines
):
grid
.
append
([])
for
j
in
range
(
7
):
grid
[
-
1
].
append
(
TimeCell
())
grid
[
-
1
].
append
(
TimeCell
(
i
,
j
))
nonstop
=
[
x
for
x
in
nonstops
if
i
>=
x
[
0
]
*
2
and
i
<
x
[
1
]
*
2
][
0
]
for
time_cell
in
grid
[
-
1
]:
...
...
@@ -101,6 +103,7 @@ class Grid(TemplateView):
t
+=
1
except
IndexError
:
pass
grid
[
i
]
=
[
x
for
x
in
grid
[
i
]
if
x
is
not
None
]
for
i
in
range
(
nb_lines
):
grid
[
i
]
=
[
x
for
x
in
grid
[
i
]
if
x
is
not
None
]
...
...
@@ -109,10 +112,14 @@ class Grid(TemplateView):
continue
t
=
1
try
:
while
grid
[
i
+
t
][
j
]
==
cell
and
grid
[
i
+
t
][
j
].
w
==
cell
.
w
:
while
True
:
same_cell_below
=
[(
bj
,
x
)
for
bj
,
x
in
enumerate
(
grid
[
i
+
cell
.
h
])
if
x
==
cell
and
x
.
y
==
cell
.
y
and
x
.
w
==
cell
.
w
]
if
not
same_cell_below
:
break
bj
,
same_cell_below
=
same_cell_below
[
0
]
del
grid
[
i
+
cell
.
h
][
bj
]
cell
.
h
+=
1
grid
[
i
+
t
][
j
]
=
None
t
+=
1
except
IndexError
:
pass
...
...
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