From ac2dbee62b275ac394ce5c6b98d5347cf81e7627 Mon Sep 17 00:00:00 2001 From: benji Date: Wed, 10 Feb 2016 15:23:16 +0100 Subject: [PATCH 1/3] Privacy and stuff --- app/controllers/users_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6cb6f63..ef6b866 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -8,6 +8,7 @@ class UsersController < ApplicationController def show @user = User.find_by(name: params[:id]) || User.new + authorize! :read, @user respond_to do |format| format.html { @transaction = Transaction.new } format.json { render json: @user } From 227903c88f26046a5edae7786749cb8017db9bbe Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Wed, 10 Feb 2016 20:32:43 +0100 Subject: [PATCH 2/3] fix #16 --- app/views/transactions/_new.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/transactions/_new.html.haml b/app/views/transactions/_new.html.haml index b304df0..b4f3482 100644 --- a/app/views/transactions/_new.html.haml +++ b/app/views/transactions/_new.html.haml @@ -14,5 +14,6 @@ %span.glyphicon.glyphicon-euro = f.number_field :euros, value: amount(@transaction.amount), placeholder: "Bedrag", step: 0.01, min: (0.01 unless current_user.penning), - class: "form-control", size: 20, max: Rails.application.config.maximum_amount/100, required: true + class: "form-control", size: 20, required: true, + max: (Rails.application.config.maximum_amount/100 unless current_user.penning) = f.submit "Send it!", class: "pure-button pure-button-primary btn" From 305939712fb2eef5f1c67cb03dafe50316ddb47f Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Wed, 10 Feb 2016 20:40:40 +0100 Subject: [PATCH 3/3] fix #17 and s/Bedrag/Amount --- app/views/transactions/_new.html.haml | 2 +- app/views/users/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/transactions/_new.html.haml b/app/views/transactions/_new.html.haml index b4f3482..cb4be2c 100644 --- a/app/views/transactions/_new.html.haml +++ b/app/views/transactions/_new.html.haml @@ -13,7 +13,7 @@ %span.input-group-addon %span.glyphicon.glyphicon-euro = f.number_field :euros, value: amount(@transaction.amount), - placeholder: "Bedrag", step: 0.01, min: (0.01 unless current_user.penning), + placeholder: "Amount", step: 0.01, min: (0.01 unless current_user.penning), class: "form-control", size: 20, required: true, max: (Rails.application.config.maximum_amount/100 unless current_user.penning) = f.submit "Send it!", class: "pure-button pure-button-primary btn" diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 7216372..51c3a26 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -1,4 +1,4 @@ -%h2= @user.name +%h2= "#{@user.name} (balance: #{@user.balance/100.0})" = render 'transactions/new'