Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Queue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Automate
Agent sessions
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
Queue
Commits
6e0fcf1e
Commit
6e0fcf1e
authored
Mar 15, 2018
by
Jochem de Goede
Browse files
Options
Downloads
Patches
Plain Diff
Improved Lab view page: show current room selected
parent
fc22f12f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/resources/static/js/map_loader.js
+23
-18
23 additions, 18 deletions
src/main/resources/static/js/map_loader.js
src/main/resources/templates/lab/view.html
+26
-19
26 additions, 19 deletions
src/main/resources/templates/lab/view.html
with
49 additions
and
37 deletions
src/main/resources/static/js/map_loader.js
+
23
−
18
View file @
6e0fcf1e
$
(
function
()
{
$
(
'
select
'
).
on
(
'
change
'
,
function
()
{
var
roomId
=
this
.
value
;
updateRoomInfo
(
this
.
value
);
});
});
function
updateRoomInfo
(
roomId
)
{
$
.
ajax
({
method
:
'
get
'
,
url
:
'
/room/
'
+
roomId
,
...
...
@@ -9,14 +13,15 @@ $(function () {
var
image
=
$
(
'
<img class="img-fluid"></img>
'
);
image
.
attr
(
'
src
'
,
'
/
'
+
response
.
path
);
$
(
'
#image-holder
'
).
show
().
html
(
image
);
$
(
'
#labelComment
'
).
html
(
"
Where are you located?
"
)
$
(
'
#labelComment
'
).
html
(
"
Where are you located?
"
)
;
$
(
'
#comment
'
).
show
();
$
(
'
#inputLocation
'
).
prop
(
"
disabled
"
,
false
);
}
else
{
$
(
'
#image-holder
'
).
hide
();
$
(
'
#comment
'
).
hide
();
$
(
'
#labelComment
'
).
html
(
"
Comment
"
)
$
(
'
#labelComment
'
).
html
(
"
Comment
"
);
$
(
'
#inputLocation
'
).
prop
(
"
disabled
"
,
true
);
}
}
});
});
});
\ No newline at end of file
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/resources/templates/lab/view.html
+
26
−
19
View file @
6e0fcf1e
...
...
@@ -51,15 +51,17 @@
th:action=
"@{/request/{id}/update-room/(id=${request.getId()})}"
>
<div
class=
"form-group"
>
<select
class=
"custom-select custom-select-md"
name=
"room"
>
<option
selected=
"selected"
>
Update your room
</option>
<option
th:each=
"room : ${lab.getFilteredRooms()}"
th:value=
"${room.getId()}"
>
<option>
Update your room
</option>
<option
th:each=
"room : ${lab.getFilteredRooms()}"
th:value=
"${room.getId()}"
th:selected=
"${request.room.equals(room)}"
>
[[${room}]]
</option>
</select>
</div>
<div
class=
"form-group"
id=
"comment"
style=
"display:none;"
>
<label>
Where are you located?
</label>
<input
type=
"text"
class=
"form-control"
name=
"comment"
placeholder=
"Cubicle 1..."
/>
<input
type=
"text"
class=
"form-control"
id=
"inputLocation"
name=
"comment"
placeholder=
"Cubicle 1..."
th:value=
"${request.comment}"
/>
</div>
<div
class=
"form-group"
>
...
...
@@ -227,6 +229,11 @@
</div>
<script
src=
"/js/map_loader.js"
></script>
<script
type=
"text/javascript"
>
$
(
function
()
{
updateRoomInfo
(
$
(
'
select
'
).
val
());
});
</script>
</section>
</body>
</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
sign in
to comment