effective_bootstrap 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +644 -0
- data/app/assets/images/icons/activity.svg +13 -0
- data/app/assets/images/icons/airplay.svg +14 -0
- data/app/assets/images/icons/alert-circle.svg +15 -0
- data/app/assets/images/icons/alert-octagon.svg +15 -0
- data/app/assets/images/icons/alert-triangle.svg +15 -0
- data/app/assets/images/icons/align-center.svg +16 -0
- data/app/assets/images/icons/align-justify.svg +16 -0
- data/app/assets/images/icons/align-left.svg +16 -0
- data/app/assets/images/icons/align-right.svg +16 -0
- data/app/assets/images/icons/anchor.svg +15 -0
- data/app/assets/images/icons/aperture.svg +19 -0
- data/app/assets/images/icons/arrow-down-circle.svg +15 -0
- data/app/assets/images/icons/arrow-down-left.svg +14 -0
- data/app/assets/images/icons/arrow-down-right.svg +14 -0
- data/app/assets/images/icons/arrow-down.svg +14 -0
- data/app/assets/images/icons/arrow-left-circle.svg +15 -0
- data/app/assets/images/icons/arrow-left.svg +14 -0
- data/app/assets/images/icons/arrow-right-circle.svg +15 -0
- data/app/assets/images/icons/arrow-right.svg +14 -0
- data/app/assets/images/icons/arrow-up-circle.svg +15 -0
- data/app/assets/images/icons/arrow-up-left.svg +14 -0
- data/app/assets/images/icons/arrow-up-right.svg +14 -0
- data/app/assets/images/icons/arrow-up.svg +14 -0
- data/app/assets/images/icons/at-sign.svg +14 -0
- data/app/assets/images/icons/award.svg +14 -0
- data/app/assets/images/icons/bar-chart-2.svg +15 -0
- data/app/assets/images/icons/bar-chart.svg +15 -0
- data/app/assets/images/icons/battery-charging.svg +15 -0
- data/app/assets/images/icons/battery.svg +14 -0
- data/app/assets/images/icons/bell-off.svg +14 -0
- data/app/assets/images/icons/bell.svg +13 -0
- data/app/assets/images/icons/bluetooth.svg +13 -0
- data/app/assets/images/icons/bold.svg +14 -0
- data/app/assets/images/icons/book-open.svg +14 -0
- data/app/assets/images/icons/book.svg +14 -0
- data/app/assets/images/icons/bookmark.svg +13 -0
- data/app/assets/images/icons/box.svg +15 -0
- data/app/assets/images/icons/briefcase.svg +14 -0
- data/app/assets/images/icons/calendar.svg +16 -0
- data/app/assets/images/icons/camera-off.svg +14 -0
- data/app/assets/images/icons/camera.svg +14 -0
- data/app/assets/images/icons/cast.svg +14 -0
- data/app/assets/images/icons/check-circle.svg +14 -0
- data/app/assets/images/icons/check-square.svg +14 -0
- data/app/assets/images/icons/check.svg +13 -0
- data/app/assets/images/icons/chevron-down.svg +13 -0
- data/app/assets/images/icons/chevron-left.svg +13 -0
- data/app/assets/images/icons/chevron-right.svg +13 -0
- data/app/assets/images/icons/chevron-up.svg +13 -0
- data/app/assets/images/icons/chevrons-down.svg +14 -0
- data/app/assets/images/icons/chevrons-left.svg +14 -0
- data/app/assets/images/icons/chevrons-right.svg +14 -0
- data/app/assets/images/icons/chevrons-up.svg +14 -0
- data/app/assets/images/icons/chrome.svg +17 -0
- data/app/assets/images/icons/circle.svg +13 -0
- data/app/assets/images/icons/clipboard.svg +14 -0
- data/app/assets/images/icons/clock.svg +14 -0
- data/app/assets/images/icons/cloud-drizzle.svg +19 -0
- data/app/assets/images/icons/cloud-lightning.svg +14 -0
- data/app/assets/images/icons/cloud-off.svg +14 -0
- data/app/assets/images/icons/cloud-rain.svg +16 -0
- data/app/assets/images/icons/cloud-snow.svg +19 -0
- data/app/assets/images/icons/cloud.svg +13 -0
- data/app/assets/images/icons/code.svg +14 -0
- data/app/assets/images/icons/codepen.svg +17 -0
- data/app/assets/images/icons/command.svg +13 -0
- data/app/assets/images/icons/compass.svg +14 -0
- data/app/assets/images/icons/copy.svg +14 -0
- data/app/assets/images/icons/corner-down-left.svg +14 -0
- data/app/assets/images/icons/corner-down-right.svg +14 -0
- data/app/assets/images/icons/corner-left-down.svg +14 -0
- data/app/assets/images/icons/corner-left-up.svg +14 -0
- data/app/assets/images/icons/corner-right-down.svg +14 -0
- data/app/assets/images/icons/corner-right-up.svg +14 -0
- data/app/assets/images/icons/corner-up-left.svg +14 -0
- data/app/assets/images/icons/corner-up-right.svg +14 -0
- data/app/assets/images/icons/cpu.svg +22 -0
- data/app/assets/images/icons/credit-card.svg +14 -0
- data/app/assets/images/icons/crop.svg +14 -0
- data/app/assets/images/icons/crosshair.svg +17 -0
- data/app/assets/images/icons/database.svg +15 -0
- data/app/assets/images/icons/delete.svg +15 -0
- data/app/assets/images/icons/disc.svg +14 -0
- data/app/assets/images/icons/dollar-sign.svg +14 -0
- data/app/assets/images/icons/download-cloud.svg +15 -0
- data/app/assets/images/icons/download.svg +15 -0
- data/app/assets/images/icons/droplet.svg +13 -0
- data/app/assets/images/icons/edit-2.svg +13 -0
- data/app/assets/images/icons/edit-3.svg +14 -0
- data/app/assets/images/icons/edit.svg +14 -0
- data/app/assets/images/icons/external-link.svg +15 -0
- data/app/assets/images/icons/eye-off.svg +14 -0
- data/app/assets/images/icons/eye.svg +14 -0
- data/app/assets/images/icons/facebook-white.svg +7 -0
- data/app/assets/images/icons/facebook.svg +13 -0
- data/app/assets/images/icons/fast-forward.svg +14 -0
- data/app/assets/images/icons/feather.svg +15 -0
- data/app/assets/images/icons/file-minus.svg +15 -0
- data/app/assets/images/icons/file-plus.svg +16 -0
- data/app/assets/images/icons/file-text.svg +17 -0
- data/app/assets/images/icons/file.svg +14 -0
- data/app/assets/images/icons/film.svg +20 -0
- data/app/assets/images/icons/filter.svg +13 -0
- data/app/assets/images/icons/flag.svg +14 -0
- data/app/assets/images/icons/folder-minus.svg +14 -0
- data/app/assets/images/icons/folder-plus.svg +15 -0
- data/app/assets/images/icons/folder.svg +13 -0
- data/app/assets/images/icons/git-branch.svg +16 -0
- data/app/assets/images/icons/git-commit.svg +15 -0
- data/app/assets/images/icons/git-merge.svg +15 -0
- data/app/assets/images/icons/git-pull-request.svg +16 -0
- data/app/assets/images/icons/github.svg +13 -0
- data/app/assets/images/icons/gitlab.svg +13 -0
- data/app/assets/images/icons/globe.svg +15 -0
- data/app/assets/images/icons/google.svg +2 -0
- data/app/assets/images/icons/grid.svg +16 -0
- data/app/assets/images/icons/hard-drive.svg +16 -0
- data/app/assets/images/icons/hash.svg +16 -0
- data/app/assets/images/icons/headphones.svg +14 -0
- data/app/assets/images/icons/heart.svg +13 -0
- data/app/assets/images/icons/help-circle.svg +15 -0
- data/app/assets/images/icons/home.svg +14 -0
- data/app/assets/images/icons/image.svg +15 -0
- data/app/assets/images/icons/inbox.svg +14 -0
- data/app/assets/images/icons/info.svg +15 -0
- data/app/assets/images/icons/instagram.svg +15 -0
- data/app/assets/images/icons/italic.svg +15 -0
- data/app/assets/images/icons/layers.svg +15 -0
- data/app/assets/images/icons/layout.svg +15 -0
- data/app/assets/images/icons/life-buoy.svg +19 -0
- data/app/assets/images/icons/link-2.svg +14 -0
- data/app/assets/images/icons/link.svg +14 -0
- data/app/assets/images/icons/linkedin.svg +15 -0
- data/app/assets/images/icons/list.svg +18 -0
- data/app/assets/images/icons/loader.svg +20 -0
- data/app/assets/images/icons/lock.svg +14 -0
- data/app/assets/images/icons/log-in.svg +15 -0
- data/app/assets/images/icons/log-out.svg +15 -0
- data/app/assets/images/icons/mail.svg +14 -0
- data/app/assets/images/icons/map-pin.svg +14 -0
- data/app/assets/images/icons/map.svg +15 -0
- data/app/assets/images/icons/maximize-2.svg +16 -0
- data/app/assets/images/icons/maximize.svg +13 -0
- data/app/assets/images/icons/menu.svg +15 -0
- data/app/assets/images/icons/message-circle.svg +13 -0
- data/app/assets/images/icons/message-square.svg +13 -0
- data/app/assets/images/icons/mic-off.svg +17 -0
- data/app/assets/images/icons/mic.svg +16 -0
- data/app/assets/images/icons/minimize-2.svg +16 -0
- data/app/assets/images/icons/minimize.svg +13 -0
- data/app/assets/images/icons/minus-circle.svg +14 -0
- data/app/assets/images/icons/minus-square.svg +14 -0
- data/app/assets/images/icons/minus.svg +13 -0
- data/app/assets/images/icons/monitor.svg +15 -0
- data/app/assets/images/icons/moon.svg +13 -0
- data/app/assets/images/icons/more-horizontal.svg +15 -0
- data/app/assets/images/icons/more-vertical.svg +15 -0
- data/app/assets/images/icons/move.svg +18 -0
- data/app/assets/images/icons/music.svg +14 -0
- data/app/assets/images/icons/navigation-2.svg +13 -0
- data/app/assets/images/icons/navigation.svg +13 -0
- data/app/assets/images/icons/octagon.svg +13 -0
- data/app/assets/images/icons/package.svg +16 -0
- data/app/assets/images/icons/paperclip.svg +13 -0
- data/app/assets/images/icons/pause-circle.svg +15 -0
- data/app/assets/images/icons/pause.svg +14 -0
- data/app/assets/images/icons/percent.svg +15 -0
- data/app/assets/images/icons/phone-call.svg +13 -0
- data/app/assets/images/icons/phone-forwarded.svg +15 -0
- data/app/assets/images/icons/phone-incoming.svg +15 -0
- data/app/assets/images/icons/phone-missed.svg +15 -0
- data/app/assets/images/icons/phone-off.svg +14 -0
- data/app/assets/images/icons/phone-outgoing.svg +15 -0
- data/app/assets/images/icons/phone.svg +13 -0
- data/app/assets/images/icons/pie-chart.svg +14 -0
- data/app/assets/images/icons/play-circle.svg +14 -0
- data/app/assets/images/icons/play.svg +13 -0
- data/app/assets/images/icons/plus-circle.svg +15 -0
- data/app/assets/images/icons/plus-square.svg +15 -0
- data/app/assets/images/icons/plus.svg +14 -0
- data/app/assets/images/icons/pocket.svg +14 -0
- data/app/assets/images/icons/power.svg +14 -0
- data/app/assets/images/icons/printer.svg +15 -0
- data/app/assets/images/icons/radio.svg +14 -0
- data/app/assets/images/icons/refresh-ccw.svg +15 -0
- data/app/assets/images/icons/refresh-cw.svg +15 -0
- data/app/assets/images/icons/repeat.svg +16 -0
- data/app/assets/images/icons/rewind.svg +14 -0
- data/app/assets/images/icons/rotate-ccw.svg +14 -0
- data/app/assets/images/icons/rotate-cw.svg +14 -0
- data/app/assets/images/icons/rss.svg +15 -0
- data/app/assets/images/icons/save.svg +15 -0
- data/app/assets/images/icons/scissors.svg +17 -0
- data/app/assets/images/icons/search.svg +14 -0
- data/app/assets/images/icons/send.svg +14 -0
- data/app/assets/images/icons/server.svg +16 -0
- data/app/assets/images/icons/settings.svg +14 -0
- data/app/assets/images/icons/share-2.svg +17 -0
- data/app/assets/images/icons/share.svg +15 -0
- data/app/assets/images/icons/shield-off.svg +15 -0
- data/app/assets/images/icons/shield.svg +13 -0
- data/app/assets/images/icons/shopping-bag.svg +15 -0
- data/app/assets/images/icons/shopping-cart.svg +15 -0
- data/app/assets/images/icons/shuffle.svg +17 -0
- data/app/assets/images/icons/sidebar.svg +14 -0
- data/app/assets/images/icons/skip-back.svg +14 -0
- data/app/assets/images/icons/skip-forward.svg +14 -0
- data/app/assets/images/icons/slack.svg +17 -0
- data/app/assets/images/icons/slash.svg +14 -0
- data/app/assets/images/icons/sliders.svg +21 -0
- data/app/assets/images/icons/smartphone.svg +14 -0
- data/app/assets/images/icons/speaker.svg +15 -0
- data/app/assets/images/icons/spinner.svg +1 -0
- data/app/assets/images/icons/square.svg +13 -0
- data/app/assets/images/icons/star.svg +13 -0
- data/app/assets/images/icons/stop-circle.svg +14 -0
- data/app/assets/images/icons/sun.svg +21 -0
- data/app/assets/images/icons/sunrise.svg +20 -0
- data/app/assets/images/icons/sunset.svg +20 -0
- data/app/assets/images/icons/tablet.svg +22 -0
- data/app/assets/images/icons/tag.svg +14 -0
- data/app/assets/images/icons/target.svg +15 -0
- data/app/assets/images/icons/terminal.svg +14 -0
- data/app/assets/images/icons/thermometer.svg +13 -0
- data/app/assets/images/icons/thumbs-down.svg +13 -0
- data/app/assets/images/icons/thumbs-up.svg +13 -0
- data/app/assets/images/icons/toggle-left.svg +14 -0
- data/app/assets/images/icons/toggle-right.svg +14 -0
- data/app/assets/images/icons/trash-2.svg +16 -0
- data/app/assets/images/icons/trash.svg +14 -0
- data/app/assets/images/icons/trending-down.svg +14 -0
- data/app/assets/images/icons/trending-up.svg +14 -0
- data/app/assets/images/icons/triangle.svg +13 -0
- data/app/assets/images/icons/truck.svg +16 -0
- data/app/assets/images/icons/tv.svg +14 -0
- data/app/assets/images/icons/twitter.svg +13 -0
- data/app/assets/images/icons/type.svg +15 -0
- data/app/assets/images/icons/umbrella.svg +13 -0
- data/app/assets/images/icons/underline.svg +14 -0
- data/app/assets/images/icons/unlock.svg +14 -0
- data/app/assets/images/icons/upload-cloud.svg +16 -0
- data/app/assets/images/icons/upload.svg +15 -0
- data/app/assets/images/icons/user-check.svg +15 -0
- data/app/assets/images/icons/user-minus.svg +15 -0
- data/app/assets/images/icons/user-plus.svg +16 -0
- data/app/assets/images/icons/user-x.svg +16 -0
- data/app/assets/images/icons/user.svg +14 -0
- data/app/assets/images/icons/users.svg +16 -0
- data/app/assets/images/icons/video-off.svg +14 -0
- data/app/assets/images/icons/video.svg +14 -0
- data/app/assets/images/icons/voicemail.svg +15 -0
- data/app/assets/images/icons/volume-1.svg +14 -0
- data/app/assets/images/icons/volume-2.svg +14 -0
- data/app/assets/images/icons/volume-x.svg +15 -0
- data/app/assets/images/icons/volume.svg +13 -0
- data/app/assets/images/icons/watch.svg +15 -0
- data/app/assets/images/icons/wifi-off.svg +19 -0
- data/app/assets/images/icons/wifi.svg +16 -0
- data/app/assets/images/icons/wind.svg +13 -0
- data/app/assets/images/icons/x-circle.svg +15 -0
- data/app/assets/images/icons/x-square.svg +15 -0
- data/app/assets/images/icons/x.svg +14 -0
- data/app/assets/images/icons/zap-off.svg +16 -0
- data/app/assets/images/icons/zap.svg +13 -0
- data/app/assets/images/icons/zoom-in.svg +16 -0
- data/app/assets/images/icons/zoom-out.svg +15 -0
- data/app/assets/javascripts/effective_bootstrap.js +25 -0
- data/app/assets/javascripts/effective_bootstrap/base.js.coffee +22 -0
- data/app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb +23 -0
- data/app/assets/javascripts/effective_bootstrap/form.js.coffee +182 -0
- data/app/assets/javascripts/effective_bootstrap/logic.js.coffee +64 -0
- data/app/assets/javascripts/effective_bootstrap/other.js.coffee +4 -0
- data/app/assets/javascripts/effective_bootstrap/tabs.js +14 -0
- data/app/assets/javascripts/effective_checks/initialize.js.coffee +7 -0
- data/app/assets/javascripts/effective_checks/input.js +1 -0
- data/app/assets/javascripts/effective_ck_editor/initialize.js.coffee +72 -0
- data/app/assets/javascripts/effective_ck_editor/input.js +1 -0
- data/app/assets/javascripts/effective_clear/initialize.js.coffee +3 -0
- data/app/assets/javascripts/effective_clear/input.js +1 -0
- data/app/assets/javascripts/effective_date/initialize.js.coffee +7 -0
- data/app/assets/javascripts/effective_date/input.js +5 -0
- data/app/assets/javascripts/effective_datetime/bootstrap-datetimepicker.js +2636 -0
- data/app/assets/javascripts/effective_datetime/initialize.js.coffee +7 -0
- data/app/assets/javascripts/effective_datetime/input.js +5 -0
- data/app/assets/javascripts/effective_datetime/overrides.js.coffee +45 -0
- data/app/assets/javascripts/effective_datetime/turbolinks.js.coffee +5 -0
- data/app/assets/javascripts/effective_editor/image-drop-and-paste.js +3 -0
- data/app/assets/javascripts/effective_editor/image-resize.js +2 -0
- data/app/assets/javascripts/effective_editor/initialize.js.coffee +138 -0
- data/app/assets/javascripts/effective_editor/input.js +4 -0
- data/app/assets/javascripts/effective_editor/quill.js +11496 -0
- data/app/assets/javascripts/effective_file/initialize.js.coffee +19 -0
- data/app/assets/javascripts/effective_file/input.js +1 -0
- data/app/assets/javascripts/effective_integer/initialize.js.coffee +6 -0
- data/app/assets/javascripts/effective_integer/input.js +1 -0
- data/app/assets/javascripts/effective_number_text/initialize.js.coffee +6 -0
- data/app/assets/javascripts/effective_number_text/input.js +1 -0
- data/app/assets/javascripts/effective_percent/initialize.js.coffee +39 -0
- data/app/assets/javascripts/effective_percent/input.js +1 -0
- data/app/assets/javascripts/effective_phone/initialize.js.coffee +4 -0
- data/app/assets/javascripts/effective_phone/input.js +2 -0
- data/app/assets/javascripts/effective_phone/jquery.maskedInput.js +182 -0
- data/app/assets/javascripts/effective_price/initialize.js.coffee +43 -0
- data/app/assets/javascripts/effective_price/input.js +1 -0
- data/app/assets/javascripts/effective_radio/initialize.js.coffee +36 -0
- data/app/assets/javascripts/effective_radio/input.js +1 -0
- data/app/assets/javascripts/effective_select/initialize.js.coffee +56 -0
- data/app/assets/javascripts/effective_select/input.js +3 -0
- data/app/assets/javascripts/effective_select/overrides.js.coffee +60 -0
- data/app/assets/javascripts/effective_select/select2.js +5747 -0
- data/app/assets/javascripts/effective_select_or_text/initialize.js +30 -0
- data/app/assets/javascripts/effective_select_or_text/input.js +1 -0
- data/app/assets/javascripts/effective_time/initialize.js.coffee +7 -0
- data/app/assets/javascripts/effective_time/input.js +5 -0
- data/app/assets/javascripts/effective_time_zone_select/initialize.js.coffee +13 -0
- data/app/assets/javascripts/effective_time_zone_select/input.js +1 -0
- data/app/assets/javascripts/moment/locale/af.js +72 -0
- data/app/assets/javascripts/moment/locale/ar-dz.js +58 -0
- data/app/assets/javascripts/moment/locale/ar-kw.js +58 -0
- data/app/assets/javascripts/moment/locale/ar-ly.js +121 -0
- data/app/assets/javascripts/moment/locale/ar-ma.js +58 -0
- data/app/assets/javascripts/moment/locale/ar-sa.js +103 -0
- data/app/assets/javascripts/moment/locale/ar-tn.js +58 -0
- data/app/assets/javascripts/moment/locale/ar.js +134 -0
- data/app/assets/javascripts/moment/locale/az.js +104 -0
- data/app/assets/javascripts/moment/locale/be.js +131 -0
- data/app/assets/javascripts/moment/locale/bg.js +89 -0
- data/app/assets/javascripts/moment/locale/bm.js +57 -0
- data/app/assets/javascripts/moment/locale/bn.js +118 -0
- data/app/assets/javascripts/moment/locale/bo.js +118 -0
- data/app/assets/javascripts/moment/locale/br.js +107 -0
- data/app/assets/javascripts/moment/locale/bs.js +150 -0
- data/app/assets/javascripts/moment/locale/ca.js +87 -0
- data/app/assets/javascripts/moment/locale/cs.js +171 -0
- data/app/assets/javascripts/moment/locale/cv.js +62 -0
- data/app/assets/javascripts/moment/locale/cy.js +79 -0
- data/app/assets/javascripts/moment/locale/da.js +59 -0
- data/app/assets/javascripts/moment/locale/de-at.js +75 -0
- data/app/assets/javascripts/moment/locale/de-ch.js +75 -0
- data/app/assets/javascripts/moment/locale/de.js +75 -0
- data/app/assets/javascripts/moment/locale/dv.js +98 -0
- data/app/assets/javascripts/moment/locale/el.js +99 -0
- data/app/assets/javascripts/moment/locale/en-SG.js +66 -0
- data/app/assets/javascripts/moment/locale/en-au.js +66 -0
- data/app/assets/javascripts/moment/locale/en-ca.js +62 -0
- data/app/assets/javascripts/moment/locale/en-gb.js +66 -0
- data/app/assets/javascripts/moment/locale/en-ie.js +66 -0
- data/app/assets/javascripts/moment/locale/en-il.js +61 -0
- data/app/assets/javascripts/moment/locale/en-nz.js +66 -0
- data/app/assets/javascripts/moment/locale/eo.js +70 -0
- data/app/assets/javascripts/moment/locale/es-do.js +91 -0
- data/app/assets/javascripts/moment/locale/es-us.js +91 -0
- data/app/assets/javascripts/moment/locale/es.js +91 -0
- data/app/assets/javascripts/moment/locale/et.js +79 -0
- data/app/assets/javascripts/moment/locale/eu.js +65 -0
- data/app/assets/javascripts/moment/locale/fa.js +105 -0
- data/app/assets/javascripts/moment/locale/fi.js +108 -0
- data/app/assets/javascripts/moment/locale/fo.js +59 -0
- data/app/assets/javascripts/moment/locale/fr-ca.js +73 -0
- data/app/assets/javascripts/moment/locale/fr-ch.js +77 -0
- data/app/assets/javascripts/moment/locale/fr.js +82 -0
- data/app/assets/javascripts/moment/locale/fy.js +74 -0
- data/app/assets/javascripts/moment/locale/ga.js +76 -0
- data/app/assets/javascripts/moment/locale/gd.js +75 -0
- data/app/assets/javascripts/moment/locale/gl.js +76 -0
- data/app/assets/javascripts/moment/locale/gom-latn.js +122 -0
- data/app/assets/javascripts/moment/locale/gu.js +123 -0
- data/app/assets/javascripts/moment/locale/he.js +96 -0
- data/app/assets/javascripts/moment/locale/hi.js +123 -0
- data/app/assets/javascripts/moment/locale/hr.js +153 -0
- data/app/assets/javascripts/moment/locale/hu.js +109 -0
- data/app/assets/javascripts/moment/locale/hy-am.js +94 -0
- data/app/assets/javascripts/moment/locale/id.js +81 -0
- data/app/assets/javascripts/moment/locale/is.js +131 -0
- data/app/assets/javascripts/moment/locale/it-ch.js +68 -0
- data/app/assets/javascripts/moment/locale/it.js +68 -0
- data/app/assets/javascripts/moment/locale/ja.js +91 -0
- data/app/assets/javascripts/moment/locale/jv.js +81 -0
- data/app/assets/javascripts/moment/locale/ka.js +88 -0
- data/app/assets/javascripts/moment/locale/kk.js +86 -0
- data/app/assets/javascripts/moment/locale/km.js +109 -0
- data/app/assets/javascripts/moment/locale/kn.js +125 -0
- data/app/assets/javascripts/moment/locale/ko.js +80 -0
- data/app/assets/javascripts/moment/locale/ku.js +118 -0
- data/app/assets/javascripts/moment/locale/ky.js +86 -0
- data/app/assets/javascripts/moment/locale/lb.js +135 -0
- data/app/assets/javascripts/moment/locale/lo.js +69 -0
- data/app/assets/javascripts/moment/locale/lt.js +117 -0
- data/app/assets/javascripts/moment/locale/lv.js +96 -0
- data/app/assets/javascripts/moment/locale/me.js +111 -0
- data/app/assets/javascripts/moment/locale/mi.js +63 -0
- data/app/assets/javascripts/moment/locale/mk.js +89 -0
- data/app/assets/javascripts/moment/locale/ml.js +80 -0
- data/app/assets/javascripts/moment/locale/mn.js +103 -0
- data/app/assets/javascripts/moment/locale/mr.js +159 -0
- data/app/assets/javascripts/moment/locale/ms-my.js +81 -0
- data/app/assets/javascripts/moment/locale/ms.js +81 -0
- data/app/assets/javascripts/moment/locale/mt.js +59 -0
- data/app/assets/javascripts/moment/locale/my.js +92 -0
- data/app/assets/javascripts/moment/locale/nb.js +61 -0
- data/app/assets/javascripts/moment/locale/ne.js +122 -0
- data/app/assets/javascripts/moment/locale/nl-be.js +86 -0
- data/app/assets/javascripts/moment/locale/nl.js +86 -0
- data/app/assets/javascripts/moment/locale/nn.js +59 -0
- data/app/assets/javascripts/moment/locale/pa-in.js +123 -0
- data/app/assets/javascripts/moment/locale/pl.js +125 -0
- data/app/assets/javascripts/moment/locale/pt-br.js +60 -0
- data/app/assets/javascripts/moment/locale/pt.js +64 -0
- data/app/assets/javascripts/moment/locale/ro.js +74 -0
- data/app/assets/javascripts/moment/locale/ru.js +181 -0
- data/app/assets/javascripts/moment/locale/sd.js +97 -0
- data/app/assets/javascripts/moment/locale/se.js +59 -0
- data/app/assets/javascripts/moment/locale/si.js +70 -0
- data/app/assets/javascripts/moment/locale/sk.js +155 -0
- data/app/assets/javascripts/moment/locale/sl.js +172 -0
- data/app/assets/javascripts/moment/locale/sq.js +67 -0
- data/app/assets/javascripts/moment/locale/sr-cyrl.js +110 -0
- data/app/assets/javascripts/moment/locale/sr.js +110 -0
- data/app/assets/javascripts/moment/locale/ss.js +87 -0
- data/app/assets/javascripts/moment/locale/sv.js +68 -0
- data/app/assets/javascripts/moment/locale/sw.js +58 -0
- data/app/assets/javascripts/moment/locale/ta.js +128 -0
- data/app/assets/javascripts/moment/locale/te.js +88 -0
- data/app/assets/javascripts/moment/locale/tet.js +66 -0
- data/app/assets/javascripts/moment/locale/tg.js +115 -0
- data/app/assets/javascripts/moment/locale/th.js +66 -0
- data/app/assets/javascripts/moment/locale/tl-ph.js +61 -0
- data/app/assets/javascripts/moment/locale/tlh.js +121 -0
- data/app/assets/javascripts/moment/locale/tr.js +93 -0
- data/app/assets/javascripts/moment/locale/tzl.js +90 -0
- data/app/assets/javascripts/moment/locale/tzm-latn.js +57 -0
- data/app/assets/javascripts/moment/locale/tzm.js +57 -0
- data/app/assets/javascripts/moment/locale/ug-cn.js +118 -0
- data/app/assets/javascripts/moment/locale/uk.js +153 -0
- data/app/assets/javascripts/moment/locale/ur.js +97 -0
- data/app/assets/javascripts/moment/locale/uz-latn.js +57 -0
- data/app/assets/javascripts/moment/locale/uz.js +57 -0
- data/app/assets/javascripts/moment/locale/vi.js +78 -0
- data/app/assets/javascripts/moment/locale/x-pseudo.js +67 -0
- data/app/assets/javascripts/moment/locale/yo.js +59 -0
- data/app/assets/javascripts/moment/locale/zh-cn.js +109 -0
- data/app/assets/javascripts/moment/locale/zh-hk.js +102 -0
- data/app/assets/javascripts/moment/locale/zh-tw.js +102 -0
- data/app/assets/javascripts/moment/moment.js +4603 -0
- data/app/assets/stylesheets/effective_bootstrap.scss +12 -0
- data/app/assets/stylesheets/effective_bootstrap/base.scss +4 -0
- data/app/assets/stylesheets/effective_bootstrap/forms.scss +65 -0
- data/app/assets/stylesheets/effective_bootstrap/icons.scss +67 -0
- data/app/assets/stylesheets/effective_bootstrap/overrides.scss +14 -0
- data/app/assets/stylesheets/effective_checks/input.scss +8 -0
- data/app/assets/stylesheets/effective_date/input.scss +1 -0
- data/app/assets/stylesheets/effective_datetime/bootstrap-datetimepicker.scss +374 -0
- data/app/assets/stylesheets/effective_datetime/input.scss +2 -0
- data/app/assets/stylesheets/effective_datetime/overrides.scss +31 -0
- data/app/assets/stylesheets/effective_editor/input.scss +2 -0
- data/app/assets/stylesheets/effective_editor/overrides.scss +25 -0
- data/app/assets/stylesheets/effective_editor/quill.scss +948 -0
- data/app/assets/stylesheets/effective_file/input.scss +46 -0
- data/app/assets/stylesheets/effective_radio/input.scss +29 -0
- data/app/assets/stylesheets/effective_select/bootstrap-theme.css +564 -0
- data/app/assets/stylesheets/effective_select/input.scss +3 -0
- data/app/assets/stylesheets/effective_select/overrides.scss +115 -0
- data/app/assets/stylesheets/effective_select/select2.css +484 -0
- data/app/assets/stylesheets/effective_select_or_text/input.scss +6 -0
- data/app/assets/stylesheets/effective_time/input.scss +1 -0
- data/app/helpers/effective_bootstrap_helper.rb +371 -0
- data/app/helpers/effective_editor_helper.rb +29 -0
- data/app/helpers/effective_form_builder_helper.rb +74 -0
- data/app/helpers/effective_icons_helper.rb +51 -0
- data/app/models/effective/access_denied.rb +17 -0
- data/app/models/effective/form_builder.rb +199 -0
- data/app/models/effective/form_input.rb +434 -0
- data/app/models/effective/form_inputs/check_box.rb +70 -0
- data/app/models/effective/form_inputs/checks.rb +99 -0
- data/app/models/effective/form_inputs/ck_editor.rb +48 -0
- data/app/models/effective/form_inputs/clear.rb +22 -0
- data/app/models/effective/form_inputs/collection_input.rb +168 -0
- data/app/models/effective/form_inputs/date_field.rb +34 -0
- data/app/models/effective/form_inputs/datetime_field.rb +83 -0
- data/app/models/effective/form_inputs/delete.rb +26 -0
- data/app/models/effective/form_inputs/editor.rb +88 -0
- data/app/models/effective/form_inputs/email_cc_field.rb +19 -0
- data/app/models/effective/form_inputs/email_field.rb +20 -0
- data/app/models/effective/form_inputs/error_field.rb +47 -0
- data/app/models/effective/form_inputs/file_field.rb +135 -0
- data/app/models/effective/form_inputs/float_field.rb +20 -0
- data/app/models/effective/form_inputs/form_group.rb +15 -0
- data/app/models/effective/form_inputs/integer_field.rb +18 -0
- data/app/models/effective/form_inputs/number_field.rb +10 -0
- data/app/models/effective/form_inputs/number_text_field.rb +15 -0
- data/app/models/effective/form_inputs/password_field.rb +24 -0
- data/app/models/effective/form_inputs/percent_field.rb +38 -0
- data/app/models/effective/form_inputs/phone_field.rb +39 -0
- data/app/models/effective/form_inputs/price_field.rb +32 -0
- data/app/models/effective/form_inputs/radios.rb +175 -0
- data/app/models/effective/form_inputs/remote_link_to.rb +30 -0
- data/app/models/effective/form_inputs/reset.rb +22 -0
- data/app/models/effective/form_inputs/save.rb +22 -0
- data/app/models/effective/form_inputs/search_field.rb +15 -0
- data/app/models/effective/form_inputs/select.rb +176 -0
- data/app/models/effective/form_inputs/select_or_text.rb +70 -0
- data/app/models/effective/form_inputs/static_field.rb +41 -0
- data/app/models/effective/form_inputs/submit.rb +109 -0
- data/app/models/effective/form_inputs/text_area.rb +11 -0
- data/app/models/effective/form_inputs/text_field.rb +6 -0
- data/app/models/effective/form_inputs/time_field.rb +34 -0
- data/app/models/effective/form_inputs/time_zone_select.rb +15 -0
- data/app/models/effective/form_inputs/url_field.rb +20 -0
- data/app/models/effective/form_logic.rb +45 -0
- data/app/models/effective/form_logics/hide_if.rb +39 -0
- data/app/models/effective/form_logics/show_if.rb +39 -0
- data/app/models/effective/form_logics/show_if_any.rb +42 -0
- data/app/views/effective/style_guide/__fields.html.haml +43 -0
- data/app/views/effective/style_guide/__inline_fields.html.haml +4 -0
- data/app/views/effective/style_guide/_effective_form_with.html.haml +26 -0
- data/app/views/effective/style_guide/_feather_icons.html.haml +9 -0
- data/config/effective_bootstrap.rb +27 -0
- data/lib/effective_bootstrap.rb +33 -0
- data/lib/effective_bootstrap/engine.rb +15 -0
- data/lib/effective_bootstrap/version.rb +3 -0
- data/lib/generators/effective_bootstrap/install_generator.rb +14 -0
- metadata +650 -0
@@ -0,0 +1 @@
|
|
1
|
+
@import '../effective_datetime/input';
|
@@ -0,0 +1,371 @@
|
|
1
|
+
# Boostrap4 Helpers
|
2
|
+
|
3
|
+
module EffectiveBootstrapHelper
|
4
|
+
# This is a special variant of collapse
|
5
|
+
# = accordion do
|
6
|
+
# = collapse('Add thing...') do
|
7
|
+
# %p Something to add
|
8
|
+
def accordion(options = nil, &block)
|
9
|
+
(options ||= {})[:class] = "accordion #{options.delete(:class)}".strip
|
10
|
+
|
11
|
+
id = "accordion-#{''.object_id}"
|
12
|
+
|
13
|
+
@_accordion_active = id
|
14
|
+
content = content_tag(:div, capture(&block), options.merge(id: id))
|
15
|
+
@_accordion_active = nil
|
16
|
+
content
|
17
|
+
end
|
18
|
+
|
19
|
+
# https://getbootstrap.com/docs/4.0/components/collapse/
|
20
|
+
|
21
|
+
# = collapse('toggle visibility') do
|
22
|
+
# %p Something Collapsed
|
23
|
+
|
24
|
+
# = collapse('already expanded', show: true) do
|
25
|
+
# %p Something Expanded
|
26
|
+
|
27
|
+
# collapse(items.length, class: 'btn btn-primary', class: 'mt-2') do
|
28
|
+
# items.map { |item| content_tag(:div, item.to_s) }.join.html_safe
|
29
|
+
# end
|
30
|
+
def collapse(label, opts = {}, &block)
|
31
|
+
raise 'expected a block' unless block_given?
|
32
|
+
|
33
|
+
id = "collapse-#{''.object_id}"
|
34
|
+
show = (opts.delete(:show) == true)
|
35
|
+
|
36
|
+
link_opts = { 'data-toggle': 'collapse', role: 'button', href: "##{id}", 'aria-controls': "##{id}", 'aria-expanded': show }
|
37
|
+
|
38
|
+
link_opts[:class] = opts.delete(:link_class) || 'btn btn-link'
|
39
|
+
div_class = opts.delete(:div_class)
|
40
|
+
card_class = opts.delete(:card_class) || 'card card-body my-2'
|
41
|
+
|
42
|
+
if @_accordion_active
|
43
|
+
# Accordion collapse
|
44
|
+
content_tag(:div, class: "card mb-0") do
|
45
|
+
content_tag(:div, class: "card-header") do
|
46
|
+
content_tag(:h2, class: "mb-0") do
|
47
|
+
content_tag(:button, label, link_opts.merge(class: "btn btn-link"))
|
48
|
+
end
|
49
|
+
end +
|
50
|
+
content_tag(:div, id: id, class: ['collapse', div_class, ('show' if show)].compact.join(' '), "data-parent": "##{@_accordion_active}") do
|
51
|
+
content_tag(:div, capture(&block), class: "card-body")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
else
|
55
|
+
# Normal collapse
|
56
|
+
content_tag(:a, label, link_opts) +
|
57
|
+
content_tag(:div, id: id, class: ['collapse', div_class, ('show' if show)].compact.join(' ')) do
|
58
|
+
content_tag(:div, capture(&block), class: card_class)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Button Dropdowns
|
64
|
+
# https://getbootstrap.com/docs/4.0/components/dropdowns/
|
65
|
+
#
|
66
|
+
# = dropdown do
|
67
|
+
# = dropdown_link_to 'Something', root_path
|
68
|
+
# = dropdown_divider
|
69
|
+
# = dropdown_link_to 'Another', root_path
|
70
|
+
#
|
71
|
+
# Button Dropdowns
|
72
|
+
# variations can be :dropup, :dropleft, :dropright
|
73
|
+
# split can be true, false
|
74
|
+
# right is to right align things
|
75
|
+
def dropdown(variation: nil, split: true, btn_class: nil, right: false, &block)
|
76
|
+
raise 'expected a block' unless block_given?
|
77
|
+
|
78
|
+
btn_class = btn_class.presence || 'btn-outline-primary'
|
79
|
+
|
80
|
+
@_dropdown_link_tos = []; yield
|
81
|
+
|
82
|
+
return @_dropdown_link_tos.first if @_dropdown_link_tos.length <= 1
|
83
|
+
|
84
|
+
retval = if split
|
85
|
+
first = @_dropdown_link_tos.first
|
86
|
+
menu = content_tag(:div, @_dropdown_link_tos[1..-1].join.html_safe, class: ['dropdown-menu', ('dropdown-menu-right' if right)].compact.join(' '))
|
87
|
+
split = content_tag(:button, class: "btn #{btn_class} dropdown-toggle dropdown-toggle-split", type: 'button', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) do
|
88
|
+
content_tag(:span, 'Toggle Dropdown', class: 'sr-only')
|
89
|
+
end
|
90
|
+
|
91
|
+
content_tag(:div, class: 'btn-group') do
|
92
|
+
content_tag(:div, class: ['btn-group', variation.to_s.presence].compact.join(' '), role: 'group') do
|
93
|
+
[:dropleft].include?(variation) ? (split + menu) : (first + split + menu)
|
94
|
+
end + ([:dropleft].include?(variation) ? first : '').html_safe
|
95
|
+
end
|
96
|
+
else
|
97
|
+
raise 'split false is unsupported'
|
98
|
+
end
|
99
|
+
|
100
|
+
@_dropdown_link_tos = nil
|
101
|
+
|
102
|
+
retval
|
103
|
+
end
|
104
|
+
|
105
|
+
# This is a special variant of dropdown
|
106
|
+
# dots do
|
107
|
+
# = dropdown_link_to 'Edit', edit_path(thing)
|
108
|
+
def dots(options = nil, &block)
|
109
|
+
(options ||= {})[:class] = "dropdown dropdown-dots #{options.delete(:class)}".strip
|
110
|
+
|
111
|
+
content_tag(:span, options) do
|
112
|
+
content_tag(:button, class: "btn btn-dots dropdown-toggle #{options.delete(:button_class)}", 'aria-expanded': true, 'aria-haspopup': true, 'data-toggle': 'dropdown', type: 'button') do
|
113
|
+
end + content_tag(:div, capture(&block), class: 'dropdown-menu')
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def dots_link_to(label, path, options = {})
|
118
|
+
options[:class] = [options[:class], 'dropdown-item'].compact.join(' ')
|
119
|
+
|
120
|
+
concat link_to(label, path, options)
|
121
|
+
end
|
122
|
+
|
123
|
+
# Works with dots do and dropdown do
|
124
|
+
def dropdown_link_to(label, path, options = {})
|
125
|
+
btn_class = options.delete(:btn_class).presence || 'btn-outline-primary'
|
126
|
+
|
127
|
+
unless @_dropdown_link_tos
|
128
|
+
options[:class] = [options[:class], 'dropdown-item'].compact.join(' ')
|
129
|
+
return link_to(label, path, options)
|
130
|
+
end
|
131
|
+
|
132
|
+
if @_dropdown_link_tos.length == 0
|
133
|
+
options[:class] = [options[:class], 'btn', btn_class].compact.join(' ')
|
134
|
+
else
|
135
|
+
options[:class] = [options[:class], 'dropdown-item'].compact.join(' ')
|
136
|
+
end
|
137
|
+
|
138
|
+
@_dropdown_link_tos << link_to(label, path, options)
|
139
|
+
|
140
|
+
nil
|
141
|
+
end
|
142
|
+
|
143
|
+
# Works with dots ao and dropdown do
|
144
|
+
def dropdown_divider
|
145
|
+
unless @_dropdown_link_tos
|
146
|
+
content_tag(:div, '', class: 'dropdown-divider')
|
147
|
+
else
|
148
|
+
@_dropdown_link_tos << content_tag(:div, '', class: 'dropdown-divider')
|
149
|
+
nil
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def list_group(&block)
|
154
|
+
content_tag(:div, yield, class: 'list-group')
|
155
|
+
end
|
156
|
+
|
157
|
+
# List group
|
158
|
+
# = list_group_link_to
|
159
|
+
# Automatically puts in the 'active' class based on request path
|
160
|
+
def list_group_link_to(label, path, opts = {})
|
161
|
+
# Regular link item
|
162
|
+
opts[:class] = if request.fullpath.include?(path)
|
163
|
+
[opts[:class], 'list-group-item active'].compact.join(' ')
|
164
|
+
else
|
165
|
+
[opts[:class], 'list-group-item'].compact.join(' ')
|
166
|
+
end
|
167
|
+
|
168
|
+
link_to(label.to_s, path, opts)
|
169
|
+
end
|
170
|
+
|
171
|
+
# Nav links and dropdowns
|
172
|
+
# Automatically puts in the 'active' class based on request path
|
173
|
+
|
174
|
+
# %ul.navbar-nav
|
175
|
+
# = nav_link_to 'Sign In', new_user_session_path
|
176
|
+
# = nav_dropdown 'Settings' do
|
177
|
+
# = nav_link_to 'Account Settings', user_settings_path
|
178
|
+
# = nav_divider
|
179
|
+
# = nav_link_to 'Sign In', new_user_session_path, method: :delete
|
180
|
+
def nav_link_to(label, path, opts = {})
|
181
|
+
if @_nav_mode == :dropdown # We insert dropdown-items
|
182
|
+
return link_to(label, path, merge_class_key(opts, 'dropdown-item'))
|
183
|
+
end
|
184
|
+
|
185
|
+
strict = opts.delete(:strict)
|
186
|
+
active = (strict ? (request.fullpath == path) : request.fullpath.include?(path))
|
187
|
+
|
188
|
+
# Regular nav link item
|
189
|
+
content_tag(:li, class: (active ? 'nav-item active' : 'nav-item')) do
|
190
|
+
link_to(label, path, merge_class_key(opts, 'nav-link'))
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
def nav_dropdown(label, right: false, link_class: [], list_class: [], &block)
|
195
|
+
raise 'expected a block' unless block_given?
|
196
|
+
|
197
|
+
id = "dropdown-#{''.object_id}"
|
198
|
+
|
199
|
+
content_tag(:li, class: 'nav-item dropdown') do
|
200
|
+
content_tag(:a, class: 'nav-link dropdown-toggle', href: '#', id: id, role: 'button', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) do
|
201
|
+
label.html_safe
|
202
|
+
end + content_tag(:div, class: (right ? 'dropdown-menu dropdown-menu-right' : 'dropdown-menu'), 'aria-labelledby': id) do
|
203
|
+
@_nav_mode = :dropdown; yield; @_nav_mode = nil
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
def nav_divider
|
209
|
+
content_tag(:div, '', class: 'dropdown-divider')
|
210
|
+
end
|
211
|
+
|
212
|
+
# Pagination
|
213
|
+
#
|
214
|
+
# https://getbootstrap.com/docs/4.0/components/pagination/
|
215
|
+
# Builds a pagination based on the given collection, current url and params[:page]
|
216
|
+
#
|
217
|
+
# = paginate(@posts, per_page: 10)
|
218
|
+
#
|
219
|
+
# Add this to your model
|
220
|
+
# scope :paginate, -> (page: nil, per_page: 10) {
|
221
|
+
# page = (page || 1).to_i
|
222
|
+
# offset = [(page - 1), 0].max * per_page
|
223
|
+
|
224
|
+
# limit(per_page).offset(offset)
|
225
|
+
# }
|
226
|
+
#
|
227
|
+
# Add this to your controller:
|
228
|
+
# @posts = Post.all.paginate(page: params[:page])
|
229
|
+
#
|
230
|
+
# Add this to your view
|
231
|
+
# %nav= paginate(@posts, per_page: 10)
|
232
|
+
#
|
233
|
+
def bootstrap_paginate(collection, per_page:, url: nil, window: 2, collection_count: nil, render_single_page: false)
|
234
|
+
raise 'expected an ActiveRecord::Relation' unless collection.respond_to?(:limit) && collection.respond_to?(:offset)
|
235
|
+
|
236
|
+
collection_count ||= collection.limit(nil).offset(nil).count # You can pass the total count, or not.
|
237
|
+
|
238
|
+
page = (params[:page] || 1).to_i
|
239
|
+
last = (collection_count.to_f / per_page).ceil
|
240
|
+
|
241
|
+
return unless (last > 1 || render_single_page) # If there's only 1 page, don't render a pagination at all.
|
242
|
+
|
243
|
+
# Build URL
|
244
|
+
uri = URI(url || request.fullpath)
|
245
|
+
params = Rack::Utils.parse_nested_query(uri.query)
|
246
|
+
url = uri.path + '?'
|
247
|
+
|
248
|
+
# Pagination Tags
|
249
|
+
prev_tag = content_tag(:li, class: ['page-item', ('disabled' if page <= 1)].compact.join(' ')) do
|
250
|
+
link_to(content_tag(:span, 'Previous'.html_safe), (page <= 1 ? '#' : url + params.merge('page' => page - 1).to_query),
|
251
|
+
class: 'page-link', 'aria-label': 'Previous', title: 'Previous', 'aria-disabled': ('true' if page <= 1), 'tabindex': ('-1' if page <= 1)
|
252
|
+
)
|
253
|
+
end
|
254
|
+
|
255
|
+
next_tag = content_tag(:li, class: ['page-item', ('disabled' if page >= last)].compact.join(' ')) do
|
256
|
+
link_to(content_tag(:span, 'Next'.html_safe), (page >= last ? '#' : url + params.merge('page' => page + 1).to_query),
|
257
|
+
class: 'page-link', 'aria-label': 'Next', title: 'Next', 'aria-disabled': ('true' if page >= last), 'tabindex': ('-1' if page >= last)
|
258
|
+
)
|
259
|
+
end
|
260
|
+
|
261
|
+
dots_tag = content_tag(:li, class: 'page-item disabled') do
|
262
|
+
link_to('...', '#', class: 'page-link', 'aria-label': '...', 'aria-disabled': true, tabindex: '-1')
|
263
|
+
end
|
264
|
+
|
265
|
+
# Calculate Windows
|
266
|
+
length = 1 + (window * 2)
|
267
|
+
left = 1.upto(last).to_a.first(length)
|
268
|
+
right = 1.upto(last).to_a.last(length)
|
269
|
+
center = []
|
270
|
+
max = length + 2
|
271
|
+
|
272
|
+
if last <= max
|
273
|
+
left = left - right
|
274
|
+
right = right - left
|
275
|
+
elsif left.include?(page + 1)
|
276
|
+
right = [last]
|
277
|
+
left = left - right
|
278
|
+
elsif right.include?(page - 1)
|
279
|
+
left = [1]
|
280
|
+
right = right - left
|
281
|
+
else
|
282
|
+
left = [1]
|
283
|
+
right = [last]
|
284
|
+
center = (page - window + 1).upto(page + window - 1).to_a
|
285
|
+
end
|
286
|
+
|
287
|
+
# Render the pagination
|
288
|
+
content_tag(:ul, class: 'pagination') do
|
289
|
+
[
|
290
|
+
prev_tag,
|
291
|
+
left.map { |index| bootstrap_paginate_tag(index, page, url, params) },
|
292
|
+
(dots_tag if last > max && left == [1]),
|
293
|
+
center.map { |index| bootstrap_paginate_tag(index, page, url, params) },
|
294
|
+
(dots_tag if last > max && right == [last]),
|
295
|
+
right.map { |index| bootstrap_paginate_tag(index, page, url, params) },
|
296
|
+
next_tag
|
297
|
+
].flatten.join.html_safe
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
def bootstrap_paginate_tag(index, page, url, params)
|
302
|
+
content_tag(:li, class: ['page-item', ('active' if index == page)].compact.join(' '), title: "Page #{index}") do
|
303
|
+
link_to(index, (url + params.merge('page' => index).to_query), class: 'page-link')
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
# Let Kaminari override this method.
|
308
|
+
alias_method(:paginate, :bootstrap_paginate) unless (respond_to?(:paginate) || defined?(Kaminari))
|
309
|
+
|
310
|
+
# Tabs DSL
|
311
|
+
# Inserts both the tablist and the tabpanel
|
312
|
+
|
313
|
+
# = tabs do
|
314
|
+
# = tab 'Imports' do
|
315
|
+
# %p Imports
|
316
|
+
|
317
|
+
# = tab 'Exports' do
|
318
|
+
# %p Exports
|
319
|
+
|
320
|
+
# If you pass active 'label' it will make that tab active. Otherwise first.
|
321
|
+
# Unique will make sure the tab html IDs are unique
|
322
|
+
# $('#tab-demographics').tab('show')
|
323
|
+
def tabs(active: nil, unique: false, list: {}, content: {}, &block)
|
324
|
+
raise 'expected a block' unless block_given?
|
325
|
+
|
326
|
+
@_tab_mode = :tablist
|
327
|
+
@_tab_active = (active || :first)
|
328
|
+
@_tab_unique = ''.object_id if unique
|
329
|
+
|
330
|
+
content_tag(:ul, {class: 'nav nav-tabs', role: 'tablist'}.merge(list)) do
|
331
|
+
yield # Yield to tab the first time
|
332
|
+
end +
|
333
|
+
content_tag(:div, {class: 'tab-content'}.merge(content)) do
|
334
|
+
@_tab_mode = :content
|
335
|
+
@_tab_active = (active || :first)
|
336
|
+
yield # Yield to tab the second time
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
def tab(label, options = {}, &block)
|
341
|
+
controls = options.delete(:controls) || label.to_s.parameterize.gsub('_', '-')
|
342
|
+
controls = controls[1..-1] if controls[0] == '#'
|
343
|
+
controls = "#{controls}-#{@_tab_unique}" if @_tab_unique
|
344
|
+
|
345
|
+
active = (@_tab_active == :first || @_tab_active == label)
|
346
|
+
|
347
|
+
@_tab_active = nil if @_tab_active == :first
|
348
|
+
|
349
|
+
if @_tab_mode == :tablist # Inserting the label into the tablist top
|
350
|
+
content_tag(:li, class: 'nav-item') do
|
351
|
+
content_tag(:a, label, id: ('tab-' + controls), class: ['nav-link', ('active' if active)].compact.join(' '), href: '#' + controls, 'aria-controls': controls, 'aria-selected': active.to_s, 'data-toggle': 'tab', role: 'tab')
|
352
|
+
end
|
353
|
+
else # Inserting the content into the tab itself
|
354
|
+
classes = ['tab-pane', 'fade', ('show active' if active), options[:class].presence].compact.join(' ')
|
355
|
+
content_tag(:div, id: controls, class: classes, role: 'tabpanel', 'aria-labelledby': ('tab-' + controls)) do
|
356
|
+
yield
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
def merge_class_key(hash, value)
|
362
|
+
return { :class => value } unless hash.kind_of?(Hash)
|
363
|
+
|
364
|
+
if hash[:class].present?
|
365
|
+
hash.merge!(:class => "#{hash[:class]} #{value}")
|
366
|
+
else
|
367
|
+
hash.merge!(:class => value)
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module EffectiveEditorHelper
|
2
|
+
|
3
|
+
def effective_editor_tag(content, options = {})
|
4
|
+
content = content.presence || '{}'
|
5
|
+
|
6
|
+
content_mode = (
|
7
|
+
if options.delete(:delta)
|
8
|
+
:delta
|
9
|
+
elsif options.delete(:html)
|
10
|
+
:html
|
11
|
+
elsif options.delete(:code)
|
12
|
+
:code
|
13
|
+
else
|
14
|
+
:delta
|
15
|
+
end
|
16
|
+
)
|
17
|
+
|
18
|
+
input_js = {
|
19
|
+
method_name: 'effective_editor_tag',
|
20
|
+
theme: 'snow',
|
21
|
+
readOnly: true,
|
22
|
+
content_mode: content_mode,
|
23
|
+
modules: { toolbar: false, syntax: (content_mode == :code) }
|
24
|
+
}
|
25
|
+
|
26
|
+
content_tag(:div, '', id: "ql-#{content.object_id}", class: 'effective_editor_content ql-effective', data: { 'input-js-options': input_js, 'content': content })
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
module EffectiveFormBuilderHelper
|
2
|
+
def effective_form_with(**options, &block)
|
3
|
+
|
4
|
+
# Compute the default ID
|
5
|
+
subject = Array(options[:scope] || options[:model]).last
|
6
|
+
class_name = subject.class.name.underscore
|
7
|
+
|
8
|
+
html_id = if subject.kind_of?(Symbol)
|
9
|
+
subject.to_s
|
10
|
+
elsif subject.respond_to?(:persisted?) && subject.persisted?
|
11
|
+
"edit_#{class_name}_#{subject.to_param}"
|
12
|
+
else
|
13
|
+
"new_#{class_name}"
|
14
|
+
end
|
15
|
+
|
16
|
+
options[:html] = (options[:html] || {}).merge(novalidate: true, onsubmit: 'return EffectiveForm.validate(this)')
|
17
|
+
|
18
|
+
remote_index = options.except(:model).hash.abs
|
19
|
+
|
20
|
+
options[:local] = true unless options.key?(:local)
|
21
|
+
|
22
|
+
if respond_to?(:inline_datatable?) && inline_datatable?
|
23
|
+
options[:remote] = true
|
24
|
+
options[:local] = false
|
25
|
+
end
|
26
|
+
|
27
|
+
options[:class] = [
|
28
|
+
options[:class],
|
29
|
+
'needs-validation',
|
30
|
+
('form-inline' if options[:layout] == :inline),
|
31
|
+
('with-errors' if subject.respond_to?(:errors) && subject.errors.present?),
|
32
|
+
('show-flash-success' if options[:remote] && options[:flash_success]),
|
33
|
+
('hide-flash-danger' if options[:remote] && options.key?(:flash_error) && !options[:flash_error])
|
34
|
+
].compact.join(' ')
|
35
|
+
|
36
|
+
if options.delete(:remote) == true
|
37
|
+
@_effective_remote_index ||= {}
|
38
|
+
remote_index = remote_index + 1 if @_effective_remote_index[remote_index]
|
39
|
+
|
40
|
+
if options[:html][:data].kind_of?(Hash)
|
41
|
+
options[:html][:data][:remote] = true
|
42
|
+
options[:html][:data]['data-remote-index'] = remote_index
|
43
|
+
else
|
44
|
+
options[:html]['data-remote'] = true
|
45
|
+
options[:html]['data-remote-index'] = remote_index
|
46
|
+
end
|
47
|
+
|
48
|
+
html_id = "#{html_id}_#{remote_index}"
|
49
|
+
|
50
|
+
@_effective_remote_index[remote_index] = true
|
51
|
+
end
|
52
|
+
|
53
|
+
# Assign default ID
|
54
|
+
options[:id] ||= (options[:html].delete(:id) || html_id) unless options.key?(:id)
|
55
|
+
|
56
|
+
without_error_proc do
|
57
|
+
form_with(**options.merge(builder: Effective::FormBuilder), &block)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
# Disables a .fields_with_errors wrapping div when
|
64
|
+
def without_error_proc
|
65
|
+
original = ActionView::Base.field_error_proc
|
66
|
+
|
67
|
+
begin
|
68
|
+
ActionView::Base.field_error_proc = proc { |input, _| input }; yield
|
69
|
+
ensure
|
70
|
+
ActionView::Base.field_error_proc = original
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|