Sha256: a0320d2c57cfb46c4f66972dcc0c18c6262ae3edda55b697816623d477ed9470

Contents?: true

Size: 1.43 KB

Versions: 40

Compression:

Stored size: 1.43 KB

Contents

module Plugins::AuthoringPost::AuthoringPostHelper
  
  def plugin_authoring_post_the_content(args)
  end

  def plugin_authoring_on_active(plugin)
  end

  def plugin_authoring_on_inactive(plugin)
  end

  def plugin_authoring_post_list(args)
   end

  def plugin_authoring_create_post(args)
  end

  def plugin_authoring_new_post(args)
    args[:extra_settings] << plugin_authoring_form_html(args[:post])
  end

  def plugin_authoring_can_visit(args)
  end

  def plugin_authoring_extra_columns(args)
  end

  def plugin_authoring_filter_post(args)
  end

  private

  def plugin_authoring_form_html(post)
    "
    <div class='form-group'>
      <label class='control-label'>#{t('camaleon_cms.admin.table.author')}</label>
      <select id='post_user_id' #{can?(:edit_other, post.post_type) && (can?(:edit_publish, post.post_type) || !post.published?) ? '' : 'disabled'} name='post[user_id]' class='form-control select valid' aria-invalid='false'>#{plugin_authoring_authors_list(post)}</select>
    </div>
    "
  end

  def plugin_authoring_authors_list(post)
    author_id = post.new_record? ? cama_current_user.id : post.author.id
    ret = ''
    current_site.users.where('role <> ?', 'client').order(:username).each do |user|
      ret += "<option value='#{user.id}' #{user.id.eql?(author_id) ? 'selected' : ''}>#{user.username.titleize}#{user.fullname.eql?(user.username.titleize) ? '' : ' (' +  user.fullname + ')' }</option>"
    end
    ret
  end

end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
camaleon_cms-2.6.4 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.6.3 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.6.2 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.6.1 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.6.0.1 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.6.0 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.5.3.1 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.5.3 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.5.2 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms_rails6-2.5.0 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.5.1 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.5.0 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.4.6.9 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.4.6.8 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.4.6.7 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.4.6.6 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.4.6.5 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.4.6.4 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.4.6.3 app/apps/plugins/authoring_post/authoring_post_helper.rb
camaleon_cms-2.4.6.2 app/apps/plugins/authoring_post/authoring_post_helper.rb