Sha256: 9ac8a7b6b6789a7e958665c534facd650b6c800cf7f64bc4a0887b202eeb7062

Contents?: true

Size: 1.83 KB

Versions: 10

Compression:

Stored size: 1.83 KB

Contents

=begin
  Camaleon CMS is a content management system
  Copyright (C) 2015 by Owen Peredo Diaz
  Email: owenperedo@gmail.com
  This program is free software: you can redistribute it and/or modify   it under the terms of the GNU Affero General Public License as  published by the Free Software Foundation, either version 3 of the  License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the  GNU Affero General Public License (GPLv3) for more details.
=end
module Admin::ApplicationHelper
  # include Admin::ApiHelper
  include Admin::MenusHelper
  include Admin::PostTypeHelper
  include Admin::CategoryHelper

  # load system notification
  def admin_system_notifications(args)
    if Date.parse(current_site.get_option("date_notified", 2.days.ago).to_s) < Date.today
      current_site.set_option("date_notified", Date.today)
      url = "http://camaleon.tuzitio.com/plugins/camaleon_notification/?version=#{CamaleonCms::VERSION}&admin_locale=#{current_site.get_admin_language}&site=#{current_site.the_url}"
      Thread.new do
        current_site.set_meta("date_notified_message", open(url).read)
        ActiveRecord::Base.connection.close #closing connection
      end
    end
    args[:content] << current_site.get_meta("date_notified_message", "")
  end

  # render pagination for current items
  # items is a will pagination object
  # sample: <%= raw do_pagination(@posts) %>
  def do_pagination(items)
    "<div class='row' class='pagination_panel'>
        <div class='col-md-6'>
          #{will_paginate items }
        </div>
        <div class='col-md-6 text-right total-items'>
          <strong>Total: #{items.total_entries} </strong>
        </div>
    </div>"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
camaleon_cms-1.1.0 app/helpers/admin/application_helper.rb
camaleon_cms-1.0.9 app/helpers/admin/application_helper.rb
camaleon_cms-1.0.8 app/helpers/admin/application_helper.rb
camaleon_cms-1.0.7 app/helpers/admin/application_helper.rb
camaleon_cms-1.0.6 app/helpers/admin/application_helper.rb
camaleon_cms-1.0.5 app/helpers/admin/application_helper.rb
camaleon_cms-1.0.4 app/helpers/admin/application_helper.rb
camaleon_cms-1.0.3 app/helpers/admin/application_helper.rb
camaleon_cms-1.0.1 app/helpers/admin/application_helper.rb
camaleon_cms-1.0 app/helpers/admin/application_helper.rb