Sha256: da9f3fdca27b8bc837cad7df34bee261a8771fa1fa2be07b0af71f324bc40139

Contents?: true

Size: 1.23 KB

Versions: 32

Compression:

Stored size: 1.23 KB

Contents

module ApplicationHelper
  include WithStudentPathNavigation

  # html-escapes an string even if it is html-safe
  def html_rescape(html)
    html_escape html.to_str
  end

  def profile_picture
    image_tag(current_user.image_url, height: 40, class: 'img-circle', onError: "this.onerror = null; this.src = '#{image_url('user_shape.png')}'")
  end

  def paginate(object, options={})
    "<div class=\"text-center\">#{super(object, {theme: 'twitter-bootstrap-3'}.merge(options))}</div>".html_safe
  end

  def last_box_class(trailing_boxes)
    trailing_boxes ? '' : 'mu-last-box'
  end

  def corollary_box(with_corollary, trailing_boxes = false)
    if with_corollary.corollary.present?
      %Q{
        <div class="#{last_box_class trailing_boxes}">
          <p>#{with_corollary.corollary_html}</p>
        </div>
      }.html_safe
    end
  end

  def chapter_finished(chapter)
    t :chapter_finished_html, chapter: link_to_path_element(chapter) if chapter
  end

  def span_toggle(hidden_text, active_text, active)
    %Q{
      <span class="#{'hidden' if active}">#{hidden_text}</span>
      <span class="#{'hidden' unless active}">#{active_text}</span>
    }.html_safe
  end
end

def sanitized(html)
  Mumukit::ContentType::Sanitizer.sanitize html
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
mumuki-laboratory-7.4.2 app/helpers/application_helper.rb
mumuki-laboratory-7.4.1 app/helpers/application_helper.rb
mumuki-laboratory-7.4.0 app/helpers/application_helper.rb
mumuki-laboratory-7.3.1 app/helpers/application_helper.rb
mumuki-laboratory-7.3.0 app/helpers/application_helper.rb
mumuki-laboratory-7.2.0 app/helpers/application_helper.rb
mumuki-laboratory-7.1.0 app/helpers/application_helper.rb
mumuki-laboratory-7.0.12 app/helpers/application_helper.rb
mumuki-laboratory-7.0.11 app/helpers/application_helper.rb
mumuki-laboratory-7.0.10 app/helpers/application_helper.rb
mumuki-laboratory-7.0.9 app/helpers/application_helper.rb
mumuki-laboratory-7.0.8 app/helpers/application_helper.rb
mumuki-laboratory-7.0.7 app/helpers/application_helper.rb
mumuki-laboratory-7.0.6 app/helpers/application_helper.rb
mumuki-laboratory-7.0.5 app/helpers/application_helper.rb
mumuki-laboratory-7.0.4 app/helpers/application_helper.rb
mumuki-laboratory-7.0.3 app/helpers/application_helper.rb
mumuki-laboratory-7.0.2 app/helpers/application_helper.rb
mumuki-laboratory-6.7.7 app/helpers/application_helper.rb
mumuki-laboratory-6.7.6 app/helpers/application_helper.rb