cirandas.net

ref: master

plugins/analytics/views/analytics_plugin/stats/_table.html.slim


.table-responsive
  table#analytics-stats.table data-toggle='table' data-striped='true' data-sortable='true' data-icons-prefix='fa'
    thead
      th= t'analytics_plugin.views.stats.user'
      th= t'analytics_plugin.views.stats.initial_time'
      th= t'analytics_plugin.views.stats.ip'
      th= t'analytics_plugin.views.stats.pages'

    tbody
      - visits.each do |visit|
        tr data-visit-id='#{visit.id}'
          td= link_to visit.user.name, visit.user.url if visit.user
          td
            div data-toggle="tooltip" data-title='#{l visit.initial_time}'
              = time_ago_in_words visit.initial_time
              | 
              = _'ago'
          td= visit.users_page_views.first.remote_ip
          td
            ol
              - visit.users_page_views.each do |page_view|
                li
                  = link_to (if page_view.title.present? then page_view.title else page_view.url end), page_view.url, target: '_blank'
                  | 
                  = "(#{distance_of_time_in_words page_view.time_on_page})"

javascript:
  $('#analytics-stats').bootstrapTable({
    striped: true,
  })

  $(document).ready(function() {
    $('[data-toggle="tooltip"]').tooltip()
  })