publify_core 9.0.0 → 9.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +92 -37
  3. data/app/assets/javascripts/bootstrap-sprockets.js +8 -0
  4. data/app/assets/javascripts/bootstrap/affix.js +164 -0
  5. data/app/assets/javascripts/bootstrap/alert.js +95 -0
  6. data/app/assets/javascripts/bootstrap/button.js +125 -0
  7. data/app/assets/javascripts/bootstrap/collapse.js +212 -0
  8. data/app/assets/javascripts/bootstrap/dropdown.js +165 -0
  9. data/app/assets/javascripts/bootstrap/modal.js +358 -0
  10. data/app/assets/javascripts/bootstrap/tab.js +155 -0
  11. data/app/assets/javascripts/bootstrap/transition.js +59 -0
  12. data/app/assets/javascripts/lightbox.js +4 -4
  13. data/app/assets/javascripts/publify_admin.js +1 -35
  14. data/app/assets/stylesheets/_bootstrap-compass.scss +9 -0
  15. data/app/assets/stylesheets/_bootstrap-mincer.scss +19 -0
  16. data/app/assets/stylesheets/_bootstrap-sprockets.scss +9 -0
  17. data/app/assets/stylesheets/_bootstrap.scss +42 -0
  18. data/app/assets/stylesheets/administration_structure.css.scss +1 -45
  19. data/app/assets/stylesheets/bootstrap/_alerts.scss +73 -0
  20. data/app/assets/stylesheets/bootstrap/_button-groups.scss +242 -0
  21. data/app/assets/stylesheets/bootstrap/_buttons.scss +168 -0
  22. data/app/assets/stylesheets/bootstrap/_close.scss +37 -0
  23. data/app/assets/stylesheets/bootstrap/_code.scss +69 -0
  24. data/app/assets/stylesheets/bootstrap/_component-animations.scss +38 -0
  25. data/app/assets/stylesheets/bootstrap/_dropdowns.scss +213 -0
  26. data/app/assets/stylesheets/bootstrap/_forms.scss +586 -0
  27. data/app/assets/stylesheets/bootstrap/_grid.scss +94 -0
  28. data/app/assets/stylesheets/bootstrap/_labels.scss +66 -0
  29. data/app/assets/stylesheets/bootstrap/_media.scss +66 -0
  30. data/app/assets/stylesheets/bootstrap/_mixins.scss +37 -0
  31. data/app/assets/stylesheets/bootstrap/_modals.scss +150 -0
  32. data/app/assets/stylesheets/bootstrap/_navbar.scss +479 -0
  33. data/app/assets/stylesheets/bootstrap/_navs.scss +242 -0
  34. data/app/assets/stylesheets/bootstrap/_normalize.scss +427 -0
  35. data/app/assets/stylesheets/bootstrap/_pagination.scss +86 -0
  36. data/app/assets/stylesheets/bootstrap/_panels.scss +222 -0
  37. data/app/assets/stylesheets/bootstrap/_print.scss +99 -0
  38. data/app/assets/stylesheets/bootstrap/_scaffolding.scss +160 -0
  39. data/app/assets/stylesheets/bootstrap/_tables.scss +234 -0
  40. data/app/assets/stylesheets/bootstrap/_theme.scss +224 -0
  41. data/app/assets/stylesheets/bootstrap/_type.scss +296 -0
  42. data/app/assets/stylesheets/bootstrap/_utilities.scss +55 -0
  43. data/app/assets/stylesheets/bootstrap/_variables.scss +638 -0
  44. data/app/assets/stylesheets/bootstrap/_wells.scss +29 -0
  45. data/app/assets/stylesheets/bootstrap/mixins/_alerts.scss +15 -0
  46. data/app/assets/stylesheets/bootstrap/mixins/_background-variant.scss +12 -0
  47. data/app/assets/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  48. data/app/assets/stylesheets/bootstrap/mixins/_buttons.scss +56 -0
  49. data/app/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  50. data/app/assets/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  51. data/app/assets/stylesheets/bootstrap/mixins/_forms.scss +82 -0
  52. data/app/assets/stylesheets/bootstrap/mixins/_gradients.scss +56 -0
  53. data/app/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
  54. data/app/assets/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  55. data/app/assets/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  56. data/app/assets/stylesheets/bootstrap/mixins/_image.scss +28 -0
  57. data/app/assets/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  58. data/app/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  59. data/app/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  60. data/app/assets/stylesheets/bootstrap/mixins/_opacity.scss +7 -0
  61. data/app/assets/stylesheets/bootstrap/mixins/_pagination.scss +24 -0
  62. data/app/assets/stylesheets/bootstrap/mixins/_panels.scss +20 -0
  63. data/app/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  64. data/app/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  65. data/app/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +17 -0
  66. data/app/assets/stylesheets/bootstrap/mixins/_size.scss +10 -0
  67. data/app/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  68. data/app/assets/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  69. data/app/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +12 -0
  70. data/app/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  71. data/app/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +222 -0
  72. data/app/assets/stylesheets/lightbox.css +3 -3
  73. data/app/assets/stylesheets/publify_admin.css.scss +0 -1
  74. data/app/controllers/accounts_controller.rb +2 -0
  75. data/app/controllers/admin/base_controller.rb +8 -16
  76. data/app/controllers/admin/content_controller.rb +38 -36
  77. data/app/controllers/admin/dashboard_controller.rb +16 -65
  78. data/app/controllers/admin/feedback_controller.rb +45 -37
  79. data/app/controllers/admin/notes_controller.rb +16 -10
  80. data/app/controllers/admin/pages_controller.rb +19 -29
  81. data/app/controllers/admin/post_types_controller.rb +7 -5
  82. data/app/controllers/admin/profiles_controller.rb +15 -5
  83. data/app/controllers/admin/redirects_controller.rb +9 -5
  84. data/app/controllers/admin/resources_controller.rb +7 -4
  85. data/app/controllers/admin/seo_controller.rb +12 -10
  86. data/app/controllers/admin/settings_controller.rb +7 -5
  87. data/app/controllers/admin/sidebar_controller.rb +6 -5
  88. data/app/controllers/admin/tags_controller.rb +6 -3
  89. data/app/controllers/admin/themes_controller.rb +10 -7
  90. data/app/controllers/admin/users_controller.rb +10 -7
  91. data/app/controllers/articles_controller.rb +49 -33
  92. data/app/controllers/authors_controller.rb +6 -3
  93. data/app/controllers/base_controller.rb +9 -11
  94. data/app/controllers/comments_controller.rb +13 -13
  95. data/app/controllers/content_controller.rb +4 -2
  96. data/app/controllers/feedback_controller.rb +4 -2
  97. data/app/controllers/notes_controller.rb +5 -3
  98. data/app/controllers/setup_controller.rb +15 -12
  99. data/app/controllers/tags_controller.rb +6 -4
  100. data/app/controllers/text_controller.rb +2 -4
  101. data/app/controllers/textfilter_controller.rb +2 -0
  102. data/app/controllers/theme_controller.rb +18 -13
  103. data/app/controllers/xml_controller.rb +2 -0
  104. data/app/helpers/admin/base_helper.rb +28 -29
  105. data/app/helpers/admin/feedback_helper.rb +34 -24
  106. data/app/helpers/articles_helper.rb +4 -2
  107. data/app/helpers/authors_helper.rb +7 -16
  108. data/app/helpers/base_helper.rb +56 -52
  109. data/app/helpers/blog_helper.rb +4 -2
  110. data/app/helpers/xml_helper.rb +3 -1
  111. data/app/jobs/application_job.rb +2 -0
  112. data/app/mailers/notification_mailer.rb +5 -3
  113. data/app/models/ability.rb +25 -23
  114. data/app/models/archives_sidebar.rb +14 -11
  115. data/app/models/article.rb +42 -42
  116. data/app/models/article/factory.rb +14 -6
  117. data/app/models/blog.rb +86 -75
  118. data/app/models/comment.rb +10 -11
  119. data/app/models/config_manager.rb +4 -2
  120. data/app/models/content.rb +37 -50
  121. data/app/models/content_base.rb +10 -4
  122. data/app/models/feedback.rb +21 -17
  123. data/app/models/meta_sidebar.rb +4 -3
  124. data/app/models/note.rb +26 -25
  125. data/app/models/page.rb +9 -8
  126. data/app/models/page_sidebar.rb +4 -2
  127. data/app/models/ping.rb +3 -1
  128. data/app/models/post_type.rb +3 -3
  129. data/app/models/redirect.rb +13 -7
  130. data/app/models/redirection.rb +3 -1
  131. data/app/models/resource.rb +5 -3
  132. data/app/models/search_sidebar.rb +4 -2
  133. data/app/models/sidebar.rb +11 -6
  134. data/app/models/static_sidebar.rb +14 -13
  135. data/app/models/tag.rb +15 -11
  136. data/app/models/tag_sidebar.rb +6 -3
  137. data/app/models/text_filter.rb +85 -11
  138. data/app/models/trackback.rb +7 -11
  139. data/app/models/trigger.rb +7 -4
  140. data/app/models/user.rb +44 -43
  141. data/app/services/title_builder.rb +52 -45
  142. data/app/uploaders/resource_uploader.rb +5 -3
  143. data/app/views/accounts/confirm.html.erb +3 -3
  144. data/app/views/admin/content/_article_list.html.erb +23 -8
  145. data/app/views/admin/content/_form.html.erb +71 -47
  146. data/app/views/admin/content/autosave.js.erb +2 -2
  147. data/app/views/admin/content/edit.html.erb +1 -1
  148. data/app/views/admin/content/index.html.erb +25 -15
  149. data/app/views/admin/content/new.html.erb +2 -2
  150. data/app/views/admin/dashboard/_comment.html.erb +5 -5
  151. data/app/views/admin/dashboard/_comments.html.erb +2 -2
  152. data/app/views/admin/dashboard/_drafts.html.erb +5 -5
  153. data/app/views/admin/dashboard/_overview.html.erb +7 -9
  154. data/app/views/admin/dashboard/_welcome.html.erb +11 -11
  155. data/app/views/admin/dashboard/index.html.erb +12 -7
  156. data/app/views/admin/feedback/_button.html.erb +6 -6
  157. data/app/views/admin/feedback/_feedback.html.erb +3 -3
  158. data/app/views/admin/feedback/_ham.html.erb +27 -9
  159. data/app/views/admin/feedback/_spam.html.erb +26 -16
  160. data/app/views/admin/feedback/article.html.erb +20 -21
  161. data/app/views/admin/feedback/edit.html.erb +14 -15
  162. data/app/views/admin/feedback/{ham.js → ham.js.erb} +0 -0
  163. data/app/views/admin/feedback/index.html.erb +25 -23
  164. data/app/views/admin/feedback/{spam.js → spam.js.erb} +0 -0
  165. data/app/views/admin/migrations/show.html.erb +10 -11
  166. data/app/views/admin/notes/_form.html.erb +13 -13
  167. data/app/views/admin/notes/_list.html.erb +19 -8
  168. data/app/views/admin/notes/_note.html.erb +12 -7
  169. data/app/views/admin/notes/edit.html.erb +6 -1
  170. data/app/views/admin/notes/index.html.erb +5 -1
  171. data/app/views/admin/notes/show.html.erb +2 -2
  172. data/app/views/admin/pages/_form.html.erb +86 -77
  173. data/app/views/admin/pages/_pages.html.erb +11 -4
  174. data/app/views/admin/pages/edit.html.erb +3 -1
  175. data/app/views/admin/pages/index.html.erb +10 -6
  176. data/app/views/admin/pages/new.html.erb +3 -1
  177. data/app/views/admin/post_types/_index_and_form.html.erb +15 -16
  178. data/app/views/admin/post_types/edit.html.erb +1 -1
  179. data/app/views/admin/post_types/index.html.erb +1 -1
  180. data/app/views/admin/profiles/index.html.erb +2 -3
  181. data/app/views/admin/redirects/_index_and_form.html.erb +10 -11
  182. data/app/views/admin/redirects/edit.html.erb +1 -1
  183. data/app/views/admin/redirects/index.html.erb +1 -1
  184. data/app/views/admin/resources/index.html.erb +19 -16
  185. data/app/views/admin/seo/_general.html.erb +23 -47
  186. data/app/views/admin/seo/_permalinks.html.erb +16 -16
  187. data/app/views/admin/seo/_titles.html.erb +63 -64
  188. data/app/views/admin/seo/show.html.erb +14 -19
  189. data/app/views/admin/settings/display.html.erb +22 -25
  190. data/app/views/admin/settings/feedback.html.erb +31 -32
  191. data/app/views/admin/settings/index.html.erb +23 -24
  192. data/app/views/admin/settings/write.html.erb +21 -22
  193. data/app/views/admin/shared/_edit.html.erb +3 -3
  194. data/app/views/admin/shared/_menu.html.erb +26 -26
  195. data/app/views/admin/shared/_twitter_alert.html.erb +1 -1
  196. data/app/views/admin/sidebar/_config.html.erb +5 -5
  197. data/app/views/admin/sidebar/_target_sidebar.html.erb +4 -4
  198. data/app/views/admin/sidebar/index.html.erb +7 -7
  199. data/app/views/admin/tags/_index_and_form.html.erb +11 -12
  200. data/app/views/admin/tags/edit.html.erb +1 -1
  201. data/app/views/admin/tags/index.html.erb +1 -1
  202. data/app/views/admin/themes/index.html.erb +5 -6
  203. data/app/views/admin/users/_form.html.erb +34 -34
  204. data/app/views/admin/users/edit.html.erb +2 -2
  205. data/app/views/admin/users/index.html.erb +10 -12
  206. data/app/views/admin/users/new.html.erb +2 -2
  207. data/app/views/archives_sidebar/_content.html.erb +2 -2
  208. data/app/views/articles/_archives_article.html.erb +3 -3
  209. data/app/views/articles/_article.html.erb +7 -9
  210. data/app/views/articles/_article_author.html.erb +4 -0
  211. data/app/views/articles/_article_content.html.erb +2 -2
  212. data/app/views/articles/_article_excerpt.html.erb +2 -2
  213. data/app/views/articles/_article_links.html.erb +1 -1
  214. data/app/views/articles/_comment_errors.html.erb +1 -1
  215. data/app/views/articles/_comment_form.html.erb +12 -12
  216. data/app/views/articles/_comment_preview.html.erb +3 -3
  217. data/app/views/articles/_password_form.html.erb +4 -4
  218. data/app/views/articles/_trackback.html.erb +2 -2
  219. data/app/views/articles/archives.html.erb +1 -1
  220. data/app/views/articles/feedback_atom_feed.atom.builder +3 -1
  221. data/app/views/articles/feedback_rss_feed.rss.builder +9 -8
  222. data/app/views/articles/index_atom_feed.atom.builder +5 -3
  223. data/app/views/articles/index_rss_feed.rss.builder +10 -9
  224. data/app/views/articles/live_search.html.erb +3 -3
  225. data/app/views/articles/read.html.erb +16 -8
  226. data/app/views/articles/search.html.erb +2 -2
  227. data/app/views/articles/trackback.xml.builder +3 -1
  228. data/app/views/articles/view_page.html.erb +2 -2
  229. data/app/views/authors/show.html.erb +9 -9
  230. data/app/views/authors/show_atom_feed.atom.builder +4 -2
  231. data/app/views/authors/show_rss_feed.rss.builder +10 -9
  232. data/app/views/comments/_comment.html.erb +3 -3
  233. data/app/views/devise/mailer/reset_password_instructions.html.erb +7 -9
  234. data/app/views/devise/passwords/edit.html.erb +4 -4
  235. data/app/views/devise/passwords/new.html.erb +1 -1
  236. data/app/views/devise/registrations/new.html.erb +5 -5
  237. data/app/views/devise/sessions/new.html.erb +3 -3
  238. data/app/views/errors/404.html.erb +2 -2
  239. data/app/views/feedback/index.atom.builder +3 -1
  240. data/app/views/feedback/index.rss.builder +9 -8
  241. data/app/views/layouts/accounts.html.erb +26 -26
  242. data/app/views/layouts/administration.html.erb +31 -31
  243. data/app/views/layouts/default.html.erb +4 -3
  244. data/app/views/layouts/editor.html.erb +5 -19
  245. data/app/views/meta_sidebar/_content.html.erb +2 -2
  246. data/app/views/notes/_note.html.erb +1 -1
  247. data/app/views/notes/index.html.erb +1 -1
  248. data/app/views/notes/show_in_reply.html.erb +1 -1
  249. data/app/views/notification_mailer/_mail_footer.html.erb +3 -3
  250. data/app/views/notification_mailer/article.html.erb +2 -2
  251. data/app/views/notification_mailer/comment.html.erb +5 -5
  252. data/app/views/notification_mailer/notif_user.html.erb +1 -1
  253. data/app/views/page_sidebar/_content.html.erb +1 -1
  254. data/app/views/search_sidebar/_content.html.erb +2 -2
  255. data/app/views/settings/install.html.erb +2 -2
  256. data/app/views/setup/index.html.erb +7 -7
  257. data/app/views/shared/_atom_header.atom.builder +4 -4
  258. data/app/views/shared/_atom_item_article.atom.builder +19 -29
  259. data/app/views/shared/_atom_item_comment.atom.builder +4 -2
  260. data/app/views/shared/_atom_item_trackback.atom.builder +4 -2
  261. data/app/views/shared/_google_analytics.html.erb +8 -0
  262. data/app/views/shared/_page_header.html.erb +9 -12
  263. data/app/views/shared/_rss_item_article.rss.builder +9 -7
  264. data/app/views/shared/_rss_item_comment.rss.builder +3 -1
  265. data/app/views/shared/_rss_item_trackback.rss.builder +3 -1
  266. data/app/views/sidebar/display_plugins.html.erb +1 -1
  267. data/app/views/tag_sidebar/_content.html.erb +1 -1
  268. data/app/views/tags/index.html.erb +1 -1
  269. data/app/views/xml/_googlesitemap_item_article.googlesitemap.builder +2 -0
  270. data/app/views/xml/_googlesitemap_item_category.googlesitemap.builder +2 -0
  271. data/app/views/xml/_googlesitemap_item_page.googlesitemap.builder +2 -0
  272. data/app/views/xml/_googlesitemap_item_tag.googlesitemap.builder +2 -0
  273. data/app/views/xml/sitemap.googlesitemap.builder +4 -2
  274. data/config/i18n-tasks.yml +0 -5
  275. data/config/initializers/devise.rb +10 -4
  276. data/config/initializers/mime_types.rb +3 -1
  277. data/config/locales/da.yml +134 -73
  278. data/config/locales/de.yml +142 -77
  279. data/config/locales/en.yml +128 -68
  280. data/config/locales/es-MX.yml +135 -71
  281. data/config/locales/fr.yml +167 -88
  282. data/config/locales/he.yml +128 -72
  283. data/config/locales/it.yml +136 -74
  284. data/config/locales/ja.yml +110 -66
  285. data/config/locales/lt.yml +153 -76
  286. data/config/locales/nb-NO.yml +123 -67
  287. data/config/locales/nl.yml +140 -77
  288. data/config/locales/pl.yml +329 -240
  289. data/config/locales/pt-BR.yml +137 -72
  290. data/config/locales/ro.yml +148 -72
  291. data/config/locales/ru.yml +161 -71
  292. data/config/locales/zh-CN.yml +106 -61
  293. data/config/locales/zh-TW.yml +109 -63
  294. data/config/routes.rb +68 -63
  295. data/db/migrate/113_initial_schema.rb +191 -191
  296. data/db/migrate/114_fixes_buggy_articles_and_notes.rb +10 -7
  297. data/db/migrate/115_drops_categories_for_tags.rb +5 -4
  298. data/db/migrate/20150207131657_add_missing_indexes.rb +2 -0
  299. data/db/migrate/20150807134129_simplify_redirect_relations.rb +5 -0
  300. data/db/migrate/20150808052637_add_blog_ids.rb +9 -3
  301. data/db/migrate/20150808191127_add_blog_id_to_redirects.rb +2 -0
  302. data/db/migrate/20150810094754_add_blog_id_to_tags.rb +2 -0
  303. data/db/migrate/20160108111120_add_devise_to_users.rb +4 -2
  304. data/db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb +2 -0
  305. data/db/migrate/20160110094906_remove_profiles_rights.rb +2 -0
  306. data/db/migrate/20160605103918_replace_profile_id_with_string.rb +2 -0
  307. data/db/migrate/20160605154632_remove_profiles.rb +10 -5
  308. data/db/migrate/20160701061851_demand_blog_id_on_contents.rb +2 -0
  309. data/db/migrate/20160701062604_add_blog_id_to_resources.rb +2 -0
  310. data/db/migrate/20170528093024_move_resources_to_content.rb +2 -0
  311. data/db/migrate/20170528094923_move_tags_to_content.rb +2 -0
  312. data/db/migrate/20170528201606_remove_separate_published_flag.rb +2 -0
  313. data/db/migrate/20170605071626_remove_extra_state_columns_from_feedback.rb +2 -0
  314. data/db/migrate/20170702105201_remove_published_at_from_feedback.rb +2 -0
  315. data/db/migrate/20190208151235_add_text_filter_name_fields.rb +9 -0
  316. data/db/migrate/20190208152646_move_text_filter_to_name.rb +97 -0
  317. data/db/migrate/20190209155717_remove_text_filter_ids.rb +19 -0
  318. data/db/migrate/20190209160610_remove_text_filters.rb +17 -0
  319. data/db/migrate/20200413140440_add_unique_indexes.rb +10 -0
  320. data/db/seeds.rb +8 -20
  321. data/lib/email_notify.rb +3 -1
  322. data/lib/format.rb +4 -12
  323. data/lib/publify_core.rb +36 -35
  324. data/lib/publify_core/engine.rb +11 -4
  325. data/lib/publify_core/lang.rb +5 -1
  326. data/lib/publify_core/testing_support/dns_mock.rb +15 -0
  327. data/lib/publify_core/testing_support/factories.rb +240 -0
  328. data/lib/publify_core/testing_support/feed_assertions.rb +48 -0
  329. data/lib/publify_core/testing_support/fixtures/exploit.svg +4 -0
  330. data/lib/publify_core/testing_support/fixtures/fakepng.png +1 -0
  331. data/lib/publify_core/testing_support/fixtures/otherfile.txt +1 -0
  332. data/lib/publify_core/testing_support/fixtures/testfile.png +0 -0
  333. data/lib/publify_core/testing_support/fixtures/testfile.txt +1 -0
  334. data/lib/publify_core/testing_support/upload_fixtures.rb +15 -0
  335. data/lib/publify_core/version.rb +3 -1
  336. data/lib/publify_guid.rb +3 -1
  337. data/lib/publify_plugins.rb +10 -5
  338. data/lib/publify_textfilter_markdown.rb +38 -25
  339. data/lib/publify_textfilter_none.rb +5 -3
  340. data/lib/publify_textfilter_smartypants.rb +5 -3
  341. data/lib/publify_textfilter_textile.rb +7 -4
  342. data/lib/publify_textfilter_twitterfilter.rb +13 -7
  343. data/lib/publify_time.rb +4 -0
  344. data/lib/sidebar_field.rb +15 -13
  345. data/lib/sidebar_registry.rb +5 -3
  346. data/lib/spam_protection.rb +19 -17
  347. data/lib/tasks/i18n.rake +9 -0
  348. data/lib/tasks/manifest.rake +30 -0
  349. data/lib/tasks/publify_core_tasks.rake +2 -0
  350. data/lib/text_filter_plugin.rb +30 -29
  351. data/lib/theme.rb +5 -5
  352. data/lib/transforms.rb +21 -20
  353. data/themes/plain/javascripts/theme.js +0 -0
  354. metadata +247 -109
  355. data/app/assets/javascripts/widearea.js +0 -486
  356. data/app/assets/stylesheets/widearea.css +0 -133
  357. data/app/controllers/admin/textfilters_controller.rb +0 -6
  358. data/app/views/admin/dashboard/_inbound.html.erb +0 -31
  359. data/app/views/admin/notes/_header.html.erb +0 -6
  360. data/app/views/articles/_protected_article_content.html.erb +0 -6
@@ -0,0 +1,37 @@
1
+ //
2
+ // Close icons
3
+ // --------------------------------------------------
4
+
5
+
6
+ .close {
7
+ float: right;
8
+ font-size: ($font-size-base * 1.5);
9
+ font-weight: $close-font-weight;
10
+ line-height: 1;
11
+ color: $close-color;
12
+ text-shadow: $close-text-shadow;
13
+ @include opacity(.2);
14
+
15
+ &:hover,
16
+ &:focus {
17
+ color: $close-color;
18
+ text-decoration: none;
19
+ cursor: pointer;
20
+ @include opacity(.5);
21
+ }
22
+
23
+ // [converter] extracted button& to button.close
24
+ }
25
+
26
+ // Additional properties for button version
27
+ // iOS requires the button element instead of an anchor tag.
28
+ // If you want the anchor version, it requires `href="#"`.
29
+ // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
30
+ button.close {
31
+ padding: 0;
32
+ cursor: pointer;
33
+ background: transparent;
34
+ border: 0;
35
+ -webkit-appearance: none;
36
+ appearance: none;
37
+ }
@@ -0,0 +1,69 @@
1
+ //
2
+ // Code (inline and block)
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Inline and block code styles
7
+ code,
8
+ kbd,
9
+ pre,
10
+ samp {
11
+ font-family: $font-family-monospace;
12
+ }
13
+
14
+ // Inline code
15
+ code {
16
+ padding: 2px 4px;
17
+ font-size: 90%;
18
+ color: $code-color;
19
+ background-color: $code-bg;
20
+ border-radius: $border-radius-base;
21
+ }
22
+
23
+ // User input typically entered via keyboard
24
+ kbd {
25
+ padding: 2px 4px;
26
+ font-size: 90%;
27
+ color: $kbd-color;
28
+ background-color: $kbd-bg;
29
+ border-radius: $border-radius-small;
30
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
31
+
32
+ kbd {
33
+ padding: 0;
34
+ font-size: 100%;
35
+ font-weight: 700;
36
+ box-shadow: none;
37
+ }
38
+ }
39
+
40
+ // Blocks of code
41
+ pre {
42
+ display: block;
43
+ padding: (($line-height-computed - 1) / 2);
44
+ margin: 0 0 ($line-height-computed / 2);
45
+ font-size: ($font-size-base - 1); // 14px to 13px
46
+ line-height: $line-height-base;
47
+ color: $pre-color;
48
+ word-break: break-all;
49
+ word-wrap: break-word;
50
+ background-color: $pre-bg;
51
+ border: 1px solid $pre-border-color;
52
+ border-radius: $border-radius-base;
53
+
54
+ // Account for some code outputs that place code tags in pre tags
55
+ code {
56
+ padding: 0;
57
+ font-size: inherit;
58
+ color: inherit;
59
+ white-space: pre-wrap;
60
+ background-color: transparent;
61
+ border-radius: 0;
62
+ }
63
+ }
64
+
65
+ // Enable scrollable blocks of code
66
+ .pre-scrollable {
67
+ max-height: $pre-scrollable-max-height;
68
+ overflow-y: scroll;
69
+ }
@@ -0,0 +1,38 @@
1
+ //
2
+ // Component animations
3
+ // --------------------------------------------------
4
+
5
+ // Heads up!
6
+ //
7
+ // We don't use the `.opacity()` mixin here since it causes a bug with text
8
+ // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552.
9
+
10
+ .fade {
11
+ opacity: 0;
12
+ @include transition(opacity .15s linear);
13
+
14
+ &.in {
15
+ opacity: 1;
16
+ }
17
+ }
18
+
19
+ .collapse {
20
+ display: none;
21
+
22
+ &.in { display: block; }
23
+ // [converter] extracted tr&.in to tr.collapse.in
24
+ // [converter] extracted tbody&.in to tbody.collapse.in
25
+ }
26
+
27
+ tr.collapse.in { display: table-row; }
28
+
29
+ tbody.collapse.in { display: table-row-group; }
30
+
31
+ .collapsing {
32
+ position: relative;
33
+ height: 0;
34
+ overflow: hidden;
35
+ @include transition-property(height, visibility);
36
+ @include transition-duration(.35s);
37
+ @include transition-timing-function(ease);
38
+ }
@@ -0,0 +1,213 @@
1
+ //
2
+ // Dropdown menus
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Dropdown arrow/caret
7
+ .caret {
8
+ display: inline-block;
9
+ width: 0;
10
+ height: 0;
11
+ margin-left: 2px;
12
+ vertical-align: middle;
13
+ border-top: $caret-width-base dashed;
14
+ border-top: $caret-width-base solid \9; // IE8
15
+ border-right: $caret-width-base solid transparent;
16
+ border-left: $caret-width-base solid transparent;
17
+ }
18
+
19
+ // The dropdown wrapper (div)
20
+ .dropup,
21
+ .dropdown {
22
+ position: relative;
23
+ }
24
+
25
+ // Prevent the focus on the dropdown toggle when closing dropdowns
26
+ .dropdown-toggle:focus {
27
+ outline: 0;
28
+ }
29
+
30
+ // The dropdown menu (ul)
31
+ .dropdown-menu {
32
+ position: absolute;
33
+ top: 100%;
34
+ left: 0;
35
+ z-index: $zindex-dropdown;
36
+ display: none; // none by default, but block on "open" of the menu
37
+ float: left;
38
+ min-width: 160px;
39
+ padding: 5px 0;
40
+ margin: 2px 0 0; // override default ul
41
+ font-size: $font-size-base;
42
+ text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
43
+ list-style: none;
44
+ background-color: $dropdown-bg;
45
+ background-clip: padding-box;
46
+ border: 1px solid $dropdown-fallback-border; // IE8 fallback
47
+ border: 1px solid $dropdown-border;
48
+ border-radius: $border-radius-base;
49
+ @include box-shadow(0 6px 12px rgba(0, 0, 0, .175));
50
+
51
+ // Aligns the dropdown menu to right
52
+ //
53
+ // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
54
+ &.pull-right {
55
+ right: 0;
56
+ left: auto;
57
+ }
58
+
59
+ // Dividers (basically an hr) within the dropdown
60
+ .divider {
61
+ @include nav-divider($dropdown-divider-bg);
62
+ }
63
+
64
+ // Links within the dropdown menu
65
+ > li > a {
66
+ display: block;
67
+ padding: 3px 20px;
68
+ clear: both;
69
+ font-weight: 400;
70
+ line-height: $line-height-base;
71
+ color: $dropdown-link-color;
72
+ white-space: nowrap; // prevent links from randomly breaking onto new lines
73
+
74
+ &:hover,
75
+ &:focus {
76
+ color: $dropdown-link-hover-color;
77
+ text-decoration: none;
78
+ background-color: $dropdown-link-hover-bg;
79
+ }
80
+ }
81
+ }
82
+
83
+ // Active state
84
+ .dropdown-menu > .active > a {
85
+ &,
86
+ &:hover,
87
+ &:focus {
88
+ color: $dropdown-link-active-color;
89
+ text-decoration: none;
90
+ background-color: $dropdown-link-active-bg;
91
+ outline: 0;
92
+ }
93
+ }
94
+
95
+ // Disabled state
96
+ //
97
+ // Gray out text and ensure the hover/focus state remains gray
98
+
99
+ .dropdown-menu > .disabled > a {
100
+ &,
101
+ &:hover,
102
+ &:focus {
103
+ color: $dropdown-link-disabled-color;
104
+ }
105
+
106
+ // Nuke hover/focus effects
107
+ &:hover,
108
+ &:focus {
109
+ text-decoration: none;
110
+ cursor: $cursor-disabled;
111
+ background-color: transparent;
112
+ background-image: none; // Remove CSS gradient
113
+ @include reset-filter;
114
+ }
115
+ }
116
+
117
+ // Open state for the dropdown
118
+ .open {
119
+ // Show the menu
120
+ > .dropdown-menu {
121
+ display: block;
122
+ }
123
+
124
+ // Remove the outline when :focus is triggered
125
+ > a {
126
+ outline: 0;
127
+ }
128
+ }
129
+
130
+ // Menu positioning
131
+ //
132
+ // Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
133
+ // menu with the parent.
134
+ .dropdown-menu-right {
135
+ right: 0;
136
+ left: auto; // Reset the default from `.dropdown-menu`
137
+ }
138
+ // With v3, we enabled auto-flipping if you have a dropdown within a right
139
+ // aligned nav component. To enable the undoing of that, we provide an override
140
+ // to restore the default dropdown menu alignment.
141
+ //
142
+ // This is only for left-aligning a dropdown menu within a `.navbar-right` or
143
+ // `.pull-right` nav component.
144
+ .dropdown-menu-left {
145
+ right: auto;
146
+ left: 0;
147
+ }
148
+
149
+ // Dropdown section headers
150
+ .dropdown-header {
151
+ display: block;
152
+ padding: 3px 20px;
153
+ font-size: $font-size-small;
154
+ line-height: $line-height-base;
155
+ color: $dropdown-header-color;
156
+ white-space: nowrap; // as with > li > a
157
+ }
158
+
159
+ // Backdrop to catch body clicks on mobile, etc.
160
+ .dropdown-backdrop {
161
+ position: fixed;
162
+ top: 0;
163
+ right: 0;
164
+ bottom: 0;
165
+ left: 0;
166
+ z-index: ($zindex-dropdown - 10);
167
+ }
168
+
169
+ // Right aligned dropdowns
170
+ .pull-right > .dropdown-menu {
171
+ right: 0;
172
+ left: auto;
173
+ }
174
+
175
+ // Allow for dropdowns to go bottom up (aka, dropup-menu)
176
+ //
177
+ // Just add .dropup after the standard .dropdown class and you're set, bro.
178
+ // TODO: abstract this so that the navbar fixed styles are not placed here?
179
+
180
+ .dropup,
181
+ .navbar-fixed-bottom .dropdown {
182
+ // Reverse the caret
183
+ .caret {
184
+ content: "";
185
+ border-top: 0;
186
+ border-bottom: $caret-width-base dashed;
187
+ border-bottom: $caret-width-base solid \9; // IE8
188
+ }
189
+ // Different positioning for bottom up menu
190
+ .dropdown-menu {
191
+ top: auto;
192
+ bottom: 100%;
193
+ margin-bottom: 2px;
194
+ }
195
+ }
196
+
197
+
198
+ // Component alignment
199
+ //
200
+ // Reiterate per navbar.less and the modified component alignment there.
201
+
202
+ @media (min-width: $grid-float-breakpoint) {
203
+ .navbar-right {
204
+ .dropdown-menu {
205
+ right: 0; left: auto;
206
+ }
207
+ // Necessary for overrides of the default right aligned menu.
208
+ // Will remove come v4 in all likelihood.
209
+ .dropdown-menu-left {
210
+ left: 0; right: auto;
211
+ }
212
+ }
213
+ }
@@ -0,0 +1,586 @@
1
+ //
2
+ // Forms
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Normalize non-controls
7
+ //
8
+ // Restyle and baseline non-control form elements.
9
+
10
+ fieldset {
11
+ // Chrome and Firefox set a `min-width: min-content;` on fieldsets,
12
+ // so we reset that to ensure it behaves more like a standard block element.
13
+ // See https://github.com/twbs/bootstrap/issues/12359.
14
+ min-width: 0;
15
+ padding: 0;
16
+ margin: 0;
17
+ border: 0;
18
+ }
19
+
20
+ legend {
21
+ display: block;
22
+ width: 100%;
23
+ padding: 0;
24
+ margin-bottom: $line-height-computed;
25
+ font-size: ($font-size-base * 1.5);
26
+ line-height: inherit;
27
+ color: $legend-color;
28
+ border: 0;
29
+ border-bottom: 1px solid $legend-border-color;
30
+ }
31
+
32
+ label {
33
+ display: inline-block;
34
+ max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)
35
+ margin-bottom: 5px;
36
+ font-weight: 700;
37
+ }
38
+
39
+
40
+ // Normalize form controls
41
+ //
42
+ // While most of our form styles require extra classes, some basic normalization
43
+ // is required to ensure optimum display with or without those classes to better
44
+ // address browser inconsistencies.
45
+
46
+ input[type="search"] {
47
+ // Override content-box in Normalize (* isn't specific enough)
48
+ @include box-sizing(border-box);
49
+
50
+ // Search inputs in iOS
51
+ //
52
+ // This overrides the extra rounded corners on search inputs in iOS so that our
53
+ // `.form-control` class can properly style them. Note that this cannot simply
54
+ // be added to `.form-control` as it's not specific enough. For details, see
55
+ // https://github.com/twbs/bootstrap/issues/11586.
56
+ -webkit-appearance: none;
57
+ appearance: none;
58
+ }
59
+
60
+ // Position radios and checkboxes better
61
+ input[type="radio"],
62
+ input[type="checkbox"] {
63
+ margin: 4px 0 0;
64
+ margin-top: 1px \9; // IE8-9
65
+ line-height: normal;
66
+
67
+ // Apply same disabled cursor tweak as for inputs
68
+ // Some special care is needed because <label>s don't inherit their parent's `cursor`.
69
+ //
70
+ // Note: Neither radios nor checkboxes can be readonly.
71
+ &[disabled],
72
+ &.disabled,
73
+ fieldset[disabled] & {
74
+ cursor: $cursor-disabled;
75
+ }
76
+ }
77
+
78
+ input[type="file"] {
79
+ display: block;
80
+ }
81
+
82
+ // Make range inputs behave like textual form controls
83
+ input[type="range"] {
84
+ display: block;
85
+ width: 100%;
86
+ }
87
+
88
+ // Make multiple select elements height not fixed
89
+ select[multiple],
90
+ select[size] {
91
+ height: auto;
92
+ }
93
+
94
+ // Focus for file, radio, and checkbox
95
+ input[type="file"]:focus,
96
+ input[type="radio"]:focus,
97
+ input[type="checkbox"]:focus {
98
+ @include tab-focus;
99
+ }
100
+
101
+ // Adjust output element
102
+ output {
103
+ display: block;
104
+ padding-top: ($padding-base-vertical + 1);
105
+ font-size: $font-size-base;
106
+ line-height: $line-height-base;
107
+ color: $input-color;
108
+ }
109
+
110
+
111
+ // Common form controls
112
+ //
113
+ // Shared size and type resets for form controls. Apply `.form-control` to any
114
+ // of the following form controls:
115
+ //
116
+ // select
117
+ // textarea
118
+ // input[type="text"]
119
+ // input[type="password"]
120
+ // input[type="datetime"]
121
+ // input[type="datetime-local"]
122
+ // input[type="date"]
123
+ // input[type="month"]
124
+ // input[type="time"]
125
+ // input[type="week"]
126
+ // input[type="number"]
127
+ // input[type="email"]
128
+ // input[type="url"]
129
+ // input[type="search"]
130
+ // input[type="tel"]
131
+ // input[type="color"]
132
+
133
+ .form-control {
134
+ display: block;
135
+ width: 100%;
136
+ height: $input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
137
+ padding: $padding-base-vertical $padding-base-horizontal;
138
+ font-size: $font-size-base;
139
+ line-height: $line-height-base;
140
+ color: $input-color;
141
+ background-color: $input-bg;
142
+ background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
143
+ border: 1px solid $input-border;
144
+ border-radius: $input-border-radius; // Note: This has no effect on <select>s in some browsers, due to the limited stylability of <select>s in CSS.
145
+ @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075));
146
+ @include transition(border-color ease-in-out .15s, box-shadow ease-in-out .15s);
147
+
148
+ // Customize the `:focus` state to imitate native WebKit styles.
149
+ @include form-control-focus;
150
+
151
+ // Placeholder
152
+ @include placeholder;
153
+
154
+ // Unstyle the caret on `<select>`s in IE10+.
155
+ &::-ms-expand {
156
+ background-color: transparent;
157
+ border: 0;
158
+ }
159
+
160
+ // Disabled and read-only inputs
161
+ //
162
+ // HTML5 says that controls under a fieldset > legend:first-child won't be
163
+ // disabled if the fieldset is disabled. Due to implementation difficulty, we
164
+ // don't honor that edge case; we style them as disabled anyway.
165
+ &[disabled],
166
+ &[readonly],
167
+ fieldset[disabled] & {
168
+ background-color: $input-bg-disabled;
169
+ opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655
170
+ }
171
+
172
+ &[disabled],
173
+ fieldset[disabled] & {
174
+ cursor: $cursor-disabled;
175
+ }
176
+
177
+ // [converter] extracted textarea& to textarea.form-control
178
+ }
179
+
180
+ // Reset height for `textarea`s
181
+ textarea.form-control {
182
+ height: auto;
183
+ }
184
+
185
+
186
+ // Special styles for iOS temporal inputs
187
+ //
188
+ // In Mobile Safari, setting `display: block` on temporal inputs causes the
189
+ // text within the input to become vertically misaligned. As a workaround, we
190
+ // set a pixel line-height that matches the given height of the input, but only
191
+ // for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848
192
+ //
193
+ // Note that as of 9.3, iOS doesn't support `week`.
194
+
195
+ @media screen and (-webkit-min-device-pixel-ratio: 0) {
196
+ input[type="date"],
197
+ input[type="time"],
198
+ input[type="datetime-local"],
199
+ input[type="month"] {
200
+ &.form-control {
201
+ line-height: $input-height-base;
202
+ }
203
+
204
+ &.input-sm {
205
+ line-height: $input-height-small;
206
+ }
207
+
208
+ &.input-lg {
209
+ line-height: $input-height-large;
210
+ }
211
+ }
212
+ }
213
+
214
+
215
+ // Form groups
216
+ //
217
+ // Designed to help with the organization and spacing of vertical forms. For
218
+ // horizontal forms, use the predefined grid classes.
219
+
220
+ .form-group {
221
+ margin-bottom: $form-group-margin-bottom;
222
+ }
223
+
224
+
225
+ // Checkboxes and radios
226
+ //
227
+ // Indent the labels to position radios/checkboxes as hanging controls.
228
+
229
+ .radio,
230
+ .checkbox {
231
+ position: relative;
232
+ display: block;
233
+ margin-top: 10px;
234
+ margin-bottom: 10px;
235
+
236
+ // These are used on elements with <label> descendants
237
+ &.disabled,
238
+ fieldset[disabled] & {
239
+ label {
240
+ cursor: $cursor-disabled;
241
+ }
242
+ }
243
+
244
+ label {
245
+ min-height: $line-height-computed; // Ensure the input doesn't jump when there is no text
246
+ padding-left: 20px;
247
+ margin-bottom: 0;
248
+ font-weight: 400;
249
+ cursor: pointer;
250
+ }
251
+ }
252
+ .radio input[type="radio"],
253
+ .radio-inline input[type="radio"],
254
+ .checkbox input[type="checkbox"],
255
+ .checkbox-inline input[type="checkbox"] {
256
+ position: absolute;
257
+ margin-top: 4px \9;
258
+ margin-left: -20px;
259
+ }
260
+
261
+ .radio + .radio,
262
+ .checkbox + .checkbox {
263
+ margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
264
+ }
265
+
266
+ // Radios and checkboxes on same line
267
+ .radio-inline,
268
+ .checkbox-inline {
269
+ position: relative;
270
+ display: inline-block;
271
+ padding-left: 20px;
272
+ margin-bottom: 0;
273
+ font-weight: 400;
274
+ vertical-align: middle;
275
+ cursor: pointer;
276
+
277
+ // These are used directly on <label>s
278
+ &.disabled,
279
+ fieldset[disabled] & {
280
+ cursor: $cursor-disabled;
281
+ }
282
+ }
283
+ .radio-inline + .radio-inline,
284
+ .checkbox-inline + .checkbox-inline {
285
+ margin-top: 0;
286
+ margin-left: 10px; // space out consecutive inline controls
287
+ }
288
+
289
+
290
+ // Static form control text
291
+ //
292
+ // Apply class to a `p` element to make any string of text align with labels in
293
+ // a horizontal form layout.
294
+
295
+ .form-control-static {
296
+ min-height: ($line-height-computed + $font-size-base);
297
+ // Size it appropriately next to real form controls
298
+ padding-top: ($padding-base-vertical + 1);
299
+ padding-bottom: ($padding-base-vertical + 1);
300
+ // Remove default margin from `p`
301
+ margin-bottom: 0;
302
+
303
+ &.input-lg,
304
+ &.input-sm {
305
+ padding-right: 0;
306
+ padding-left: 0;
307
+ }
308
+ }
309
+
310
+
311
+ // Form control sizing
312
+ //
313
+ // Build on `.form-control` with modifier classes to decrease or increase the
314
+ // height and font-size of form controls.
315
+ //
316
+ // The `.form-group-* form-control` variations are sadly duplicated to avoid the
317
+ // issue documented in https://github.com/twbs/bootstrap/issues/15074.
318
+
319
+ @include input-size('.input-sm', $input-height-small, $padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $input-border-radius-small);
320
+ .form-group-sm {
321
+ .form-control {
322
+ height: $input-height-small;
323
+ padding: $padding-small-vertical $padding-small-horizontal;
324
+ font-size: $font-size-small;
325
+ line-height: $line-height-small;
326
+ border-radius: $input-border-radius-small;
327
+ }
328
+ select.form-control {
329
+ height: $input-height-small;
330
+ line-height: $input-height-small;
331
+ }
332
+ textarea.form-control,
333
+ select[multiple].form-control {
334
+ height: auto;
335
+ }
336
+ .form-control-static {
337
+ height: $input-height-small;
338
+ min-height: ($line-height-computed + $font-size-small);
339
+ padding: ($padding-small-vertical + 1) $padding-small-horizontal;
340
+ font-size: $font-size-small;
341
+ line-height: $line-height-small;
342
+ }
343
+ }
344
+
345
+ @include input-size('.input-lg', $input-height-large, $padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $input-border-radius-large);
346
+ .form-group-lg {
347
+ .form-control {
348
+ height: $input-height-large;
349
+ padding: $padding-large-vertical $padding-large-horizontal;
350
+ font-size: $font-size-large;
351
+ line-height: $line-height-large;
352
+ border-radius: $input-border-radius-large;
353
+ }
354
+ select.form-control {
355
+ height: $input-height-large;
356
+ line-height: $input-height-large;
357
+ }
358
+ textarea.form-control,
359
+ select[multiple].form-control {
360
+ height: auto;
361
+ }
362
+ .form-control-static {
363
+ height: $input-height-large;
364
+ min-height: ($line-height-computed + $font-size-large);
365
+ padding: ($padding-large-vertical + 1) $padding-large-horizontal;
366
+ font-size: $font-size-large;
367
+ line-height: $line-height-large;
368
+ }
369
+ }
370
+
371
+
372
+ // Form control feedback states
373
+ //
374
+ // Apply contextual and semantic states to individual form controls.
375
+
376
+ .has-feedback {
377
+ // Enable absolute positioning
378
+ position: relative;
379
+
380
+ // Ensure icons don't overlap text
381
+ .form-control {
382
+ padding-right: ($input-height-base * 1.25);
383
+ }
384
+ }
385
+ // Feedback icon (requires .glyphicon classes)
386
+ .form-control-feedback {
387
+ position: absolute;
388
+ top: 0;
389
+ right: 0;
390
+ z-index: 2; // Ensure icon is above input groups
391
+ display: block;
392
+ width: $input-height-base;
393
+ height: $input-height-base;
394
+ line-height: $input-height-base;
395
+ text-align: center;
396
+ pointer-events: none;
397
+ }
398
+ .input-lg + .form-control-feedback,
399
+ .form-group-lg .form-control + .form-control-feedback {
400
+ width: $input-height-large;
401
+ height: $input-height-large;
402
+ line-height: $input-height-large;
403
+ }
404
+ .input-sm + .form-control-feedback,
405
+ .form-group-sm .form-control + .form-control-feedback {
406
+ width: $input-height-small;
407
+ height: $input-height-small;
408
+ line-height: $input-height-small;
409
+ }
410
+
411
+ // Feedback states
412
+ .has-success {
413
+ @include form-control-validation($state-success-text, $state-success-text, $state-success-bg);
414
+ }
415
+ .has-warning {
416
+ @include form-control-validation($state-warning-text, $state-warning-text, $state-warning-bg);
417
+ }
418
+ .has-error {
419
+ @include form-control-validation($state-danger-text, $state-danger-text, $state-danger-bg);
420
+ }
421
+
422
+ // Reposition feedback icon if input has visible label above
423
+ .has-feedback label {
424
+
425
+ & ~ .form-control-feedback {
426
+ top: ($line-height-computed + 5); // Height of the `label` and its margin
427
+ }
428
+ &.sr-only ~ .form-control-feedback {
429
+ top: 0;
430
+ }
431
+ }
432
+
433
+
434
+ // Help text
435
+ //
436
+ // Apply to any element you wish to create light text for placement immediately
437
+ // below a form control. Use for general help, formatting, or instructional text.
438
+
439
+ .help-block {
440
+ display: block; // account for any element using help-block
441
+ margin-top: 5px;
442
+ margin-bottom: 10px;
443
+ color: lighten($text-color, 25%); // lighten the text some for contrast
444
+ }
445
+
446
+
447
+ // Inline forms
448
+ //
449
+ // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
450
+ // forms begin stacked on extra small (mobile) devices and then go inline when
451
+ // viewports reach <768px.
452
+ //
453
+ // Requires wrapping inputs and labels with `.form-group` for proper display of
454
+ // default HTML form controls and our custom form controls (e.g., input groups).
455
+ //
456
+
457
+ // [converter] extracted from `.form-inline` for libsass compatibility
458
+ @mixin form-inline {
459
+
460
+ // Kick in the inline
461
+ @media (min-width: $screen-sm-min) {
462
+ // Inline-block all the things for "inline"
463
+ .form-group {
464
+ display: inline-block;
465
+ margin-bottom: 0;
466
+ vertical-align: middle;
467
+ }
468
+
469
+ // In navbar-form, allow folks to *not* use `.form-group`
470
+ .form-control {
471
+ display: inline-block;
472
+ width: auto; // Prevent labels from stacking above inputs in `.form-group`
473
+ vertical-align: middle;
474
+ }
475
+
476
+ // Make static controls behave like regular ones
477
+ .form-control-static {
478
+ display: inline-block;
479
+ }
480
+
481
+ .control-label {
482
+ margin-bottom: 0;
483
+ vertical-align: middle;
484
+ }
485
+
486
+ // Remove default margin on radios/checkboxes that were used for stacking, and
487
+ // then undo the floating of radios and checkboxes to match.
488
+ .radio,
489
+ .checkbox {
490
+ display: inline-block;
491
+ margin-top: 0;
492
+ margin-bottom: 0;
493
+ vertical-align: middle;
494
+
495
+ label {
496
+ padding-left: 0;
497
+ }
498
+ }
499
+ .radio input[type="radio"],
500
+ .checkbox input[type="checkbox"] {
501
+ position: relative;
502
+ margin-left: 0;
503
+ }
504
+
505
+ // Re-override the feedback icon.
506
+ .has-feedback .form-control-feedback {
507
+ top: 0;
508
+ }
509
+ }
510
+ }
511
+ // [converter] extracted as `@mixin form-inline` for libsass compatibility
512
+ .form-inline {
513
+ @include form-inline;
514
+ }
515
+
516
+
517
+
518
+ // Horizontal forms
519
+ //
520
+ // Horizontal forms are built on grid classes and allow you to create forms with
521
+ // labels on the left and inputs on the right.
522
+
523
+ .form-horizontal {
524
+
525
+ // Consistent vertical alignment of radios and checkboxes
526
+ //
527
+ // Labels also get some reset styles, but that is scoped to a media query below.
528
+ .radio,
529
+ .checkbox,
530
+ .radio-inline,
531
+ .checkbox-inline {
532
+ padding-top: ($padding-base-vertical + 1); // Default padding plus a border
533
+ margin-top: 0;
534
+ margin-bottom: 0;
535
+ }
536
+ // Account for padding we're adding to ensure the alignment and of help text
537
+ // and other content below items
538
+ .radio,
539
+ .checkbox {
540
+ min-height: ($line-height-computed + ($padding-base-vertical + 1));
541
+ }
542
+
543
+ // Make form groups behave like rows
544
+ .form-group {
545
+ @include make-row;
546
+ }
547
+
548
+ // Reset spacing and right align labels, but scope to media queries so that
549
+ // labels on narrow viewports stack the same as a default form example.
550
+ @media (min-width: $screen-sm-min) {
551
+ .control-label {
552
+ padding-top: ($padding-base-vertical + 1); // Default padding plus a border
553
+ margin-bottom: 0;
554
+ text-align: right;
555
+ }
556
+ }
557
+
558
+ // Validation states
559
+ //
560
+ // Reposition the icon because it's now within a grid column and columns have
561
+ // `position: relative;` on them. Also accounts for the grid gutter padding.
562
+ .has-feedback .form-control-feedback {
563
+ right: floor(($grid-gutter-width / 2));
564
+ }
565
+
566
+ // Form group sizes
567
+ //
568
+ // Quick utility class for applying `.input-lg` and `.input-sm` styles to the
569
+ // inputs and labels within a `.form-group`.
570
+ .form-group-lg {
571
+ @media (min-width: $screen-sm-min) {
572
+ .control-label {
573
+ padding-top: ($padding-large-vertical + 1);
574
+ font-size: $font-size-large;
575
+ }
576
+ }
577
+ }
578
+ .form-group-sm {
579
+ @media (min-width: $screen-sm-min) {
580
+ .control-label {
581
+ padding-top: ($padding-small-vertical + 1);
582
+ font-size: $font-size-small;
583
+ }
584
+ }
585
+ }
586
+ }