elabs 4.0.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +9 -0
- data/.node-version +1 -1
- data/.rubocop.yml +4 -0
- data/.stylelintrc.yml +12 -2
- data/CHANGELOG.md +81 -12
- data/Gemfile +1 -1
- data/Gemfile.lock +96 -94
- data/README.md +2 -0
- data/ROADMAP.md +4 -2
- data/app/assets/config/elabs_manifest.js +2 -1
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.eot +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.svg +1148 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.ttf +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.woff +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-brands-400.woff2 +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.eot +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.svg +467 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.ttf +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.woff +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-regular-400.woff2 +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.eot +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.svg +2231 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.ttf +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.woff +0 -0
- data/app/assets/fonts/elabs/FontAwesome/fa-solid-900.woff2 +0 -0
- data/app/assets/fonts/elabs/OpenSans/Apache License.txt +201 -0
- data/app/assets/fonts/elabs/OpenSans/OpenSans-Bold.ttf +0 -0
- data/app/assets/fonts/elabs/OpenSans/OpenSans-Light.ttf +0 -0
- data/app/assets/fonts/elabs/OpenSans/OpenSans-Regular.ttf +0 -0
- data/app/assets/fonts/elabs/OpenSans/OpenSans-Semibold.ttf +0 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.eot +0 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.svg +51 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.ttf +0 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.woff +0 -0
- data/app/assets/fonts/elabs/license-icons/license-icons.woff2 +0 -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/announcements.js +33 -0
- data/app/assets/javascripts/elabs/application.js.erb +17 -14
- data/app/assets/javascripts/elabs/forms.js +0 -1
- data/app/assets/javascripts/elabs/helpers-markdown.js +2 -2
- data/app/assets/javascripts/elabs/helpers.js +17 -0
- data/app/assets/javascripts/elabs/menu.js +5 -0
- data/app/assets/stylesheets/elabs/_fonts.scss +32 -0
- data/app/assets/stylesheets/elabs/_variables.scss +286 -5
- data/app/assets/stylesheets/elabs/app/components/_act.scss +83 -0
- data/app/assets/stylesheets/elabs/app/components/_announcement.scss +41 -0
- data/app/assets/stylesheets/elabs/app/components/_classifier_types.scss +43 -0
- data/app/assets/stylesheets/elabs/app/components/_comment.scss +29 -0
- data/app/assets/stylesheets/elabs/app/components/_content_relations.scss +53 -0
- data/app/assets/stylesheets/elabs/app/components/_content_statuses.scss +39 -0
- data/app/assets/stylesheets/elabs/app/components/_content_types.scss +41 -0
- data/app/assets/stylesheets/elabs/app/components/_git_cards.scss +122 -0
- data/app/assets/stylesheets/elabs/app/elements/_alerts.scss +3 -0
- data/app/assets/stylesheets/elabs/app/elements/_badges.scss +17 -0
- data/app/assets/stylesheets/elabs/app/elements/_buttons.scss +34 -0
- data/app/assets/stylesheets/elabs/app/elements/_dropdowns.scss +78 -0
- data/app/assets/stylesheets/elabs/app/elements/_empty.scss +31 -0
- data/app/assets/stylesheets/elabs/app/elements/_errors.scss +15 -0
- data/app/assets/stylesheets/elabs/app/elements/_filter_link.scss +23 -0
- data/app/assets/stylesheets/elabs/app/elements/_fixed_links.scss +19 -0
- data/app/assets/stylesheets/elabs/app/elements/_forms.scss +123 -0
- data/app/assets/stylesheets/elabs/app/elements/_icons.scss +74 -0
- data/app/assets/stylesheets/elabs/app/{_medias.scss → elements/_medias.scss} +2 -0
- data/app/assets/stylesheets/elabs/app/{_modals.scss → elements/_modals.scss} +8 -4
- data/app/assets/stylesheets/elabs/app/elements/_nsfw.scss +41 -0
- data/app/assets/stylesheets/elabs/app/{_pagination.scss → elements/_pagination.scss} +0 -0
- data/app/assets/stylesheets/elabs/app/{_tables.scss → elements/_tables.scss} +2 -2
- data/app/assets/stylesheets/elabs/app/elements/_tabs.scss +73 -0
- data/app/assets/stylesheets/elabs/app/helpers/_cards.scss +80 -0
- data/app/assets/stylesheets/elabs/app/helpers/_containers.scss +7 -0
- data/app/assets/stylesheets/elabs/app/helpers/_states.scss +3 -0
- data/app/assets/stylesheets/elabs/app/{_helpers.scss → helpers/_typo.scss} +6 -4
- data/app/assets/stylesheets/elabs/app/layouts/_acts.scss +25 -0
- data/app/assets/stylesheets/elabs/app/layouts/_classifiers.scss +32 -0
- data/app/assets/stylesheets/elabs/app/{_comments.scss → layouts/_comments.scss} +0 -2
- data/app/assets/stylesheets/elabs/app/layouts/_devise.scss +65 -0
- data/app/assets/stylesheets/elabs/app/layouts/_layout.scss +40 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page.scss +14 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_content.scss +13 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_footer.scss +20 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_header.scss +146 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_menu.scss +232 -0
- data/app/assets/stylesheets/elabs/app/layouts/_page_messages.scss +4 -0
- data/app/assets/stylesheets/elabs/app/layouts/_private_layout.scss +78 -0
- data/app/assets/stylesheets/elabs/app/{_typo.scss → layouts/_typo.scss} +3 -0
- data/app/assets/stylesheets/elabs/app/mixins/_classifier_card.scss +43 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content_card.scss +103 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content_full.scss +158 -0
- data/app/assets/stylesheets/elabs/app/mixins/{_content-inline.scss → _content_inline.scss} +0 -0
- data/app/assets/stylesheets/elabs/lib/_codemirror.scss +2 -2
- data/app/assets/stylesheets/elabs/{_colors.scss → lib/_colors_reference.scss} +0 -52
- data/app/assets/stylesheets/elabs/lib/_license_icons.scss +121 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_fontawesome.scss +1 -1
- data/app/assets/stylesheets/elabs/lib/fontawesome/_fonts.scss +18 -18
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss.scss +1 -1
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss_variables.scss +227 -0
- data/app/assets/stylesheets/elabs/style.scss +62 -57
- data/app/controllers/elabs/admin/admin_application_controller.rb +1 -1
- data/app/controllers/elabs/admin/announcements_controller.rb +71 -0
- data/app/controllers/elabs/concerns/elabs_controller.rb +3 -0
- data/app/controllers/elabs/content_application_controller.rb +4 -0
- data/app/controllers/elabs/elabs_public_controller.rb +15 -0
- data/app/controllers/elabs/languages_controller.rb +1 -5
- data/app/controllers/elabs/member/comments_controller.rb +42 -0
- data/app/controllers/elabs/member/member_application_controller.rb +1 -1
- data/app/controllers/elabs/reports_controller.rb +2 -0
- data/app/helpers/elabs/acts_helper.rb +7 -2
- data/app/helpers/elabs/application_helper.rb +8 -50
- data/app/helpers/elabs/content_filters_helper.rb +17 -24
- data/app/helpers/elabs/content_helper.rb +8 -35
- data/app/helpers/elabs/content_renderer_helper.rb +4 -112
- data/app/helpers/elabs/form_helper.rb +11 -11
- data/app/helpers/elabs/icons_helper.rb +63 -0
- data/app/helpers/elabs/{admin_content_helper.rb → links_admin_helper.rb} +1 -1
- data/app/helpers/elabs/links_helper.rb +58 -0
- data/app/helpers/elabs/{member_content_helper.rb → links_member_helper.rb} +2 -2
- data/app/helpers/elabs/notification_helper.rb +17 -3
- data/app/helpers/elabs/shortcodes_helper.rb +108 -0
- data/app/helpers/elabs/thumbnails_helper.rb +1 -1
- data/app/models/elabs/album.rb +14 -0
- data/app/models/elabs/announcement.rb +33 -0
- data/app/models/elabs/article.rb +14 -0
- data/app/models/elabs/comment.rb +10 -4
- data/app/models/elabs/note.rb +14 -0
- data/app/models/elabs/project.rb +12 -0
- data/app/models/elabs/report.rb +1 -0
- data/app/models/elabs/upload.rb +16 -0
- data/app/models/elabs/user.rb +2 -1
- data/app/views/elabs/acts/_filters.html.haml +3 -2
- data/app/views/elabs/acts/index.html.haml +2 -13
- data/app/views/elabs/admin/announcements/_announcement.json.jbuilder +10 -0
- data/app/views/elabs/admin/announcements/_form.html.haml +52 -0
- data/app/views/elabs/admin/announcements/edit.html.haml +3 -0
- data/app/views/elabs/admin/announcements/index.html.haml +28 -0
- data/app/views/elabs/admin/announcements/index.json.jbuilder +1 -0
- data/app/views/elabs/admin/announcements/new.html.haml +3 -0
- data/app/views/elabs/admin/licenses/index.html.haml +2 -2
- data/app/views/elabs/admin/uploads/_upload.json.jbuilder +3 -3
- data/app/views/elabs/albums/_card_content.html.haml +8 -0
- data/app/views/elabs/albums/_filters.html.haml +5 -3
- data/app/views/elabs/albums/index.html.haml +1 -1
- data/app/views/elabs/albums/show.html.haml +38 -29
- data/app/views/elabs/articles/_filters.html.haml +5 -3
- data/app/views/elabs/articles/index.html.haml +1 -1
- data/app/views/elabs/articles/show.html.haml +33 -25
- data/app/views/elabs/auth/confirmations/new.html.haml +1 -1
- data/app/views/elabs/auth/passwords/edit.html.haml +1 -1
- data/app/views/elabs/auth/passwords/new.html.haml +1 -1
- data/app/views/elabs/auth/registrations/new.html.haml +7 -2
- data/app/views/elabs/auth/sessions/_new.html.haml +1 -1
- data/app/views/elabs/auth/unlocks/new.html.haml +1 -1
- data/app/views/elabs/comments/_comments.html.haml +29 -20
- data/app/views/elabs/comments/_form.html.haml +40 -36
- data/app/views/elabs/languages/_filters.html.haml +3 -5
- data/app/views/elabs/languages/index.html.haml +12 -13
- data/app/views/elabs/languages/show.html.haml +36 -31
- data/app/views/elabs/layouts/_announcements.html.haml +9 -0
- data/app/views/elabs/layouts/_content_associations.html.haml +89 -0
- data/app/views/elabs/layouts/_content_card.html.haml +41 -0
- data/app/views/elabs/layouts/_flash_messages.html.haml +4 -0
- data/app/views/elabs/layouts/_footer.html.haml +18 -10
- data/app/views/elabs/layouts/_form_honeypot.html.haml +12 -0
- data/app/views/elabs/layouts/_hidden_entry.html.haml +1 -1
- data/app/views/elabs/layouts/_hidden_entry_full.html.haml +4 -2
- data/app/views/elabs/layouts/_hidden_entry_inline.html.haml +1 -1
- data/app/views/elabs/layouts/_language_menu.html.haml +2 -2
- data/app/views/elabs/layouts/_menu.html.haml +58 -75
- data/app/views/elabs/layouts/_menu_admin.html.haml +40 -0
- data/app/views/elabs/layouts/_menu_member.html.haml +57 -0
- data/app/views/elabs/layouts/application.html.haml +24 -13
- data/app/views/elabs/layouts/application_admin.html.haml +33 -0
- data/app/views/elabs/layouts/application_member.html.haml +36 -0
- data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_albums.html.haml +0 -0
- data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_projects.html.haml +0 -0
- data/app/views/elabs/layouts/{lists → content_classifiers_lists}/_tags.html.haml +0 -0
- data/app/views/elabs/layouts/{_shortcode_infinite_loop.html.haml → shortcodes/_infinite_loop.html.haml} +1 -1
- data/app/views/elabs/layouts/{_shortcode_infinite_loop_inline.html.haml → shortcodes/_infinite_loop_inline.html.haml} +0 -0
- data/app/views/elabs/layouts/{_shortcode_missing_content.html.haml → shortcodes/_missing_content.html.haml} +1 -1
- data/app/views/elabs/layouts/{_shortcode_missing_content_inline.html.haml → shortcodes/_missing_content_inline.html.haml} +0 -0
- data/app/views/elabs/layouts/shortcodes/_open_to_see.html.haml +2 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_repo_card.html.haml +1 -1
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_repo_inline.html.haml +0 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_github_user_card.html.haml +0 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_group_card.html.haml +1 -1
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_repo_card.html.haml +1 -1
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_repo_inline.html.haml +0 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/_gitlab_user_card.html.haml +1 -1
- data/app/views/elabs/layouts/shortcodes/widgets/vue/_all_widgets.html.haml +5 -0
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_github_repo_card_vue.html.haml +8 -8
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_github_user_card_vue.html.haml +5 -5
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_group_card_vue.html.haml +5 -5
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_repo_card_vue.html.haml +8 -8
- data/app/views/elabs/layouts/{widgets → shortcodes/widgets}/vue/_gitlab_user_card_vue.html.haml +4 -4
- data/app/views/elabs/licenses/_filters.html.haml +3 -2
- data/app/views/elabs/licenses/index.html.haml +14 -12
- data/app/views/elabs/licenses/show.html.haml +40 -34
- data/app/views/elabs/member/albums/_form.html.haml +1 -43
- data/app/views/elabs/member/articles/_form.html.haml +1 -39
- data/app/views/elabs/member/layouts/_form_commons.html.haml +55 -0
- data/app/views/elabs/member/notes/_form.html.haml +1 -39
- data/app/views/elabs/member/preferences/edit.html.haml +1 -2
- data/app/views/elabs/member/projects/_form.html.haml +3 -38
- data/app/views/elabs/member/uploads/_form.html.haml +1 -42
- data/app/views/elabs/member/uploads/_upload.json.jbuilder +3 -3
- data/app/views/elabs/member/users/edit.html.haml +3 -4
- data/app/views/elabs/notes/_filters.html.haml +5 -3
- data/app/views/elabs/notes/index.html.haml +1 -1
- data/app/views/elabs/notes/show.html.haml +33 -25
- data/app/views/elabs/projects/_filters.html.haml +5 -3
- data/app/views/elabs/projects/index.html.haml +1 -1
- data/app/views/elabs/projects/show.html.haml +68 -62
- data/app/views/elabs/reports/_form.html.haml +2 -0
- data/app/views/elabs/tags/_filters.html.haml +3 -2
- data/app/views/elabs/tags/index.html.haml +11 -11
- data/app/views/elabs/tags/show.html.haml +31 -28
- data/app/views/elabs/uploads/_filters.html.haml +5 -3
- data/app/views/elabs/uploads/_preview.html.haml +5 -4
- data/app/views/elabs/uploads/_thumbnail.html.haml +9 -0
- data/app/views/elabs/uploads/_upload.json.jbuilder +3 -3
- data/app/views/elabs/uploads/index.html.haml +1 -1
- data/app/views/elabs/uploads/show.html.haml +45 -39
- data/app/views/elabs/users/_filters.html.haml +3 -2
- data/app/views/elabs/users/_user.html.haml +3 -3
- data/app/views/elabs/users/show.html.haml +48 -43
- data/config/routes.rb +13 -8
- data/db/migrate/20181025084232_add_archived_field_to_comments.rb +5 -0
- data/db/migrate/20181026071743_delete_comment_notifications.rb +5 -0
- data/db/migrate/20181030063505_create_announcements.rb +14 -0
- data/docs/CODEOWNERS +10 -0
- data/docs/migrating.md +16 -1
- data/docs/shortcodes_guide.md +51 -0
- data/lib/assets/javascripts/README-highlight.js.md +5 -5
- data/lib/assets/javascripts/highlight.js-9.13.1/highlight.pack.js +2 -0
- data/lib/assets/stylesheets/{highlight.js-9.12.0 → highlight.js-9.13.1}/styles/atelier-sulphurpool-light.css +0 -0
- data/lib/elabs.rb +8 -0
- data/lib/elabs/version.rb +1 -1
- data/lib/generators/elabs/{devise_views_generator.rb → devise_mailer_views_generator.rb} +2 -2
- data/lib/generators/elabs/images_generator.rb +24 -0
- data/lib/generators/elabs/required_assets_generator.rb +0 -2
- data/lib/generators/templates/elabs.rb +3 -0
- data/locale/app.pot +132 -19
- data/locale/en/app.edit.po +130 -17
- data/locale/en/app.po +130 -17
- data/locale/fr/app.edit.po +145 -28
- data/locale/fr/app.po +141 -27
- data/package.json +10 -12
- data/yarn.lock +885 -668
- metadata +136 -97
- data/app/assets/stylesheets/elabs/_icons.scss +0 -17
- data/app/assets/stylesheets/elabs/app/_acts.scss +0 -69
- data/app/assets/stylesheets/elabs/app/_alerts.scss +0 -3
- data/app/assets/stylesheets/elabs/app/_badges.scss +0 -11
- data/app/assets/stylesheets/elabs/app/_buttons.scss +0 -29
- data/app/assets/stylesheets/elabs/app/_content.scss +0 -25
- data/app/assets/stylesheets/elabs/app/_content_statuses.scss +0 -32
- data/app/assets/stylesheets/elabs/app/_content_uploads.scss +0 -39
- data/app/assets/stylesheets/elabs/app/_empty.scss +0 -19
- data/app/assets/stylesheets/elabs/app/_errors.scss +0 -9
- data/app/assets/stylesheets/elabs/app/_filter_links.scss +0 -27
- data/app/assets/stylesheets/elabs/app/_forms.scss +0 -74
- data/app/assets/stylesheets/elabs/app/_languages.scss +0 -6
- data/app/assets/stylesheets/elabs/app/_layout.scss +0 -206
- data/app/assets/stylesheets/elabs/app/_licenses.scss +0 -6
- data/app/assets/stylesheets/elabs/app/_link-to-top.scss +0 -8
- data/app/assets/stylesheets/elabs/app/_tabs.scss +0 -54
- data/app/assets/stylesheets/elabs/app/_tags.scss +0 -6
- data/app/assets/stylesheets/elabs/app/_toolbars.scss +0 -3
- data/app/assets/stylesheets/elabs/app/_users.scss +0 -21
- data/app/assets/stylesheets/elabs/app/admin-members/_forms.scss +0 -13
- data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +0 -46
- data/app/assets/stylesheets/elabs/app/admin-members/_layout.scss +0 -17
- data/app/assets/stylesheets/elabs/app/areas/_devise.scss +0 -31
- data/app/assets/stylesheets/elabs/app/components/_cards.scss +0 -16
- data/app/assets/stylesheets/elabs/app/components/_container.scss +0 -4
- data/app/assets/stylesheets/elabs/app/mixins/_classifier-card.scss +0 -16
- data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +0 -72
- data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +0 -77
- data/app/assets/stylesheets/elabs/app/widgets/_git-cards.scss +0 -88
- data/app/assets/stylesheets/elabs/lib/fontawesome/_icons.scss +0 -1118
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +0 -239
- data/app/views/elabs/albums/_album.html.haml +0 -38
- data/app/views/elabs/articles/_article.html.haml +0 -30
- data/app/views/elabs/languages/_associations.html.haml +0 -61
- data/app/views/elabs/layouts/_shortcode_open_to_see.html.haml +0 -2
- data/app/views/elabs/layouts/admin_application.html.haml +0 -21
- data/app/views/elabs/layouts/member_application.html.haml +0 -24
- data/app/views/elabs/layouts/widgets/vue/_all_widgets.html.haml +0 -5
- data/app/views/elabs/licenses/_associations.html.haml +0 -61
- data/app/views/elabs/notes/_note.html.haml +0 -31
- data/app/views/elabs/projects/_associations.html.haml +0 -54
- data/app/views/elabs/projects/_project.html.haml +0 -29
- data/app/views/elabs/tags/_associations.html.haml +0 -61
- data/app/views/elabs/uploads/_upload.html.haml +0 -41
- data/app/views/elabs/users/_associations.html.haml +0 -61
- data/db/seeds.rb +0 -10
- data/db/seeds_development.rb +0 -21
- data/db/seeds_production.rb +0 -0
- data/lib/assets/javascripts/codemirror-5.39.2/addon/mode/overlay.js +0 -90
- data/lib/assets/javascripts/codemirror-5.39.2/lib/codemirror.js +0 -9684
- data/lib/assets/javascripts/codemirror-5.39.2/mode/clike/clike.js +0 -834
- data/lib/assets/javascripts/codemirror-5.39.2/mode/css/css.js +0 -832
- data/lib/assets/javascripts/codemirror-5.39.2/mode/gfm/gfm.js +0 -129
- data/lib/assets/javascripts/codemirror-5.39.2/mode/htmlmixed/htmlmixed.js +0 -152
- data/lib/assets/javascripts/codemirror-5.39.2/mode/javascript/javascript.js +0 -896
- data/lib/assets/javascripts/codemirror-5.39.2/mode/markdown/markdown.js +0 -882
- data/lib/assets/javascripts/codemirror-5.39.2/mode/meta.js +0 -217
- data/lib/assets/javascripts/codemirror-5.39.2/mode/xml/xml.js +0 -402
- data/lib/assets/javascripts/highlight.js-9.12.0/highlight.pack.js +0 -2
- data/lib/assets/stylesheets/codemirror-5.39.2/lib/codemirror.css +0 -346
- data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-dark.css +0 -38
- data/lib/assets/stylesheets/codemirror-5.39.2/theme/base16-light.css +0 -38
@@ -0,0 +1,71 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Admin
|
3
|
+
class AnnouncementsController < AdminApplicationController
|
4
|
+
before_action :set_announcement, only: %i[edit update destroy]
|
5
|
+
|
6
|
+
# GET /announcements
|
7
|
+
def index
|
8
|
+
@announcements = Announcement.all
|
9
|
+
end
|
10
|
+
|
11
|
+
# GET /announcements/new
|
12
|
+
def new
|
13
|
+
@announcement = Announcement.new
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /announcements/1/edit
|
17
|
+
def edit; end
|
18
|
+
|
19
|
+
# POST /announcements
|
20
|
+
def create
|
21
|
+
@announcement = Announcement.new(announcement_params)
|
22
|
+
@announcement.user = current_user
|
23
|
+
|
24
|
+
respond_to do |format|
|
25
|
+
if @announcement.save
|
26
|
+
format.html { redirect_to admin_announcements_url, notice: _('Announcement was successfully created.') }
|
27
|
+
format.json { render '_announcement', status: :created, locals: { announcement: @announcement } }
|
28
|
+
else
|
29
|
+
format.html { render :new }
|
30
|
+
format.json { render json: @announcement.errors, status: :unprocessable_entity }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# PATCH/PUT /announcements/1
|
36
|
+
def update
|
37
|
+
respond_to do |format|
|
38
|
+
if @announcement.update(announcement_params)
|
39
|
+
format.html { redirect_to admin_announcements_url, notice: _('Announcement was successfully updated.') }
|
40
|
+
format.json { render '_announcement', status: :ok, locals: { announcement: @announcement } }
|
41
|
+
|
42
|
+
else
|
43
|
+
format.html { render :edit }
|
44
|
+
format.json { render json: @announcement.errors, status: :unprocessable_entity }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# DELETE /announcements/1
|
50
|
+
def destroy
|
51
|
+
@announcement.destroy
|
52
|
+
respond_to do |format|
|
53
|
+
format.html { redirect_to admin_announcements_url, notice: _('Announcement was successfully destroyed.') }
|
54
|
+
format.json { head :no_content }
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
# Use callbacks to share common setup or constraints between actions.
|
61
|
+
def set_announcement
|
62
|
+
@announcement = Announcement.find(params[:id])
|
63
|
+
end
|
64
|
+
|
65
|
+
# Only allow a trusted parameter "white list" through.
|
66
|
+
def announcement_params
|
67
|
+
params.require(:announcement).permit(:start_at, :end_at, :content, :level, :target)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -9,8 +9,11 @@ module Elabs
|
|
9
9
|
|
10
10
|
included do
|
11
11
|
helper Elabs::ApplicationHelper
|
12
|
+
helper Elabs::IconsHelper
|
12
13
|
helper Elabs::ContentFiltersHelper
|
13
14
|
helper Elabs::NotificationHelper
|
15
|
+
helper Elabs::ContentRendererHelper
|
16
|
+
helper Elabs::ShortcodesHelper
|
14
17
|
|
15
18
|
layout 'elabs/layouts/application'
|
16
19
|
end
|
@@ -7,7 +7,10 @@ module Elabs
|
|
7
7
|
|
8
8
|
# POST /comments
|
9
9
|
# POST /comments.json
|
10
|
+
# rubocop:disable Metrics/AbcSize
|
10
11
|
def create_comment
|
12
|
+
return if trap_dumb_bot_in 'body', _('Comment was successfully created. Thank you Bishop.')
|
13
|
+
|
11
14
|
build_comment
|
12
15
|
|
13
16
|
respond_to do |format|
|
@@ -21,6 +24,7 @@ module Elabs
|
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
27
|
+
# rubocop:enable Metrics/AbcSize
|
24
28
|
|
25
29
|
private
|
26
30
|
|
@@ -96,5 +96,20 @@ module Elabs
|
|
96
96
|
# and slug fields that are not present in params
|
97
97
|
slug_parameters.reject { |field| %w[tag_slug project_slug].include?(field) || !params.include?(field) }
|
98
98
|
end
|
99
|
+
|
100
|
+
def trap_dumb_bot_in(field, notice)
|
101
|
+
return false unless Elabs.trap_dumb_bots?
|
102
|
+
|
103
|
+
if params[field].present?
|
104
|
+
respond_to do |format|
|
105
|
+
format.html { redirect_to request.referer, notice: notice }
|
106
|
+
format.json { render json: { message: 'ok' }, status: :created }
|
107
|
+
end
|
108
|
+
|
109
|
+
return true
|
110
|
+
end
|
111
|
+
|
112
|
+
false
|
113
|
+
end
|
99
114
|
end
|
100
115
|
end
|
@@ -9,11 +9,7 @@ module Elabs
|
|
9
9
|
# GET /languages.json
|
10
10
|
def index
|
11
11
|
languages = scope_request Language.page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE)
|
12
|
-
@languages =
|
13
|
-
languages
|
14
|
-
else
|
15
|
-
languages.with_content_only
|
16
|
-
end
|
12
|
+
@languages = languages.with_content_only
|
17
13
|
end
|
18
14
|
|
19
15
|
# GET /languages/1
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Elabs
|
2
|
+
module Member
|
3
|
+
class CommentsController < MemberApplicationController
|
4
|
+
before_action :set_comment, only: %i[archive destroy]
|
5
|
+
|
6
|
+
def archive
|
7
|
+
respond_to do |format|
|
8
|
+
if @comment.archive!
|
9
|
+
format.html { redirect_to @comment.content, notice: _('Comment was successfully archived.') }
|
10
|
+
format.json { render json: @comment, status: :ok }
|
11
|
+
else
|
12
|
+
format.html { redirect_to @comment.content, notice: _('An error occurred during process') }
|
13
|
+
format.json { render json: @comment.errors, status: :unprocessable_entity }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy
|
19
|
+
content = @comment.content
|
20
|
+
@comment.destroy
|
21
|
+
respond_to do |format|
|
22
|
+
format.html { redirect_to content, notice: _('Comment was successfully destroyed.') }
|
23
|
+
format.json { head :no_content }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def set_comment
|
30
|
+
id = params.key?('comment_id') ? params['comment_id'] : params['id']
|
31
|
+
comment = Elabs::Comment.find(id)
|
32
|
+
|
33
|
+
if comment.content.user.id == current_user.id
|
34
|
+
@comment = comment
|
35
|
+
return
|
36
|
+
end
|
37
|
+
|
38
|
+
throw ActiveRecord::RecordNotFound
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -13,8 +13,13 @@ module Elabs
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def act_notice_string(act, include_link = true)
|
16
|
-
|
17
|
-
|
16
|
+
type = act.content_type.demodulize
|
17
|
+
title = act.content.title_to_display
|
18
|
+
string = if %w[unpublish destroy lock].include?(act.event) || !include_link
|
19
|
+
format('%<type>s "%<title>s"', type: type, title: title)
|
20
|
+
else
|
21
|
+
format('%<type>s "%<link>s"', type: type, link: link_to(title, act.content))
|
22
|
+
end
|
18
23
|
|
19
24
|
format(_('%<string>s has been %<event>s'), string: string, event: act_action(act.event)).html_safe
|
20
25
|
end
|
@@ -8,56 +8,6 @@ module Elabs
|
|
8
8
|
session[:show_nsfw]
|
9
9
|
end
|
10
10
|
|
11
|
-
def show_item?(entity)
|
12
|
-
(entity.sfw? || show_nsfw?) && !entity.locked?
|
13
|
-
end
|
14
|
-
|
15
|
-
def user_is_author_of(entity)
|
16
|
-
current_user&.id && entity.user_id == current_user.id
|
17
|
-
end
|
18
|
-
|
19
|
-
def icon_text(icon, text, icon_options = [], reverse = false)
|
20
|
-
format(
|
21
|
-
reverse ? _('%<text>s %<icon>s') : _('%<icon>s %<text>s'),
|
22
|
-
icon: icon(icon, icon_options), text: text
|
23
|
-
).html_safe
|
24
|
-
end
|
25
|
-
|
26
|
-
def boolean_icon_tag(value, true_icon = 'check', false_icon = 'times', false_class = '', true_class = '')
|
27
|
-
icon_class = [
|
28
|
-
"fas fa-#{value ? true_icon : false_icon} fa-fw #{value ? true_class : false_class}"
|
29
|
-
]
|
30
|
-
content_tag(:i, nil, class: icon_class)
|
31
|
-
end
|
32
|
-
|
33
|
-
def colored_good_or_bad_icon_tag(value, true_icon = 'check', false_icon = 'times', false_is_good = false)
|
34
|
-
if false_is_good
|
35
|
-
false_class = 'is-success'
|
36
|
-
true_class = 'is-danger'
|
37
|
-
else
|
38
|
-
false_class = 'is-danger'
|
39
|
-
true_class = 'is-success'
|
40
|
-
end
|
41
|
-
boolean_icon_tag value, true_icon, false_icon, false_class, true_class
|
42
|
-
end
|
43
|
-
|
44
|
-
def icon(name, classes = [], base = 'fas')
|
45
|
-
icon_class = ["#{base} fa-#{name}"]
|
46
|
-
icon_class += classes.map do |c|
|
47
|
-
if %w[2x 3x 4x fw pulse spin].include? c
|
48
|
-
"fa-#{c}"
|
49
|
-
else
|
50
|
-
c
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
content_tag(:i, nil, class: icon_class)
|
55
|
-
end
|
56
|
-
|
57
|
-
def license_icon(license, classes = ['fw'])
|
58
|
-
icon license.icon, classes, 'fab'
|
59
|
-
end
|
60
|
-
|
61
11
|
def page_title(title, namespace = nil)
|
62
12
|
out = [Elabs.site_name]
|
63
13
|
out.push(namespace) if namespace
|
@@ -77,5 +27,13 @@ module Elabs
|
|
77
27
|
self.formats = old_formats
|
78
28
|
end
|
79
29
|
end
|
30
|
+
|
31
|
+
def singular_type_name(entity)
|
32
|
+
entity.class.name.demodulize.tableize.singularize
|
33
|
+
end
|
34
|
+
|
35
|
+
def model_from_entity(type)
|
36
|
+
"Elabs::#{type.classify}".constantize
|
37
|
+
end
|
80
38
|
end
|
81
39
|
end
|
@@ -6,10 +6,10 @@ module Elabs
|
|
6
6
|
options = { param_name => direction }
|
7
7
|
options['sfw_status'] = params['sfw_status'] if params['sfw_status']
|
8
8
|
|
9
|
-
|
9
|
+
link_icon = determine_sort_icon param_name, direction
|
10
10
|
|
11
11
|
link_to options, class: 'filter-link' do
|
12
|
-
icon_text
|
12
|
+
icon_text link_icon, content_tag('span', title, class: 'link'), %w[fw icon], true
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -24,39 +24,23 @@ module Elabs
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def sfw_only_link
|
27
|
-
|
27
|
+
link_icon = params['sfw_status'] && params['sfw_status'] == 'sfw_only' ? 'dot-circle' : 'circle'
|
28
28
|
link_to request.params.merge(sfw_status: 'sfw_only'), class: 'filter-link' do
|
29
|
-
icon_text(
|
29
|
+
icon_text link_icon, content_tag('span', _('Only SFW'), class: 'link'), %w[fw icon]
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
def nsfw_only_link
|
34
|
-
|
34
|
+
link_icon = params['sfw_status'] && params['sfw_status'] == 'nsfw_only' ? 'dot-circle' : 'circle'
|
35
35
|
link_to request.params.merge(sfw_status: 'nsfw_only'), class: 'filter-link' do
|
36
|
-
icon_text(
|
36
|
+
icon_text link_icon, content_tag('span', _('Only NSFW'), class: 'link'), %w[fw icon]
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
def all_sfw_status_link
|
41
|
-
|
41
|
+
link_icon = params['sfw_status'] && %w[sfw_only nsfw_only].include?(params['sfw_status']) ? 'circle' : 'dot-circle'
|
42
42
|
link_to request.params.merge(sfw_status: 'all'), class: 'filter-link' do
|
43
|
-
icon_text(
|
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)
|
43
|
+
icon_text link_icon, content_tag('span', _('Show all'), class: 'link'), %w[fw icon]
|
60
44
|
end
|
61
45
|
end
|
62
46
|
|
@@ -93,5 +77,14 @@ module Elabs
|
|
93
77
|
projects
|
94
78
|
uploads].include?(controller_name) && action_name == 'index'
|
95
79
|
end
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def determine_sort_icon(field, direction)
|
84
|
+
return 'sort-up' if params[field] && direction == :asc
|
85
|
+
return 'sort-down' if params[field] && direction == :desc
|
86
|
+
|
87
|
+
'minus'
|
88
|
+
end
|
96
89
|
end
|
97
90
|
end
|
@@ -1,45 +1,18 @@
|
|
1
1
|
module Elabs
|
2
2
|
module ContentHelper
|
3
|
-
def
|
4
|
-
|
5
|
-
title: _('View online'),
|
6
|
-
class: 'btn btn--small btn--show'
|
7
|
-
}
|
8
|
-
if entity.respond_to?(:publicly_visible?) && !entity.publicly_visible?
|
9
|
-
options[:disabled] = true
|
10
|
-
return content_tag 'a', icon('eye', ['fw']), options
|
11
|
-
end
|
12
|
-
link_to entity, options do
|
13
|
-
icon('eye', ['fw'])
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def namespace_show_link(namespace, singular_model, entity)
|
18
|
-
link_to send("#{namespace}_#{singular_model}_path", entity),
|
19
|
-
title: _('View online'),
|
20
|
-
class: 'btn btn--small btn--show' do
|
21
|
-
icon('eye', ['fw'])
|
22
|
-
end
|
3
|
+
def show_item?(entity)
|
4
|
+
(entity.sfw? || show_nsfw?) && !entity.locked?
|
23
5
|
end
|
24
6
|
|
25
|
-
def
|
26
|
-
|
27
|
-
title: _('Edit'),
|
28
|
-
class: 'btn btn--small btn--edit' do
|
29
|
-
icon('pencil-alt', ['fw'])
|
30
|
-
end
|
7
|
+
def user_is_author_of(entity)
|
8
|
+
current_user&.id && entity.user_id == current_user.id
|
31
9
|
end
|
32
10
|
|
33
|
-
def
|
34
|
-
|
35
|
-
|
36
|
-
method: :delete,
|
37
|
-
class: 'btn btn--small btn--destroy'
|
38
|
-
}
|
39
|
-
link_params[:data] = { confirm: _('Are you sure?') } if confirm
|
40
|
-
link_to send("#{namespace}_#{singular_model}_path".to_sym, entity), link_params do
|
41
|
-
icon('trash', ['fw'])
|
11
|
+
def first_type_with_content(entity)
|
12
|
+
%i[albums articles notes projects uploads].each do |type|
|
13
|
+
return type.to_s if entity.respond_to?(type) && entity["#{type}_count"].positive?
|
42
14
|
end
|
15
|
+
'albums'
|
43
16
|
end
|
44
17
|
end
|
45
18
|
end
|
@@ -1,123 +1,15 @@
|
|
1
1
|
module Elabs
|
2
2
|
module ContentRendererHelper
|
3
|
-
SHORT_CODES = {
|
4
|
-
/\[album:(\d+)\]/ => [:shortcode_album, { size: :inline }],
|
5
|
-
/\[article:(\d+)\]/ => [:shortcode_article, { size: :inline }],
|
6
|
-
/\[note:(\d+)\]/ => [:shortcode_note, { size: :inline }],
|
7
|
-
/\[project:(\d+)\]/ => [:shortcode_project, { size: :inline }],
|
8
|
-
/\[upload:(\d+)\]/ => [:shortcode_upload, { size: :inline }],
|
9
|
-
/\[user:(\d+)\]/ => [:shortcode_user, { size: :inline }],
|
10
|
-
/\[album-card:(\d+)\]/ => [:shortcode_album, { size: :large }],
|
11
|
-
/\[article-card:(\d+)\]/ => [:shortcode_article, { size: :large }],
|
12
|
-
/\[note-card:(\d+)\]/ => [:shortcode_note, { size: :large }],
|
13
|
-
/\[project-card:(\d+)\]/ => [:shortcode_project, { size: :large }],
|
14
|
-
/\[upload-card:(\d+)\]/ => [:shortcode_upload, { size: :large }],
|
15
|
-
/\[user-card:(\d+)\]/ => [:shortcode_user, { size: :large }],
|
16
|
-
%r{\[github-repo:([a-zA-Z0-9\-_]+/[a-zA-Z0-9\-_]+)\]} => [:shortcode_github_repo_inline, { size: :inline }],
|
17
|
-
%r{\[github-repo-card:([a-zA-Z0-9\-_]+/[a-zA-Z0-9\-_]+)\]} => [:shortcode_github_repo, {}],
|
18
|
-
/\[github-user-card:([a-zA-Z0-9\-_]+)\]/ => [:shortcode_github_user, {}],
|
19
|
-
%r{\[gitlab-repo:(https://.*)\]} => [:shortcode_gitlab_repo_inline, { size: :inline }],
|
20
|
-
%r{\[gitlab-repo-card:(https://.*)\]} => [:shortcode_gitlab_repo, {}],
|
21
|
-
%r{\[gitlab-user-card:(https://.*)\]} => [:shortcode_gitlab_user, {}],
|
22
|
-
%r{\[gitlab-group-card:(https://.*)\]} => [:shortcode_gitlab_group, {}]
|
23
|
-
}.freeze
|
24
|
-
|
25
3
|
def markdown(text, reference_entity = nil, show_short_codes = true)
|
26
|
-
|
4
|
+
return '' if text.nil?
|
5
|
+
|
6
|
+
process_short_codes CommonMarker.render_html(text, [:DEFAULT], [:table]).html_safe,
|
27
7
|
reference_entity,
|
28
8
|
show_short_codes
|
29
9
|
end
|
30
10
|
|
31
11
|
def render_entity_content(entity, field, show_short_codes = true)
|
32
|
-
markdown entity
|
33
|
-
end
|
34
|
-
|
35
|
-
def process_short_codes(text, original_entity = nil, display = true)
|
36
|
-
SHORT_CODES.each do |key, method|
|
37
|
-
text.gsub! key do |match|
|
38
|
-
if display || (method[1][:size] && method[1][:size] == :inline)
|
39
|
-
send(method[0], original_entity, match.sub(key, '\1'), method[1])
|
40
|
-
else
|
41
|
-
render(partial: 'elabs/layouts/shortcode_open_to_see') unless display
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
text.html_safe
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
def shortcode_album(original_entity, id, options = {})
|
51
|
-
shortcode_content 'album', original_entity, id, options
|
52
|
-
end
|
53
|
-
|
54
|
-
def shortcode_article(original_entity, id, options = {})
|
55
|
-
shortcode_content 'article', original_entity, id, options
|
56
|
-
end
|
57
|
-
|
58
|
-
def shortcode_note(original_entity, id, options = {})
|
59
|
-
shortcode_content 'note', original_entity, id, options
|
60
|
-
end
|
61
|
-
|
62
|
-
def shortcode_project(original_entity, id, options = {})
|
63
|
-
shortcode_content 'project', original_entity, id, options
|
64
|
-
end
|
65
|
-
|
66
|
-
def shortcode_upload(original_entity, id, options = {})
|
67
|
-
shortcode_content 'upload', original_entity, id, options
|
68
|
-
end
|
69
|
-
|
70
|
-
def shortcode_user(original_entity, id, options = {})
|
71
|
-
shortcode_content 'user', original_entity, id, options
|
72
|
-
end
|
73
|
-
|
74
|
-
def shortcode_content(type, original_entity, id, options = { size: :large })
|
75
|
-
model = "Elabs::#{type.classify}".constantize
|
76
|
-
widget_size = case options[:size]
|
77
|
-
when :inline
|
78
|
-
'_inline'
|
79
|
-
else
|
80
|
-
''
|
81
|
-
end
|
82
|
-
return render "elabs/layouts/shortcode_infinite_loop#{widget_size}", format: :html if original_entity && original_entity.id == id.to_i && original_entity.class == model
|
83
|
-
|
84
|
-
entity = model.find_by(id: id)
|
85
|
-
return render "elabs/layouts/shortcode_missing_content#{widget_size}", format: :html unless entity
|
86
|
-
|
87
|
-
render partial: "elabs/#{type.pluralize}/#{type}#{widget_size}", locals: { type.to_sym => entity }, format: :html
|
88
|
-
end
|
89
|
-
|
90
|
-
def shortcode_github_repo(_original_entity, repo_url, _options = {})
|
91
|
-
render partial: 'elabs/layouts/widgets/github_repo_card', locals: { repo_url: repo_url }
|
92
|
-
end
|
93
|
-
|
94
|
-
def shortcode_github_repo_inline(_original_entity, repo_url, _options = {})
|
95
|
-
url_matches = %r{([a-zA-Z0-9\-_]+)/([a-zA-Z0-9\-_]+)}.match repo_url
|
96
|
-
render partial: 'elabs/layouts/widgets/github_repo_inline', locals: { url_matches: url_matches }
|
97
|
-
end
|
98
|
-
|
99
|
-
def shortcode_github_user(_original_entity, user_name, _options = {})
|
100
|
-
render partial: 'elabs/layouts/widgets/github_user_card', locals: { user_name: user_name }
|
101
|
-
end
|
102
|
-
|
103
|
-
def shortcode_gitlab_repo(_original_entity, repo_url, _options = {})
|
104
|
-
url_matches = %r{(?:https://)?([a-z0-9\-_\.]+)/(.+)}.match repo_url
|
105
|
-
render partial: 'elabs/layouts/widgets/gitlab_repo_card', locals: { url_matches: url_matches }
|
106
|
-
end
|
107
|
-
|
108
|
-
def shortcode_gitlab_repo_inline(_original_entity, repo_url, _options = {})
|
109
|
-
url_matches = %r{(.*)/([a-zA-Z0-9\-_]+)/([a-zA-Z0-9\-_]+)}.match repo_url
|
110
|
-
render partial: 'elabs/layouts/widgets/gitlab_repo_inline', locals: { url_matches: url_matches }
|
111
|
-
end
|
112
|
-
|
113
|
-
def shortcode_gitlab_user(_original_entity, user_url, _options = {})
|
114
|
-
url_matches = %r{(?:https://)?([a-z0-9\-_\.]*)/([a-zA-Z0-9\-_]+)}.match user_url
|
115
|
-
render partial: 'elabs/layouts/widgets/gitlab_user_card', locals: { url_matches: url_matches }
|
116
|
-
end
|
117
|
-
|
118
|
-
def shortcode_gitlab_group(_original_entity, group_url, _options = {})
|
119
|
-
url_matches = %r{(?:https://)?([a-z0-9\-_\.]*)/([a-zA-Z0-9\-_]+)}.match group_url
|
120
|
-
render partial: 'elabs/layouts/widgets/gitlab_group_card', locals: { url_matches: url_matches }
|
12
|
+
markdown entity.send(field), entity, show_short_codes
|
121
13
|
end
|
122
14
|
end
|
123
15
|
end
|