module Admin::OlympiamanagementsHelper def create_pagination(page=1,fields=ClassSettingFields) page = 1 if page == 0 per_page_num = 10 all_page_num = fields.all.count / per_page_num + 1 pagination = '
'+((I18n.locale.to_s == 'zh_tw') ? "第 #{page} 頁" : "page #{page}") +'/'+ ((I18n.locale.to_s == 'zh_tw') ? "共 #{all_page_num} 頁" : "Total #{all_page_num} page(s)")+'
    '+ ((page == 1) ? '
  1. ['+t('olympiamanagement.prev_page')+']
  2. ' : '
  3. ['+t('olympiamanagement.prev_page')+']
  4. ') (1..all_page_num).to_a.each{|page_num| pagination += ((page_num == page) ? '
  5. '+page_num.to_s+'
  6. ' : '
  7. '+page_num.to_s+'
  8. ')} pagination += (((page==all_page_num) ? '
  9. ['+t('olympiamanagement.next_page')+']
  10. ' : '
  11. ['+t('olympiamanagement.next_page')+']
  12. ')+'
') end end