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,11 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class AlbumsController < MemberContentApplicationController
|
4
|
+
ALLOWED_FIELDS = %i[name description sfw published hidden_in_history language_id license_id tags_list].freeze
|
5
|
+
ALLOWED_RELATIONS = { project_ids: [], upload_ids: [] }.freeze
|
6
|
+
MODEL = Album
|
7
|
+
PLURAL_NAME = 'albums'.freeze
|
8
|
+
SINGULAR_NAME = 'album'.freeze
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class ArticlesController < MemberContentApplicationController
|
4
|
+
ALLOWED_FIELDS = %i[title excerpt content sfw published published_at hidden_in_history license_id language_id tags_list].freeze
|
5
|
+
ALLOWED_RELATIONS = { project_ids: [] }.freeze
|
6
|
+
MODEL = Article
|
7
|
+
PLURAL_NAME = 'articles'.freeze
|
8
|
+
SINGULAR_NAME = 'article'.freeze
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class MemberApplicationController < ElabsApplicationController
|
4
|
+
DEFAULT_ORDER_FIELD = 'id'.freeze
|
5
|
+
MAX_ITEMS_PER_PAGE = Elabs.max_members_items_per_page
|
6
|
+
|
7
|
+
before_action :authenticate_user!
|
8
|
+
|
9
|
+
layout 'elabs/layouts/member_application'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class MemberContentApplicationController < MemberApplicationController
|
4
|
+
ALLOWED_FIELDS = [].freeze
|
5
|
+
ALLOWED_RELATIONS = {}.freeze
|
6
|
+
DEFAULT_ORDER_FIELD = 'updated_at'.freeze
|
7
|
+
MODEL = nil
|
8
|
+
PLURAL_NAME = nil
|
9
|
+
SINGULAR_NAME = nil
|
10
|
+
|
11
|
+
before_action :set_entity, only: %i[edit update destroy toggle_publication]
|
12
|
+
|
13
|
+
# GET /articles
|
14
|
+
# GET /articles.json
|
15
|
+
# rubocop: disable Metrics/AbcSize
|
16
|
+
def index
|
17
|
+
order = params['order_by'] || self.class::DEFAULT_ORDER_FIELD
|
18
|
+
direction = params['direction'] || 'desc'
|
19
|
+
create_instance_variable self.class::PLURAL_NAME, self.class::MODEL.by_member(current_user.id).order(order => direction).page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
|
20
|
+
end
|
21
|
+
# rubocop: enable Metrics/AbcSize
|
22
|
+
|
23
|
+
# GET /articles/new
|
24
|
+
def new
|
25
|
+
create_instance_variable self.class::SINGULAR_NAME, self.class::MODEL.new
|
26
|
+
end
|
27
|
+
|
28
|
+
# GET /articles/1/edit
|
29
|
+
def edit; end
|
30
|
+
|
31
|
+
# POST /articles
|
32
|
+
# POST /articles.json
|
33
|
+
# rubocop: disable Metrics/AbcSize
|
34
|
+
def create
|
35
|
+
build_entity
|
36
|
+
|
37
|
+
respond_to do |format|
|
38
|
+
if @entity.save entity_params
|
39
|
+
format.html { redirect_to_index_with_notice :notice, format(_('%<model_name>s was successfully created.'), model_name: self.class::SINGULAR_NAME.capitalize) }
|
40
|
+
format.json { render "member/#{self.class::PLURAL_NAME}/#{self.class::SINGULAR_NAME}", status: :created }
|
41
|
+
else
|
42
|
+
format.html { render :new }
|
43
|
+
format.json { render json: @entity.errors, status: :unprocessable_entity }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
# rubocop: enable Metrics/AbcSize
|
48
|
+
|
49
|
+
# PATCH/PUT /articles/1
|
50
|
+
# PATCH/PUT /articles/1.json
|
51
|
+
# rubocop: disable Metrics/AbcSize
|
52
|
+
def update
|
53
|
+
respond_to do |format|
|
54
|
+
if @entity.update entity_params
|
55
|
+
format.html { redirect_to_index_with_notice :notice, format(_('%<model_name>s was successfully updated.'), model_name: self.class::SINGULAR_NAME.capitalize) }
|
56
|
+
format.json { render "member/#{self.class::PLURAL_NAME}/#{self.class::SINGULAR_NAME}", status: :ok }
|
57
|
+
else
|
58
|
+
format.html { render :edit }
|
59
|
+
format.json { render json: @entity.errors, status: :unprocessable_entity }
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
# rubocop: enable Metrics/AbcSize
|
64
|
+
|
65
|
+
# DELETE /articles/1
|
66
|
+
# DELETE /articles/1.json
|
67
|
+
def destroy
|
68
|
+
@entity.destroy
|
69
|
+
respond_to do |format|
|
70
|
+
format.html { redirect_to index_url, notice: format(_('%<model_name>s was successfully destroyed.'), model_name: self.class::SINGULAR_NAME.capitalize) }
|
71
|
+
format.json { head :no_content }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# PUT /<entity>/1/toggle_publication
|
76
|
+
def toggle_publication
|
77
|
+
if @entity.toggle(:published).save
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to_index_with_notice :notice, publication_message(@entity) }
|
80
|
+
format.json { render :show, status: :ok }
|
81
|
+
end
|
82
|
+
else
|
83
|
+
respond_to do |format|
|
84
|
+
format.html { redirect_to_index_with_notice :error, 'An error prevented to update this entity' }
|
85
|
+
format.json { render json: @entity.errors, status: :unprocessable_entity }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
|
92
|
+
# Use callbacks to share common setup or constraints between actions.
|
93
|
+
def set_entity
|
94
|
+
id = params[:id] || params["#{self.class::SINGULAR_NAME}_id"]
|
95
|
+
@entity = self.class::MODEL.by_member(current_user.id).find(id)
|
96
|
+
create_instance_variable self.class::SINGULAR_NAME
|
97
|
+
end
|
98
|
+
|
99
|
+
def build_entity
|
100
|
+
@entity = self.class::MODEL.new(entity_params)
|
101
|
+
@entity.user = current_user
|
102
|
+
create_instance_variable self.class::SINGULAR_NAME
|
103
|
+
end
|
104
|
+
|
105
|
+
def index_url
|
106
|
+
"member_#{self.class::PLURAL_NAME}".to_sym
|
107
|
+
end
|
108
|
+
|
109
|
+
def redirect_to_index_with_notice(type, notice)
|
110
|
+
redirect_to "member_#{self.class::PLURAL_NAME}".to_sym, "#{type}": notice
|
111
|
+
end
|
112
|
+
|
113
|
+
def publication_message(entity)
|
114
|
+
message = if entity.published?
|
115
|
+
_('%<model_name>s was successfully published.')
|
116
|
+
else
|
117
|
+
_('%<model_name>s was successfully removed from publication.')
|
118
|
+
end
|
119
|
+
format(message, model_name: self.class::SINGULAR_NAME.capitalize)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
123
|
+
def entity_params
|
124
|
+
params.require(self.class::SINGULAR_NAME.to_sym).permit(self.class::ALLOWED_FIELDS, self.class::ALLOWED_RELATIONS)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class NotesController < MemberContentApplicationController
|
4
|
+
ALLOWED_FIELDS = %i[content sfw hidden_in_history published license_id language_id tags_list].freeze
|
5
|
+
ALLOWED_RELATIONS = { project_ids: [] }.freeze
|
6
|
+
MODEL = Note
|
7
|
+
PLURAL_NAME = 'notes'.freeze
|
8
|
+
SINGULAR_NAME = 'note'.freeze
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class PreferencesController < MemberApplicationController
|
4
|
+
before_action :set_preference, only: %i[edit update]
|
5
|
+
|
6
|
+
# GET /preferences/edit
|
7
|
+
def edit; end
|
8
|
+
|
9
|
+
# PATCH/PUT /preferences
|
10
|
+
# PATCH/PUT /preferences
|
11
|
+
def update
|
12
|
+
respond_to do |format|
|
13
|
+
if @preference.update(preference_params)
|
14
|
+
format.html { redirect_to member_edit_preferences_url, notice: _('Preference was successfully updated.') }
|
15
|
+
format.json { render :show, status: :ok, location: @preference }
|
16
|
+
else
|
17
|
+
format.html { render :edit }
|
18
|
+
format.json { render json: @preference.errors, status: :unprocessable_entity }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
# Use callbacks to share common setup or constraints between actions.
|
26
|
+
def set_preference
|
27
|
+
@preference = current_user.preference
|
28
|
+
end
|
29
|
+
|
30
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
31
|
+
def preference_params
|
32
|
+
params.require(:preference).permit(:show_nsfw, :locale)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class ProjectsController < MemberContentApplicationController
|
4
|
+
ALLOWED_FIELDS = %i[name short_description description main_url sfw published hidden_in_history license_id language_id tags_list].freeze
|
5
|
+
ALLOWED_RELATIONS = {}.freeze
|
6
|
+
MODEL = Project
|
7
|
+
PLURAL_NAME = 'projects'.freeze
|
8
|
+
SINGULAR_NAME = 'project'.freeze
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class UploadsController < MemberContentApplicationController
|
4
|
+
ALLOWED_FIELDS = %i[title description sfw published hidden_in_history language_id license_id file tags_list].freeze
|
5
|
+
ALLOWED_RELATIONS = { album_ids: [], project_ids: [] }.freeze
|
6
|
+
MODEL = Upload
|
7
|
+
PLURAL_NAME = 'uploads'.freeze
|
8
|
+
SINGULAR_NAME = 'upload'.freeze
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class UsersController < ElabsApplicationController
|
4
|
+
before_action :set_user, only: [:update]
|
5
|
+
|
6
|
+
# PATCH/PUT /member/users/1
|
7
|
+
def update
|
8
|
+
if @user.update(user_params)
|
9
|
+
redirect_to @user, notice: _('Your infos were successfully saved')
|
10
|
+
else
|
11
|
+
render edit_user_registration_path
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
# Use callbacks to share common setup or constraints between actions.
|
18
|
+
def set_user
|
19
|
+
@user = current_user
|
20
|
+
end
|
21
|
+
|
22
|
+
# Only allow a trusted parameter "white list" through.
|
23
|
+
def user_params
|
24
|
+
params.require(:user).permit(:real_name, :biography)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Elabs
|
2
|
+
class NotesController < ContentApplicationController
|
3
|
+
ALLOWED_NESTED_FROM = %w[language license tag user project].freeze
|
4
|
+
ALLOWED_ORDER_FROM = %w[published_at updated_at].freeze
|
5
|
+
|
6
|
+
before_action :set_note, only: %i[show]
|
7
|
+
|
8
|
+
# GET /notes
|
9
|
+
# GET /notes.json
|
10
|
+
def index
|
11
|
+
@notes = scope_request(Note.published).page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /notes/1
|
15
|
+
# GET /notes/1.json
|
16
|
+
def show; end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
# Use callbacks to share common setup or constraints between actions.
|
21
|
+
def set_note
|
22
|
+
@note = Note.find_publicly_visible(params[:id])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Elabs
|
2
|
+
class ProjectsController < ContentApplicationController
|
3
|
+
ALLOWED_NESTED_FROM = %w[language license tag user].freeze
|
4
|
+
ALLOWED_ORDER_FROM = %w[name published_at updated_at].freeze
|
5
|
+
|
6
|
+
before_action :set_project, only: %i[show]
|
7
|
+
|
8
|
+
# GET /projects
|
9
|
+
# GET /projects.json
|
10
|
+
def index
|
11
|
+
@projects = scope_request(Project.published).page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /projects/1
|
15
|
+
# GET /projects/1.json
|
16
|
+
def show
|
17
|
+
@project_albums = @project.albums.for_relation
|
18
|
+
@project_articles = @project.articles.for_relation
|
19
|
+
@project_notes = @project.notes.for_relation
|
20
|
+
@project_uploads = @project.uploads.for_relation
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
# Use callbacks to share common setup or constraints between actions.
|
26
|
+
def set_project
|
27
|
+
@project = Project.find_publicly_visible(params[:id])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Elabs
|
2
|
+
class ReportsController < ElabsApplicationController
|
3
|
+
# POST /reports
|
4
|
+
# POST /reports.json
|
5
|
+
# rubocop:disable Metrics/AbcSize
|
6
|
+
def create
|
7
|
+
report = complete_report_with_user
|
8
|
+
|
9
|
+
respond_to do |format|
|
10
|
+
if report.save
|
11
|
+
format.html { redirect_to request.referer, notice: _('Report was successfully created.') }
|
12
|
+
format.json { render json: { message: 'ok' }, status: :created, location: report }
|
13
|
+
else
|
14
|
+
format.html { redirect_to request.referer, notice: { error: report.errors } }
|
15
|
+
format.json { render json: report.errors, status: :unprocessable_entity }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
# rubocop:enable Metrics/AbcSize
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
24
|
+
def report_params
|
25
|
+
params.require(:report).permit(:name, :email, :reason, :allow_contact)
|
26
|
+
end
|
27
|
+
|
28
|
+
def complete_report_with_user
|
29
|
+
report = Report.new(report_params)
|
30
|
+
report.url = request.referer
|
31
|
+
report.user = current_user if user_signed_in?
|
32
|
+
|
33
|
+
report
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Elabs
|
2
|
+
class TagsController < ElabsApplicationController
|
3
|
+
ALLOWED_ORDER_FROM = %w[name].freeze
|
4
|
+
DEFAULT_ORDER = { name: :desc }.freeze
|
5
|
+
|
6
|
+
before_action :set_tag, only: %i[show]
|
7
|
+
|
8
|
+
# GET /tags
|
9
|
+
# GET /tags.json
|
10
|
+
def index
|
11
|
+
@tags = Tag.all
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /tags/1
|
15
|
+
# GET /tags/1.json
|
16
|
+
def show
|
17
|
+
@tag_albums = @tag.albums.for_relation
|
18
|
+
@tag_articles = @tag.articles.for_relation
|
19
|
+
@tag_notes = @tag.notes.for_relation
|
20
|
+
@tag_projects = @tag.projects.for_relation
|
21
|
+
@tag_uploads = @tag.uploads.for_relation
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
# Use callbacks to share common setup or constraints between actions.
|
27
|
+
def set_tag
|
28
|
+
@tag = Tag.find(params[:id])
|
29
|
+
end
|
30
|
+
|
31
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
32
|
+
def tag_params
|
33
|
+
params.require(:tag).permit(:name)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Elabs
|
2
|
+
class UploadsController < ContentApplicationController
|
3
|
+
ALLOWED_NESTED_FROM = %w[language license tag user album project].freeze
|
4
|
+
ALLOWED_ORDER_FROM = %w[title published_at updated_at].freeze
|
5
|
+
|
6
|
+
before_action :set_upload, only: %i[show]
|
7
|
+
|
8
|
+
# GET /uploads
|
9
|
+
# GET /uploads.json
|
10
|
+
def index
|
11
|
+
@uploads = scope_request(Upload.published).page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /uploads/1/edit
|
15
|
+
def show; end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
# Use callbacks to share common setup or constraints between actions.
|
20
|
+
def set_upload
|
21
|
+
@upload = Upload.find_publicly_visible(params[:id])
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Elabs
|
2
|
+
class UsersController < ElabsApplicationController
|
3
|
+
ALLOWED_ORDER_FROM = %w[username created_at].freeze
|
4
|
+
DEFAULT_ORDER = { username: :desc }.freeze
|
5
|
+
|
6
|
+
before_action :set_user, only: %i[show edit update destroy]
|
7
|
+
|
8
|
+
# GET /users
|
9
|
+
# GET /users.json
|
10
|
+
def index
|
11
|
+
@users = User.page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
|
12
|
+
end
|
13
|
+
|
14
|
+
# GET /users/1
|
15
|
+
# GET /users/1.json
|
16
|
+
def show
|
17
|
+
@user_albums = @user.albums.for_relation
|
18
|
+
@user_articles = @user.articles.for_relation
|
19
|
+
@user_notes = @user.notes.for_relation
|
20
|
+
@user_projects = @user.projects.for_relation
|
21
|
+
@user_uploads = @user.uploads.for_relation
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
# Use callbacks to share common setup or constraints between actions.
|
27
|
+
def set_user
|
28
|
+
@user = User.find(params[:id])
|
29
|
+
end
|
30
|
+
|
31
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
32
|
+
def user_params
|
33
|
+
params.fetch(:user, {})
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|