Sha256: 65c0feb4e2d760bb03b495bff7057b0b93ba2c02b012e9b15b38be2255cf12dc

Contents?: true

Size: 825 Bytes

Versions: 3

Compression:

Stored size: 825 Bytes

Contents

class NotesController < ContentController
  require 'json'

  layout :theme_layout

  after_action :set_blog_infos

  def index
    @notes = Note.published.page(params[:page]).per(this_blog.limit_article_display)

    if @notes.empty?
      @message = I18n.t('errors.no_notes_found')
      render 'notes/error', status: 200
    end
  end

  def show
    @note = Note.published.find_by! permalink: CGI.escape(params[:permalink])

    if @note.in_reply_to_message.present?
      @reply = JSON.parse(@note.in_reply_to_message)
      render :show_in_reply
    end
  end

  private

  def set_blog_infos
    @keywords = this_blog.meta_keywords
    @page_title = this_blog.statuses_title_template.to_title(@notes, this_blog, params)
    @description = this_blog.statuses_desc_template.to_title(@notes, this_blog, params)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
publify_core-9.1.0 app/controllers/notes_controller.rb
publify_core-9.0.1 app/controllers/notes_controller.rb
publify_core-9.0.0 app/controllers/notes_controller.rb