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,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Elabs
|
4
|
+
module Auth
|
5
|
+
class PasswordsController < Devise::PasswordsController
|
6
|
+
include Elabs::Concerns::ElabsController
|
7
|
+
include Elabs::Concerns::Reportable
|
8
|
+
include Elabs::Concerns::Localizable
|
9
|
+
|
10
|
+
# GET /resource/password/new
|
11
|
+
# def new
|
12
|
+
# super
|
13
|
+
# end
|
14
|
+
|
15
|
+
# POST /resource/password
|
16
|
+
# def create
|
17
|
+
# super
|
18
|
+
# end
|
19
|
+
|
20
|
+
# GET /resource/password/edit?reset_password_token=abcdef
|
21
|
+
# def edit
|
22
|
+
# super
|
23
|
+
# end
|
24
|
+
|
25
|
+
# PUT /resource/password
|
26
|
+
# def update
|
27
|
+
# super
|
28
|
+
# end
|
29
|
+
|
30
|
+
protected
|
31
|
+
|
32
|
+
# Override the default "new_session_path" method to return a known path
|
33
|
+
def new_session_path(*)
|
34
|
+
new_user_session_path
|
35
|
+
end
|
36
|
+
|
37
|
+
# def after_resetting_password_path_for(resource)
|
38
|
+
# super(resource)
|
39
|
+
# end
|
40
|
+
|
41
|
+
# The path used after sending reset password instructions
|
42
|
+
# def after_sending_reset_password_instructions_path_for(resource_name)
|
43
|
+
# super(resource_name)
|
44
|
+
# end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Elabs
|
4
|
+
module Auth
|
5
|
+
class RegistrationsController < Devise::RegistrationsController
|
6
|
+
include Elabs::Concerns::ElabsController
|
7
|
+
include Elabs::Concerns::Reportable
|
8
|
+
include Elabs::Concerns::Localizable
|
9
|
+
|
10
|
+
before_action :configure_sign_up_params, only: [:create]
|
11
|
+
# before_action :configure_account_update_params, only: [:update]
|
12
|
+
|
13
|
+
# GET /resource/sign_up
|
14
|
+
# def new
|
15
|
+
# super
|
16
|
+
# end
|
17
|
+
|
18
|
+
# POST /resource
|
19
|
+
# def create
|
20
|
+
# super
|
21
|
+
# end
|
22
|
+
|
23
|
+
# GET /resource/edit
|
24
|
+
# def edit
|
25
|
+
# super
|
26
|
+
# end
|
27
|
+
|
28
|
+
# PUT /resource
|
29
|
+
# def update
|
30
|
+
# super
|
31
|
+
# end
|
32
|
+
|
33
|
+
# DELETE /resource
|
34
|
+
# def destroy
|
35
|
+
# super
|
36
|
+
# end
|
37
|
+
|
38
|
+
# GET /resource/cancel
|
39
|
+
# Forces the session data which is usually expired after sign
|
40
|
+
# in to be expired now. This is useful if the user wants to
|
41
|
+
# cancel oauth signing in/up in the middle of the process,
|
42
|
+
# removing all OAuth session data.
|
43
|
+
# def cancel
|
44
|
+
# super
|
45
|
+
# end
|
46
|
+
|
47
|
+
protected
|
48
|
+
|
49
|
+
# If you have extra params to permit, append them to the sanitizer.
|
50
|
+
def configure_sign_up_params
|
51
|
+
devise_parameter_sanitizer.permit(:sign_up, keys: ['username'])
|
52
|
+
end
|
53
|
+
|
54
|
+
# If you have extra params to permit, append them to the sanitizer.
|
55
|
+
# def configure_account_update_params
|
56
|
+
# devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
|
57
|
+
# end
|
58
|
+
|
59
|
+
# The path used after sign up.
|
60
|
+
# def after_sign_up_path_for(resource)
|
61
|
+
# super(resource)
|
62
|
+
# end
|
63
|
+
|
64
|
+
# The path used after sign up for inactive accounts.
|
65
|
+
# def after_inactive_sign_up_path_for(resource)
|
66
|
+
# super(resource)
|
67
|
+
# end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Auth
|
3
|
+
class SessionsController < ::Devise::SessionsController
|
4
|
+
include Elabs::Concerns::ElabsController
|
5
|
+
include Elabs::Concerns::Reportable
|
6
|
+
include Elabs::Concerns::Localizable
|
7
|
+
|
8
|
+
# before_action :configure_sign_in_params, only: [:create]
|
9
|
+
|
10
|
+
# GET /resource/sign_in
|
11
|
+
# def new
|
12
|
+
# super
|
13
|
+
# end
|
14
|
+
|
15
|
+
# POST /resource/sign_in
|
16
|
+
def create
|
17
|
+
super
|
18
|
+
|
19
|
+
session[:show_nsfw] = current_user.preference.show_nsfw
|
20
|
+
session[:locale] = current_user.preference.locale
|
21
|
+
end
|
22
|
+
|
23
|
+
# DELETE /resource/sign_out
|
24
|
+
# def destroy
|
25
|
+
# super
|
26
|
+
# end
|
27
|
+
|
28
|
+
# protected
|
29
|
+
|
30
|
+
# If you have extra params to permit, append them to the sanitizer.
|
31
|
+
# def configure_sign_in_params
|
32
|
+
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
|
33
|
+
# end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Elabs
|
4
|
+
module Auth
|
5
|
+
class UnlocksController < Devise::UnlocksController
|
6
|
+
include Elabs::Concerns::ElabsController
|
7
|
+
include Elabs::Concerns::Reportable
|
8
|
+
include Elabs::Concerns::Localizable
|
9
|
+
|
10
|
+
# GET /resource/unlock/new
|
11
|
+
# def new
|
12
|
+
# super
|
13
|
+
# end
|
14
|
+
|
15
|
+
# POST /resource/unlock
|
16
|
+
# def create
|
17
|
+
# super
|
18
|
+
# end
|
19
|
+
|
20
|
+
# GET /resource/unlock?unlock_token=abcdef
|
21
|
+
# def show
|
22
|
+
# super
|
23
|
+
# end
|
24
|
+
|
25
|
+
# protected
|
26
|
+
|
27
|
+
# The path used after sending unlock password instructions
|
28
|
+
# def after_sending_unlock_instructions_path_for(resource)
|
29
|
+
# super(resource)
|
30
|
+
# end
|
31
|
+
|
32
|
+
# The path used after unlocking the resource
|
33
|
+
# def after_unlock_path_for(resource)
|
34
|
+
# super(resource)
|
35
|
+
# end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Concerns
|
3
|
+
# This concern is meant to be included in controllers extending
|
4
|
+
# other plugins/engines controllers (i.e.: Devise)
|
5
|
+
# This should not be used on Elabs controllers, as everything here is declared
|
6
|
+
# in ElabsApplicationController.
|
7
|
+
module ElabsController
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
|
10
|
+
included do
|
11
|
+
helper Elabs::ApplicationHelper
|
12
|
+
helper Elabs::ContentFiltersHelper
|
13
|
+
|
14
|
+
layout 'elabs/layouts/application'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Concerns
|
3
|
+
module Reportable
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
before_action :prepare_empty_report
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def prepare_empty_report
|
13
|
+
@new_report = Elabs::Report.new
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Elabs
|
2
|
+
class ContentApplicationController < ElabsApplicationController
|
3
|
+
DEFAULT_ORDER = { published_at: :desc }.freeze
|
4
|
+
IS_NSFW_FILTERABLE = true
|
5
|
+
|
6
|
+
before_action :new_comment
|
7
|
+
|
8
|
+
# POST /comments
|
9
|
+
# POST /comments.json
|
10
|
+
def create_comment
|
11
|
+
build_comment
|
12
|
+
|
13
|
+
respond_to do |format|
|
14
|
+
if @comment.save
|
15
|
+
format.html { redirect_to @comment.content, notice: _('Comment was successfully created.') }
|
16
|
+
format.json { render :show, status: :created, location: @comment.content }
|
17
|
+
else
|
18
|
+
@new_comment = @comment
|
19
|
+
format.html { redirect_to @comment.content }
|
20
|
+
format.json { render json: @comment.errors, status: :unprocessable_entity }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
28
|
+
def comment_params
|
29
|
+
params.require(:comment).permit(:name, :email, :comment, :allow_contact)
|
30
|
+
end
|
31
|
+
|
32
|
+
def new_comment
|
33
|
+
@new_comment ||= Comment.new
|
34
|
+
end
|
35
|
+
|
36
|
+
def build_comment
|
37
|
+
@comment = Comment.new(comment_params)
|
38
|
+
params.each do |key, value|
|
39
|
+
@comment.content_id = value if %w[album_id article_id note_id project_id upload_id].include? key
|
40
|
+
end
|
41
|
+
@comment.content_type = params[:controller].classify
|
42
|
+
@comment.user = current_user if user_signed_in?
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module Elabs
|
2
|
+
class ElabsApplicationController < ActionController::Base
|
3
|
+
include Elabs::Concerns::Reportable
|
4
|
+
include Elabs::Concerns::Localizable
|
5
|
+
|
6
|
+
ALLOWED_NESTED_FROM = [].freeze
|
7
|
+
ALLOWED_ORDER_FROM = [].freeze
|
8
|
+
DEFAULT_ORDER = { id: :desc }.freeze
|
9
|
+
IS_NSFW_FILTERABLE = false
|
10
|
+
MAX_ITEMS_PER_PAGE = Elabs.max_items_per_page
|
11
|
+
|
12
|
+
before_action :set_nsfw_option
|
13
|
+
protect_from_forgery with: :exception
|
14
|
+
|
15
|
+
layout 'elabs/layouts/application'
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def scope_request(orm_request)
|
20
|
+
orm_request = build_request_nested orm_request
|
21
|
+
orm_request = build_request_where orm_request
|
22
|
+
orm_request = build_request_nsfw orm_request if self.class::IS_NSFW_FILTERABLE
|
23
|
+
|
24
|
+
build_request_order orm_request
|
25
|
+
end
|
26
|
+
|
27
|
+
def build_request_nested(orm_request)
|
28
|
+
where_clauses = {}
|
29
|
+
|
30
|
+
params.each do |p|
|
31
|
+
# No need to do this with "album_id" as there is no action requiring it (as for a /albums/xxx/uploads)
|
32
|
+
next unless %w[tag_id project_id].include? p[0]
|
33
|
+
foreign_table = p[0].chomp('_id').pluralize.to_sym
|
34
|
+
orm_request = orm_request.joins(foreign_table)
|
35
|
+
where_clauses[foreign_table] = { id: p[1] }
|
36
|
+
next
|
37
|
+
end
|
38
|
+
|
39
|
+
orm_request.where(where_clauses)
|
40
|
+
end
|
41
|
+
|
42
|
+
def build_request_where(orm_request)
|
43
|
+
allowed_scopes_ids = self.class::ALLOWED_NESTED_FROM.map { |n| "#{n}_id" }
|
44
|
+
clean_list = allowed_scopes_ids.reject { |s| %w[tag_id project_id].include? s }
|
45
|
+
|
46
|
+
params.each do |p|
|
47
|
+
orm_request = orm_request.where(p[0] => p[1]) if clean_list.include? p[0]
|
48
|
+
end
|
49
|
+
|
50
|
+
orm_request
|
51
|
+
end
|
52
|
+
|
53
|
+
def build_request_order(orm_request)
|
54
|
+
allowed_order_fields = self.class::ALLOWED_ORDER_FROM.map { |n| "order_by_#{n}" }
|
55
|
+
orders = 0
|
56
|
+
|
57
|
+
params.each do |p|
|
58
|
+
next unless allowed_order_fields.include? p[0]
|
59
|
+
field = p[0].gsub(/^order_by_/, '')
|
60
|
+
orm_request = orm_request.order "#{field}_id" => p[1]
|
61
|
+
orders += 1
|
62
|
+
end
|
63
|
+
|
64
|
+
orm_request = orm_request.order(self.class::DEFAULT_ORDER) if orders.zero?
|
65
|
+
|
66
|
+
orm_request
|
67
|
+
end
|
68
|
+
|
69
|
+
def build_request_nsfw(orm_request)
|
70
|
+
if params['sfw_status']
|
71
|
+
return case params['sfw_status']
|
72
|
+
when 'sfw_only'
|
73
|
+
orm_request.where(sfw: true)
|
74
|
+
when 'nsfw_only'
|
75
|
+
orm_request.where(sfw: false)
|
76
|
+
else
|
77
|
+
orm_request
|
78
|
+
end
|
79
|
+
end
|
80
|
+
orm_request
|
81
|
+
end
|
82
|
+
|
83
|
+
def set_nsfw_option
|
84
|
+
session[:show_nsfw] ||= false
|
85
|
+
session[:show_nsfw] = params['show_nsfw'] == 'true' if params['show_nsfw']
|
86
|
+
end
|
87
|
+
|
88
|
+
# Wrapper method for `instance_variable_set` that adds the `@` character to the variable name.
|
89
|
+
#
|
90
|
+
# @return [void]
|
91
|
+
def create_instance_variable(variable, entity = @entity)
|
92
|
+
instance_variable_set "@#{variable}", entity
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Elabs
|
2
|
+
class LanguagesController < ElabsApplicationController
|
3
|
+
ALLOWED_ORDER_FROM = %w[name].freeze
|
4
|
+
DEFAULT_ORDER = { name: :desc }.freeze
|
5
|
+
|
6
|
+
before_action :set_language, only: %i[show edit]
|
7
|
+
|
8
|
+
# GET /languages
|
9
|
+
# GET /languages.json
|
10
|
+
def index
|
11
|
+
languages = Language.page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
|
12
|
+
@languages = if params['with_content_only'] && params['with_content_only'] == 'false'
|
13
|
+
languages
|
14
|
+
else
|
15
|
+
languages.with_content_only
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# GET /languages/1
|
20
|
+
# GET /languages/1.json
|
21
|
+
def show
|
22
|
+
@language_albums = @language.albums.for_relation
|
23
|
+
@language_articles = @language.articles.for_relation
|
24
|
+
@language_notes = @language.notes.for_relation
|
25
|
+
@language_projects = @language.projects.for_relation
|
26
|
+
@language_uploads = @language.uploads.for_relation
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
# Use callbacks to share common setup or constraints between actions.
|
32
|
+
def set_language
|
33
|
+
@language = Language.find(params[:id])
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Elabs
|
2
|
+
class LicensesController < ElabsApplicationController
|
3
|
+
ALLOWED_ORDER_FROM = %w[name].freeze
|
4
|
+
DEFAULT_ORDER = { name: :desc }.freeze
|
5
|
+
|
6
|
+
before_action :set_license, only: [:show]
|
7
|
+
|
8
|
+
# GET /licenses
|
9
|
+
# GET /licenses.json
|
10
|
+
def index
|
11
|
+
@licenses = License.all
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /licenses/1
|
15
|
+
# GET /licenses/1.json
|
16
|
+
def show
|
17
|
+
@license_albums = @license.albums.for_relation
|
18
|
+
@license_articles = @license.articles.for_relation
|
19
|
+
@license_notes = @license.notes.for_relation
|
20
|
+
@license_projects = @license.projects.for_relation
|
21
|
+
@license_uploads = @license.uploads.for_relation
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
# Use callbacks to share common setup or constraints between actions.
|
27
|
+
def set_license
|
28
|
+
@license = License.find(params[:id])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|