Commit 57fd4cbd authored by Kim Meiser's avatar Kim Meiser 💬
Browse files

Texte angepasst

parent 4ae41f61
...@@ -3,11 +3,10 @@ class EarningsController < ApplicationController ...@@ -3,11 +3,10 @@ class EarningsController < ApplicationController
before_filter :set_earning, :only => [:cancel] before_filter :set_earning, :only => [:cancel]
# TODO user should be set # TODO user should be set
def cancel def cancel
if @earning.cancel!(current_hacker) 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 end
redirect_to :back redirect_to :back
end end
...@@ -22,4 +21,4 @@ class EarningsController < ApplicationController ...@@ -22,4 +21,4 @@ class EarningsController < ApplicationController
def set_earning def set_earning
@earning = Earning.find(params[:id]) @earning = Earning.find(params[:id])
end end
end end
\ No newline at end of file
...@@ -13,9 +13,9 @@ class QuestsController < ApplicationController ...@@ -13,9 +13,9 @@ class QuestsController < ApplicationController
def solve def solve
if @quest.solve(@hacker, current_hacker) if @quest.solve(@hacker, current_hacker)
flash[:success] = 'Quest abgeschloßen' flash[:success] = "#{@quest.title}: #{@hacker.nickname} wurden #{@quest.points} Punkte gutgeschrieben."
else else
flash[:error] = 'Quest konnte nicht abgeschloßen werden' flash[:error] = "Die Punkte für #{@quest.title} konnten nicht gutgeschrieben werden."
end end
redirect_to :back redirect_to :back
end end
......
...@@ -4,7 +4,7 @@ class RedemptionsController < ApplicationController ...@@ -4,7 +4,7 @@ class RedemptionsController < ApplicationController
def cancel def cancel
if @redemption.cancel! if @redemption.cancel!
flash[:warning] = "#{@redemption.points} storniert" flash[:warning] = "#{@redemption.reward.title} vom #{I18n.l(@redemption.created_at, :format => :short)} storniert"
end end
redirect_to :back redirect_to :back
......
...@@ -14,9 +14,9 @@ class RewardsController < ApplicationController ...@@ -14,9 +14,9 @@ class RewardsController < ApplicationController
def earn def earn
redemption = @reward.earn(@hacker, current_hacker) redemption = @reward.earn(@hacker, current_hacker)
if redemption.valid? if redemption.valid?
flash[:success] = 'Reward eingelöst' flash[:success] = "#{redemption.reward.title} eingelöst"
else 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" flash[:error] << redemption.errors.full_messages * "\n"
end end
redirect_to :back redirect_to :back
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<%= render :partial => 'quests', :locals => {:quests => @quests, :hacker => @hacker} %> <%= render :partial => 'quests', :locals => {:quests => @quests, :hacker => @hacker} %>
</div> </div>
<h2>Punkte einlösen</h2> <h2>Punkte gegen Artikel tauschen</h2>
<div class="container-fluid"> <div class="container-fluid">
<%= render :partial => 'rewards', :locals => {:rewards => @rewards, :hacker => @hacker} %> <%= render :partial => 'rewards', :locals => {:rewards => @rewards, :hacker => @hacker} %>
</div> </div>
......
...@@ -31,19 +31,19 @@ Quest.create({ ...@@ -31,19 +31,19 @@ Quest.create({
}) })
Reward.create({ Reward.create({
:title => 'Roter Artikel einlösen (Getränk)', :title => 'Roter Artikel (Getränk)',
:points => 15, :points => 15,
:image_url => 'icon-beer' :image_url => 'icon-beer'
}) })
Reward.create({ Reward.create({
:title => 'Gelber Artikel einlösen (Snack)', :title => 'Gelber Artikel (Snack)',
:points => 10, :points => 10,
:image_url => 'icon-drink' :image_url => 'icon-drink'
}) })
Reward.create({ Reward.create({
:title => 'Blauer Artikel einlösen (Mini-Snack)', :title => 'Blauer Artikel (Mini-Snack)',
:points => 5 :points => 5
}) })
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment