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
jz
CCCROC
Commits
9a330cb1
Commit
9a330cb1
authored
Dec 25, 2014
by
Oliver Feldt
Browse files
Fixed bug not being able to return radios via scan
parent
3395be5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
data/ccc_roc/assets/javascripts/application.js
View file @
9a330cb1
...
...
@@ -62,9 +62,10 @@ $("#search_form").on("submit", function(e) {
$
.
getJSON
(
"
/radios
"
,
$
(
this
).
serialize
(),
function
(
data
)
{
var
radio
=
data
.
radio
;
var
checkouts
=
data
.
checkouts
;
function
(
response
)
{
var
radio
=
response
.
radio
;
var
checkouts
=
response
.
checkouts
;
var
angel
=
response
.
angel
;
if
(
radio
.
id
===
null
)
{
$
(
"
#new_radio_form input[name='radio_id']
"
).
val
(
radio
.
name
);
$
(
"
#new_radio
"
).
modal
(
"
show
"
);
...
...
@@ -78,7 +79,7 @@ $("#search_form").on("submit", function(e) {
$
(
"
#radio_form input[name='radio_id']
"
).
val
(
radio
.
name
);
$
(
"
#radios tr[data-id='
"
+
radio
.
id
+
"
']
"
).
data
(
"
last_scanned_at
"
,
new
Date
());
if
(
radio
.
angel
===
undefined
)
{
if
(
angel
===
null
)
{
$
(
"
#radio_form button[name='return']
"
).
addClass
(
"
disabled
"
);
}
else
{
$
(
"
#radio_form button[name='return']
"
).
removeClass
(
"
disabled
"
);
...
...
lib/ccc_roc/application.rb
View file @
9a330cb1
...
...
@@ -58,7 +58,9 @@ module CCC
@radio
.
save
end
json
radio:
@radio
,
checkouts:
@radio
.
checkouts
.
all
checkouts
=
@radio
.
checkouts
.
all
angel
=
checkouts
.
last
&&
!
checkouts
.
last
.
checked_in_at
?
checkouts
.
last
.
angel
:
nil
json
(
radio:
@radio
,
checkouts:
checkouts
,
angel:
angel
)
end
get
"/checkouts"
do
...
...
Write
Preview
Supports
Markdown
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