Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Hacksaar
SpacePoints
Commits
57fd4cbd
Commit
57fd4cbd
authored
Feb 25, 2014
by
Kim Meiser
💬
Browse files
Texte angepasst
parent
4ae41f61
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/controllers/earnings_controller.rb
View file @
57fd4cbd
...
...
@@ -3,11 +3,10 @@ class EarningsController < ApplicationController
before_filter
:set_earning
,
:only
=>
[
:cancel
]
# TODO user should be set
def
cancel
if
@earning
.
cancel!
(
current_hacker
)
flash
[
:warning
]
=
"
#{
@earning
.
points
}
storniert"
flash
[
:warning
]
=
"
#{
@earning
.
quest
.
title
}
vom
#{
I18n
.
l
(
@earning
.
created_at
,
:format
=>
:short
)
}
storniert
.
"
end
redirect_to
:back
end
...
...
@@ -22,4 +21,4 @@ class EarningsController < ApplicationController
def
set_earning
@earning
=
Earning
.
find
(
params
[
:id
])
end
end
end
\ No newline at end of file
app/controllers/quests_controller.rb
View file @
57fd4cbd
...
...
@@ -13,9 +13,9 @@ class QuestsController < ApplicationController
def
solve
if
@quest
.
solve
(
@hacker
,
current_hacker
)
flash
[
:success
]
=
'Quest abgeschloßen'
flash
[
:success
]
=
"
#{
@quest
.
title
}
:
#{
@hacker
.
nickname
}
wurden
#{
@quest
.
points
}
Punkte gutgeschrieben."
else
flash
[
:error
]
=
'Quest
konnte nicht
ab
gesch
loß
en werden
'
flash
[
:error
]
=
"Die Punkte für
#{
@quest
.
title
}
konnte
n
nicht
gut
gesch
rieb
en werden
."
end
redirect_to
:back
end
...
...
app/controllers/redemptions_controller.rb
View file @
57fd4cbd
...
...
@@ -4,7 +4,7 @@ class RedemptionsController < ApplicationController
def
cancel
if
@redemption
.
cancel!
flash
[
:warning
]
=
"
#{
@redemption
.
points
}
storniert"
flash
[
:warning
]
=
"
#{
@redemption
.
reward
.
title
}
vom
#{
I18n
.
l
(
@redemption
.
created_at
,
:format
=>
:short
)
}
storniert"
end
redirect_to
:back
...
...
app/controllers/rewards_controller.rb
View file @
57fd4cbd
...
...
@@ -14,9 +14,9 @@ class RewardsController < ApplicationController
def
earn
redemption
=
@reward
.
earn
(
@hacker
,
current_hacker
)
if
redemption
.
valid?
flash
[
:success
]
=
'Reward
eingelöst
'
flash
[
:success
]
=
"
#{
redemption
.
reward
.
title
}
eingelöst
"
else
flash
[
:error
]
=
"
Reward
konnte nicht eingelöst werden
\n
"
flash
[
:error
]
=
"
#{
redemption
.
reward
.
title
}
konnte nicht eingelöst werden
\n
"
flash
[
:error
]
<<
redemption
.
errors
.
full_messages
*
"
\n
"
end
redirect_to
:back
...
...
app/views/hackers/show.html.erb
View file @
57fd4cbd
...
...
@@ -36,7 +36,7 @@
<%=
render
:partial
=>
'quests'
,
:locals
=>
{
:quests
=>
@quests
,
:hacker
=>
@hacker
}
%>
</div>
<h2>
Punkte
einlös
en
</h2>
<h2>
Punkte
gegen Artikel tausch
en
</h2>
<div
class=
"container-fluid"
>
<%=
render
:partial
=>
'rewards'
,
:locals
=>
{
:rewards
=>
@rewards
,
:hacker
=>
@hacker
}
%>
</div>
...
...
db/seeds.rb
View file @
57fd4cbd
...
...
@@ -31,19 +31,19 @@ Quest.create({
})
Reward
.
create
({
:title
=>
'Roter Artikel
einlösen
(Getränk)'
,
:title
=>
'Roter Artikel (Getränk)'
,
:points
=>
15
,
:image_url
=>
'icon-beer'
})
Reward
.
create
({
:title
=>
'Gelber Artikel
einlösen
(Snack)'
,
:title
=>
'Gelber Artikel (Snack)'
,
:points
=>
10
,
:image_url
=>
'icon-drink'
})
Reward
.
create
({
:title
=>
'Blauer Artikel
einlösen
(Mini-Snack)'
,
:title
=>
'Blauer Artikel (Mini-Snack)'
,
:points
=>
5
})
...
...
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