Module: CamaleonCms::Admin::ApplicationHelper
- Includes:
- CategoryHelper, CustomFieldsHelper, MenusHelper, PostTypeHelper
- Included in:
- CamaleonCms::AdminController
- Defined in:
- app/helpers/camaleon_cms/admin/application_helper.rb
Instance Method Summary collapse
-
#cama_do_pagination(items, *will_paginate_options) ⇒ Object
render pagination for current items items is a will pagination object sample: <%= raw cama_do_pagination(@posts) %>.
-
#cama_get_i18n_frontend ⇒ Object
return the locale for frontend translations initialized in admin controller used by models like posts, categories, …, sample: my_post.the_url fix for github.com/owen2345/camaleon-cms/issues/233#issuecomment-215385432.
-
#cama_shortcode_print(code) ⇒ Object
print code with auto copy.
Methods included from CustomFieldsHelper
#cama_custom_field_elements, #cf_add_model
Methods included from CategoryHelper
#cama_category_get_options_html
Methods included from PostTypeHelper
#cama_hierarchy_post_list, #post_type_html_inputs, #post_type_list_taxonomy, #post_type_status
Methods included from MenusHelper
#admin_menu_add_menu, #admin_menu_append_menu_item, #admin_menu_draw, #admin_menu_insert_menu_after, #admin_menu_insert_menu_before, #admin_menu_prepend_menu_item, #admin_menus_add_commons
Methods included from BreadcrumbHelper
#admin_breadcrumb_add, #cama_admin_title_draw
Instance Method Details
#cama_do_pagination(items, *will_paginate_options) ⇒ Object
render pagination for current items items is a will pagination object sample: <%= raw cama_do_pagination(@posts) %>
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/helpers/camaleon_cms/admin/application_helper.rb', line 13 def cama_do_pagination(items, *) = . custom_class = [:panel_class] .delete(:panel_class) "<div class='row #{custom_class} pagination_panel cama_ajax_request'> <div class='col-md-10'> #{begin will_paginate(items, ) rescue StandardError '' end} </div> <div class='col-md-2 text-right total-items'> <strong>#{I18n.t('camaleon_cms.admin.table.total', default: 'Total')}: #{begin items.total_entries rescue StandardError items.count end} </strong> </div> </div>" end |
#cama_get_i18n_frontend ⇒ Object
return the locale for frontend translations initialized in admin controller used by models like posts, categories, …, sample: my_post.the_url fix for github.com/owen2345/camaleon-cms/issues/233#issuecomment-215385432
38 39 40 |
# File 'app/helpers/camaleon_cms/admin/application_helper.rb', line 38 def cama_get_i18n_frontend @cama_i18n_frontend end |
#cama_shortcode_print(code) ⇒ Object
print code with auto copy
43 44 45 |
# File 'app/helpers/camaleon_cms/admin/application_helper.rb', line 43 def cama_shortcode_print(code) "<input onmousedown=\"this.clicked = 1;\" readonly onfocus=\"if (!this.clicked) this.select(); else this.clicked = 2;\" onclick=\"if (this.clicked == 2) this.select(); this.clicked = 0;\" class='code_style' tabindex='-1' value=\"#{code}\">" end |