diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb new file mode 100644 index 000000000..ae269b98a --- /dev/null +++ b/app/helpers/admin_helper.rb @@ -0,0 +1,16 @@ +module AdminHelper + + def abusers + file = Rails.root.join("tmp", "abusers.txt") + if File.exists?(file) + content_tag(:ul) do + safe_join File.readlines(file).map do |l| + content_tag(:li, l) + end + end + else + content_tag(:p, "aucun") + end + end + +end diff --git a/app/views/admin/_box.html.haml b/app/views/admin/_box.html.haml index 5767daa31..4be3f3770 100644 --- a/app/views/admin/_box.html.haml +++ b/app/views/admin/_box.html.haml @@ -1,3 +1,5 @@ #admin_box.box %h1 = link_to "Admin", '/admin' + %h2 Abusers + = abusers