publify_core 9.2.10 → 10.0.0

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 (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -18
  3. data/app/assets/javascripts/lang/ar_AR.js +17 -0
  4. data/app/controllers/admin/{content_controller.rb → articles_controller.rb} +24 -24
  5. data/app/controllers/admin/dashboard_controller.rb +3 -3
  6. data/app/controllers/admin/feedback_controller.rb +23 -23
  7. data/app/controllers/admin/pages_controller.rb +2 -2
  8. data/app/controllers/admin/post_types_controller.rb +10 -4
  9. data/app/controllers/admin/redirects_controller.rb +10 -6
  10. data/app/controllers/admin/resources_controller.rb +2 -2
  11. data/app/controllers/admin/sidebar_controller.rb +2 -2
  12. data/app/controllers/admin/tags_controller.rb +5 -3
  13. data/app/controllers/admin/themes_controller.rb +1 -2
  14. data/app/controllers/admin/users_controller.rb +5 -3
  15. data/app/controllers/articles_controller.rb +5 -5
  16. data/app/controllers/authors_controller.rb +2 -2
  17. data/app/controllers/base_controller.rb +0 -3
  18. data/app/controllers/feedback_controller.rb +3 -3
  19. data/app/controllers/tags_controller.rb +3 -3
  20. data/app/helpers/authors_helper.rb +1 -1
  21. data/app/helpers/base_helper.rb +6 -6
  22. data/app/models/ability.rb +1 -1
  23. data/app/models/archives_sidebar.rb +3 -3
  24. data/app/models/article.rb +13 -13
  25. data/app/models/blog.rb +3 -6
  26. data/app/models/content.rb +1 -3
  27. data/app/models/content_base.rb +2 -13
  28. data/app/models/feedback.rb +1 -2
  29. data/app/models/meta_sidebar.rb +1 -1
  30. data/app/models/note.rb +2 -2
  31. data/app/models/redirect.rb +0 -1
  32. data/app/models/sidebar.rb +1 -1
  33. data/app/models/static_sidebar.rb +1 -1
  34. data/app/models/tag.rb +7 -8
  35. data/app/models/tag_sidebar.rb +3 -3
  36. data/app/models/text_filter.rb +17 -43
  37. data/app/models/user.rb +2 -2
  38. data/app/services/title_builder.rb +4 -4
  39. data/app/views/admin/{content → articles}/_article_list.html.erb +3 -3
  40. data/app/views/admin/{content → articles}/_form.html.erb +11 -1
  41. data/app/views/admin/{content → articles}/index.html.erb +1 -1
  42. data/app/views/admin/dashboard/_drafts.html.erb +2 -2
  43. data/app/views/admin/dashboard/_overview.html.erb +1 -1
  44. data/app/views/admin/dashboard/_welcome.html.erb +4 -4
  45. data/app/views/admin/dashboard/index.html.erb +0 -7
  46. data/app/views/admin/feedback/article.html.erb +12 -6
  47. data/app/views/admin/feedback/edit.html.erb +14 -2
  48. data/app/views/admin/feedback/index.html.erb +6 -7
  49. data/app/views/admin/pages/_form.html.erb +13 -14
  50. data/app/views/admin/seo/show.html.erb +12 -1
  51. data/app/views/admin/shared/_menu.html.erb +5 -4
  52. data/app/views/admin/tags/_index_and_form.html.erb +2 -1
  53. data/app/views/articles/_comment_errors.html.erb +11 -1
  54. data/app/views/articles/read.html.erb +1 -1
  55. data/app/views/layouts/administration.html.erb +9 -17
  56. data/config/i18n-tasks.yml +8 -1
  57. data/config/initializers/devise.rb +1 -1
  58. data/config/locales/ar.yml +885 -0
  59. data/config/locales/da.yml +12 -12
  60. data/config/locales/de.yml +12 -12
  61. data/config/locales/en.yml +12 -12
  62. data/config/locales/es-MX.yml +12 -12
  63. data/config/locales/fr.yml +12 -12
  64. data/config/locales/he.yml +12 -12
  65. data/config/locales/it.yml +12 -12
  66. data/config/locales/ja.yml +13 -13
  67. data/config/locales/lt.yml +12 -12
  68. data/config/locales/{nb-NO.yml → nb.yml} +13 -13
  69. data/config/locales/nl.yml +13 -13
  70. data/config/locales/pl.yml +12 -12
  71. data/config/locales/pt-BR.yml +12 -12
  72. data/config/locales/ro.yml +12 -12
  73. data/config/locales/ru.yml +13 -13
  74. data/config/locales/sidebars.ar.yml +20 -0
  75. data/config/locales/{sidebars.nb-NO.yml → sidebars.nb.yml} +1 -1
  76. data/config/locales/zh-CN.yml +12 -12
  77. data/config/locales/zh-TW.yml +12 -12
  78. data/config/routes.rb +2 -2
  79. data/db/migrate/20150807134129_simplify_redirect_relations.rb +1 -0
  80. data/db/migrate/20150808052637_add_blog_ids.rb +3 -1
  81. data/db/migrate/20160605103918_replace_profile_id_with_string.rb +1 -0
  82. data/db/migrate/20160701062604_add_blog_id_to_resources.rb +2 -0
  83. data/db/migrate/20190208152646_move_text_filter_to_name.rb +17 -17
  84. data/db/migrate/20221007091049_remove_table_sitealizer.rb +19 -0
  85. data/db/migrate/20221010092846_remove_page_caches_table.rb +15 -0
  86. data/db/migrate/20221012163214_remove_itunes_fields_from_resources.rb +14 -0
  87. data/db/seeds.rb +0 -4
  88. data/lib/publify_core/content_text_helpers.rb +11 -0
  89. data/lib/publify_core/lang.rb +1 -1
  90. data/lib/publify_core/testing_support/factories/articles.rb +55 -0
  91. data/lib/publify_core/testing_support/factories/blogs.rb +24 -0
  92. data/lib/publify_core/testing_support/factories/comments.rb +40 -0
  93. data/lib/publify_core/testing_support/factories/contents.rb +7 -0
  94. data/lib/publify_core/testing_support/factories/notes.rb +17 -0
  95. data/lib/publify_core/testing_support/factories/pages.rb +13 -0
  96. data/lib/publify_core/testing_support/factories/post_types.rb +8 -0
  97. data/lib/publify_core/testing_support/factories/redirects.rb +9 -0
  98. data/lib/publify_core/testing_support/factories/resources.rb +16 -0
  99. data/lib/publify_core/testing_support/factories/sequences.rb +12 -0
  100. data/lib/publify_core/testing_support/factories/sidebars.rb +10 -0
  101. data/lib/publify_core/testing_support/factories/tags.rb +9 -0
  102. data/lib/publify_core/testing_support/factories/trackbacks.rb +13 -0
  103. data/lib/publify_core/testing_support/factories/users.rb +43 -0
  104. data/lib/publify_core/version.rb +1 -1
  105. data/lib/publify_core.rb +3 -3
  106. data/lib/publify_textfilter_markdown.rb +8 -9
  107. data/lib/publify_textfilter_markdown_smartquotes.rb +20 -0
  108. data/lib/publify_textfilter_twitterfilter.rb +36 -18
  109. data/lib/sidebar_field.rb +2 -2
  110. data/lib/sidebar_registry.rb +0 -12
  111. data/lib/text_filter_plugin.rb +23 -30
  112. metadata +213 -105
  113. data/lib/publify_core/testing_support/factories.rb +0 -240
  114. data/lib/publify_textfilter_textile.rb +0 -24
  115. data/lib/tasks/i18n.rake +0 -9
  116. /data/app/views/admin/{content → articles}/autosave.js.erb +0 -0
  117. /data/app/views/admin/{content → articles}/edit.html.erb +0 -0
  118. /data/app/views/admin/{content → articles}/index.js.erb +0 -0
  119. /data/app/views/admin/{content → articles}/new.html.erb +0 -0
@@ -1,5 +1,5 @@
1
1
  <% content_for :page_heading do %>
2
- <h2>
2
+ <h2 class="page-title">
3
3
  <%= t('.feedback') %>
4
4
  </h2>
5
5
  <% end %>
@@ -19,7 +19,10 @@
19
19
 
20
20
  <%= hidden_field_tag 'page', params[:page] %>
21
21
 
22
- <%= render 'button', position: 'top' %>
22
+ <% if @feedback.any? %>
23
+ <%= render 'button', position: 'top' %>
24
+ <% end %>
25
+
23
26
  <table class='table hover'>
24
27
  <thead>
25
28
  <tr class='noborder'>
@@ -33,6 +36,7 @@
33
36
  <th><%= t(".actions") %></th>
34
37
  </tr>
35
38
  </thead>
39
+
36
40
  <% if @feedback.empty? %>
37
41
  <tr>
38
42
  <td colspan="5">
@@ -45,12 +49,7 @@
45
49
  <%= render 'feedback', comment: comment %>
46
50
  <% end %>
47
51
  <%= display_pagination(@feedback, 7) %>
48
- <tr>
49
- <th><input type="checkbox" name="checkall" id="checkall" onclick="check_all(this);" /></th>
50
- <th colspan='6'><%= t('.select_all') %></th>
51
- </tr>
52
52
  </table>
53
- <%= render 'button', position: 'bottom' %>
54
53
  <% end %>
55
54
 
56
55
  <br class='clear' />
@@ -1,15 +1,3 @@
1
- <% if @page.errors.any? %>
2
- <div id="error_explanation">
3
- <h2><%= pluralize(@page.errors.count, 'error') %> prohibited this post from being saved:</h2>
4
-
5
- <ul>
6
- <% @page.errors.full_messages.each do |message| %>
7
- <li><%= message %></li>
8
- <% end %>
9
- </ul>
10
- </div>
11
- <% end %>
12
-
13
1
  <%= hidden_field_tag 'user_textfilter', current_user.text_filter_name %>
14
2
 
15
3
  <div class="row save-bar">
@@ -25,8 +13,19 @@
25
13
  </div>
26
14
 
27
15
  <div class="row">
28
- <div class="col-md-8 col-md-offset-2" style="padding-top: 20px">
29
- <%= error_messages_for 'page' %>
16
+ <div class="col-md-8 col-md-offset-2" id="error-message-page">
17
+ <%= render 'shared/flash', flash: flash %>
18
+ <% if @page.errors.any? %>
19
+ <div id="error_explanation">
20
+ <h2><%= t("errors.template.header", model: 'page', count: @page.errors.count) %></h2>
21
+ <p><%= t("errors.template.body") %></p>
22
+ <ul>
23
+ <% @page.errors.full_messages.each do |message| %>
24
+ <li><%= message %></li>
25
+ <% end %>
26
+ </ul>
27
+ </div>
28
+ <% end %>
30
29
  </div>
31
30
  </div>
32
31
 
@@ -8,7 +8,18 @@
8
8
  </h2>
9
9
  <% end %>
10
10
 
11
- <%= error_messages_for 'blog' %>
11
+ <%= render 'shared/flash', flash: flash %>
12
+ <% if @setting.errors.any? %>
13
+ <div id="error_explanation">
14
+ <h2><%= t("errors.template.header", model: 'blog', count: @setting.errors.count) %></h2>
15
+ <p><%= t("errors.template.body") %></p>
16
+ <ul>
17
+ <% @setting.errors.full_messages.each do |message| %>
18
+ <li><%= message %></li>
19
+ <% end %>
20
+ </ul>
21
+ </div>
22
+ <% end %>
12
23
 
13
24
  <%= form_tag admin_seo_path, method: :put do %>
14
25
  <%= case @section
@@ -10,15 +10,15 @@
10
10
  </div>
11
11
  <div class="collapse navbar-collapse" id="sidebar-top">
12
12
  <ul class='nav navbar-nav'>
13
- <% if can? :index, 'admin/content' %>
13
+ <% if can? :index, 'admin/articles' %>
14
14
  <li class='dropdown'>
15
15
  <a class="dropdown-toggle" data-toggle="dropdown" href="#">
16
16
  <%= t('.articles') %>
17
17
  <b class="caret"></b>
18
18
  </a>
19
19
  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
20
- <%= menu_item(t('.all_articles'), admin_content_index_path) %>
21
- <%= menu_item(t('.new_article'), new_admin_content_path) %>
20
+ <%= menu_item(t('.all_articles'), admin_articles_path) %>
21
+ <%= menu_item(t('.new_article'), new_admin_article_path) %>
22
22
  <%= menu_item(t('.feedback'), admin_feedback_index_path) %>
23
23
  <%= menu_item(t('.tags'), admin_tags_path) %>
24
24
  <%= menu_item(t('.article_types'), admin_post_types_path) %>
@@ -84,6 +84,7 @@
84
84
  </ul>
85
85
  </li>
86
86
  <% end %>
87
+ <%= menu_item(t('.view_blog'), this_blog.base_url) %>
87
88
  </ul>
88
89
  <ul class='nav navbar-nav pull-right'>
89
90
  <li class='dropdown'>
@@ -110,7 +111,7 @@
110
111
  <b class="caret"></b>
111
112
  </a>
112
113
  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
113
- <li><%= link_to(t('.new_article'), controller: 'content', action: 'new') %></li>
114
+ <li><%= link_to(t('.new_article'), controller: 'articles', action: 'new') %></li>
114
115
  <li><%= link_to(t('.new_page'), controller: 'pages', actions: 'new') %></li>
115
116
  <li><%= link_to(t('.new_media'), controller: 'resources', action: 'index') %></li>
116
117
  <li><%= link_to(t('.new_note'), controller: 'notes') %></li>
@@ -47,7 +47,8 @@
47
47
  <%= link_to tag.display_name, edit_admin_tag_path(tag), class: 'edit' %>
48
48
  <%= button_to_edit tag %>
49
49
  <%= button_to_delete tag %>
50
- <%= link_to_permalink(tag, "#{tag.contents.size} #{t(".view")}".html_safe, nil, 'btn btn-success btn-xs') %>
50
+ <%= link_to_permalink(tag, "#{tag.contents.size} #{t(".view")}".html_safe,
51
+ style: 'btn btn-success btn-xs') %>
51
52
  </td>
52
53
  <td><%= tag.name %></td>
53
54
  </tr>
@@ -1,2 +1,12 @@
1
1
  <p><%= t('.message') %></p>
2
- <%= error_messages_for('comment') %>
2
+ <% if @comment.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= t("errors.template.header", model: 'comment', count: @comment.errors.count) %></h2>
5
+ <p><%= t("errors.template.body") %></p>
6
+ <ul>
7
+ <% @comment.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <div class="post"<%= onhover_show_admin_tools(:article) %>>
2
- <%= link_to(t('.edit'), { controller: 'admin/content', action: 'edit', id: @article.id }, { class: 'admintools', style: 'display: none', id: 'admin_article' }) %>
2
+ <%= link_to(t('.edit'), { controller: 'admin/articles', action: 'edit', id: @article.id }, { class: 'admintools', style: 'display: none', id: 'admin_article' }) %>
3
3
  <% cache @article do %>
4
4
  <h2><%= link_to_permalink @article, @article.title %></h2>
5
5
  <%= render 'articles/article_author', article: @article %>
@@ -12,25 +12,17 @@
12
12
  <body>
13
13
  <%= render 'admin/shared/menu' %>
14
14
  <div class='container-fluid'>
15
- <div class='row'>
16
- <div class='col-md-12'>
17
- <div style='margin-top:20px'>
18
- <%= render 'shared/flash', flash: flash %>
19
- </div>
20
- <% if content_for?(:page_heading) %>
21
- <div class='page-header'>
22
- <%= yield :page_heading %>
23
- </div>
24
- <% end %>
25
- <%= yield %>
26
- </div>
15
+ <div style='margin-top:20px'>
16
+ <%= render 'shared/flash', flash: flash %>
27
17
  </div>
28
- <footer>
29
- <div class='row'>
30
- <div class='col-md-12'>
31
- <%= link_to(this_blog.blog_name, this_blog.base_url) %> <%= t('.powered_by') %> Publify <%= h PublifyCore::VERSION %>
32
- </div>
18
+ <% if content_for?(:page_heading) %>
19
+ <div class='page-header'>
20
+ <%= yield :page_heading %>
33
21
  </div>
22
+ <% end %>
23
+ <%= yield %>
24
+ <footer>
25
+ <%= link_to(this_blog.blog_name, this_blog.base_url) %> <%= t('.powered_by') %> Publify <%= h PublifyCore::VERSION %>
34
26
  </footer>
35
27
  </div>
36
28
  </body>
@@ -3,6 +3,8 @@
3
3
  # The "main" locale.
4
4
  base_locale: en
5
5
 
6
+ <% rails_i18n_path = %x[bundle info --path rails-i18n].chomp %>
7
+
6
8
  # Read and write translations.
7
9
  data:
8
10
  # Locale files or `File.find` patterns where translations are read from:
@@ -10,6 +12,11 @@ data:
10
12
  - config/locales/%{locale}.yml
11
13
  - config/locales/**/*.%{locale}.yml
12
14
 
15
+ # External locale data (e.g. gems).
16
+ # This data is not considered unused and is never written to.
17
+ external:
18
+ - "<%= rails_i18n_path %>/rails/locale/%{locale}.yml"
19
+
13
20
  # Locale files to write new keys to, based on a list of key pattern => file
14
21
  # rules. Matched from top to bottom:
15
22
  # `i18n-tasks normalize -p` will force move the keys according to these rules
@@ -41,4 +48,4 @@ ignore_unused:
41
48
  - 'time.formats.*'
42
49
  - 'layouts.default.designed_by'
43
50
  - 'date.*'
44
- - 'activerecord.{attributes,errors,models}.*'
51
+ - 'activerecord.errors.models.*'
@@ -47,7 +47,7 @@ Devise.setup do |config|
47
47
  # Configure which authentication keys should be case-insensitive.
48
48
  # These keys will be downcased upon creating or modifying a user and when used
49
49
  # to authenticate or find a user. Default is :email.
50
- config.case_insensitive_keys = [:login]
50
+ config.case_insensitive_keys = [:login, :email]
51
51
 
52
52
  # Configure which authentication keys should have whitespace stripped.
53
53
  # These keys will have whitespace before and after removed upon creating or