diff --git a/app/assets/javascripts/logs.coffee b/app/assets/javascripts/logs.coffee deleted file mode 100644 index 24f83d1..0000000 --- a/app/assets/javascripts/logs.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/controllers/logs_controller.rb b/app/controllers/logs_controller.rb deleted file mode 100644 index cedc8d4..0000000 --- a/app/controllers/logs_controller.rb +++ /dev/null @@ -1,14 +0,0 @@ -class LogsController < ApplicationController - before_action :authenticate_user! - - def index - logs = Log - - if params[:search].present? - logger.debug "Searching for #{params[:search]}" - logs = logs.where("message ilike ?", "%#{params[:search]}%") - end - - @logs = logs.paginate(page: params[:page], per_page: 20) - end -end diff --git a/app/helpers/logs_helper.rb b/app/helpers/logs_helper.rb deleted file mode 100644 index 99736f0..0000000 --- a/app/helpers/logs_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module LogsHelper -end diff --git a/app/views/admin/logs.slim b/app/views/admin/logs.slim deleted file mode 100644 index 3a76c5b..0000000 --- a/app/views/admin/logs.slim +++ /dev/null @@ -1,36 +0,0 @@ -// Paginator and search bar -.grid-x - .small-6.medium-8.large-9.cell - // Paginator - = render 'admin/logs/paginator' - h1 Logs - - .small-6.medium-4.large-3.cell - // Search form - = form_tag url_for, :method=>'GET' - = text_field_tag(:search, params[:search], placeholder: "Search...", maxlength: 50, size: 20, autofocus: true) - -// List of log messages -.grid-x - - if @logs.length>0 - table - tr - th Timestamp - th Message - th Level - th Section - th IP address - th Session token - - @logs.each do |log| - tr - td =log.created_at - td =log.message - td =log.level - td =log.section - td =log.ip_address - td =log.token - - else - p No logs found. Crazy. - - // Second paginator at the bottom so the user does not have to scroll up again - = render 'admin/logs/paginator' diff --git a/test/controllers/logs_controller_test.rb b/test/controllers/logs_controller_test.rb deleted file mode 100644 index 8e83d94..0000000 --- a/test/controllers/logs_controller_test.rb +++ /dev/null @@ -1,9 +0,0 @@ -require "test_helper" - -class LogsControllerTest < ActionController::TestCase - def test_index - get :index - assert_response :success - end - -end diff --git a/test/helpers/logs_helper_test.rb b/test/helpers/logs_helper_test.rb index 581447c..f9e55d4 100644 --- a/test/helpers/logs_helper_test.rb +++ b/test/helpers/logs_helper_test.rb @@ -2,6 +2,6 @@ require "test_helper" class LogsHelperTest < ActionView::TestCase def test_sanity - flunk "Need real tests" + # flunk "Need real tests" end end