elabs 3.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +89 -0
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +7 -2
  5. data/README.md +24 -17
  6. data/ROADMAP.md +8 -7
  7. data/app/assets/javascripts/elabs/application.js.erb +42 -0
  8. data/app/assets/javascripts/elabs/forms.js +10 -0
  9. data/app/assets/javascripts/elabs/helpers-markdown.js +11 -33
  10. data/app/assets/javascripts/elabs/helpers.js +28 -0
  11. data/app/assets/javascripts/elabs/hljs.js +4 -0
  12. data/app/assets/stylesheets/elabs/_colors.scss +5 -0
  13. data/app/assets/stylesheets/elabs/_fixes.scss +6 -0
  14. data/app/assets/stylesheets/elabs/_icons.scss +4 -0
  15. data/app/assets/stylesheets/elabs/app/_acts.scss +11 -0
  16. data/app/assets/stylesheets/elabs/app/_buttons.scss +8 -0
  17. data/app/assets/stylesheets/elabs/app/_comments.scss +10 -1
  18. data/app/assets/stylesheets/elabs/app/_content.scss +15 -0
  19. data/app/assets/stylesheets/elabs/app/_content_statuses.scss +32 -0
  20. data/app/assets/stylesheets/elabs/app/_forms.scss +5 -0
  21. data/app/assets/stylesheets/elabs/app/_helpers.scss +10 -0
  22. data/app/assets/stylesheets/elabs/app/_layout.scss +4 -0
  23. data/app/assets/stylesheets/elabs/app/_modals.scss +4 -0
  24. data/app/assets/stylesheets/elabs/app/_tables.scss +31 -0
  25. data/app/assets/stylesheets/elabs/app/_typo.scss +14 -0
  26. data/app/assets/stylesheets/elabs/app/_users.scss +14 -6
  27. data/app/assets/stylesheets/elabs/app/admin-members/_forms.scss +8 -1
  28. data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +1 -26
  29. data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +11 -1
  30. data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +26 -0
  31. data/app/assets/stylesheets/elabs/app/mixins/_content-inline.scss +7 -0
  32. data/app/assets/stylesheets/elabs/app/widgets/_git-cards.scss +88 -0
  33. data/app/assets/stylesheets/elabs/lib/_hljs.scss +5 -0
  34. data/app/assets/stylesheets/elabs/lib/fontawesome/_icons.scss +11 -11
  35. data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +10 -2
  36. data/app/assets/stylesheets/elabs/style.scss +11 -1
  37. data/app/controllers/elabs/admin/admin_application_controller.rb +1 -1
  38. data/app/controllers/elabs/admin/admin_content_application_controller.rb +2 -2
  39. data/app/controllers/elabs/admin/languages_controller.rb +1 -1
  40. data/app/controllers/elabs/admin/licenses_controller.rb +1 -1
  41. data/app/controllers/elabs/admin/tags_controller.rb +1 -1
  42. data/app/controllers/elabs/admin/users_controller.rb +1 -1
  43. data/app/controllers/elabs/albums_controller.rb +1 -1
  44. data/app/controllers/elabs/articles_controller.rb +1 -1
  45. data/app/controllers/elabs/content_application_controller.rb +2 -1
  46. data/app/controllers/elabs/elabs_public_controller.rb +28 -8
  47. data/app/controllers/elabs/languages_controller.rb +1 -1
  48. data/app/controllers/elabs/licenses_controller.rb +1 -1
  49. data/app/controllers/elabs/member/albums_controller.rb +1 -1
  50. data/app/controllers/elabs/member/articles_controller.rb +1 -1
  51. data/app/controllers/elabs/member/markdown_previewer_controller.rb +11 -0
  52. data/app/controllers/elabs/member/member_content_application_controller.rb +2 -2
  53. data/app/controllers/elabs/member/notes_controller.rb +1 -1
  54. data/app/controllers/elabs/member/projects_controller.rb +1 -1
  55. data/app/controllers/elabs/member/uploads_controller.rb +1 -1
  56. data/app/controllers/elabs/notes_controller.rb +1 -1
  57. data/app/controllers/elabs/projects_controller.rb +1 -1
  58. data/app/controllers/elabs/tags_controller.rb +1 -6
  59. data/app/controllers/elabs/uploads_controller.rb +1 -1
  60. data/app/controllers/elabs/users_controller.rb +1 -1
  61. data/app/helpers/elabs/acts_helper.rb +2 -2
  62. data/app/helpers/elabs/application_helper.rb +30 -3
  63. data/app/helpers/elabs/content_helper.rb +9 -3
  64. data/app/helpers/elabs/content_renderer_helper.rb +118 -8
  65. data/app/helpers/elabs/rss_helper.rb +9 -0
  66. data/app/helpers/elabs/thumbnails_helper.rb +24 -19
  67. data/app/helpers/elabs/time_helper.rb +7 -1
  68. data/app/models/elabs/album.rb +2 -0
  69. data/app/models/elabs/application_content_record.rb +3 -0
  70. data/app/models/elabs/article.rb +2 -0
  71. data/app/models/elabs/concerns/actable_entity.rb +17 -2
  72. data/app/models/elabs/concerns/content_entity.rb +2 -2
  73. data/app/models/elabs/concerns/sluggable.rb +40 -0
  74. data/app/models/elabs/language.rb +8 -0
  75. data/app/models/elabs/license.rb +5 -0
  76. data/app/models/elabs/note.rb +2 -0
  77. data/app/models/elabs/project.rb +3 -0
  78. data/app/models/elabs/tag.rb +5 -0
  79. data/app/models/elabs/upload.rb +2 -0
  80. data/app/models/elabs/user.rb +10 -2
  81. data/app/views/elabs/acts/_act.rss.builder +22 -0
  82. data/app/views/elabs/acts/index.html.haml +5 -1
  83. data/app/views/elabs/acts/index.rss.builder +15 -0
  84. data/app/views/elabs/admin/albums/index.html.haml +4 -4
  85. data/app/views/elabs/admin/articles/index.html.haml +4 -4
  86. data/app/views/elabs/admin/languages/_form.html.haml +2 -1
  87. data/app/views/elabs/admin/licenses/_form.html.haml +2 -1
  88. data/app/views/elabs/admin/notes/index.html.haml +5 -5
  89. data/app/views/elabs/admin/projects/index.html.haml +4 -4
  90. data/app/views/elabs/admin/reports/index.html.haml +2 -2
  91. data/app/views/elabs/admin/tags/_form.html.haml +2 -1
  92. data/app/views/elabs/admin/uploads/index.html.haml +4 -4
  93. data/app/views/elabs/admin/users/index.html.haml +3 -3
  94. data/app/views/elabs/admin/users/show.html.haml +2 -2
  95. data/app/views/elabs/albums/_album.html.haml +1 -1
  96. data/app/views/elabs/albums/_album.rss.builder +7 -0
  97. data/app/views/elabs/albums/_album_inline.html.haml +8 -0
  98. data/app/views/elabs/albums/index.rss.builder +14 -0
  99. data/app/views/elabs/albums/show.html.haml +3 -3
  100. data/app/views/elabs/articles/_article.html.haml +1 -1
  101. data/app/views/elabs/articles/_article.rss.builder +7 -0
  102. data/app/views/elabs/articles/_article_inline.html.haml +8 -0
  103. data/app/views/elabs/articles/index.rss.builder +14 -0
  104. data/app/views/elabs/articles/show.html.haml +4 -4
  105. data/app/views/elabs/comments/_comments.html.haml +4 -3
  106. data/app/views/elabs/comments/_form.html.haml +18 -6
  107. data/app/views/elabs/languages/_associations.html.haml +15 -5
  108. data/app/views/elabs/layouts/_footer.html.haml +8 -1
  109. data/app/views/elabs/layouts/_hidden_entry.html.haml +4 -4
  110. data/app/views/elabs/layouts/_hidden_entry_full.html.haml +4 -4
  111. data/app/views/elabs/layouts/_hidden_entry_inline.html.haml +6 -0
  112. data/app/views/elabs/layouts/_shortcode_infinite_loop.html.haml +2 -0
  113. data/app/views/elabs/layouts/_shortcode_infinite_loop_inline.html.haml +2 -0
  114. data/app/views/elabs/layouts/_shortcode_missing_content.html.haml +2 -0
  115. data/app/views/elabs/layouts/_shortcode_missing_content_inline.html.haml +2 -0
  116. data/app/views/elabs/layouts/_shortcode_open_to_see.html.haml +2 -0
  117. data/app/views/elabs/layouts/admin_application.html.haml +2 -2
  118. data/app/views/elabs/layouts/application.html.haml +11 -3
  119. data/app/views/elabs/layouts/member_application.html.haml +5 -2
  120. data/app/views/elabs/layouts/widgets/_github_repo_card.html.haml +12 -0
  121. data/app/views/elabs/layouts/widgets/_github_repo_inline.html.haml +8 -0
  122. data/app/views/elabs/layouts/widgets/_github_user_card.html.haml +7 -0
  123. data/app/views/elabs/layouts/widgets/_gitlab_group_card.html.haml +11 -0
  124. data/app/views/elabs/layouts/widgets/_gitlab_repo_card.html.haml +12 -0
  125. data/app/views/elabs/layouts/widgets/_gitlab_repo_inline.html.haml +8 -0
  126. data/app/views/elabs/layouts/widgets/_gitlab_user_card.html.haml +11 -0
  127. data/app/views/elabs/layouts/widgets/vue/_all_widgets.html.haml +5 -0
  128. data/app/views/elabs/layouts/widgets/vue/_github_repo_card_vue.html.haml +72 -0
  129. data/app/views/elabs/layouts/widgets/vue/_github_user_card_vue.html.haml +64 -0
  130. data/app/views/elabs/layouts/widgets/vue/_gitlab_group_card_vue.html.haml +64 -0
  131. data/app/views/elabs/layouts/widgets/vue/_gitlab_repo_card_vue.html.haml +69 -0
  132. data/app/views/elabs/layouts/widgets/vue/_gitlab_user_card_vue.html.haml +99 -0
  133. data/app/views/elabs/licenses/_associations.html.haml +15 -5
  134. data/app/views/elabs/licenses/show.json.jbuilder +1 -1
  135. data/app/views/elabs/member/albums/_form.html.haml +12 -1
  136. data/app/views/elabs/member/albums/index.html.haml +4 -4
  137. data/app/views/elabs/member/articles/_form.html.haml +12 -1
  138. data/app/views/elabs/member/articles/index.html.haml +4 -4
  139. data/app/views/elabs/member/markdown_previewer/preview.json.jbuilder +2 -0
  140. data/app/views/elabs/member/notes/_form.html.haml +12 -1
  141. data/app/views/elabs/member/notes/index.html.haml +4 -4
  142. data/app/views/elabs/member/notifications/index.html.haml +1 -1
  143. data/app/views/elabs/member/preferences/_form.html.haml +2 -1
  144. data/app/views/elabs/member/projects/_form.html.haml +18 -2
  145. data/app/views/elabs/member/projects/_project.json.jbuilder +2 -0
  146. data/app/views/elabs/member/projects/index.html.haml +4 -4
  147. data/app/views/elabs/member/uploads/_form.html.haml +12 -1
  148. data/app/views/elabs/member/uploads/index.html.haml +6 -9
  149. data/app/views/elabs/member/users/_form.html.haml +2 -1
  150. data/app/views/elabs/notes/_note.html.haml +2 -2
  151. data/app/views/elabs/notes/_note.rss.builder +7 -0
  152. data/app/views/elabs/notes/_note_inline.haml +8 -0
  153. data/app/views/elabs/notes/index.rss.builder +14 -0
  154. data/app/views/elabs/notes/show.html.haml +3 -3
  155. data/app/views/elabs/projects/_associations.html.haml +12 -4
  156. data/app/views/elabs/projects/_project.html.haml +1 -1
  157. data/app/views/elabs/projects/_project.json.jbuilder +2 -0
  158. data/app/views/elabs/projects/_project.rss.builder +7 -0
  159. data/app/views/elabs/projects/_project_inline.html.haml +9 -0
  160. data/app/views/elabs/projects/index.rss.builder +14 -0
  161. data/app/views/elabs/projects/show.html.haml +20 -9
  162. data/app/views/elabs/reports/_form.html.haml +2 -1
  163. data/app/views/elabs/tags/_associations.html.haml +15 -5
  164. data/app/views/elabs/tags/index.html.haml +2 -0
  165. data/app/views/elabs/uploads/_preview.html.haml +1 -6
  166. data/app/views/elabs/uploads/_upload.rss.builder +7 -0
  167. data/app/views/elabs/uploads/_upload_inline.html.haml +8 -0
  168. data/app/views/elabs/uploads/index.rss.builder +14 -0
  169. data/app/views/elabs/uploads/show.html.haml +7 -8
  170. data/app/views/elabs/users/_associations.html.haml +15 -5
  171. data/app/views/elabs/users/_user.html.haml +24 -18
  172. data/app/views/elabs/users/_user_inline.html.haml +7 -0
  173. data/app/views/elabs/users/show.html.haml +2 -2
  174. data/config/brakeman.ignore +13 -111
  175. data/config/locales/en.yml +6 -0
  176. data/config/locales/fr.yml +6 -0
  177. data/config/routes.rb +30 -28
  178. data/db/migrate/20180917133442_add_urls_to_projects.rb +6 -0
  179. data/db/migrate/20181005105642_add_reason_to_acts.rb +5 -0
  180. data/db/migrate/20181006073541_add_slugs.rb +39 -0
  181. data/docs/migrating.md +51 -0
  182. data/docs/setup.md +1 -0
  183. data/lib/elabs.rb +5 -0
  184. data/lib/elabs/version.rb +1 -1
  185. data/lib/generators/elabs/install_generator.rb +1 -0
  186. data/lib/generators/elabs/views_generator.rb +0 -1
  187. data/lib/generators/templates/elabs.rb +4 -0
  188. data/lib/generators/templates/user_model.rb +6 -0
  189. data/locale/app.pot +129 -9
  190. data/locale/en/app.edit.po +127 -7
  191. data/locale/en/app.po +127 -7
  192. data/locale/fr/app.edit.po +130 -10
  193. data/locale/fr/app.po +129 -9
  194. metadata +59 -5
  195. data/app/assets/javascripts/elabs/application.js +0 -27
  196. data/app/assets/stylesheets/elabs/app/_nsfw.scss +0 -5
  197. data/lib/assets/javascripts/markdown-it-8.4.2.min.js +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 179fc820588cdbe7ae3de5e0c42a37a678fab8e0e190a173426e493302f23556
4
- data.tar.gz: 7e720b16441c9044c6e9489f71a32b95e1e392e9d8ffb4de25ab3916d113c482
3
+ metadata.gz: 75bab8c8f62a2628529aab8f110eacd5fc1408bc94a7f595e7174f20028e715b
4
+ data.tar.gz: 1ba31dd537c39379523ae34aa4ed95b0557469d712af34b2d8ce422a75b51e32
5
5
  SHA512:
6
- metadata.gz: 9983023566a96ad10c252882c4b05c68c719bb477127b6361f5364b70ff6359f9e35c59158f522ab6f24b9b554da544a319241e4281cb4d1dc1673bea0e25b79
7
- data.tar.gz: 8f2474412043a4f25ac5277ef001b3b8ea06974da8500c4328de52839c3986416923cf70c250829388cbd600a15c111f033c89c4fcd0450daae8f31d8ee1e0d7
6
+ metadata.gz: 3eb92ccbf84c2a6c94c58cf7edc5c431fa46a6108233d60dd989771a5818a8a4ac1f3fda7d94960302861e9ebf21ddd03a848b1cc201516b0a3fd8ed7d5d396e
7
+ data.tar.gz: 04e89c6f2a90bef67578927f80087438f48f903e2263bdeadc43bceaf8bcdf9e7faaf5346f8803ae01572838fbb6c31cd1129304542a35e38c9b2ffc89f5e07b
@@ -1,6 +1,90 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [4.0.0] - 2018-10-11 - RSS, slugs ans shortcodes
5
+ ### Added
6
+
7
+ - RSS feeds for content and activity
8
+ - Added `sources_url` and `docs_url` fields in projects
9
+ - Support for shortcodes:
10
+ - In Elabs:
11
+ - `[<content>:<id>]` displays a link with an icon to the specified
12
+ content,
13
+ - `[<content>-card:<id>]` displays a card of the specified content
14
+ - `[user:<id>]`, `[user-card:<id>]` displays link with icon or a card
15
+ for the specified user
16
+ - Gitlab instances (_Only https, public data are handled for now.)_:
17
+ - `[gitlab-repo:<url>]`, will display a link with an icon to the
18
+ repository
19
+ - `[gitlab-repo-card:<url>]` displays a card for a repository
20
+ - `[gitlab-user-card:<url>]` displays a card for a gitlab user
21
+ - `[gitlab-group-card:<url>]` displays a card for a gitlab user
22
+ - Github:
23
+ - `[github-repo:<username/repo>]`, displays a link with an icon
24
+ to the repository
25
+ - `[github-repo-card:<username/repo>]` displays a card for a
26
+ repository
27
+ - `[github-user-card:<username>]` displays a card for a github user
28
+ - Added a `with_format` helper method to render a partial of a different
29
+ format in a view (i.e.: `with_format(:html){ markdown 'content' }` in
30
+ a json view.
31
+ - Added a `colored_good_or_bad_icon_tag` that colors the icon depending on
32
+ its value.
33
+ - Added classes for text based on the list of color variant.
34
+ `is-<variant>` colors the text with the background-color defined in
35
+ `$variants-list`
36
+ - Added ability to save content specifying a reason for the edition.
37
+ This reason will be saved in the corresponding act.
38
+ - Added ability to save content specifying the modification as "minor".
39
+ No act will be created in this case.
40
+ - Slug support added. This **is a breaking change** as it will change all
41
+ the links in the site. The following entities are now slugged:
42
+ - languages/licenses/tags/users classifiers and their nested
43
+ resources (i.e: `/languages/en/projects`)
44
+ - albums/articles/notes/projects/uploads and projects nested resources
45
+ - Customized datetime formats were added. Sadly, it' in yml files
46
+ located in `config/locales/<lng>.yml` until we can export this to
47
+ gettext.
48
+
49
+ ### Changed
50
+
51
+ - Markdown is now rendered with gem `commonmarker`. Markdown-it has
52
+ been removed, so content previews are done with an ajax request
53
+ - `boolean_icon_tag()` now takes two additional parameters:
54
+ - `false_class`: additional CSS class when value is `false`. Default is `nil`
55
+ - `true_class`: additional CSS class when value is `true`. Default is `nil`
56
+
57
+ ### Improved
58
+
59
+ - `Elabs::ActsHelper.act_notice_string` now have a second parameter,
60
+ `include_link`. Default is `true`; set it to false to generate
61
+ activity notice strings without link in it.
62
+ - Admin/member indexes: disabled "Show online" links when content is
63
+ not publicly visible.
64
+ - Improved thumbnails generation methods with a new
65
+ `thumbnail_center_crop(document, size)` which will return
66
+ the URL for processed document.
67
+ - Avatar and thumbnails possible dimensions are now
68
+ `THUMBNAILS_DIMENSIONS` and `AVATAR_DIMENSIONS` module constants.
69
+ - User cards are now larger and content is condensed on one line.
70
+ - Member and admin indexes now have colored status icons
71
+ - Visual enhancements:
72
+ - rendered content have more space between sections; titles are more
73
+ contrasted
74
+ - cards are more contrasted
75
+ - actions zones in forms are now standing out
76
+ - tabs for related content now have the count of related items in them
77
+ - `.field` classes now have a top margin, resulting in more airy forms
78
+ - `short_date` helper method now displays a ... date.
79
+ - `medium_datetime` helper method has been created to display a short
80
+ datetime with the year in it.
81
+
82
+ ### Removed
83
+
84
+ ### Fixed
85
+
86
+ - The permalink icon was missing on notes cards
87
+
4
88
  ## [3.0.0] - 2018-09-17 - Notifications and avatars
5
89
  ### Added
6
90
 
@@ -24,6 +108,9 @@ All notable changes to this project will be documented in this file.
24
108
 
25
109
  - Misc:
26
110
  - Date helper: new `short_date(date)` method
111
+ - Registrations can be closed by changing the `Elabs::users_can_register`
112
+ variable. All it does is to basically prevent `:registerable` in the
113
+ user model.
27
114
 
28
115
  ### Changed
29
116
 
@@ -38,6 +125,8 @@ All notable changes to this project will be documented in this file.
38
125
  `current_lock_action` and `current_update_action` to the
39
126
  `ContentEntity` concern, as they are now shared between "actable"
40
127
  and "notifiable" concerns
128
+ - `rails g elabs:install` now creates an user model template with devise
129
+ configured with conditional behavior.
41
130
 
42
131
  ### Improved
43
132
 
data/Gemfile CHANGED
@@ -24,10 +24,10 @@ group :development, :test do
24
24
  gem 'pg'
25
25
  # Rails and plugins:
26
26
  gem 'active_link_to'
27
+ gem 'commonmarker'
27
28
  gem 'devise'
28
29
  gem 'haml-rails'
29
30
  gem 'kaminari'
30
- # gem 'rails', '~> 5.2.1'
31
31
  gem 'sass-rails', '~> 5.0'
32
32
  # Translations
33
33
  gem 'gettext_i18n_rails'
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- elabs (3.0.0)
12
+ elabs (4.0.0)
13
13
  rails (~> 5.2.1)
14
14
 
15
15
  GEM
@@ -86,6 +86,8 @@ GEM
86
86
  chromedriver-helper (1.2.0)
87
87
  archive-zip (~> 0.10)
88
88
  nokogiri (~> 1.8)
89
+ commonmarker (0.17.13)
90
+ ruby-enum (~> 0.5)
89
91
  concurrent-ruby (1.0.5)
90
92
  crass (1.0.4)
91
93
  cucumber (3.1.2)
@@ -189,7 +191,7 @@ GEM
189
191
  nokogiri (>= 1.5.9)
190
192
  mail (2.7.0)
191
193
  mini_mime (>= 0.1.1)
192
- marcel (0.3.2)
194
+ marcel (0.3.3)
193
195
  mimemagic (~> 0.3.2)
194
196
  method_source (0.9.0)
195
197
  mime-types (3.2.2)
@@ -281,6 +283,8 @@ GEM
281
283
  rainbow (>= 2.2.2, < 4.0)
282
284
  ruby-progressbar (~> 1.7)
283
285
  unicode-display_width (~> 1.0, >= 1.0.1)
286
+ ruby-enum (0.7.2)
287
+ i18n
284
288
  ruby-progressbar (1.10.0)
285
289
  ruby_dep (1.5.0)
286
290
  ruby_parser (3.11.0)
@@ -350,6 +354,7 @@ DEPENDENCIES
350
354
  capybara (>= 2.15, < 4.0)
351
355
  capybara-screenshot
352
356
  chromedriver-helper
357
+ commonmarker
353
358
  cucumber-rails
354
359
  database_cleaner
355
360
  devise
data/README.md CHANGED
@@ -1,34 +1,41 @@
1
1
  # README
2
+
2
3
  Rails engine adding CMS features to publish content related to projects.
3
4
  An online version can be tested on http://next.experimentslabs.com
5
+
4
6
  ## Features
5
7
 
6
8
  Manage various content types:
7
- - Articles
8
- - Notes
9
- - Files
10
- - Albums (files collections)
11
- - Projects (may have everything above attached to them)
9
+
10
+ - Articles
11
+ - Notes
12
+ - Files
13
+ - Albums (files collections)
14
+ - Projects (may have everything above attached to them)
12
15
 
13
16
  Classify content:
14
- - Tags
15
- - Language
16
- - Licenses
17
+
18
+ - Tags
19
+ - Language
20
+ - Licenses
17
21
 
18
22
  Generic features:
19
- - Comments (only visible to author)
20
- - Safe/not safe for work content flags
21
- - Content reporting
22
- - Site structure translations
23
23
 
24
- Features wishlist: check the [roadmap](ROADMAP.md#wonderland) to see
25
- what's coming.
24
+ - Comments (only visible to author)
25
+ - Safe/not safe for work content flags
26
+ - Content reporting
27
+ - Site structure translations
26
28
 
27
- ## Known issues:
28
- JSON views are not created yet. They exists but were created using
29
- scaffolding and never touched again.
29
+ Features wishlist: check the [roadmap](ROADMAP.md#wonderland) to see what's coming.
30
+
31
+ ## Status
32
+
33
+ Elabs engine is not production ready. If the core feature are working,
34
+ a lot of changes and improvements are still coming in. Use it in production
35
+ only if you don't mind to update often.
30
36
 
31
37
  ## Documentation:
38
+
32
39
  - [Setup guide](docs/setup.md)
33
40
  - [Sample app](https://gitlab.com/experimentslabs/sample_app)
34
41
  - [How to override the app](docs/overriding.md)
data/ROADMAP.md CHANGED
@@ -19,11 +19,11 @@ See the [issues](https://gitlab.com/experimentslabs/website/website/issues) for
19
19
 
20
20
  Note that the elements in this list may change during development; it' a
21
21
  general idea of what will be done next.
22
- - [4.0.0] - Urls table to attach urls to content, share favorites
23
- - [5.0.0] - Teams to attach user and distant people to projects
24
- - [6.0.0] - Projects: commits aggregation
25
- - [7.0.0] - Users: service status aggregation without storage for now
26
- - [8.0.0] - Raw content for everything
22
+ - [5.0.0] - Urls table to attach urls to content, share favorites
23
+ - [6.0.0] - Teams to attach user and distant people to projects
24
+ - [7.0.0] - Projects: commits aggregation
25
+ - [8.0.0] - Users: service status aggregation without storage for now
26
+ - [9.0.0] - Raw content for everything
27
27
 
28
28
  ## Wonderland
29
29
  - ~~Rails engine~~ (since 2.0.0)
@@ -36,8 +36,9 @@ general idea of what will be done next.
36
36
  - Projects users
37
37
  - Urls management (lists of URLs, favorites, sources,...)
38
38
  - Content: code snippets
39
- - Content references (reference others work in your own work)
40
- - Better license support (i.e.: html tags for creative commons license)
39
+ - ~~Content references (reference others work in your own work)~~
40
+ (since 4.0.0, with shortcodes)
41
+ - Better license support (i.e.: html tags for creative commons licenses)
41
42
  - Widgets (to add custom content in created content)
42
43
  - Data aggregation from various VCS providers
43
44
  - Data aggregation for users profiles from various providers
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
3
+ // listed below.
4
+ //
5
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
6
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
7
+ //
8
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
9
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
10
+ //
11
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
12
+ // about supported directives.
13
+ //
14
+ <%
15
+ require_asset 'rails-ujs'
16
+ require_asset 'activestorage'
17
+ # Node_modules files
18
+ require_asset 'codemirror-5.39.2/lib/codemirror.js'
19
+ require_asset 'codemirror-5.39.2/addon/mode/overlay.js'
20
+ require_asset 'codemirror-5.39.2/mode/xml/xml.js'
21
+ require_asset 'codemirror-5.39.2/mode/markdown/markdown.js'
22
+ require_asset 'codemirror-5.39.2/mode/javascript/javascript.js'
23
+ require_asset 'codemirror-5.39.2/mode/css/css.js'
24
+ require_asset 'codemirror-5.39.2/mode/htmlmixed/htmlmixed.js'
25
+ require_asset 'codemirror-5.39.2/mode/clike/clike.js'
26
+ require_asset 'codemirror-5.39.2/mode/meta.js'
27
+ require_asset 'codemirror-5.39.2/mode/gfm/gfm.js'
28
+ require_asset 'highlight.js-9.12.0/highlight.pack.js'
29
+ if Rails.env.development?
30
+ require_asset "vue/dist/vue"
31
+ else
32
+ require_asset "vue/dist/vue.min"
33
+ end
34
+ # Current folder files
35
+ require_asset './forms'
36
+ require_asset './helpers'
37
+ require_asset './helpers-codemirror'
38
+ require_asset './helpers-markdown'
39
+ require_asset './hljs'
40
+ require_asset './modals'
41
+ require_asset './tabs'
42
+ %>
@@ -0,0 +1,10 @@
1
+ // eslint-disable-next-line no-unused-vars
2
+ function toggleUpdateMessageField (event, element) {
3
+ var checked = event.target.checked
4
+ console.log(event, element, checked)
5
+ if (checked) {
6
+ document.getElementById(element).setAttribute('disabled', 'disabled')
7
+ } else {
8
+ document.getElementById(element).removeAttribute('disabled')
9
+ }
10
+ }
@@ -1,42 +1,20 @@
1
1
  // eslint-disable-next-line no-unused-vars
2
2
  function createMDPreviewer (cmInstance) {
3
- var md = window.markdownit()
4
-
5
3
  return function (event) {
6
4
  event.preventDefault()
5
+ var targetElement = document.getElementById('content-description-preview')
6
+ var data = new FormData()
7
+ data.append('text', cmInstance.getValue())
7
8
 
8
- document.getElementById('content-description-preview').innerHTML = md.render(cmInstance.getValue())
9
+ // eslint-disable-next-line no-undef
10
+ ajax('POST', '/member/markdown_previewer', data, function (request) {
11
+ targetElement.innerHTML = JSON.parse(request.responseText).html_content
12
+ }, function () {
13
+ targetElement.innerHTML = 'Something bad happened on our side. Sorry for that...'
14
+ }, function () {
15
+ targetElement.innerHTML = 'Something bad happened on our side. Sorry for that...'
16
+ })
9
17
 
10
18
  openModal('content-preview-modal')
11
19
  }
12
20
  }
13
-
14
- /*
15
- * @author Wladimir Palant
16
- * @source https://stackoverflow.com/questions/1912501/unescape-html-entities-in-javascript/34064434#34064434
17
- */
18
- function htmlDecode (input) {
19
- if (typeof DOMParser !== 'function') { return input }
20
- var doc = new DOMParser().parseFromString(input, 'text/html')
21
- return doc.documentElement.textContent
22
- }
23
-
24
- // eslint-disable-next-line no-unused-vars
25
- function renderMdFromId (areaId) {
26
- var md = window.markdownit({
27
- highlight: function (str, lang) {
28
- // Unescape some chars
29
- str = htmlDecode(str)
30
- if (lang && hljs.getLanguage(lang)) {
31
- try {
32
- return hljs.highlight(lang, str).value
33
- } catch (__) {}
34
- }
35
-
36
- return '' // use external default escaping
37
- }
38
- })
39
- var value = document.getElementById('raw-' + areaId).innerHTML
40
-
41
- document.getElementById('markdown-' + areaId).innerHTML = md.render(value)
42
- }
@@ -15,3 +15,31 @@ function addClass (element, className) {
15
15
  element.className += ' ' + className
16
16
  }
17
17
  }
18
+
19
+ // eslint-disable-next-line no-unused-vars
20
+ function documentReady (fn) {
21
+ if (document.attachEvent ? document.readyState === 'complete' : document.readyState !== 'loading') {
22
+ fn()
23
+ } else {
24
+ document.addEventListener('DOMContentLoaded', fn)
25
+ }
26
+ }
27
+
28
+ // eslint-disable-next-line no-unused-vars
29
+ function ajax (method, url, data, success, failure, error) {
30
+ var request = new XMLHttpRequest()
31
+ request.open(method, url, true)
32
+ request.setRequestHeader('Accept', 'application/json')
33
+
34
+ request.onload = function () {
35
+ if (request.status >= 200 && request.status < 400) {
36
+ if (typeof success === 'function') success(request)
37
+ } else {
38
+ if (typeof failure === 'function') failure(request)
39
+ }
40
+ }
41
+ request.onerror = function () {
42
+ if (typeof error === 'function') error(request)
43
+ }
44
+ request.send(data)
45
+ }
@@ -0,0 +1,4 @@
1
+ // eslint-disable-next-line no-undef
2
+ documentReady(function () {
3
+ hljs.initHighlighting()
4
+ })
@@ -313,6 +313,11 @@ $color-background-base: $color-grey-200;
313
313
  $color-inverse: $color-grey-100;
314
314
  $color-background-inverse: $color-orange-300;
315
315
 
316
+ // Cards
317
+ $color-card-title: $color-grey-600;
318
+ $color-card-content: $color-grey-500;
319
+ $color-card-infos: $color-grey-400;
320
+
316
321
  // Information messages
317
322
  $color-error-background: $color-red-500;
318
323
  $color-error: $color-white;
@@ -0,0 +1,6 @@
1
+ // Various fixes for the libraries used
2
+
3
+ textarea {
4
+ /* Fix for https://github.com/alsacreations/KNACSS/issues/288 */
5
+ white-space: pre-wrap;
6
+ }
@@ -11,3 +11,7 @@
11
11
  .#{$fa-css-prefix}-experience:before { content: fa-content($fa-var-flask); }
12
12
 
13
13
  .#{$fa-css-prefix}-mime-type:before { content: fa-content($fa-var-wrench); }
14
+
15
+ .#{$fa-css-prefix}-group:before { content: fa-content($fa-var-box); }
16
+
17
+ .#{$fa-css-prefix}-permalink:before { content: fa-content($fa-var-link); }
@@ -53,6 +53,17 @@
53
53
  &--unlock:before {
54
54
  @include icon($fa-var-unlock, true);
55
55
  }
56
+
57
+ q {
58
+
59
+ &:before {
60
+ content: '';
61
+ }
62
+
63
+ &:after {
64
+ content: '';
65
+ }
66
+ }
56
67
  }
57
68
  }
58
69
  }