elabs 2.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.eslintrc.yml +26 -0
- data/.gitignore +49 -0
- data/.gitlab-ci.yml +93 -0
- data/.haml-lint.yml +4 -0
- data/.node-version +1 -0
- data/.rspec +1 -0
- data/.rubocop.yml +59 -0
- data/.ruby-version +1 -0
- data/.simplecov +5 -0
- data/.stylelintrc.yml +218 -0
- data/CHANGELOG.md +273 -0
- data/CODE_OF_CONDUCT.md +78 -0
- data/Gemfile +75 -0
- data/Gemfile.lock +376 -0
- data/LICENSE +21 -0
- data/LICENSES.md +6 -0
- data/README.md +41 -0
- data/ROADMAP.md +61 -0
- data/Rakefile +32 -0
- data/app/assets/config/elabs_manifest.js +3 -0
- data/app/assets/images/elabs/preview_placeholder.png +0 -0
- data/app/assets/images/elabs/preview_placeholder_nsfw.png +0 -0
- data/app/assets/javascripts/elabs/application.js +27 -0
- data/app/assets/javascripts/elabs/helpers-codemirror.js +29 -0
- data/app/assets/javascripts/elabs/helpers-markdown.js +42 -0
- data/app/assets/javascripts/elabs/helpers.js +17 -0
- data/app/assets/javascripts/elabs/modals.js +19 -0
- data/app/assets/javascripts/elabs/tabs.js +32 -0
- data/app/assets/stylesheets/elabs/_colors.scss +345 -0
- data/app/assets/stylesheets/elabs/_icons.scss +9 -0
- data/app/assets/stylesheets/elabs/_variables.scss +13 -0
- data/app/assets/stylesheets/elabs/app/_acts.scss +58 -0
- data/app/assets/stylesheets/elabs/app/_alerts.scss +3 -0
- data/app/assets/stylesheets/elabs/app/_buttons.scss +21 -0
- data/app/assets/stylesheets/elabs/app/_comments.scss +1 -0
- data/app/assets/stylesheets/elabs/app/_content.scss +10 -0
- data/app/assets/stylesheets/elabs/app/_content_uploads.scss +39 -0
- data/app/assets/stylesheets/elabs/app/_empty.scss +19 -0
- data/app/assets/stylesheets/elabs/app/_errors.scss +9 -0
- data/app/assets/stylesheets/elabs/app/_filter_links.scss +27 -0
- data/app/assets/stylesheets/elabs/app/_forms.scss +69 -0
- data/app/assets/stylesheets/elabs/app/_helpers.scss +3 -0
- data/app/assets/stylesheets/elabs/app/_languages.scss +6 -0
- data/app/assets/stylesheets/elabs/app/_layout.scss +194 -0
- data/app/assets/stylesheets/elabs/app/_licenses.scss +6 -0
- data/app/assets/stylesheets/elabs/app/_link-to-top.scss +8 -0
- data/app/assets/stylesheets/elabs/app/_medias.scss +12 -0
- data/app/assets/stylesheets/elabs/app/_modals.scss +53 -0
- data/app/assets/stylesheets/elabs/app/_nsfw.scss +5 -0
- data/app/assets/stylesheets/elabs/app/_pagination.scss +16 -0
- data/app/assets/stylesheets/elabs/app/_tabs.scss +54 -0
- data/app/assets/stylesheets/elabs/app/_tags.scss +6 -0
- data/app/assets/stylesheets/elabs/app/_toolbars.scss +3 -0
- data/app/assets/stylesheets/elabs/app/_users.scss +6 -0
- data/app/assets/stylesheets/elabs/app/admin-members/_forms.scss +6 -0
- data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +70 -0
- data/app/assets/stylesheets/elabs/app/admin-members/_layout.scss +17 -0
- data/app/assets/stylesheets/elabs/app/areas/_devise.scss +31 -0
- data/app/assets/stylesheets/elabs/app/components/_cards.scss +16 -0
- data/app/assets/stylesheets/elabs/app/components/_container.scss +4 -0
- data/app/assets/stylesheets/elabs/app/mixins/_classifier-card.scss +16 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +58 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +39 -0
- data/app/assets/stylesheets/elabs/app/mixins/_icon.scss +9 -0
- data/app/assets/stylesheets/elabs/application.css +14 -0
- data/app/assets/stylesheets/elabs/lib/_codemirror.scss +26 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_fontawesome.scss +38 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_fonts.scss +42 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_icons.scss +1118 -0
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +230 -0
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss.scss +59 -0
- data/app/assets/stylesheets/elabs/style.scss +72 -0
- data/app/controllers/elabs/acts_controller.rb +12 -0
- data/app/controllers/elabs/admin/admin_application_controller.rb +19 -0
- data/app/controllers/elabs/admin/admin_content_application_controller.rb +66 -0
- data/app/controllers/elabs/admin/albums_controller.rb +10 -0
- data/app/controllers/elabs/admin/articles_controller.rb +10 -0
- data/app/controllers/elabs/admin/languages_controller.rb +77 -0
- data/app/controllers/elabs/admin/licenses_controller.rb +77 -0
- data/app/controllers/elabs/admin/notes_controller.rb +10 -0
- data/app/controllers/elabs/admin/projects_controller.rb +10 -0
- data/app/controllers/elabs/admin/reports_controller.rb +34 -0
- data/app/controllers/elabs/admin/tags_controller.rb +56 -0
- data/app/controllers/elabs/admin/uploads_controller.rb +10 -0
- data/app/controllers/elabs/admin/users_controller.rb +43 -0
- data/app/controllers/elabs/albums_controller.rb +26 -0
- data/app/controllers/elabs/articles_controller.rb +25 -0
- data/app/controllers/elabs/auth/callbacks_controller.rb +38 -0
- data/app/controllers/elabs/auth/confirmations_controller.rb +43 -0
- data/app/controllers/elabs/auth/passwords_controller.rb +47 -0
- data/app/controllers/elabs/auth/registrations_controller.rb +70 -0
- data/app/controllers/elabs/auth/sessions_controller.rb +36 -0
- data/app/controllers/elabs/auth/unlocks_controller.rb +38 -0
- data/app/controllers/elabs/concerns/elabs_controller.rb +18 -0
- data/app/controllers/elabs/concerns/localizable.rb +11 -0
- data/app/controllers/elabs/concerns/reportable.rb +17 -0
- data/app/controllers/elabs/content_application_controller.rb +45 -0
- data/app/controllers/elabs/elabs_application_controller.rb +95 -0
- data/app/controllers/elabs/languages_controller.rb +36 -0
- data/app/controllers/elabs/licenses_controller.rb +31 -0
- data/app/controllers/elabs/member/albums_controller.rb +11 -0
- data/app/controllers/elabs/member/articles_controller.rb +11 -0
- data/app/controllers/elabs/member/member_application_controller.rb +12 -0
- data/app/controllers/elabs/member/member_content_application_controller.rb +128 -0
- data/app/controllers/elabs/member/notes_controller.rb +11 -0
- data/app/controllers/elabs/member/preferences_controller.rb +36 -0
- data/app/controllers/elabs/member/projects_controller.rb +11 -0
- data/app/controllers/elabs/member/uploads_controller.rb +11 -0
- data/app/controllers/elabs/member/users_controller.rb +28 -0
- data/app/controllers/elabs/notes_controller.rb +25 -0
- data/app/controllers/elabs/projects_controller.rb +30 -0
- data/app/controllers/elabs/reports_controller.rb +36 -0
- data/app/controllers/elabs/tags_controller.rb +36 -0
- data/app/controllers/elabs/uploads_controller.rb +24 -0
- data/app/controllers/elabs/users_controller.rb +36 -0
- data/app/helpers/elabs/acts_helper.rb +22 -0
- data/app/helpers/elabs/admin_content_helper.rb +54 -0
- data/app/helpers/elabs/application_helper.rb +54 -0
- data/app/helpers/elabs/content_filters_helper.rb +97 -0
- data/app/helpers/elabs/content_renderer_helper.rb +13 -0
- data/app/helpers/elabs/member_content_helper.rb +47 -0
- data/app/helpers/elabs/thumbnails_helper.rb +28 -0
- data/app/helpers/elabs/time_helper.rb +19 -0
- data/app/helpers/elabs/uploads_helper.rb +19 -0
- data/app/jobs/elabs/application_job.rb +4 -0
- data/app/mailers/elabs/application_mailer.rb +6 -0
- data/app/models/elabs/act.rb +7 -0
- data/app/models/elabs/album.rb +24 -0
- data/app/models/elabs/albums_tag.rb +21 -0
- data/app/models/elabs/albums_upload.rb +21 -0
- data/app/models/elabs/application_content_record.rb +10 -0
- data/app/models/elabs/application_record.rb +5 -0
- data/app/models/elabs/article.rb +23 -0
- data/app/models/elabs/articles_tag.rb +21 -0
- data/app/models/elabs/comment.rb +12 -0
- data/app/models/elabs/concerns/actable_entity.rb +52 -0
- data/app/models/elabs/concerns/content_entity.rb +70 -0
- data/app/models/elabs/concerns/countable_entity.rb +81 -0
- data/app/models/elabs/concerns/taggable.rb +33 -0
- data/app/models/elabs/language.rb +17 -0
- data/app/models/elabs/license.rb +15 -0
- data/app/models/elabs/note.rb +21 -0
- data/app/models/elabs/notes_tag.rb +21 -0
- data/app/models/elabs/preference.rb +9 -0
- data/app/models/elabs/project.rb +25 -0
- data/app/models/elabs/projects_album.rb +21 -0
- data/app/models/elabs/projects_article.rb +21 -0
- data/app/models/elabs/projects_note.rb +21 -0
- data/app/models/elabs/projects_tag.rb +21 -0
- data/app/models/elabs/projects_upload.rb +21 -0
- data/app/models/elabs/report.rb +11 -0
- data/app/models/elabs/tag.rb +18 -0
- data/app/models/elabs/upload.rb +28 -0
- data/app/models/elabs/uploads_tag.rb +21 -0
- data/app/models/elabs/user.rb +30 -0
- data/app/validators/elabs/associated_author_validator.rb +11 -0
- data/app/views/elabs/acts/_act.json.jbuilder +2 -0
- data/app/views/elabs/acts/_filters.html.haml +3 -0
- data/app/views/elabs/acts/index.html.haml +27 -0
- data/app/views/elabs/acts/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/albums/_album.json.jbuilder +2 -0
- data/app/views/elabs/admin/albums/index.html.haml +43 -0
- data/app/views/elabs/admin/albums/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/articles/_article.json.jbuilder +2 -0
- data/app/views/elabs/admin/articles/index.html.haml +41 -0
- data/app/views/elabs/admin/articles/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/languages/_form.html.haml +18 -0
- data/app/views/elabs/admin/languages/_language.json.jbuilder +2 -0
- data/app/views/elabs/admin/languages/edit.html.haml +6 -0
- data/app/views/elabs/admin/languages/index.html.haml +34 -0
- data/app/views/elabs/admin/languages/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/languages/new.html.haml +3 -0
- data/app/views/elabs/admin/licenses/_form.html.haml +25 -0
- data/app/views/elabs/admin/licenses/_license.json.jbuilder +2 -0
- data/app/views/elabs/admin/licenses/edit.html.haml +6 -0
- data/app/views/elabs/admin/licenses/index.html.haml +42 -0
- data/app/views/elabs/admin/licenses/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/licenses/new.html.haml +3 -0
- data/app/views/elabs/admin/notes/_note.json.jbuilder +2 -0
- data/app/views/elabs/admin/notes/index.html.haml +40 -0
- data/app/views/elabs/admin/notes/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/projects/_project.json.jbuilder +2 -0
- data/app/views/elabs/admin/projects/index.html.haml +45 -0
- data/app/views/elabs/admin/projects/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/reports/index.html.haml +27 -0
- data/app/views/elabs/admin/reports/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/tags/_form.html.haml +17 -0
- data/app/views/elabs/admin/tags/_tag.json.jbuilder +2 -0
- data/app/views/elabs/admin/tags/edit.html.haml +6 -0
- data/app/views/elabs/admin/tags/index.html.haml +27 -0
- data/app/views/elabs/admin/tags/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/uploads/_upload.json.jbuilder +2 -0
- data/app/views/elabs/admin/uploads/index.html.haml +45 -0
- data/app/views/elabs/admin/uploads/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/users/_admin_user.json.jbuilder +2 -0
- data/app/views/elabs/admin/users/index.html.haml +33 -0
- data/app/views/elabs/admin/users/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/users/show.html.haml +26 -0
- data/app/views/elabs/admin/users/show.json.jbuilder +1 -0
- data/app/views/elabs/albums/_album.html.haml +38 -0
- data/app/views/elabs/albums/_album.json.jbuilder +2 -0
- data/app/views/elabs/albums/_filters.html.haml +8 -0
- data/app/views/elabs/albums/index.html.haml +9 -0
- data/app/views/elabs/albums/index.json.jbuilder +1 -0
- data/app/views/elabs/albums/show.html.haml +60 -0
- data/app/views/elabs/albums/show.json.jbuilder +1 -0
- data/app/views/elabs/articles/_article.html.haml +30 -0
- data/app/views/elabs/articles/_article.json.jbuilder +2 -0
- data/app/views/elabs/articles/_filters.html.haml +8 -0
- data/app/views/elabs/articles/index.html.haml +9 -0
- data/app/views/elabs/articles/index.json.jbuilder +1 -0
- data/app/views/elabs/articles/show.html.haml +45 -0
- data/app/views/elabs/articles/show.json.jbuilder +1 -0
- data/app/views/elabs/auth/confirmations/new.html.haml +26 -0
- data/app/views/elabs/auth/passwords/edit.html.haml +31 -0
- data/app/views/elabs/auth/passwords/new.html.haml +23 -0
- data/app/views/elabs/auth/registrations/edit.html.haml +48 -0
- data/app/views/elabs/auth/registrations/new.html.haml +34 -0
- data/app/views/elabs/auth/sessions/_new.html.haml +15 -0
- data/app/views/elabs/auth/sessions/new.html.haml +8 -0
- data/app/views/elabs/auth/shared/_links.html.haml +16 -0
- data/app/views/elabs/auth/unlocks/new.html.haml +23 -0
- data/app/views/elabs/comments/_comment.json.jbuilder +2 -0
- data/app/views/elabs/comments/_comments.html.haml +21 -0
- data/app/views/elabs/comments/_form.html.haml +31 -0
- data/app/views/elabs/languages/_associations.html.haml +51 -0
- data/app/views/elabs/languages/_filters.html.haml +6 -0
- data/app/views/elabs/languages/_language.json.jbuilder +2 -0
- data/app/views/elabs/languages/index.html.haml +33 -0
- data/app/views/elabs/languages/index.json.jbuilder +1 -0
- data/app/views/elabs/languages/show.html.haml +38 -0
- data/app/views/elabs/languages/show.json.jbuilder +1 -0
- data/app/views/elabs/layouts/_empty.html.haml +3 -0
- data/app/views/elabs/layouts/_footer.html.haml +6 -0
- data/app/views/elabs/layouts/_hidden_entry.html.haml +6 -0
- data/app/views/elabs/layouts/_hidden_entry_full.html.haml +6 -0
- data/app/views/elabs/layouts/_language_menu.html.haml +2 -0
- data/app/views/elabs/layouts/_menu.html.haml +72 -0
- data/app/views/elabs/layouts/admin_application.html.haml +21 -0
- data/app/views/elabs/layouts/application.html.haml +37 -0
- data/app/views/elabs/layouts/lists/_albums.html.haml +10 -0
- data/app/views/elabs/layouts/lists/_projects.html.haml +10 -0
- data/app/views/elabs/layouts/lists/_tags.html.haml +9 -0
- data/app/views/elabs/layouts/mailer.html.haml +8 -0
- data/app/views/elabs/layouts/mailer.text.haml +1 -0
- data/app/views/elabs/layouts/member_application.html.haml +21 -0
- data/app/views/elabs/licenses/_associations.html.haml +51 -0
- data/app/views/elabs/licenses/_filters.html.haml +3 -0
- data/app/views/elabs/licenses/_license.json.jbuilder +2 -0
- data/app/views/elabs/licenses/index.html.haml +27 -0
- data/app/views/elabs/licenses/index.json.jbuilder +1 -0
- data/app/views/elabs/licenses/show.html.haml +44 -0
- data/app/views/elabs/licenses/show.json.jbuilder +1 -0
- data/app/views/elabs/member/albums/_album.json.jbuilder +2 -0
- data/app/views/elabs/member/albums/_form.html.haml +64 -0
- data/app/views/elabs/member/albums/edit.html.haml +6 -0
- data/app/views/elabs/member/albums/index.html.haml +49 -0
- data/app/views/elabs/member/albums/index.json.jbuilder +1 -0
- data/app/views/elabs/member/albums/new.html.haml +3 -0
- data/app/views/elabs/member/articles/_article.json.jbuilder +2 -0
- data/app/views/elabs/member/articles/_form.html.haml +70 -0
- data/app/views/elabs/member/articles/edit.html.haml +6 -0
- data/app/views/elabs/member/articles/index.html.haml +47 -0
- data/app/views/elabs/member/articles/index.json.jbuilder +1 -0
- data/app/views/elabs/member/articles/new.html.haml +3 -0
- data/app/views/elabs/member/layouts/_empty.html.haml +4 -0
- data/app/views/elabs/member/layouts/_markdown-preview.html.haml +8 -0
- data/app/views/elabs/member/notes/_form.html.haml +54 -0
- data/app/views/elabs/member/notes/_note.json.jbuilder +2 -0
- data/app/views/elabs/member/notes/edit.html.haml +6 -0
- data/app/views/elabs/member/notes/index.html.haml +47 -0
- data/app/views/elabs/member/notes/index.json.jbuilder +1 -0
- data/app/views/elabs/member/notes/new.html.haml +3 -0
- data/app/views/elabs/member/preferences/_form.html.haml +20 -0
- data/app/views/elabs/member/preferences/edit.html.haml +3 -0
- data/app/views/elabs/member/projects/_form.html.haml +71 -0
- data/app/views/elabs/member/projects/_project.json.jbuilder +2 -0
- data/app/views/elabs/member/projects/edit.html.haml +6 -0
- data/app/views/elabs/member/projects/index.html.haml +53 -0
- data/app/views/elabs/member/projects/index.json.jbuilder +1 -0
- data/app/views/elabs/member/projects/new.html.haml +3 -0
- data/app/views/elabs/member/uploads/_form.html.haml +67 -0
- data/app/views/elabs/member/uploads/_upload.json.jbuilder +2 -0
- data/app/views/elabs/member/uploads/edit.html.haml +6 -0
- data/app/views/elabs/member/uploads/index.html.haml +61 -0
- data/app/views/elabs/member/uploads/index.json.jbuilder +1 -0
- data/app/views/elabs/member/uploads/new.html.haml +3 -0
- data/app/views/elabs/member/users/_form.html.haml +38 -0
- data/app/views/elabs/notes/_filters.html.haml +7 -0
- data/app/views/elabs/notes/_note.html.haml +31 -0
- data/app/views/elabs/notes/_note.json.jbuilder +2 -0
- data/app/views/elabs/notes/index.html.haml +9 -0
- data/app/views/elabs/notes/index.json.jbuilder +1 -0
- data/app/views/elabs/notes/show.html.haml +44 -0
- data/app/views/elabs/notes/show.json.jbuilder +1 -0
- data/app/views/elabs/projects/_associations.html.haml +46 -0
- data/app/views/elabs/projects/_filters.html.haml +8 -0
- data/app/views/elabs/projects/_project.html.haml +29 -0
- data/app/views/elabs/projects/index.html.haml +9 -0
- data/app/views/elabs/projects/index.json.jbuilder +1 -0
- data/app/views/elabs/projects/show.html.haml +71 -0
- data/app/views/elabs/projects/show.json.jbuilder +1 -0
- data/app/views/elabs/reports/_form.html.haml +29 -0
- data/app/views/elabs/tags/_associations.html.haml +51 -0
- data/app/views/elabs/tags/_filters.html.haml +3 -0
- data/app/views/elabs/tags/_tag.json.jbuilder +2 -0
- data/app/views/elabs/tags/index.html.haml +26 -0
- data/app/views/elabs/tags/index.json.jbuilder +1 -0
- data/app/views/elabs/tags/show.html.haml +34 -0
- data/app/views/elabs/tags/show.json.jbuilder +1 -0
- data/app/views/elabs/uploads/_filters.html.haml +7 -0
- data/app/views/elabs/uploads/_player.html.haml +10 -0
- data/app/views/elabs/uploads/_preview.html.haml +17 -0
- data/app/views/elabs/uploads/_upload.html.haml +41 -0
- data/app/views/elabs/uploads/_upload.json.jbuilder +2 -0
- data/app/views/elabs/uploads/index.html.haml +9 -0
- data/app/views/elabs/uploads/index.json.jbuilder +1 -0
- data/app/views/elabs/uploads/show.html.haml +58 -0
- data/app/views/elabs/uploads/show.json.jbuilder +1 -0
- data/app/views/elabs/users/_associations.html.haml +51 -0
- data/app/views/elabs/users/_filters.html.haml +4 -0
- data/app/views/elabs/users/_user.html.haml +31 -0
- data/app/views/elabs/users/_user.json.jbuilder +2 -0
- data/app/views/elabs/users/index.html.haml +7 -0
- data/app/views/elabs/users/index.json.jbuilder +1 -0
- data/app/views/elabs/users/show.html.haml +48 -0
- data/app/views/elabs/users/show.json.jbuilder +1 -0
- data/bin/rails +14 -0
- data/config.ru +5 -0
- data/config/brakeman.ignore +124 -0
- data/config/brakeman.yml +3 -0
- data/config/cucumber.yml +9 -0
- data/config/routes.rb +116 -0
- data/db/migrate/20180813000000_devise_update_users.rb +15 -0
- data/db/migrate/20180813000001_create_languages.rb +16 -0
- data/db/migrate/20180813000002_create_tags.rb +14 -0
- data/db/migrate/20180813000004_create_licenses.rb +17 -0
- data/db/migrate/20180813000005_create_reports.rb +15 -0
- data/db/migrate/20180813000006_create_comments.rb +15 -0
- data/db/migrate/20180813000007_create_acts.rb +10 -0
- data/db/migrate/20180813000008_create_preferences.rb +13 -0
- data/db/migrate/20180813000009_create_active_storage_tables.active_storage.rb +26 -0
- data/db/migrate/20180813000010_create_albums.rb +23 -0
- data/db/migrate/20180813000011_create_articles.rb +23 -0
- data/db/migrate/20180813000012_create_notes.rb +21 -0
- data/db/migrate/20180813000013_create_uploads.rb +26 -0
- data/db/migrate/20180813000014_create_projects.rb +44 -0
- data/db/seeds.rb +10 -0
- data/db/seeds_development.rb +21 -0
- data/db/seeds_production.rb +0 -0
- data/docs/contributing.md +52 -0
- data/docs/cucumber_terms.md +9 -0
- data/docs/migrating.md +4 -0
- data/docs/overriding.md +20 -0
- data/docs/setup.md +136 -0
- data/docs/tips.md +13 -0
- data/elabs.gemspec +25 -0
- data/lib/assets/javascripts/README-highlight.js.md +39 -0
- data/lib/assets/javascripts/codemirror-5.39.2/addon/mode/overlay.js +90 -0
- data/lib/assets/javascripts/codemirror-5.39.2/lib/codemirror.js +9684 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/clike/clike.js +834 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/css/css.js +832 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/gfm/gfm.js +129 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/htmlmixed/htmlmixed.js +152 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/javascript/javascript.js +896 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/markdown/markdown.js +882 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/meta.js +217 -0
- data/lib/assets/javascripts/codemirror-5.39.2/mode/xml/xml.js +402 -0
- data/lib/assets/javascripts/highlight.js-9.12.0/highlight.pack.js +2 -0
- data/lib/assets/javascripts/markdown-it-8.4.2.min.js +1 -0
- data/lib/assets/stylesheets/codemirror-5.39.2/lib/codemirror.css +346 -0
- data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-dark.css +38 -0
- data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-light.css +38 -0
- data/lib/assets/stylesheets/highlight.js-9.12.0/styles/atelier-sulphurpool-light.css +69 -0
- data/lib/elabs.rb +41 -0
- data/lib/elabs/engine.rb +5 -0
- data/lib/elabs/version.rb +3 -0
- data/lib/generators/elabs/assets_generator.rb +36 -0
- data/lib/generators/elabs/devise_views_generator.rb +24 -0
- data/lib/generators/elabs/install_generator.rb +26 -0
- data/lib/generators/elabs/required_assets_generator.rb +26 -0
- data/lib/generators/elabs/views_generator.rb +25 -0
- data/lib/generators/templates/elabs.rb +25 -0
- data/lib/generators/templates/fast_gettext.rb +3 -0
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/cucumber.rake +75 -0
- data/lib/tasks/elabs_tasks.rake +4 -0
- data/lib/tasks/factory_bot.rake +14 -0
- data/lib/tasks/wipe.rake +31 -0
- data/locale/app.pot +1124 -0
- data/locale/devise_strings.rb +88 -0
- data/locale/en/app.edit.po +1123 -0
- data/locale/en/app.po +1123 -0
- data/locale/en/app.po.time_stamp +0 -0
- data/locale/fr/app.edit.po +1126 -0
- data/locale/fr/app.po +1125 -0
- data/locale/fr/app.po.time_stamp +0 -0
- data/locale/model_attributes.rb +85 -0
- data/package.json +22 -0
- data/script/cucumber +10 -0
- data/tmp/pids/.keep +0 -0
- data/yarn.lock +2759 -0
- metadata +463 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
module Elabs
|
2
|
+
module ActsHelper
|
3
|
+
def act_action(action)
|
4
|
+
actions = {
|
5
|
+
create: _('created'),
|
6
|
+
update: _('updated'),
|
7
|
+
lock: _('locked'),
|
8
|
+
unlock: _('unlocked'),
|
9
|
+
publish: _('published'),
|
10
|
+
unpublish: _('removed from publication')
|
11
|
+
}.freeze
|
12
|
+
actions[action.to_sym] || "[missing: #{action}]"
|
13
|
+
end
|
14
|
+
|
15
|
+
def act_notice_string(act)
|
16
|
+
string = format('%<type>s #%<id>i', type: act.content_type.demodulize, id: act.content_id)
|
17
|
+
string = link_to string, act.content unless %w[unpublish destroy lock].include? act.event
|
18
|
+
|
19
|
+
format(_('%<string>s has been %<event>s'), string: string, event: act_action(act.event)).html_safe
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Elabs
|
2
|
+
module AdminContentHelper
|
3
|
+
def admin_action_links(singular_model, entity)
|
4
|
+
out = []
|
5
|
+
out.push(admin_show_online_link(entity))
|
6
|
+
out.push(admin_lock_link(singular_model, entity))
|
7
|
+
out.push(admin_destroy_link(singular_model, entity))
|
8
|
+
|
9
|
+
raw out.join('')
|
10
|
+
end
|
11
|
+
|
12
|
+
def admin_show_link(singular_model, entity)
|
13
|
+
link_to send("admin_#{singular_model}_path".to_sym, entity),
|
14
|
+
title: _('Show'),
|
15
|
+
class: 'btn btn--small btn--show' do
|
16
|
+
icon('eye', ['fw'])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def admin_show_online_link(entity)
|
21
|
+
link_to entity,
|
22
|
+
title: _('View online'),
|
23
|
+
class: 'btn btn--small btn--show' do
|
24
|
+
icon('globe', ['fw'])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def admin_lock_link(singular_model, entity)
|
29
|
+
link_to send("admin_#{singular_model}_toggle_lock_path", entity),
|
30
|
+
title: (entity.locked? ? _('Unlock') : _('Lock')),
|
31
|
+
class: 'btn btn--small btn--lock',
|
32
|
+
method: :put do
|
33
|
+
icon(entity.locked? ? 'unlock' : 'lock', ['fw'])
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def admin_destroy_link(singular_model, entity)
|
38
|
+
link_to send("admin_#{singular_model}_path".to_sym, entity),
|
39
|
+
title: _('Destroy'),
|
40
|
+
class: 'btn btn--small btn--destroy',
|
41
|
+
method: :delete, data: { confirm: _('Are you sure?') } do
|
42
|
+
icon('trash', ['fw'])
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def admin_edit_link(singular_model, entity)
|
47
|
+
link_to send("edit_admin_#{singular_model}_path".to_sym, entity),
|
48
|
+
title: _('Edit'),
|
49
|
+
class: 'btn btn--small btn--edit' do
|
50
|
+
icon('pencil-alt', ['fw'])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Elabs
|
2
|
+
module ApplicationHelper
|
3
|
+
def show_nsfw?
|
4
|
+
session[:show_nsfw]
|
5
|
+
end
|
6
|
+
|
7
|
+
def show_item?(entity)
|
8
|
+
(entity.sfw? || show_nsfw?) && !entity.locked?
|
9
|
+
end
|
10
|
+
|
11
|
+
def user_is_author_of(entity)
|
12
|
+
current_user&.id && entity.user_id == current_user.id
|
13
|
+
end
|
14
|
+
|
15
|
+
def icon_text(icon, text, icon_options = [], reverse = false)
|
16
|
+
format(
|
17
|
+
reverse ? _('%<text>s %<icon>s') : _('%<icon>s %<text>s'),
|
18
|
+
icon: icon(icon, icon_options), text: text
|
19
|
+
).html_safe
|
20
|
+
end
|
21
|
+
|
22
|
+
def boolean_icon_tag(value, true_icon = 'check', false_icon = 'times')
|
23
|
+
icon_class = [
|
24
|
+
"fas fa-#{value ? true_icon : false_icon} fa-fw"
|
25
|
+
]
|
26
|
+
content_tag(:i, nil, class: icon_class)
|
27
|
+
end
|
28
|
+
|
29
|
+
def icon(name, classes = [], base = 'fas')
|
30
|
+
icon_class = ["#{base} fa-#{name}"]
|
31
|
+
icon_class += classes.map do |c|
|
32
|
+
if %w[2x 3x 4x].include? c
|
33
|
+
"fa-#{c}"
|
34
|
+
else
|
35
|
+
c
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
content_tag(:i, nil, class: icon_class)
|
40
|
+
end
|
41
|
+
|
42
|
+
def license_icon(license, classes = ['fw'])
|
43
|
+
icon license.icon, classes, 'fab'
|
44
|
+
end
|
45
|
+
|
46
|
+
def page_title(title, namespace = nil)
|
47
|
+
out = [Elabs.site_name]
|
48
|
+
out.push(namespace) if namespace
|
49
|
+
out.push(title) if title
|
50
|
+
|
51
|
+
out.join('::')
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
module Elabs
|
2
|
+
module ContentFiltersHelper
|
3
|
+
def order_link(title, field)
|
4
|
+
param_name = "order_by_#{field}"
|
5
|
+
direction = params[param_name] && params[param_name] == 'asc' ? :desc : :asc
|
6
|
+
options = { param_name => direction }
|
7
|
+
options['sfw_status'] = params['sfw_status'] if params['sfw_status']
|
8
|
+
|
9
|
+
icon = direction == :asc ? 'sort-up' : 'sort-down'
|
10
|
+
|
11
|
+
link_to options, class: 'filter-link' do
|
12
|
+
icon_text icon, title, ['fw'], true
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def sfw_status_links
|
17
|
+
out = []
|
18
|
+
|
19
|
+
out.push all_sfw_status_link
|
20
|
+
out.push sfw_only_link
|
21
|
+
out.push nsfw_only_link
|
22
|
+
|
23
|
+
raw out.join('')
|
24
|
+
end
|
25
|
+
|
26
|
+
def sfw_only_link
|
27
|
+
icon = params['sfw_status'] && params['sfw_status'] == 'sfw_only' ? 'dot-circle' : 'circle'
|
28
|
+
link_to request.params.merge(sfw_status: 'sfw_only'), class: 'filter-link' do
|
29
|
+
icon_text(icon, _('Only SFW'), ['fw'], true)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def nsfw_only_link
|
34
|
+
icon = params['sfw_status'] && params['sfw_status'] == 'nsfw_only' ? 'dot-circle' : 'circle'
|
35
|
+
link_to request.params.merge(sfw_status: 'nsfw_only'), class: 'filter-link' do
|
36
|
+
icon_text(icon, _('Only NSFW'), ['fw'], true)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def all_sfw_status_link
|
41
|
+
icon = params['sfw_status'] && %w[sfw_only nsfw_only].include?(params['sfw_status']) ? 'circle' : 'dot-circle'
|
42
|
+
link_to request.params.merge(sfw_status: 'all'), class: 'filter-link' do
|
43
|
+
icon_text(icon, _('Show all'), ['fw'], true)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def with_content_filter_links
|
48
|
+
out = []
|
49
|
+
|
50
|
+
out.push all_filter_link
|
51
|
+
out.push with_content_only_filter_link
|
52
|
+
|
53
|
+
raw out.join('')
|
54
|
+
end
|
55
|
+
|
56
|
+
def with_content_only_filter_link
|
57
|
+
icon = !params['with_content_only'] || params['with_content_only'] == 'true' ? 'dot-circle' : 'circle'
|
58
|
+
link_to request.params.merge(with_content_only: 'true'), class: 'filter-link' do
|
59
|
+
icon_text(icon, _('With content only'), ['fw'], true)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def all_filter_link
|
64
|
+
icon = params['with_content_only'] && params['with_content_only'] == 'false' ? 'dot-circle' : 'circle'
|
65
|
+
link_to request.params.merge(with_content_only: 'false'), class: 'filter-link' do
|
66
|
+
icon_text(icon, _('Show all'), ['fw'], true)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def admin_order_by_link(title, field)
|
71
|
+
current_direction = params['order_by'] == field && params['direction'] ? params['direction'] : 'desc'
|
72
|
+
direction = current_direction == 'asc' ? :desc : :asc
|
73
|
+
options = { order_by: field, direction: direction }
|
74
|
+
|
75
|
+
icon = direction == :asc ? 'sort-up' : 'sort-down'
|
76
|
+
|
77
|
+
link_to options, class: 'filter-link' do
|
78
|
+
icon_text icon, title, ['fw'], true
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
alias member_order_by_link admin_order_by_link
|
83
|
+
|
84
|
+
def render_filters?
|
85
|
+
%w[acts
|
86
|
+
languages
|
87
|
+
licenses
|
88
|
+
tags
|
89
|
+
users
|
90
|
+
albums
|
91
|
+
articles
|
92
|
+
notes
|
93
|
+
projects
|
94
|
+
uploads].include?(controller_name) && action_name == 'index'
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Elabs
|
2
|
+
module ContentRendererHelper
|
3
|
+
ALPHABET = ('a'..'z').to_a
|
4
|
+
|
5
|
+
def markdown(text)
|
6
|
+
area_id = Array.new(5) { ALPHABET.sample }.join
|
7
|
+
content = ''.html_safe
|
8
|
+
content += content_tag('pre', text, id: "raw-#{area_id}")
|
9
|
+
content += javascript_tag("renderMdFromId('#{area_id}')").html_safe
|
10
|
+
content_tag('div', content, id: "markdown-#{area_id}").html_safe
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Elabs
|
2
|
+
module MemberContentHelper
|
3
|
+
def member_action_links(singular_model, entity)
|
4
|
+
out = []
|
5
|
+
out.push member_show_link(entity)
|
6
|
+
out.push member_edit_link(singular_model, entity)
|
7
|
+
out.push member_publish_link(singular_model, entity)
|
8
|
+
out.push member_destroy_link(singular_model, entity)
|
9
|
+
|
10
|
+
raw out.join('')
|
11
|
+
end
|
12
|
+
|
13
|
+
def member_show_link(entity)
|
14
|
+
link_to entity,
|
15
|
+
title: _('View online'),
|
16
|
+
class: 'btn btn--small btn--show' do
|
17
|
+
icon('eye', ['fw'])
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def member_edit_link(singular_model, entity)
|
22
|
+
link_to send("edit_member_#{singular_model}_path", entity),
|
23
|
+
title: _('Edit'),
|
24
|
+
class: 'btn btn--small btn--edit' do
|
25
|
+
icon('pencil-alt', ['fw'])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def member_publish_link(singular_model, entity)
|
30
|
+
link_to send("member_#{singular_model}_toggle_publication_path", entity),
|
31
|
+
title: entity.published? ? _('Unpublish') : _('Publish'),
|
32
|
+
method: :put,
|
33
|
+
class: 'btn btn--small btn--' do
|
34
|
+
icon(entity.published? ? 'calendar-times' : 'calendar-check', ['fw'])
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def member_destroy_link(singular_model, entity)
|
39
|
+
link_to send("member_#{singular_model}_path".to_sym, entity),
|
40
|
+
title: _('Destroy'),
|
41
|
+
method: :delete, data: { confirm: _('Are you sure?') },
|
42
|
+
class: 'btn btn--small btn--destroy' do
|
43
|
+
icon('trash', ['fw'])
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Elabs
|
2
|
+
module ThumbnailsHelper
|
3
|
+
def thumbnail_center_crop_properties(size = :medium)
|
4
|
+
dimensions = case size
|
5
|
+
when :small
|
6
|
+
'50x50'
|
7
|
+
else
|
8
|
+
'300x300' # medium size
|
9
|
+
end
|
10
|
+
{ gravity: 'Center', resize: "#{dimensions}^", extent: dimensions }
|
11
|
+
end
|
12
|
+
|
13
|
+
def thumbnail_preview_placeholder_file
|
14
|
+
'elabs/preview_placeholder.png'
|
15
|
+
end
|
16
|
+
|
17
|
+
def image_resize_properties(size = :page)
|
18
|
+
dimensions = case size
|
19
|
+
when :large
|
20
|
+
'1920x1080'
|
21
|
+
else
|
22
|
+
'960x540' # page size
|
23
|
+
end
|
24
|
+
|
25
|
+
{ resize: dimensions }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Elabs
|
2
|
+
module TimeHelper
|
3
|
+
def same_day?(previous_date_time, current_date_time)
|
4
|
+
return false if previous_date_time.nil?
|
5
|
+
date1 = Date.parse(previous_date_time.to_s)
|
6
|
+
date2 = Date.parse(current_date_time.to_s)
|
7
|
+
|
8
|
+
date1 == date2
|
9
|
+
end
|
10
|
+
|
11
|
+
def date_time_to_date(time)
|
12
|
+
time.strftime(_('%Y-%m-%d'))
|
13
|
+
end
|
14
|
+
|
15
|
+
def date_time_to_time(time)
|
16
|
+
time.strftime(_('%I:%M %p'))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Elabs
|
2
|
+
module UploadsHelper
|
3
|
+
def playable?(uploaded_file)
|
4
|
+
video?(uploaded_file) || audio?(uploaded_file)
|
5
|
+
end
|
6
|
+
|
7
|
+
def audio?(uploaded_file)
|
8
|
+
Elabs.av_formats_audio.include? uploaded_file.content_type
|
9
|
+
end
|
10
|
+
|
11
|
+
def video?(uploaded_file)
|
12
|
+
Elabs.av_formats_video.include? uploaded_file.content_type
|
13
|
+
end
|
14
|
+
|
15
|
+
def available_formats
|
16
|
+
Elabs.av_formats_audio + Elabs.av_formats_video
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Elabs
|
2
|
+
class Album < ApplicationContentRecord
|
3
|
+
self.table_name = 'albums'
|
4
|
+
|
5
|
+
ADDITIONAL_HABTM_COUNTER_CACHES = [
|
6
|
+
%w[projects albums]
|
7
|
+
].freeze
|
8
|
+
|
9
|
+
validates :name, presence: true
|
10
|
+
validates :description, presence: true
|
11
|
+
validates_with AssociatedAuthorValidator, relations: %w[project upload]
|
12
|
+
|
13
|
+
belongs_to :user
|
14
|
+
belongs_to :license
|
15
|
+
belongs_to :language
|
16
|
+
has_many :albums_tags
|
17
|
+
has_many :projects_albums
|
18
|
+
has_many :albums_uploads
|
19
|
+
has_many :tags, through: :albums_tags, dependent: :destroy
|
20
|
+
has_many :projects, through: :projects_albums, dependent: :destroy
|
21
|
+
has_many :uploads, through: :albums_uploads, dependent: :destroy
|
22
|
+
has_many :comments, as: 'content'
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Elabs
|
2
|
+
class AlbumsTag < ApplicationRecord
|
3
|
+
self.table_name = 'albums_tags'
|
4
|
+
|
5
|
+
belongs_to :album
|
6
|
+
belongs_to :tag
|
7
|
+
|
8
|
+
after_create :increment_counter_cache
|
9
|
+
after_destroy :decrement_counter_cache
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def increment_counter_cache
|
14
|
+
tag.increment! :albums_count if album.publicly_visible?
|
15
|
+
end
|
16
|
+
|
17
|
+
def decrement_counter_cache
|
18
|
+
tag.decrement! :albums_count if album.publicly_visible?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Elabs
|
2
|
+
class AlbumsUpload < ApplicationRecord
|
3
|
+
self.table_name = 'albums_uploads'
|
4
|
+
|
5
|
+
belongs_to :album
|
6
|
+
belongs_to :upload
|
7
|
+
|
8
|
+
after_create :increment_counter_cache
|
9
|
+
after_destroy :decrement_counter_cache
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def increment_counter_cache
|
14
|
+
album.increment! :uploads_count if upload.publicly_visible?
|
15
|
+
end
|
16
|
+
|
17
|
+
def decrement_counter_cache
|
18
|
+
album.decrement! :uploads_count if upload.publicly_visible?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|