dm_core 4.2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +22 -0
- data/README.md +25 -0
- data/Rakefile +34 -0
- data/app/assets/images/dm_core/draft_menu_bg.png +0 -0
- data/app/assets/images/dm_core/expand.png +0 -0
- data/app/assets/images/dm_core/flags/ad.gif +0 -0
- data/app/assets/images/dm_core/flags/ae.gif +0 -0
- data/app/assets/images/dm_core/flags/af.gif +0 -0
- data/app/assets/images/dm_core/flags/ag.gif +0 -0
- data/app/assets/images/dm_core/flags/ai.gif +0 -0
- data/app/assets/images/dm_core/flags/al.gif +0 -0
- data/app/assets/images/dm_core/flags/am.gif +0 -0
- data/app/assets/images/dm_core/flags/an.gif +0 -0
- data/app/assets/images/dm_core/flags/ao.gif +0 -0
- data/app/assets/images/dm_core/flags/ar.gif +0 -0
- data/app/assets/images/dm_core/flags/as.gif +0 -0
- data/app/assets/images/dm_core/flags/at.gif +0 -0
- data/app/assets/images/dm_core/flags/au.gif +0 -0
- data/app/assets/images/dm_core/flags/aw.gif +0 -0
- data/app/assets/images/dm_core/flags/ax.gif +0 -0
- data/app/assets/images/dm_core/flags/az.gif +0 -0
- data/app/assets/images/dm_core/flags/ba.gif +0 -0
- data/app/assets/images/dm_core/flags/bb.gif +0 -0
- data/app/assets/images/dm_core/flags/bd.gif +0 -0
- data/app/assets/images/dm_core/flags/be.gif +0 -0
- data/app/assets/images/dm_core/flags/bf.gif +0 -0
- data/app/assets/images/dm_core/flags/bg.gif +0 -0
- data/app/assets/images/dm_core/flags/bh.gif +0 -0
- data/app/assets/images/dm_core/flags/bi.gif +0 -0
- data/app/assets/images/dm_core/flags/bj.gif +0 -0
- data/app/assets/images/dm_core/flags/bm.gif +0 -0
- data/app/assets/images/dm_core/flags/bn.gif +0 -0
- data/app/assets/images/dm_core/flags/bo.gif +0 -0
- data/app/assets/images/dm_core/flags/br.gif +0 -0
- data/app/assets/images/dm_core/flags/bs.gif +0 -0
- data/app/assets/images/dm_core/flags/bt.gif +0 -0
- data/app/assets/images/dm_core/flags/bv.gif +0 -0
- data/app/assets/images/dm_core/flags/bw.gif +0 -0
- data/app/assets/images/dm_core/flags/by.gif +0 -0
- data/app/assets/images/dm_core/flags/bz.gif +0 -0
- data/app/assets/images/dm_core/flags/ca.gif +0 -0
- data/app/assets/images/dm_core/flags/cc.gif +0 -0
- data/app/assets/images/dm_core/flags/cd.gif +0 -0
- data/app/assets/images/dm_core/flags/cf.gif +0 -0
- data/app/assets/images/dm_core/flags/cg.gif +0 -0
- data/app/assets/images/dm_core/flags/ch.gif +0 -0
- data/app/assets/images/dm_core/flags/ci.gif +0 -0
- data/app/assets/images/dm_core/flags/ck.gif +0 -0
- data/app/assets/images/dm_core/flags/cl.gif +0 -0
- data/app/assets/images/dm_core/flags/cm.gif +0 -0
- data/app/assets/images/dm_core/flags/cn.gif +0 -0
- data/app/assets/images/dm_core/flags/co.gif +0 -0
- data/app/assets/images/dm_core/flags/cr.gif +0 -0
- data/app/assets/images/dm_core/flags/cs.gif +0 -0
- data/app/assets/images/dm_core/flags/cu.gif +0 -0
- data/app/assets/images/dm_core/flags/cv.gif +0 -0
- data/app/assets/images/dm_core/flags/cx.gif +0 -0
- data/app/assets/images/dm_core/flags/cy.gif +0 -0
- data/app/assets/images/dm_core/flags/cz.gif +0 -0
- data/app/assets/images/dm_core/flags/de.gif +0 -0
- data/app/assets/images/dm_core/flags/dj.gif +0 -0
- data/app/assets/images/dm_core/flags/dk.gif +0 -0
- data/app/assets/images/dm_core/flags/dm.gif +0 -0
- data/app/assets/images/dm_core/flags/do.gif +0 -0
- data/app/assets/images/dm_core/flags/dz.gif +0 -0
- data/app/assets/images/dm_core/flags/ec.gif +0 -0
- data/app/assets/images/dm_core/flags/ee.gif +0 -0
- data/app/assets/images/dm_core/flags/eg.gif +0 -0
- data/app/assets/images/dm_core/flags/eh.gif +0 -0
- data/app/assets/images/dm_core/flags/en.gif +0 -0
- data/app/assets/images/dm_core/flags/england.gif +0 -0
- data/app/assets/images/dm_core/flags/er.gif +0 -0
- data/app/assets/images/dm_core/flags/es.gif +0 -0
- data/app/assets/images/dm_core/flags/et.gif +0 -0
- data/app/assets/images/dm_core/flags/fam.gif +0 -0
- data/app/assets/images/dm_core/flags/fi.gif +0 -0
- data/app/assets/images/dm_core/flags/fj.gif +0 -0
- data/app/assets/images/dm_core/flags/fk.gif +0 -0
- data/app/assets/images/dm_core/flags/fm.gif +0 -0
- data/app/assets/images/dm_core/flags/fo.gif +0 -0
- data/app/assets/images/dm_core/flags/fr.gif +0 -0
- data/app/assets/images/dm_core/flags/ga.gif +0 -0
- data/app/assets/images/dm_core/flags/gb.gif +0 -0
- data/app/assets/images/dm_core/flags/gd.gif +0 -0
- data/app/assets/images/dm_core/flags/ge.gif +0 -0
- data/app/assets/images/dm_core/flags/gh.gif +0 -0
- data/app/assets/images/dm_core/flags/gi.gif +0 -0
- data/app/assets/images/dm_core/flags/gl.gif +0 -0
- data/app/assets/images/dm_core/flags/gm.gif +0 -0
- data/app/assets/images/dm_core/flags/gn.gif +0 -0
- data/app/assets/images/dm_core/flags/gp.gif +0 -0
- data/app/assets/images/dm_core/flags/gq.gif +0 -0
- data/app/assets/images/dm_core/flags/gr.gif +0 -0
- data/app/assets/images/dm_core/flags/gs.gif +0 -0
- data/app/assets/images/dm_core/flags/gt.gif +0 -0
- data/app/assets/images/dm_core/flags/gu.gif +0 -0
- data/app/assets/images/dm_core/flags/gw.gif +0 -0
- data/app/assets/images/dm_core/flags/gy.gif +0 -0
- data/app/assets/images/dm_core/flags/hk.gif +0 -0
- data/app/assets/images/dm_core/flags/hn.gif +0 -0
- data/app/assets/images/dm_core/flags/hr.gif +0 -0
- data/app/assets/images/dm_core/flags/ht.gif +0 -0
- data/app/assets/images/dm_core/flags/hu.gif +0 -0
- data/app/assets/images/dm_core/flags/id.gif +0 -0
- data/app/assets/images/dm_core/flags/ie.gif +0 -0
- data/app/assets/images/dm_core/flags/il.gif +0 -0
- data/app/assets/images/dm_core/flags/in.gif +0 -0
- data/app/assets/images/dm_core/flags/io.gif +0 -0
- data/app/assets/images/dm_core/flags/iq.gif +0 -0
- data/app/assets/images/dm_core/flags/ir.gif +0 -0
- data/app/assets/images/dm_core/flags/is.gif +0 -0
- data/app/assets/images/dm_core/flags/it.gif +0 -0
- data/app/assets/images/dm_core/flags/ja.gif +0 -0
- data/app/assets/images/dm_core/flags/jm.gif +0 -0
- data/app/assets/images/dm_core/flags/jo.gif +0 -0
- data/app/assets/images/dm_core/flags/ke.gif +0 -0
- data/app/assets/images/dm_core/flags/kg.gif +0 -0
- data/app/assets/images/dm_core/flags/kh.gif +0 -0
- data/app/assets/images/dm_core/flags/ki.gif +0 -0
- data/app/assets/images/dm_core/flags/km.gif +0 -0
- data/app/assets/images/dm_core/flags/kn.gif +0 -0
- data/app/assets/images/dm_core/flags/kp.gif +0 -0
- data/app/assets/images/dm_core/flags/kr.gif +0 -0
- data/app/assets/images/dm_core/flags/kw.gif +0 -0
- data/app/assets/images/dm_core/flags/ky.gif +0 -0
- data/app/assets/images/dm_core/flags/kz.gif +0 -0
- data/app/assets/images/dm_core/flags/la.gif +0 -0
- data/app/assets/images/dm_core/flags/lb.gif +0 -0
- data/app/assets/images/dm_core/flags/lc.gif +0 -0
- data/app/assets/images/dm_core/flags/li.gif +0 -0
- data/app/assets/images/dm_core/flags/lk.gif +0 -0
- data/app/assets/images/dm_core/flags/lr.gif +0 -0
- data/app/assets/images/dm_core/flags/ls.gif +0 -0
- data/app/assets/images/dm_core/flags/lt.gif +0 -0
- data/app/assets/images/dm_core/flags/lu.gif +0 -0
- data/app/assets/images/dm_core/flags/lv.gif +0 -0
- data/app/assets/images/dm_core/flags/ly.gif +0 -0
- data/app/assets/images/dm_core/flags/ma.gif +0 -0
- data/app/assets/images/dm_core/flags/mc.gif +0 -0
- data/app/assets/images/dm_core/flags/md.gif +0 -0
- data/app/assets/images/dm_core/flags/mg.gif +0 -0
- data/app/assets/images/dm_core/flags/mh.gif +0 -0
- data/app/assets/images/dm_core/flags/mk.gif +0 -0
- data/app/assets/images/dm_core/flags/ml.gif +0 -0
- data/app/assets/images/dm_core/flags/mm.gif +0 -0
- data/app/assets/images/dm_core/flags/mn.gif +0 -0
- data/app/assets/images/dm_core/flags/mo.gif +0 -0
- data/app/assets/images/dm_core/flags/mp.gif +0 -0
- data/app/assets/images/dm_core/flags/mq.gif +0 -0
- data/app/assets/images/dm_core/flags/mr.gif +0 -0
- data/app/assets/images/dm_core/flags/ms.gif +0 -0
- data/app/assets/images/dm_core/flags/mt.gif +0 -0
- data/app/assets/images/dm_core/flags/mu.gif +0 -0
- data/app/assets/images/dm_core/flags/mv.gif +0 -0
- data/app/assets/images/dm_core/flags/mw.gif +0 -0
- data/app/assets/images/dm_core/flags/mx.gif +0 -0
- data/app/assets/images/dm_core/flags/my.gif +0 -0
- data/app/assets/images/dm_core/flags/mz.gif +0 -0
- data/app/assets/images/dm_core/flags/na.gif +0 -0
- data/app/assets/images/dm_core/flags/nc.gif +0 -0
- data/app/assets/images/dm_core/flags/ne.gif +0 -0
- data/app/assets/images/dm_core/flags/nf.gif +0 -0
- data/app/assets/images/dm_core/flags/ng.gif +0 -0
- data/app/assets/images/dm_core/flags/ni.gif +0 -0
- data/app/assets/images/dm_core/flags/nl.gif +0 -0
- data/app/assets/images/dm_core/flags/no.gif +0 -0
- data/app/assets/images/dm_core/flags/np.gif +0 -0
- data/app/assets/images/dm_core/flags/nr.gif +0 -0
- data/app/assets/images/dm_core/flags/nu.gif +0 -0
- data/app/assets/images/dm_core/flags/nz.gif +0 -0
- data/app/assets/images/dm_core/flags/om.gif +0 -0
- data/app/assets/images/dm_core/flags/pa.gif +0 -0
- data/app/assets/images/dm_core/flags/pe.gif +0 -0
- data/app/assets/images/dm_core/flags/pf.gif +0 -0
- data/app/assets/images/dm_core/flags/pg.gif +0 -0
- data/app/assets/images/dm_core/flags/ph.gif +0 -0
- data/app/assets/images/dm_core/flags/pk.gif +0 -0
- data/app/assets/images/dm_core/flags/pl.gif +0 -0
- data/app/assets/images/dm_core/flags/pm.gif +0 -0
- data/app/assets/images/dm_core/flags/pn.gif +0 -0
- data/app/assets/images/dm_core/flags/pr.gif +0 -0
- data/app/assets/images/dm_core/flags/ps.gif +0 -0
- data/app/assets/images/dm_core/flags/pt.gif +0 -0
- data/app/assets/images/dm_core/flags/pw.gif +0 -0
- data/app/assets/images/dm_core/flags/py.gif +0 -0
- data/app/assets/images/dm_core/flags/qa.gif +0 -0
- data/app/assets/images/dm_core/flags/ro.gif +0 -0
- data/app/assets/images/dm_core/flags/ru.gif +0 -0
- data/app/assets/images/dm_core/flags/rw.gif +0 -0
- data/app/assets/images/dm_core/flags/sa.gif +0 -0
- data/app/assets/images/dm_core/flags/sb.gif +0 -0
- data/app/assets/images/dm_core/flags/sc.gif +0 -0
- data/app/assets/images/dm_core/flags/scotland.gif +0 -0
- data/app/assets/images/dm_core/flags/sd.gif +0 -0
- data/app/assets/images/dm_core/flags/se.gif +0 -0
- data/app/assets/images/dm_core/flags/sg.gif +0 -0
- data/app/assets/images/dm_core/flags/sh.gif +0 -0
- data/app/assets/images/dm_core/flags/si.gif +0 -0
- data/app/assets/images/dm_core/flags/sk.gif +0 -0
- data/app/assets/images/dm_core/flags/sl.gif +0 -0
- data/app/assets/images/dm_core/flags/sm.gif +0 -0
- data/app/assets/images/dm_core/flags/sn.gif +0 -0
- data/app/assets/images/dm_core/flags/so.gif +0 -0
- data/app/assets/images/dm_core/flags/sr.gif +0 -0
- data/app/assets/images/dm_core/flags/st.gif +0 -0
- data/app/assets/images/dm_core/flags/sv.gif +0 -0
- data/app/assets/images/dm_core/flags/sy.gif +0 -0
- data/app/assets/images/dm_core/flags/sz.gif +0 -0
- data/app/assets/images/dm_core/flags/tc.gif +0 -0
- data/app/assets/images/dm_core/flags/td.gif +0 -0
- data/app/assets/images/dm_core/flags/tf.gif +0 -0
- data/app/assets/images/dm_core/flags/tg.gif +0 -0
- data/app/assets/images/dm_core/flags/th.gif +0 -0
- data/app/assets/images/dm_core/flags/tj.gif +0 -0
- data/app/assets/images/dm_core/flags/tk.gif +0 -0
- data/app/assets/images/dm_core/flags/tl.gif +0 -0
- data/app/assets/images/dm_core/flags/tm.gif +0 -0
- data/app/assets/images/dm_core/flags/tn.gif +0 -0
- data/app/assets/images/dm_core/flags/to.gif +0 -0
- data/app/assets/images/dm_core/flags/tr.gif +0 -0
- data/app/assets/images/dm_core/flags/tt.gif +0 -0
- data/app/assets/images/dm_core/flags/tv.gif +0 -0
- data/app/assets/images/dm_core/flags/tw.gif +0 -0
- data/app/assets/images/dm_core/flags/tz.gif +0 -0
- data/app/assets/images/dm_core/flags/ua.gif +0 -0
- data/app/assets/images/dm_core/flags/ug.gif +0 -0
- data/app/assets/images/dm_core/flags/um.gif +0 -0
- data/app/assets/images/dm_core/flags/us.gif +0 -0
- data/app/assets/images/dm_core/flags/uy.gif +0 -0
- data/app/assets/images/dm_core/flags/uz.gif +0 -0
- data/app/assets/images/dm_core/flags/va.gif +0 -0
- data/app/assets/images/dm_core/flags/vc.gif +0 -0
- data/app/assets/images/dm_core/flags/ve.gif +0 -0
- data/app/assets/images/dm_core/flags/vg.gif +0 -0
- data/app/assets/images/dm_core/flags/vi.gif +0 -0
- data/app/assets/images/dm_core/flags/vn.gif +0 -0
- data/app/assets/images/dm_core/flags/vu.gif +0 -0
- data/app/assets/images/dm_core/flags/wales.gif +0 -0
- data/app/assets/images/dm_core/flags/wf.gif +0 -0
- data/app/assets/images/dm_core/flags/ws.gif +0 -0
- data/app/assets/images/dm_core/flags/ye.gif +0 -0
- data/app/assets/images/dm_core/flags/yt.gif +0 -0
- data/app/assets/images/dm_core/flags/za.gif +0 -0
- data/app/assets/images/dm_core/flags/zm.gif +0 -0
- data/app/assets/images/dm_core/flags/zw.gif +0 -0
- data/app/assets/images/dm_core/user.gif +0 -0
- data/app/assets/javascripts/dm_core/admin.js +223 -0
- data/app/assets/javascripts/dm_core/admin_extra.js.coffee +118 -0
- data/app/assets/javascripts/dm_core/application.js +14 -0
- data/app/assets/javascripts/dm_core/common_js.js.coffee +61 -0
- data/app/assets/javascripts/dm_core/underscore-1.4.4-min.js +1 -0
- data/app/assets/javascripts/dm_core/underscore-1.4.4.js +1227 -0
- data/app/assets/stylesheets/dm_core/admin.css +250 -0
- data/app/assets/stylesheets/dm_core/application.css +31 -0
- data/app/assets/stylesheets/dm_core/font-awesome.css +1479 -0
- data/app/assets/stylesheets/dm_core/font/FontAwesome.otf +0 -0
- data/app/assets/stylesheets/dm_core/font/fontawesome-webfont.eot +0 -0
- data/app/assets/stylesheets/dm_core/font/fontawesome-webfont.svg +399 -0
- data/app/assets/stylesheets/dm_core/font/fontawesome-webfont.ttf +0 -0
- data/app/assets/stylesheets/dm_core/font/fontawesome-webfont.woff +0 -0
- data/app/controllers/dm_core/admin/accounts_controller.rb +125 -0
- data/app/controllers/dm_core/admin/admin_controller.rb +133 -0
- data/app/controllers/dm_core/admin/comments_controller.rb +70 -0
- data/app/controllers/dm_core/admin/dashboard_controller.rb +38 -0
- data/app/controllers/dm_core/admin/system_controller.rb +44 -0
- data/app/controllers/dm_core/admin/users_controller.rb +106 -0
- data/app/controllers/dm_core/application_controller.rb +253 -0
- data/app/controllers/dm_core/concerns/profile_controller.rb +41 -0
- data/app/controllers/dm_core/profile_controller.rb +8 -0
- data/app/datatables/user_datatable.rb +75 -0
- data/app/helpers/devise_helper.rb +25 -0
- data/app/helpers/dm_core/account_helper.rb +70 -0
- data/app/helpers/dm_core/admin/application_helper.rb +23 -0
- data/app/helpers/dm_core/application_helper.rb +58 -0
- data/app/helpers/dm_core/liquid_helper.rb +79 -0
- data/app/helpers/dm_core/params_helper.rb +19 -0
- data/app/helpers/dm_core/render_helper.rb +104 -0
- data/app/helpers/dm_core/url_helper.rb +189 -0
- data/app/helpers/dm_utilities/currency_helper.rb +24 -0
- data/app/helpers/dm_utilities/date_helper.rb +72 -0
- data/app/inputs/code_editor_input.rb +51 -0
- data/app/inputs/text_full_width_input.rb +9 -0
- data/app/inputs/toggle_checked_input.rb +9 -0
- data/app/inputs/toggle_input.rb +9 -0
- data/app/mailers/dm_core/site_mailer.rb +18 -0
- data/app/models/account.rb +241 -0
- data/app/models/activity.rb +10 -0
- data/app/models/address.rb +24 -0
- data/app/models/category.rb +18 -0
- data/app/models/comment.rb +24 -0
- data/app/models/custom_field.rb +99 -0
- data/app/models/custom_field_def.rb +61 -0
- data/app/models/dm_core/concerns/ability.rb +17 -0
- data/app/models/dm_core/concerns/defines_custom_fields.rb +17 -0
- data/app/models/dm_core/concerns/friendly_id.rb +57 -0
- data/app/models/dm_core/concerns/has_custom_fields.rb +28 -0
- data/app/models/dm_core/concerns/public_private.rb +151 -0
- data/app/models/dm_core/concerns/user.rb +144 -0
- data/app/models/dm_core/concerns/user_profile.rb +113 -0
- data/app/models/dm_core/concerns/user_site_profile.rb +65 -0
- data/app/models/dm_core/country.rb +8 -0
- data/app/models/dm_core/language.rb +59 -0
- data/app/models/dm_core/permitted_params.rb +52 -0
- data/app/models/follow.rb +13 -0
- data/app/models/liquid_validator.rb +26 -0
- data/app/models/payment_history.rb +57 -0
- data/app/models/presence_default_locale_validator.rb +12 -0
- data/app/models/role.rb +12 -0
- data/app/models/system_email.rb +15 -0
- data/app/models/ultracart/notification.rb +107 -0
- data/app/models/ultracart/payment_history.rb +55 -0
- data/app/models/user.rb +22 -0
- data/app/models/user_profile.rb +9 -0
- data/app/models/user_site_profile.rb +11 -0
- data/app/presenters/base_presenter.rb +30 -0
- data/app/presenters/comment_presenter.rb +20 -0
- data/app/presenters/user_presenter.rb +48 -0
- data/app/uploaders/avatar_uploader.rb +75 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +7 -0
- data/app/views/devise/mailer/confirmation_instructions.text.erb +7 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +9 -0
- data/app/views/devise/mailer/reset_password_instructions.text.erb +9 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/mailer/unlock_instructions.text.erb +7 -0
- data/app/views/dm_core/admin/accounts/_settings_menu.html.erb +24 -0
- data/app/views/dm_core/admin/accounts/analytics.html.erb +38 -0
- data/app/views/dm_core/admin/accounts/email.html.erb +26 -0
- data/app/views/dm_core/admin/accounts/general.html.erb +22 -0
- data/app/views/dm_core/admin/accounts/media.html.erb +37 -0
- data/app/views/dm_core/admin/accounts/metadata.html.erb +22 -0
- data/app/views/dm_core/admin/comments/_comment.html.erb +14 -0
- data/app/views/dm_core/admin/comments/_comment_edit_form.html.erb +3 -0
- data/app/views/dm_core/admin/comments/_comment_form.html.erb +15 -0
- data/app/views/dm_core/admin/comments/_comment_list.html.erb +5 -0
- data/app/views/dm_core/admin/comments/_comment_section.html.erb +7 -0
- data/app/views/dm_core/admin/comments/create.js.erb +4 -0
- data/app/views/dm_core/admin/comments/destroy.js.erb +1 -0
- data/app/views/dm_core/admin/comments/edit.js.erb +2 -0
- data/app/views/dm_core/admin/comments/update.js.erb +2 -0
- data/app/views/dm_core/admin/custom_fields/_check_box_collection.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_custom_field_def_fields.html.erb +34 -0
- data/app/views/dm_core/admin/custom_fields/_divider.html.erb +1 -0
- data/app/views/dm_core/admin/custom_fields/_number_field.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_radio_buttons.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_select.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_text_area.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_text_field.html.erb +4 -0
- data/app/views/dm_core/admin/dashboard/_index_sidebar.html.erb +22 -0
- data/app/views/dm_core/admin/dashboard/_widget_recent_new_users.html.erb +23 -0
- data/app/views/dm_core/admin/dashboard/_widget_recent_user_activity.html.erb +21 -0
- data/app/views/dm_core/admin/dashboard/index.html.erb +7 -0
- data/app/views/dm_core/admin/dashboard/update_site_assets.html.erb +5 -0
- data/app/views/dm_core/admin/shared/_header_stats_new_users.html.erb +2 -0
- data/app/views/dm_core/admin/shared/_header_stats_user_activity.html.erb +2 -0
- data/app/views/dm_core/admin/system/show.html.erb +23 -0
- data/app/views/dm_core/admin/users/_form.html.erb +44 -0
- data/app/views/dm_core/admin/users/edit.html.erb +201 -0
- data/app/views/dm_core/admin/users/index.html.erb +30 -0
- data/app/views/dm_core/profile/_profile_sidebar.html.erb +6 -0
- data/app/views/dm_core/profile/account.html.erb +38 -0
- data/app/views/dm_core/profile/details.html.erb +38 -0
- data/app/views/layouts/dm_core/application.html.erb +14 -0
- data/app/views/layouts/dm_core/maintenance.html.erb +31 -0
- data/app/views/layouts/email_templates/default_email_layout.html.erb +289 -0
- data/config/initializers/_dm_core.rb +7 -0
- data/config/initializers/carrierwave.rb +33 -0
- data/config/initializers/devise.rb +252 -0
- data/config/initializers/friendly_id.rb +88 -0
- data/config/initializers/globalize_easy_accessors.rb +67 -0
- data/config/initializers/globalize_papertrail_fix.rb +20 -0
- data/config/initializers/globalize_reflections.rb +22 -0
- data/config/initializers/rolify.rb +8 -0
- data/config/initializers/simple_form.rb +161 -0
- data/config/initializers/simple_form_amsterdam.rb +31 -0
- data/config/initializers/simple_form_bootstrap.rb +87 -0
- data/config/initializers/simple_form_bootstrap3.rb +175 -0
- data/config/initializers/will_paginate.rb +87 -0
- data/config/locales/custom.cs.yml +82 -0
- data/config/locales/custom.de.yml +82 -0
- data/config/locales/custom.en.yml +84 -0
- data/config/locales/custom.fi.yml +84 -0
- data/config/locales/custom.ja.yml +84 -0
- data/config/locales/devise.cs.yml +70 -0
- data/config/locales/devise.de.yml +60 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/locales/devise.fi.yml +57 -0
- data/config/locales/devise.ja.yml +102 -0
- data/config/locales/rails.cs.yml +211 -0
- data/config/locales/rails.de-AT.yml +203 -0
- data/config/locales/rails.de.yml +203 -0
- data/config/locales/rails.en-GB.yml +205 -0
- data/config/locales/rails.en-IN.yml +205 -0
- data/config/locales/rails.en.yml +205 -0
- data/config/locales/rails.fi.yml +199 -0
- data/config/locales/rails.fr-CH.yml +207 -0
- data/config/locales/rails.fr.yml +215 -0
- data/config/locales/rails.ja.yml +197 -0
- data/config/locales/simple_form.cs.yml +26 -0
- data/config/locales/simple_form.de.yml +26 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/locales/simple_form.fi.yml +26 -0
- data/config/locales/simple_form.ja.yml +26 -0
- data/config/routes.rb +33 -0
- data/db/globalize_seed_data.sql +76 -0
- data/db/migrate/20121023202117_add_globalize_countries.rb +49 -0
- data/db/migrate/20121028125329_devise_create_users.rb +45 -0
- data/db/migrate/20121028125831_add_user_fields.rb +13 -0
- data/db/migrate/20121028153317_rolify_create_roles.rb +19 -0
- data/db/migrate/20121105205634_add_last_access.rb +9 -0
- data/db/migrate/20121110213512_create_versions.rb +18 -0
- data/db/migrate/20121110213513_add_object_changes_column_to_versions.rb +11 -0
- data/db/migrate/20130206121535_create_dm_core_accounts.rb +12 -0
- data/db/migrate/20130206223323_add_account_to_users.rb +8 -0
- data/db/migrate/20130207170247_create_preferences.rb +12 -0
- data/db/migrate/20130321144726_create_comments.rb +21 -0
- data/db/migrate/20130402203739_add_activity.rb +20 -0
- data/db/migrate/20130415095617_add_type_to_comments.rb +8 -0
- data/db/migrate/20130429191051_add_category.rb +27 -0
- data/db/migrate/20130513112751_create_email_table.rb +25 -0
- data/db/migrate/20130516143539_add_user_profile.rb +45 -0
- data/db/migrate/20130518155712_add_profile_email.rb +13 -0
- data/db/migrate/20130620145610_create_payment_history.rb +36 -0
- data/db/migrate/20130625091108_change_anchor_field.rb +9 -0
- data/db/migrate/20130628112848_create_user_site_profile.rb +26 -0
- data/db/migrate/20130708150236_add_avatar.rb +11 -0
- data/db/migrate/20130914132041_add_notify_to_payment_history.rb +7 -0
- data/db/migrate/20140105133446_acts_as_votable_migration.rb +27 -0
- data/db/migrate/20140107112418_add_user_site_profile_uuid.rb +18 -0
- data/db/migrate/20140129110547_add_invoice_id.rb +6 -0
- data/db/migrate/20140201092656_acts_as_follower_migration.rb +17 -0
- data/db/migrate/20140203131320_rename_invoice_id.rb +11 -0
- data/db/migrate/20140210195143_add_core_addresses.rb +17 -0
- data/db/migrate/20140411190454_papertrail_increase_column.rb +8 -0
- data/db/migrate/20140501160009_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +31 -0
- data/db/migrate/20140501160010_add_missing_unique_indices.acts_as_taggable_on_engine.rb +22 -0
- data/db/migrate/20140501160011_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
- data/db/migrate/20140529164730_create_custom_fields.rb +39 -0
- data/db/migrate/20140709145503_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
- data/db/migrate/20141216094639_add_favored_locale.rb +18 -0
- data/db/migrate/20160128094739_update_papertrail_v4.rb +73 -0
- data/db/migrate/20160630095745_create_delayed_jobs.rb +22 -0
- data/db/migrate/20160821150111_index_foreign_keys_in_core_accounts.rb +5 -0
- data/db/migrate/20160821150113_index_foreign_keys_in_core_addresses.rb +5 -0
- data/db/migrate/20160821150114_index_foreign_keys_in_core_categories.rb +5 -0
- data/db/migrate/20160821150115_index_foreign_keys_in_core_comments.rb +5 -0
- data/db/migrate/20160821150116_index_foreign_keys_in_core_custom_fields.rb +5 -0
- data/db/migrate/20160821150117_index_foreign_keys_in_core_payment_histories.rb +7 -0
- data/db/migrate/20160821150118_index_foreign_keys_in_core_system_email_translations.rb +5 -0
- data/db/migrate/20160821150119_index_foreign_keys_in_core_system_emails.rb +6 -0
- data/db/migrate/20160821150128_index_foreign_keys_in_preferences.rb +5 -0
- data/db/migrate/20160821150129_index_foreign_keys_in_roles.rb +5 -0
- data/db/migrate/20160821150130_index_foreign_keys_in_taggings.rb +5 -0
- data/db/migrate/20160821150131_index_foreign_keys_in_user_profiles.rb +7 -0
- data/db/migrate/20160821150132_index_foreign_keys_in_user_site_profiles.rb +6 -0
- data/db/migrate/20160821150133_index_foreign_keys_in_users_roles.rb +5 -0
- data/db/migrate/20160821150134_index_foreign_keys_in_version_associations.rb +5 -0
- data/db/migrate/20160821150135_index_foreign_keys_in_versions.rb +5 -0
- data/db/seeds.rb +433 -0
- data/db/seeds/globalize_countries.rb +239 -0
- data/db/seeds/globalize_languages.rb +186 -0
- data/lib/dm_core.rb +38 -0
- data/lib/dm_core/csv_exporter.rb +210 -0
- data/lib/dm_core/csv_importer.rb +16 -0
- data/lib/dm_core/engine.rb +51 -0
- data/lib/dm_core/liquid_extensions.rb +125 -0
- data/lib/dm_core/nls.rb +31 -0
- data/lib/dm_core/scio_excel.rb +501 -0
- data/lib/dm_core/state_select.rb +135 -0
- data/lib/dm_core/version.rb +3 -0
- data/lib/tasks/dm_core_tasks.rake +60 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ability.rb +10 -0
- data/spec/dummy/app/models/user.rb +6 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +27 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +11 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +399 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +374 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/accounts.rb +9 -0
- data/spec/factories/user_profiles.rb +10 -0
- data/spec/factories/users.rb +19 -0
- data/spec/helpers/account_helper_spec.rb +50 -0
- data/spec/models/account_spec.rb +20 -0
- data/spec/models/user_spec.rb +99 -0
- data/spec/rails_helper.rb +70 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/accounts.rb +19 -0
- data/spec/support/devise.rb +44 -0
- data/spec/support/fix_locale.rb +57 -0
- metadata +1124 -0
@@ -0,0 +1,88 @@
|
|
1
|
+
# FriendlyId Global Configuration
|
2
|
+
#
|
3
|
+
# Use this to set up shared configuration options for your entire application.
|
4
|
+
# Any of the configuration options shown here can also be applied to single
|
5
|
+
# models by passing arguments to the `friendly_id` class method or defining
|
6
|
+
# methods in your model.
|
7
|
+
#
|
8
|
+
# To learn more, check out the guide:
|
9
|
+
#
|
10
|
+
# http://norman.github.io/friendly_id/file.Guide.html
|
11
|
+
|
12
|
+
FriendlyId.defaults do |config|
|
13
|
+
# ## Reserved Words
|
14
|
+
#
|
15
|
+
# Some words could conflict with Rails's routes when used as slugs, or are
|
16
|
+
# undesirable to allow as slugs. Edit this list as needed for your app.
|
17
|
+
config.use :reserved
|
18
|
+
|
19
|
+
config.reserved_words = %w(new edit session login logout users admin
|
20
|
+
stylesheets assets javascripts images)
|
21
|
+
|
22
|
+
# ## Friendly Finders
|
23
|
+
#
|
24
|
+
# Uncomment this to use friendly finders in all models. By default, if
|
25
|
+
# you wish to find a record by its friendly id, you must do:
|
26
|
+
#
|
27
|
+
# MyModel.friendly.find('foo')
|
28
|
+
#
|
29
|
+
# If you uncomment this, you can do:
|
30
|
+
#
|
31
|
+
# MyModel.find('foo')
|
32
|
+
#
|
33
|
+
# This is significantly more convenient but may not be appropriate for
|
34
|
+
# all applications, so you must explicity opt-in to this behavior. You can
|
35
|
+
# always also configure it on a per-model basis if you prefer.
|
36
|
+
#
|
37
|
+
# Something else to consider is that using the :finders addon boosts
|
38
|
+
# performance because it will avoid Rails-internal code that makes runtime
|
39
|
+
# calls to `Module.extend`.
|
40
|
+
#
|
41
|
+
# config.use :finders
|
42
|
+
#
|
43
|
+
# ## Slugs
|
44
|
+
#
|
45
|
+
# Most applications will use the :slugged module everywhere. If you wish
|
46
|
+
# to do so, uncomment the following line.
|
47
|
+
#
|
48
|
+
# config.use :slugged
|
49
|
+
#
|
50
|
+
# By default, FriendlyId's :slugged addon expects the slug column to be named
|
51
|
+
# 'slug', but you can change it if you wish.
|
52
|
+
#
|
53
|
+
# config.slug_column = 'slug'
|
54
|
+
#
|
55
|
+
# When FriendlyId can not generate a unique ID from your base method, it appends
|
56
|
+
# a UUID, separated by a single dash. You can configure the character used as the
|
57
|
+
# separator. If you're upgrading from FriendlyId 4, you may wish to replace this
|
58
|
+
# with two dashes.
|
59
|
+
#
|
60
|
+
# config.sequence_separator = '-'
|
61
|
+
#
|
62
|
+
# ## Tips and Tricks
|
63
|
+
#
|
64
|
+
# ### Controlling when slugs are generated
|
65
|
+
#
|
66
|
+
# As of FriendlyId 5.0, new slugs are generated only when the slug field is
|
67
|
+
# nil, but if you're using a column as your base method can change this
|
68
|
+
# behavior by overriding the `should_generate_new_friendly_id` method that
|
69
|
+
# FriendlyId adds to your model. The change below makes FriendlyId 5.0 behave
|
70
|
+
# more like 4.0.
|
71
|
+
#
|
72
|
+
# config.use Module.new {
|
73
|
+
# def should_generate_new_friendly_id?
|
74
|
+
# slug.blank? || <your_column_name_here>_changed?
|
75
|
+
# end
|
76
|
+
# }
|
77
|
+
#
|
78
|
+
# FriendlyId uses Rails's `parameterize` method to generate slugs, but for
|
79
|
+
# languages that don't use the Roman alphabet, that's not usually suffient. Here
|
80
|
+
# we use the Babosa library to transliterate Russian Cyrillic slugs to ASCII. If
|
81
|
+
# you use this, don't forget to add "babosa" to your Gemfile.
|
82
|
+
#
|
83
|
+
# config.use Module.new {
|
84
|
+
# def normalize_friendly_id(text)
|
85
|
+
# text.to_slug.normalize! :transliterations => [:russian, :latin]
|
86
|
+
# end
|
87
|
+
# }
|
88
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# Pulled from the EasyGlobalize3Accessors gem. It's very simple, and pulling
|
2
|
+
# here removes a dependency on a forked gem version:
|
3
|
+
# git://github.com/digitalmoksha/easy_globalize3_accessors.git
|
4
|
+
#
|
5
|
+
#------------------------------------------------------------------------------
|
6
|
+
# Definition like this:
|
7
|
+
#
|
8
|
+
# class Product
|
9
|
+
# translates :title, :description
|
10
|
+
# globalize_accessors :locales => [:en, :pl], :attributes => [:title]
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# Gives you access to methods: title_pl, title_en, title_pl=, title_en= (and similar
|
14
|
+
# set of description_* methods). And they work seamlessly with Globalize3
|
15
|
+
# (not even touching the "core" title, title= methods used by Globalize3 itself).
|
16
|
+
#
|
17
|
+
# :locales and :attributes are optional. Default values are:
|
18
|
+
# :locales => I18n.available_locales
|
19
|
+
# :attributes => translated_attribute_names
|
20
|
+
#
|
21
|
+
# which means that skipping all options will generate you accessor method for all
|
22
|
+
# translated fields and available languages
|
23
|
+
#------------------------------------------------------------------------------
|
24
|
+
module EasyGlobalizeAccessors
|
25
|
+
|
26
|
+
#------------------------------------------------------------------------------
|
27
|
+
def globalize_accessors(options = {})
|
28
|
+
options.reverse_merge!(:locales => I18n.available_locales, :attributes => translated_attribute_names)
|
29
|
+
each_attribute_and_locale(options) do |attr_name, locale|
|
30
|
+
define_accessors(attr_name, locale)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
#------------------------------------------------------------------------------
|
37
|
+
def define_accessors(attr_name, locale)
|
38
|
+
define_getter(attr_name, locale)
|
39
|
+
define_setter(attr_name, locale)
|
40
|
+
end
|
41
|
+
|
42
|
+
#------------------------------------------------------------------------------
|
43
|
+
def define_getter(attr_name, locale)
|
44
|
+
define_method :"#{attr_name}_#{locale}" do
|
45
|
+
read_attribute(attr_name, :locale => locale)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
#------------------------------------------------------------------------------
|
50
|
+
def define_setter(attr_name, locale)
|
51
|
+
define_method :"#{attr_name}_#{locale}=" do |value|
|
52
|
+
write_attribute(attr_name, value, :locale => locale)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
#------------------------------------------------------------------------------
|
57
|
+
def each_attribute_and_locale(options)
|
58
|
+
options[:attributes].each do |attr_name|
|
59
|
+
options[:locales].each do |locale|
|
60
|
+
yield attr_name, locale
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
ActiveRecord::Base.extend EasyGlobalizeAccessors
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# [todo] Now with PaperTrail 4, not sure if this fix is needed.
|
2
|
+
# Also, v4 recommends not using an initializer to modify PaperTrail (see changelog)
|
3
|
+
# Removed for now
|
4
|
+
|
5
|
+
# This fixes an issue where changing a translated field *and* a non-translated
|
6
|
+
# field at the same time caused the translated field in other locales to be
|
7
|
+
# replaced with the data of the changed translated field (it's previous data).
|
8
|
+
# Fix was outlined here: https://github.com/globalize/globalize/issues/117
|
9
|
+
# This has not been fixed as of the 3.0-stable release on Oct 24, 2013
|
10
|
+
#------------------------------------------------------------------------------
|
11
|
+
# module PaperTrail
|
12
|
+
# module Model
|
13
|
+
# module InstanceMethods
|
14
|
+
# def initialize_copy(source)
|
15
|
+
# obj = super
|
16
|
+
# obj.tap { |o| o.send(:remove_instance_variable, :@globalize) } rescue obj
|
17
|
+
# end
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
# end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# [todo] is this patch still needed?
|
2
|
+
#
|
3
|
+
# This monkey patch fixes an issue where the "relfections" method was not defined.
|
4
|
+
# Globalize 4.0.2 fixes this, but at this moment, there is another bug in 4.0.2
|
5
|
+
# that requires me to use 4.0.1 instead. Once the bug in 4.0.2 is fixed,
|
6
|
+
# then we should be able to remove this patch. Test by making sure
|
7
|
+
# a CmsPage with translations can be saved...
|
8
|
+
# https://github.com/globalize/globalize/issues/357
|
9
|
+
# [todo]
|
10
|
+
#------------------------------------------------------------------------------
|
11
|
+
# module Globalize
|
12
|
+
# module ActiveRecord
|
13
|
+
# class Adapter
|
14
|
+
# protected
|
15
|
+
#
|
16
|
+
# def ensure_foreign_key_for(translation)
|
17
|
+
# # Sometimes the translation is initialised before a foreign key can be set.
|
18
|
+
# translation[translation.class.reflections[:globalized_model].foreign_key] = record.id
|
19
|
+
# end
|
20
|
+
# end
|
21
|
+
# end
|
22
|
+
# end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Rolify.configure do |config|
|
2
|
+
# By default ORM adapter is ActiveRecord. uncomment to use mongoid
|
3
|
+
# config.use_mongoid
|
4
|
+
|
5
|
+
# Dynamic shortcuts for User class (user.is_admin? like methods). Default is: false
|
6
|
+
# Enable this feature _after_ running rake db:migrate as it relies on the roles table
|
7
|
+
# config.use_dynamic_shortcuts
|
8
|
+
end
|
@@ -0,0 +1,161 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, class: :input,
|
9
|
+
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
10
|
+
## Extensions enabled by default
|
11
|
+
# Any of these extensions can be disabled for a
|
12
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
+
# You can make any of these extensions optional by
|
14
|
+
# renaming `b.use` to `b.optional`.
|
15
|
+
|
16
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
+
# and required attributes
|
18
|
+
b.use :html5
|
19
|
+
|
20
|
+
# Calculates placeholders automatically from I18n
|
21
|
+
# You can also pass a string as f.input placeholder: "Placeholder"
|
22
|
+
b.use :placeholder
|
23
|
+
|
24
|
+
## Optional extensions
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
|
26
|
+
# to the input. If so, they will retrieve the values from the model
|
27
|
+
# if any exists. If you want to enable the lookup for any of those
|
28
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
29
|
+
|
30
|
+
# Calculates maxlength from length validations for string inputs
|
31
|
+
b.optional :maxlength
|
32
|
+
|
33
|
+
# Calculates pattern from format validations for string inputs
|
34
|
+
b.optional :pattern
|
35
|
+
|
36
|
+
# Calculates min and max from length validations for numeric inputs
|
37
|
+
b.optional :min_max
|
38
|
+
|
39
|
+
# Calculates readonly automatically from readonly attributes
|
40
|
+
b.optional :readonly
|
41
|
+
|
42
|
+
## Inputs
|
43
|
+
b.use :label_input
|
44
|
+
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
45
|
+
b.use :error, wrap_with: { tag: :span, class: :error }
|
46
|
+
|
47
|
+
## full_messages_for
|
48
|
+
# If you want to display the full error message for the attribute, you can
|
49
|
+
# use the component :full_error, like:
|
50
|
+
#
|
51
|
+
# b.use :full_error, wrap_with: { tag: :span, class: :error }
|
52
|
+
end
|
53
|
+
|
54
|
+
# The default wrapper to be used by the FormBuilder.
|
55
|
+
config.default_wrapper = :default
|
56
|
+
|
57
|
+
# Define the way to render check boxes / radio buttons with labels.
|
58
|
+
# Defaults to :nested for bootstrap config.
|
59
|
+
# inline: input + label
|
60
|
+
# nested: label > input
|
61
|
+
config.boolean_style = :nested
|
62
|
+
|
63
|
+
# Default class for buttons
|
64
|
+
config.button_class = 'btn'
|
65
|
+
|
66
|
+
# Method used to tidy up errors. Specify any Rails Array method.
|
67
|
+
# :first lists the first message for each field.
|
68
|
+
# Use :to_sentence to list all errors for each field.
|
69
|
+
# config.error_method = :first
|
70
|
+
|
71
|
+
# Default tag used for error notification helper.
|
72
|
+
config.error_notification_tag = :div
|
73
|
+
|
74
|
+
# CSS class to add for error notification helper.
|
75
|
+
config.error_notification_class = 'alert alert-danger block-inner'
|
76
|
+
|
77
|
+
# ID to add for error notification helper.
|
78
|
+
# config.error_notification_id = nil
|
79
|
+
|
80
|
+
# Series of attempts to detect a default label method for collection.
|
81
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
82
|
+
|
83
|
+
# Series of attempts to detect a default value method for collection.
|
84
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
85
|
+
|
86
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
87
|
+
# config.collection_wrapper_tag = nil
|
88
|
+
|
89
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
90
|
+
# config.collection_wrapper_class = nil
|
91
|
+
|
92
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
93
|
+
# defaulting to :span. Please note that when using :boolean_style = :nested,
|
94
|
+
# SimpleForm will force this option to be a label.
|
95
|
+
# config.item_wrapper_tag = :span
|
96
|
+
|
97
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
98
|
+
# config.item_wrapper_class = nil
|
99
|
+
|
100
|
+
# How the label text should be generated altogether with the required text.
|
101
|
+
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
|
102
|
+
|
103
|
+
# You can define the class to use on all labels. Default is nil.
|
104
|
+
# config.label_class = nil
|
105
|
+
|
106
|
+
# You can define the class to use on all forms. Default is simple_form.
|
107
|
+
# config.form_class = :simple_form
|
108
|
+
|
109
|
+
# You can define which elements should obtain additional classes
|
110
|
+
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
111
|
+
|
112
|
+
# Whether attributes are required by default (or not). Default is true.
|
113
|
+
# config.required_by_default = true
|
114
|
+
|
115
|
+
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
116
|
+
# These validations are enabled in SimpleForm's internal config but disabled by default
|
117
|
+
# in this configuration, which is recommended due to some quirks from different browsers.
|
118
|
+
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
119
|
+
# change this configuration to true.
|
120
|
+
config.browser_validations = false
|
121
|
+
|
122
|
+
# Collection of methods to detect if a file type was given.
|
123
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
124
|
+
|
125
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
126
|
+
# to match as key, and the input type that will be used when the field name
|
127
|
+
# matches the regexp as value.
|
128
|
+
# config.input_mappings = { /count/ => :integer }
|
129
|
+
|
130
|
+
# Custom wrappers for input types. This should be a hash containing an input
|
131
|
+
# type as key and the wrapper that will be used for all inputs with specified type.
|
132
|
+
# config.wrapper_mappings = { string: :prepend }
|
133
|
+
|
134
|
+
# Default priority for time_zone inputs.
|
135
|
+
# config.time_zone_priority = nil
|
136
|
+
|
137
|
+
# Default priority for country inputs.
|
138
|
+
# config.country_priority = nil
|
139
|
+
|
140
|
+
# When false, do not use translations for labels.
|
141
|
+
# config.translate_labels = true
|
142
|
+
|
143
|
+
# Automatically discover new inputs in Rails' autoload path.
|
144
|
+
# config.inputs_discovery = true
|
145
|
+
|
146
|
+
# Cache SimpleForm inputs discovery
|
147
|
+
# config.cache_discovery = !Rails.env.development?
|
148
|
+
|
149
|
+
# Default class for inputs
|
150
|
+
# config.input_class = nil
|
151
|
+
|
152
|
+
# Define the default class of the input wrapper of the boolean input.
|
153
|
+
config.boolean_label_class = 'checkbox'
|
154
|
+
|
155
|
+
# Defines if the default input wrapper class should be included in radio
|
156
|
+
# collection wrappers.
|
157
|
+
# config.include_default_input_wrapper_class = true
|
158
|
+
|
159
|
+
# Defines which i18n scope will be used in Simple Form.
|
160
|
+
# config.i18n_scope = 'simple_form'
|
161
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# # Use this setup block to configure all options available in SimpleForm.
|
2
|
+
# SimpleForm.setup do |config|
|
3
|
+
# config.wrappers :toggle, :tag => 'div', :class => "form-horizontal control-group", :error_class => 'error' do |b|
|
4
|
+
# b.use :html5
|
5
|
+
# b.use :placeholder
|
6
|
+
# b.use :label
|
7
|
+
# b.wrapper :tag => 'div', :class => 'controls on_off' do |ba|
|
8
|
+
# ba.use :input, :wrap_with => { :tag => 'div', :class => 'checkbox inline' }
|
9
|
+
# ba.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
|
10
|
+
# ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
|
11
|
+
# end
|
12
|
+
# # b.wrapper :tag => 'div', :class => 'controls on_off' do |input|
|
13
|
+
# # input.wrapper :tag => 'div', :class => 'checkbox inline' do |append|
|
14
|
+
# # append.use :input
|
15
|
+
# # end
|
16
|
+
# # input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
|
17
|
+
# # input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
|
18
|
+
# # end
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
# config.wrappers :vertical, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
|
22
|
+
# b.use :html5
|
23
|
+
# b.use :placeholder
|
24
|
+
# b.use :label
|
25
|
+
# b.wrapper :tag => 'div', :class => 'controls' do |ba|
|
26
|
+
# ba.use :input
|
27
|
+
# ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
|
28
|
+
# ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
|
29
|
+
# end
|
30
|
+
# end
|
31
|
+
# end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# Configured for use with Bootstrap 2
|
2
|
+
#------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
SimpleForm.setup do |config|
|
5
|
+
config.wrappers :bs2_horizontal_form, tag: 'div', class: 'form-horizontal control-group', error_class: 'error' do |b|
|
6
|
+
b.use :html5
|
7
|
+
b.use :placeholder
|
8
|
+
b.use :label, class: 'control-label'
|
9
|
+
b.wrapper tag: 'div', class: 'controls' do |ba|
|
10
|
+
ba.use :input
|
11
|
+
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
|
12
|
+
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
#--- same as ::bs2_horizontal_form wrapper, but here for backward compatability
|
17
|
+
config.wrappers :bootstrap2, tag: 'div', class: 'form-horizontal control-group', error_class: 'error' do |b|
|
18
|
+
b.use :html5
|
19
|
+
b.use :placeholder
|
20
|
+
b.use :label, class: 'control-label'
|
21
|
+
b.wrapper tag: 'div', class: 'controls' do |ba|
|
22
|
+
ba.use :input
|
23
|
+
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
|
24
|
+
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
config.wrappers :bs2_vertical_form, tag: 'div', error_class: 'error' do |b|
|
29
|
+
b.use :html5
|
30
|
+
b.use :placeholder
|
31
|
+
b.use :label
|
32
|
+
b.wrapper tag: 'div' do |ba|
|
33
|
+
ba.use :input
|
34
|
+
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
|
35
|
+
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
config.wrappers :bs2_prepend, tag: 'div', class: "form-horizontal control-group", error_class: 'error' do |b|
|
40
|
+
b.use :html5
|
41
|
+
b.use :placeholder
|
42
|
+
b.use :label, class: 'control-label'
|
43
|
+
b.wrapper tag: 'div', class: 'controls' do |input|
|
44
|
+
input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
|
45
|
+
prepend.use :input
|
46
|
+
end
|
47
|
+
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
|
48
|
+
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
config.wrappers :bs2_append, tag: 'div', class: "form-horizontal control-group", error_class: 'error' do |b|
|
53
|
+
b.use :html5
|
54
|
+
b.use :placeholder
|
55
|
+
b.use :label, class: 'control-label'
|
56
|
+
b.wrapper tag: 'div', class: 'controls' do |input|
|
57
|
+
input.wrapper tag: 'div', class: 'input-append' do |append|
|
58
|
+
append.use :input
|
59
|
+
end
|
60
|
+
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
|
61
|
+
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
config.wrappers :bs2_prepend_append, tag: 'div', class: "form-horizontal control-group", error_class: 'error' do |b|
|
66
|
+
b.use :html5
|
67
|
+
b.use :placeholder
|
68
|
+
b.use :label, class: 'control-label'
|
69
|
+
b.wrapper tag: 'div', class: 'controls' do |input|
|
70
|
+
input.wrapper tag: 'div', class: 'input-prepend input-append' do |append|
|
71
|
+
append.use :input
|
72
|
+
end
|
73
|
+
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
|
74
|
+
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
config.wrappers :bs2_inline_checkbox, tag: 'div', class: 'form-horizontal control-group', error_class: 'error' do |b|
|
79
|
+
b.use :html5
|
80
|
+
b.use :placeholder
|
81
|
+
b.wrapper tag: 'div', class: 'controls' do |ba|
|
82
|
+
ba.use :label_input, wrap_with: { class: 'checkbox inline' }
|
83
|
+
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
|
84
|
+
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|