From 61afbfa771bed92dc1306d0173cf9564127f38f6 Mon Sep 17 00:00:00 2001 From: Stijn Seghers Date: Thu, 18 Feb 2016 19:53:43 +0100 Subject: [PATCH 1/4] EUROES --- app/views/users/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 5ffcc59..3dcecec 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -1,4 +1,4 @@ -%h2= "#{@user.name} (balance: #{@user.balance/100.0})" +%h2= "#{@user.name} (balance: €#{@user.balance/100.0})" = render 'transactions/new' From 50d27561e4c2f598c54164b38a84bac6ab720201 Mon Sep 17 00:00:00 2001 From: benji Date: Mon, 21 Mar 2016 11:54:32 +0100 Subject: [PATCH 2/4] escape shit --- app/controllers/concerns/data_table.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/data_table.rb b/app/controllers/concerns/data_table.rb index 3ce4dde..d662685 100644 --- a/app/controllers/concerns/data_table.rb +++ b/app/controllers/concerns/data_table.rb @@ -1,4 +1,6 @@ class DataTable + include ActionView::Helpers::JavaScriptHelper + include ERB::Util def initialize user, params @user = user @params = sanitize_params(params) @@ -11,7 +13,7 @@ class DataTable draw: @params[:draw], recordsTotal: @user.transactions.count, recordsFiltered: count, - data: data + data: data.map { |d| (d["message"] = json_escape(d["message"])) && d } } end private From 8a9e9d9184ff1c22819758fb8e6b3ef15972faf4 Mon Sep 17 00:00:00 2001 From: benji Date: Fri, 20 May 2016 15:08:14 +0200 Subject: [PATCH 3/4] Use decent escaping of special characters in transaction messages --- app/assets/javascripts/transactions.js | 6 ++++++ app/controllers/concerns/data_table.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/transactions.js b/app/assets/javascripts/transactions.js index dc81726..a7071f6 100644 --- a/app/assets/javascripts/transactions.js +++ b/app/assets/javascripts/transactions.js @@ -34,6 +34,12 @@ ready = function() { render: function(data, type, full, meta) { return (data/100).toFixed(2); } + }, + { + targets: 4, + render: function(data, type, full, meta) { + return new Option(data).innerHTML + } } ] }); diff --git a/app/controllers/concerns/data_table.rb b/app/controllers/concerns/data_table.rb index d662685..fbfc765 100644 --- a/app/controllers/concerns/data_table.rb +++ b/app/controllers/concerns/data_table.rb @@ -13,7 +13,7 @@ class DataTable draw: @params[:draw], recordsTotal: @user.transactions.count, recordsFiltered: count, - data: data.map { |d| (d["message"] = json_escape(d["message"])) && d } + data: data } end private From 0b83509fb025ab80001673313701f67eec4a9e6b Mon Sep 17 00:00:00 2001 From: Rien Date: Mon, 8 Aug 2016 13:12:02 +0200 Subject: [PATCH 4/4] Set timezone Fix incorrect timestamps --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index fcfe579..a9eff52 100644 --- a/config/application.rb +++ b/config/application.rb @@ -14,7 +14,7 @@ module Tab # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' + config.time_zone = 'Brussels' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]