Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MyMovieLibrary
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
MyMovieLibrary
Commits
d0115875
Commit
d0115875
authored
11 years ago
by
Brian Wood
Browse files
Options
Downloads
Patches
Plain Diff
Add movies modal looks nicer
parent
56e972c8
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
project/controllers/library.py
+8
-1
8 additions, 1 deletion
project/controllers/library.py
project/static/css/style.css
+23
-0
23 additions, 0 deletions
project/static/css/style.css
project/templates/library/addmovie_modal.html
+5
-3
5 additions, 3 deletions
project/templates/library/addmovie_modal.html
with
36 additions
and
4 deletions
project/controllers/library.py
+
8
−
1
View file @
d0115875
...
...
@@ -44,7 +44,14 @@ def removelibraryItem(name, index,user=None):
movie
=
library
.
hydrateUnit
(
index
)
if
not
movie
:
return
jsonify
(
response
=
'
error
'
,
message
=
'
Unable to find the given Movie in Library %s
'
%
library
.
name
),
404
if
library
.
name
==
'
Master
'
:
libraries
=
Library
.
objects
(
user
=
user
,
unit
=
'
Movie
'
)
for
library
in
libraries
:
library
.
removeUnit
(
movie
)
else
:
library
.
removeUnit
(
movie
)
return
jsonify
(
response
=
'
success
'
,
type
=
'
redirect
'
,
path
=
url_for
(
endpoint
=
'
library
'
,
name
=
name
,
_external
=
True
))
@app.route
(
'
/libraries/<name>/add
'
,
methods
=
[
'
POST
'
])
...
...
This diff is collapsed.
Click to expand it.
project/static/css/style.css
+
23
−
0
View file @
d0115875
...
...
@@ -26,3 +26,26 @@ html,body {
.adjust-left
{
padding-right
:
5%
;
}
.movie-select
{
padding
:
10px
15px
0px
20px
;
border-radius
:
15px
;
background-color
:
darkslategray
;
margin
:
5px
;
width
:
30%
;
height
:
200px
;
overflow
:
hidden
;
}
.movie-select.selected
{
background-color
:
slategray
;
}
.clearfix
{
float
:
none
!important
;
}
#results
{
max-height
:
500px
;
overflow-y
:
scroll
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
project/templates/library/addmovie_modal.html
+
5
−
3
View file @
d0115875
...
...
@@ -11,7 +11,7 @@
</form>
</div>
</div>
<div
id=
"results"
class=
"
row
well col-md-10 col-md-offset-1"
>
<div
id=
"results"
class=
"
clearfix
well col-md-10 col-md-offset-1"
>
Search for your movie!
</div>
<div
class=
"hidden"
>
...
...
@@ -45,6 +45,8 @@
listMovies
(
$results
,
movies
);
$results
.
on
(
'
click
'
,
'
.movie-select
'
,
function
(){
var
id
=
$
(
this
).
data
(
'
id
'
);
$
(
'
.selected
'
).
removeClass
(
'
selected
'
);
$
(
this
).
addClass
(
'
selected
'
);
$addForm
.
find
(
'
input
'
).
val
(
id
);
});
},
...
...
@@ -63,9 +65,9 @@
var
html
=
""
;
for
(
var
i
=
movies
.
length
-
1
;
i
>=
0
;
i
--
)
{
movie
=
movies
[
i
];
html
+=
"
<div class='col-md-
3
movie-select' data-id='
"
+
movie
[
'
id
'
]
+
"
'>
"
;
html
+=
"
<div
title='
"
+
movie
[
'
title
'
]
+
"
'
class='col-md-
4
movie-select' data-id='
"
+
movie
[
'
id
'
]
+
"
'>
"
;
html
+=
"
<img class='img-thumbnail' src='
"
+
movie
[
'
poster
'
]
+
"
'/>
"
;
html
+=
"
<h
3
>
"
+
movie
[
'
title
'
]
+
"
</h
3
>
"
;
html
+=
"
<h
6
>
"
+
movie
[
'
title
'
]
+
"
</h
6
>
"
;
html
+=
"
</div>
"
;
};
list
.
html
(
html
);
...
...
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