elabs 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +89 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +7 -2
- data/README.md +24 -17
- data/ROADMAP.md +8 -7
- data/app/assets/javascripts/elabs/application.js.erb +42 -0
- data/app/assets/javascripts/elabs/forms.js +10 -0
- data/app/assets/javascripts/elabs/helpers-markdown.js +11 -33
- data/app/assets/javascripts/elabs/helpers.js +28 -0
- data/app/assets/javascripts/elabs/hljs.js +4 -0
- data/app/assets/stylesheets/elabs/_colors.scss +5 -0
- data/app/assets/stylesheets/elabs/_fixes.scss +6 -0
- data/app/assets/stylesheets/elabs/_icons.scss +4 -0
- data/app/assets/stylesheets/elabs/app/_acts.scss +11 -0
- data/app/assets/stylesheets/elabs/app/_buttons.scss +8 -0
- data/app/assets/stylesheets/elabs/app/_comments.scss +10 -1
- data/app/assets/stylesheets/elabs/app/_content.scss +15 -0
- data/app/assets/stylesheets/elabs/app/_content_statuses.scss +32 -0
- data/app/assets/stylesheets/elabs/app/_forms.scss +5 -0
- data/app/assets/stylesheets/elabs/app/_helpers.scss +10 -0
- data/app/assets/stylesheets/elabs/app/_layout.scss +4 -0
- data/app/assets/stylesheets/elabs/app/_modals.scss +4 -0
- data/app/assets/stylesheets/elabs/app/_tables.scss +31 -0
- data/app/assets/stylesheets/elabs/app/_typo.scss +14 -0
- data/app/assets/stylesheets/elabs/app/_users.scss +14 -6
- data/app/assets/stylesheets/elabs/app/admin-members/_forms.scss +8 -1
- data/app/assets/stylesheets/elabs/app/admin-members/_indexes.scss +1 -26
- data/app/assets/stylesheets/elabs/app/mixins/_content-card.scss +11 -1
- data/app/assets/stylesheets/elabs/app/mixins/_content-full.scss +26 -0
- data/app/assets/stylesheets/elabs/app/mixins/_content-inline.scss +7 -0
- data/app/assets/stylesheets/elabs/app/widgets/_git-cards.scss +88 -0
- data/app/assets/stylesheets/elabs/lib/_hljs.scss +5 -0
- data/app/assets/stylesheets/elabs/lib/fontawesome/_icons.scss +11 -11
- data/app/assets/stylesheets/elabs/lib/knacss/_knacss-variables.scss +10 -2
- data/app/assets/stylesheets/elabs/style.scss +11 -1
- data/app/controllers/elabs/admin/admin_application_controller.rb +1 -1
- data/app/controllers/elabs/admin/admin_content_application_controller.rb +2 -2
- data/app/controllers/elabs/admin/languages_controller.rb +1 -1
- data/app/controllers/elabs/admin/licenses_controller.rb +1 -1
- data/app/controllers/elabs/admin/tags_controller.rb +1 -1
- data/app/controllers/elabs/admin/users_controller.rb +1 -1
- data/app/controllers/elabs/albums_controller.rb +1 -1
- data/app/controllers/elabs/articles_controller.rb +1 -1
- data/app/controllers/elabs/content_application_controller.rb +2 -1
- data/app/controllers/elabs/elabs_public_controller.rb +28 -8
- data/app/controllers/elabs/languages_controller.rb +1 -1
- data/app/controllers/elabs/licenses_controller.rb +1 -1
- data/app/controllers/elabs/member/albums_controller.rb +1 -1
- data/app/controllers/elabs/member/articles_controller.rb +1 -1
- data/app/controllers/elabs/member/markdown_previewer_controller.rb +11 -0
- data/app/controllers/elabs/member/member_content_application_controller.rb +2 -2
- data/app/controllers/elabs/member/notes_controller.rb +1 -1
- data/app/controllers/elabs/member/projects_controller.rb +1 -1
- data/app/controllers/elabs/member/uploads_controller.rb +1 -1
- data/app/controllers/elabs/notes_controller.rb +1 -1
- data/app/controllers/elabs/projects_controller.rb +1 -1
- data/app/controllers/elabs/tags_controller.rb +1 -6
- data/app/controllers/elabs/uploads_controller.rb +1 -1
- data/app/controllers/elabs/users_controller.rb +1 -1
- data/app/helpers/elabs/acts_helper.rb +2 -2
- data/app/helpers/elabs/application_helper.rb +30 -3
- data/app/helpers/elabs/content_helper.rb +9 -3
- data/app/helpers/elabs/content_renderer_helper.rb +118 -8
- data/app/helpers/elabs/rss_helper.rb +9 -0
- data/app/helpers/elabs/thumbnails_helper.rb +24 -19
- data/app/helpers/elabs/time_helper.rb +7 -1
- data/app/models/elabs/album.rb +2 -0
- data/app/models/elabs/application_content_record.rb +3 -0
- data/app/models/elabs/article.rb +2 -0
- data/app/models/elabs/concerns/actable_entity.rb +17 -2
- data/app/models/elabs/concerns/content_entity.rb +2 -2
- data/app/models/elabs/concerns/sluggable.rb +40 -0
- data/app/models/elabs/language.rb +8 -0
- data/app/models/elabs/license.rb +5 -0
- data/app/models/elabs/note.rb +2 -0
- data/app/models/elabs/project.rb +3 -0
- data/app/models/elabs/tag.rb +5 -0
- data/app/models/elabs/upload.rb +2 -0
- data/app/models/elabs/user.rb +10 -2
- data/app/views/elabs/acts/_act.rss.builder +22 -0
- data/app/views/elabs/acts/index.html.haml +5 -1
- data/app/views/elabs/acts/index.rss.builder +15 -0
- data/app/views/elabs/admin/albums/index.html.haml +4 -4
- data/app/views/elabs/admin/articles/index.html.haml +4 -4
- data/app/views/elabs/admin/languages/_form.html.haml +2 -1
- data/app/views/elabs/admin/licenses/_form.html.haml +2 -1
- data/app/views/elabs/admin/notes/index.html.haml +5 -5
- data/app/views/elabs/admin/projects/index.html.haml +4 -4
- data/app/views/elabs/admin/reports/index.html.haml +2 -2
- data/app/views/elabs/admin/tags/_form.html.haml +2 -1
- data/app/views/elabs/admin/uploads/index.html.haml +4 -4
- data/app/views/elabs/admin/users/index.html.haml +3 -3
- data/app/views/elabs/admin/users/show.html.haml +2 -2
- data/app/views/elabs/albums/_album.html.haml +1 -1
- data/app/views/elabs/albums/_album.rss.builder +7 -0
- data/app/views/elabs/albums/_album_inline.html.haml +8 -0
- data/app/views/elabs/albums/index.rss.builder +14 -0
- data/app/views/elabs/albums/show.html.haml +3 -3
- data/app/views/elabs/articles/_article.html.haml +1 -1
- data/app/views/elabs/articles/_article.rss.builder +7 -0
- data/app/views/elabs/articles/_article_inline.html.haml +8 -0
- data/app/views/elabs/articles/index.rss.builder +14 -0
- data/app/views/elabs/articles/show.html.haml +4 -4
- data/app/views/elabs/comments/_comments.html.haml +4 -3
- data/app/views/elabs/comments/_form.html.haml +18 -6
- data/app/views/elabs/languages/_associations.html.haml +15 -5
- data/app/views/elabs/layouts/_footer.html.haml +8 -1
- data/app/views/elabs/layouts/_hidden_entry.html.haml +4 -4
- data/app/views/elabs/layouts/_hidden_entry_full.html.haml +4 -4
- data/app/views/elabs/layouts/_hidden_entry_inline.html.haml +6 -0
- data/app/views/elabs/layouts/_shortcode_infinite_loop.html.haml +2 -0
- data/app/views/elabs/layouts/_shortcode_infinite_loop_inline.html.haml +2 -0
- data/app/views/elabs/layouts/_shortcode_missing_content.html.haml +2 -0
- data/app/views/elabs/layouts/_shortcode_missing_content_inline.html.haml +2 -0
- data/app/views/elabs/layouts/_shortcode_open_to_see.html.haml +2 -0
- data/app/views/elabs/layouts/admin_application.html.haml +2 -2
- data/app/views/elabs/layouts/application.html.haml +11 -3
- data/app/views/elabs/layouts/member_application.html.haml +5 -2
- data/app/views/elabs/layouts/widgets/_github_repo_card.html.haml +12 -0
- data/app/views/elabs/layouts/widgets/_github_repo_inline.html.haml +8 -0
- data/app/views/elabs/layouts/widgets/_github_user_card.html.haml +7 -0
- data/app/views/elabs/layouts/widgets/_gitlab_group_card.html.haml +11 -0
- data/app/views/elabs/layouts/widgets/_gitlab_repo_card.html.haml +12 -0
- data/app/views/elabs/layouts/widgets/_gitlab_repo_inline.html.haml +8 -0
- data/app/views/elabs/layouts/widgets/_gitlab_user_card.html.haml +11 -0
- data/app/views/elabs/layouts/widgets/vue/_all_widgets.html.haml +5 -0
- data/app/views/elabs/layouts/widgets/vue/_github_repo_card_vue.html.haml +72 -0
- data/app/views/elabs/layouts/widgets/vue/_github_user_card_vue.html.haml +64 -0
- data/app/views/elabs/layouts/widgets/vue/_gitlab_group_card_vue.html.haml +64 -0
- data/app/views/elabs/layouts/widgets/vue/_gitlab_repo_card_vue.html.haml +69 -0
- data/app/views/elabs/layouts/widgets/vue/_gitlab_user_card_vue.html.haml +99 -0
- data/app/views/elabs/licenses/_associations.html.haml +15 -5
- data/app/views/elabs/licenses/show.json.jbuilder +1 -1
- data/app/views/elabs/member/albums/_form.html.haml +12 -1
- data/app/views/elabs/member/albums/index.html.haml +4 -4
- data/app/views/elabs/member/articles/_form.html.haml +12 -1
- data/app/views/elabs/member/articles/index.html.haml +4 -4
- data/app/views/elabs/member/markdown_previewer/preview.json.jbuilder +2 -0
- data/app/views/elabs/member/notes/_form.html.haml +12 -1
- data/app/views/elabs/member/notes/index.html.haml +4 -4
- data/app/views/elabs/member/notifications/index.html.haml +1 -1
- data/app/views/elabs/member/preferences/_form.html.haml +2 -1
- data/app/views/elabs/member/projects/_form.html.haml +18 -2
- data/app/views/elabs/member/projects/_project.json.jbuilder +2 -0
- data/app/views/elabs/member/projects/index.html.haml +4 -4
- data/app/views/elabs/member/uploads/_form.html.haml +12 -1
- data/app/views/elabs/member/uploads/index.html.haml +6 -9
- data/app/views/elabs/member/users/_form.html.haml +2 -1
- data/app/views/elabs/notes/_note.html.haml +2 -2
- data/app/views/elabs/notes/_note.rss.builder +7 -0
- data/app/views/elabs/notes/_note_inline.haml +8 -0
- data/app/views/elabs/notes/index.rss.builder +14 -0
- data/app/views/elabs/notes/show.html.haml +3 -3
- data/app/views/elabs/projects/_associations.html.haml +12 -4
- data/app/views/elabs/projects/_project.html.haml +1 -1
- data/app/views/elabs/projects/_project.json.jbuilder +2 -0
- data/app/views/elabs/projects/_project.rss.builder +7 -0
- data/app/views/elabs/projects/_project_inline.html.haml +9 -0
- data/app/views/elabs/projects/index.rss.builder +14 -0
- data/app/views/elabs/projects/show.html.haml +20 -9
- data/app/views/elabs/reports/_form.html.haml +2 -1
- data/app/views/elabs/tags/_associations.html.haml +15 -5
- data/app/views/elabs/tags/index.html.haml +2 -0
- data/app/views/elabs/uploads/_preview.html.haml +1 -6
- data/app/views/elabs/uploads/_upload.rss.builder +7 -0
- data/app/views/elabs/uploads/_upload_inline.html.haml +8 -0
- data/app/views/elabs/uploads/index.rss.builder +14 -0
- data/app/views/elabs/uploads/show.html.haml +7 -8
- data/app/views/elabs/users/_associations.html.haml +15 -5
- data/app/views/elabs/users/_user.html.haml +24 -18
- data/app/views/elabs/users/_user_inline.html.haml +7 -0
- data/app/views/elabs/users/show.html.haml +2 -2
- data/config/brakeman.ignore +13 -111
- data/config/locales/en.yml +6 -0
- data/config/locales/fr.yml +6 -0
- data/config/routes.rb +30 -28
- data/db/migrate/20180917133442_add_urls_to_projects.rb +6 -0
- data/db/migrate/20181005105642_add_reason_to_acts.rb +5 -0
- data/db/migrate/20181006073541_add_slugs.rb +39 -0
- data/docs/migrating.md +51 -0
- data/docs/setup.md +1 -0
- data/lib/elabs.rb +5 -0
- data/lib/elabs/version.rb +1 -1
- data/lib/generators/elabs/install_generator.rb +1 -0
- data/lib/generators/elabs/views_generator.rb +0 -1
- data/lib/generators/templates/elabs.rb +4 -0
- data/lib/generators/templates/user_model.rb +6 -0
- data/locale/app.pot +129 -9
- data/locale/en/app.edit.po +127 -7
- data/locale/en/app.po +127 -7
- data/locale/fr/app.edit.po +130 -10
- data/locale/fr/app.po +129 -9
- metadata +59 -5
- data/app/assets/javascripts/elabs/application.js +0 -27
- data/app/assets/stylesheets/elabs/app/_nsfw.scss +0 -5
- data/lib/assets/javascripts/markdown-it-8.4.2.min.js +0 -1
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
-# You must provide an url for the form
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
%h2= _('Leave a comment')
|
|
4
|
+
|
|
5
|
+
%p= _('You want to react to this content or ask something to the author? Just leave a comment here!')
|
|
6
|
+
|
|
7
|
+
.alert.alert--info
|
|
8
|
+
%p= _("Note that the comments are not publicly visible, so don't worry if you don't see yours.")
|
|
9
|
+
%p= _("All the information you give will only be visible to the author. We don't share anything with anyone.")
|
|
10
|
+
|
|
3
11
|
= form_for new_comment, url: url do |f|
|
|
4
12
|
- if new_comment.errors.any?
|
|
5
13
|
.error
|
|
@@ -12,8 +20,10 @@
|
|
|
12
20
|
|
|
13
21
|
- if user_signed_in?
|
|
14
22
|
.alert.alert--info
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
-# haml-lint:disable LineLength
|
|
24
|
+
= format(_('This comment will be posted as "%<name>s". By submitting this comment, you agree to be recontacted by the author.'),
|
|
25
|
+
name: current_user.username)
|
|
26
|
+
-# haml-lint:enable LineLength
|
|
17
27
|
- else
|
|
18
28
|
.field
|
|
19
29
|
= f.label :name
|
|
@@ -22,10 +32,12 @@
|
|
|
22
32
|
= f.label :email
|
|
23
33
|
.field-input= f.text_field :email, required: true
|
|
24
34
|
.field
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
.field-input
|
|
36
|
+
= f.check_box :allow_contact
|
|
37
|
+
= f.label :allow_contact, _('I agree to be recontacted')
|
|
27
38
|
.field
|
|
28
39
|
= f.label :comment
|
|
29
40
|
.field-input= f.text_area :comment, required: true
|
|
30
41
|
.actions
|
|
31
|
-
|
|
42
|
+
.actions-buttons
|
|
43
|
+
= f.submit 'Save', class: 'btn btn--save'
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
%aside.tabs
|
|
2
2
|
%ul.tabs__tabs-list
|
|
3
3
|
%li.tabs__tabs-list__tab#tab-albums
|
|
4
|
-
%a{ href: '#tab-content-albums', onclick: 'selectTab(event, "albums")' }
|
|
4
|
+
%a{ href: '#tab-content-albums', onclick: 'selectTab(event, "albums")' }
|
|
5
|
+
= _('Albums')
|
|
6
|
+
%span.badge.badge--notification= language.albums_count
|
|
5
7
|
%li.tabs__tabs-list__tab#tab-articles
|
|
6
|
-
%a{ href: '#tab-content-articles', onclick: 'selectTab(event, "articles")' }
|
|
8
|
+
%a{ href: '#tab-content-articles', onclick: 'selectTab(event, "articles")' }
|
|
9
|
+
= _('Articles')
|
|
10
|
+
%span.badge.badge--notification= language.articles_count
|
|
7
11
|
%li.tabs__tabs-list__tab#tab-notes
|
|
8
|
-
%a{ href: '#tab-content-notes', onclick: 'selectTab(event, "notes")' }
|
|
12
|
+
%a{ href: '#tab-content-notes', onclick: 'selectTab(event, "notes")' }
|
|
13
|
+
= _('Notes')
|
|
14
|
+
%span.badge.badge--notification= language.notes_count
|
|
9
15
|
%li.tabs__tabs-list__tab#tab-projects
|
|
10
|
-
%a{ href: '#tab-content-projects', onclick: 'selectTab(event, "projects")' }
|
|
16
|
+
%a{ href: '#tab-content-projects', onclick: 'selectTab(event, "projects")' }
|
|
17
|
+
= _('Projects')
|
|
18
|
+
%span.badge.badge--notification= language.projects_count
|
|
11
19
|
%li.tabs__tabs-list__tab#tab-uploads
|
|
12
|
-
%a{ href: '#tab-content-uploads', onclick: 'selectTab(event, "uploads")' }
|
|
20
|
+
%a{ href: '#tab-content-uploads', onclick: 'selectTab(event, "uploads")' }
|
|
21
|
+
= _('Uploads')
|
|
22
|
+
%span.badge.badge--notification= language.uploads_count
|
|
13
23
|
|
|
14
24
|
%section.tabs__tab-content.albums-list#tab-content-albums
|
|
15
25
|
.tabs__tab-content__title
|
|
@@ -3,4 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
%footer.page__footer
|
|
5
5
|
.page__footer__content
|
|
6
|
-
© 2018 - Experiments Labs
|
|
6
|
+
© 2018 - Experiments Labs -
|
|
7
|
+
= icon_text('rss', _('RSS:'), ['fw'])
|
|
8
|
+
= link_to _('Activity'), activities_url(format: :rss, show_nsfw: show_nsfw?)
|
|
9
|
+
= link_to _('Albums'), albums_url(format: :rss, show_nsfw: show_nsfw?)
|
|
10
|
+
= link_to _('Articles'), articles_url(format: :rss, show_nsfw: show_nsfw?)
|
|
11
|
+
= link_to _('Notes'), notes_url(format: :rss, show_nsfw: show_nsfw?)
|
|
12
|
+
= link_to _('Projects'), projects_url(format: :rss, show_nsfw: show_nsfw?)
|
|
13
|
+
= link_to _('Uploads'), uploads_url(format: :rss, show_nsfw: show_nsfw?)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
- if entity.locked?
|
|
2
|
-
.locked
|
|
3
|
-
= _('This content needs review and have been retired for now.')
|
|
2
|
+
.locked.locked--large
|
|
3
|
+
= icon_text 'lock', _('This content needs review and have been retired for now.'), ['fw']
|
|
4
4
|
- else
|
|
5
|
-
.nsfw
|
|
6
|
-
= _('This content might not be appropriate for every situation.')
|
|
5
|
+
.nsfw.nsfw--large
|
|
6
|
+
= icon_text 'exclamation', _('This content might not be appropriate for every situation.'), ['fw']
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
- if entity.locked?
|
|
2
|
-
.locked
|
|
3
|
-
= _('This content needs review and have been retired for now.')
|
|
2
|
+
.locked.locked--full
|
|
3
|
+
= icon_text 'lock', _('This content needs review and have been retired for now.'), ['fw']
|
|
4
4
|
- else
|
|
5
|
-
.nsfw
|
|
6
|
-
= _('This content might not be appropriate for every situation.')
|
|
5
|
+
.nsfw.nsfw--full
|
|
6
|
+
= icon_text 'exclamation', _('This content might not be appropriate for every situation.'), ['fw']
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
%meta{ content: 'text/html; charset=UTF-8', 'http-equiv': 'Content-Type' }/
|
|
5
5
|
%title= page_title(@page_title, _('Admin'))
|
|
6
6
|
= csrf_meta_tags
|
|
7
|
-
= stylesheet_link_tag 'application',
|
|
8
|
-
= javascript_include_tag 'application'
|
|
7
|
+
= stylesheet_link_tag 'application', media: 'all'
|
|
8
|
+
= javascript_include_tag 'application'
|
|
9
9
|
%body.page.page--admin
|
|
10
10
|
%noscript
|
|
11
11
|
= _('Javascript seems to be disabled.')
|
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
%meta{ content: 'text/html; charset=UTF-8', 'http-equiv': 'Content-Type' }/
|
|
5
5
|
%title= page_title(@page_title)
|
|
6
6
|
= csrf_meta_tags
|
|
7
|
-
= stylesheet_link_tag 'application',
|
|
8
|
-
= javascript_include_tag 'application'
|
|
7
|
+
= stylesheet_link_tag 'application', media: 'all'
|
|
8
|
+
= javascript_include_tag 'application'
|
|
9
|
+
= auto_discovery_link_tag :rss, albums_url(format: :rss, show_nsfw: show_nsfw?)
|
|
10
|
+
= auto_discovery_link_tag :rss, articles_url(format: :rss, show_nsfw: show_nsfw?)
|
|
11
|
+
= auto_discovery_link_tag :rss, notes_url(format: :rss, show_nsfw: show_nsfw?)
|
|
12
|
+
= auto_discovery_link_tag :rss, projects_url(format: :rss, show_nsfw: show_nsfw?)
|
|
13
|
+
= auto_discovery_link_tag :rss, uploads_url(format: :rss, show_nsfw: show_nsfw?)
|
|
9
14
|
%body.page#top
|
|
10
15
|
%noscript
|
|
11
16
|
= _('Javascript seems to be disabled.')
|
|
@@ -25,7 +30,7 @@
|
|
|
25
30
|
= yield
|
|
26
31
|
|
|
27
32
|
.modal#report-modal
|
|
28
|
-
.modal__overlay
|
|
33
|
+
.modal__overlay{ onclick: 'closeModal("report-modal")' }
|
|
29
34
|
.modal__window
|
|
30
35
|
.modal__window__title
|
|
31
36
|
%h1= _('Report this page')
|
|
@@ -35,3 +40,6 @@
|
|
|
35
40
|
= render 'elabs/reports/form', new_report: @new_report
|
|
36
41
|
|
|
37
42
|
= render 'elabs/layouts/footer'
|
|
43
|
+
|
|
44
|
+
-# Widget templates
|
|
45
|
+
= render 'elabs/layouts/widgets/vue/all_widgets'
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
%meta{ content: 'text/html; charset=UTF-8', 'http-equiv': 'Content-Type' }/
|
|
5
5
|
%title= page_title(@page_title, _('Member'))
|
|
6
6
|
= csrf_meta_tags
|
|
7
|
-
= stylesheet_link_tag 'application',
|
|
8
|
-
= javascript_include_tag 'application'
|
|
7
|
+
= stylesheet_link_tag 'application', media: 'all'
|
|
8
|
+
= javascript_include_tag 'application'
|
|
9
9
|
%body.page.page--member
|
|
10
10
|
%noscript
|
|
11
11
|
= _('Javascript seems to be disabled.')
|
|
@@ -19,3 +19,6 @@
|
|
|
19
19
|
= yield
|
|
20
20
|
|
|
21
21
|
= render 'elabs/layouts/footer'
|
|
22
|
+
|
|
23
|
+
-# Widget templates
|
|
24
|
+
= render 'elabs/layouts/widgets/vue/all_widgets'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
- widget_id = random_string
|
|
2
|
+
- repo_url ||= nil
|
|
3
|
+
|
|
4
|
+
- if repo_url.nil?
|
|
5
|
+
= render 'elabs/layouts/shortcode_missing_content'
|
|
6
|
+
- else
|
|
7
|
+
%div{ id: "gh-repo-widget-#{widget_id}" }
|
|
8
|
+
|
|
9
|
+
:javascript
|
|
10
|
+
documentReady(function () {
|
|
11
|
+
githubRepoCard("#{repo_url}", "gh-repo-widget-#{widget_id}")
|
|
12
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
%span.github-inline
|
|
2
|
+
- if url_matches.length == 3
|
|
3
|
+
= icon 'github', ['fw'], 'fab'
|
|
4
|
+
= link_to url_matches[1], "https://github.com/#{url_matches[1]}"
|
|
5
|
+
\/
|
|
6
|
+
= link_to url_matches[2], "https://github.com/#{url_matches[1]}/#{url_matches[2]}"
|
|
7
|
+
- else
|
|
8
|
+
= _('Invalid Github repository')
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
- widget_id = random_string
|
|
2
|
+
- url_matches ||= nil
|
|
3
|
+
- if url_matches.nil? || url_matches.length < 3
|
|
4
|
+
= render 'elabs/layouts/shortcode_missing_content'
|
|
5
|
+
- else
|
|
6
|
+
%div{ id: "gl-group-widget-#{widget_id}" }
|
|
7
|
+
|
|
8
|
+
:javascript
|
|
9
|
+
documentReady(function () {
|
|
10
|
+
gitlabGroupCard({site: "#{url_matches[1]}", groupName: "#{url_matches[2]}"}, "gl-group-widget-#{widget_id}")
|
|
11
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
- widget_id = random_string
|
|
2
|
+
- url_matches ||= nil
|
|
3
|
+
|
|
4
|
+
- if url_matches.nil? || url_matches.length < 3
|
|
5
|
+
= render 'elabs/layouts/shortcode_missing_content'
|
|
6
|
+
- else
|
|
7
|
+
%div{ id: "gl-repo-widget-#{widget_id}" }
|
|
8
|
+
|
|
9
|
+
:javascript
|
|
10
|
+
documentReady(function () {
|
|
11
|
+
gitlabRepoCard({site: "#{url_matches[1]}", repo: "#{url_matches[2]}"}, "gl-repo-widget-#{widget_id}")
|
|
12
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
- widget_id = random_string
|
|
2
|
+
- url_matches ||= nil
|
|
3
|
+
- if url_matches.nil? || url_matches.length < 3
|
|
4
|
+
= render 'elabs/layouts/shortcode_missing_content'
|
|
5
|
+
- else
|
|
6
|
+
%div{ id: "gl-user-widget-#{widget_id}" }
|
|
7
|
+
|
|
8
|
+
:javascript
|
|
9
|
+
documentReady(function () {
|
|
10
|
+
gitlabUserCard({site: "#{url_matches[1]}", user: "#{url_matches[2]}"}, "gl-user-widget-#{widget_id}")
|
|
11
|
+
})
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
= render 'elabs/layouts/widgets/vue/github_repo_card_vue'
|
|
2
|
+
= render 'elabs/layouts/widgets/vue/github_user_card_vue'
|
|
3
|
+
= render 'elabs/layouts/widgets/vue/gitlab_repo_card_vue'
|
|
4
|
+
= render 'elabs/layouts/widgets/vue/gitlab_user_card_vue'
|
|
5
|
+
= render 'elabs/layouts/widgets/vue/gitlab_group_card_vue'
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
%script{ type: 'text/x-template', id: 'template-github-repo-card' }
|
|
2
|
+
.github-card{ ':disabled': 'failed' }
|
|
3
|
+
.content{ 'v-if': 'ready && !failed' }
|
|
4
|
+
%h2
|
|
5
|
+
= icon 'github', ['fw'], 'fab'
|
|
6
|
+
%small
|
|
7
|
+
%a{ ':href': '"https://github.com/" + repo.owner.login', target: '_blank' } {{repo.owner.login}}
|
|
8
|
+
\/
|
|
9
|
+
%a{ ':href': '"https://github.com/" + repo_name', target: '_blank' } {{repo.name}}
|
|
10
|
+
%ul.infos
|
|
11
|
+
%li
|
|
12
|
+
= icon_text 'code-branch', _('Fork:'), ['fw']
|
|
13
|
+
{{repo.fork ? '#{_('Yes')}' : '#{_('No')}'}}
|
|
14
|
+
%li{ 'v-if': 'repo.homepage' }
|
|
15
|
+
= icon 'home', ['fw']
|
|
16
|
+
%a{ ':href': 'repo.homepage', target: '_blank' }= _('Home page')
|
|
17
|
+
%li
|
|
18
|
+
= icon 'star'
|
|
19
|
+
{{repo.stargazers_count}}
|
|
20
|
+
%li
|
|
21
|
+
= icon 'license'
|
|
22
|
+
%template{ 'v-if': 'repo.license' } {{repo.license.name}}
|
|
23
|
+
%li
|
|
24
|
+
= icon_text 'code-branch', _('Forks:'), ['fw']
|
|
25
|
+
{{repo.forks}}
|
|
26
|
+
%li
|
|
27
|
+
= icon 'exclamation-circle'
|
|
28
|
+
{{repo.open_issues}}
|
|
29
|
+
%pre.description{ 'v-if': 'repo.description' } {{repo.description}}
|
|
30
|
+
.alert.alert--warning{ 'v-else-if': 'failed && !error' }
|
|
31
|
+
= icon_text 'bug', _('An error occured when fetching the repository data from Github.'), ['fw']
|
|
32
|
+
.alert.alert--warning{ 'v-else-if': 'failed && error' }
|
|
33
|
+
= icon_text 'bug', _("We can't display the repository infos. Github responded with the following error:"), ['fw']
|
|
34
|
+
%code {{error}}
|
|
35
|
+
.alert{ 'v-else': '' }
|
|
36
|
+
= icon_text 'spinner', _('Loading data from Github. Please wait.'), %w[fw pulse]
|
|
37
|
+
|
|
38
|
+
:javascript
|
|
39
|
+
function githubRepoCard (repo_name, target_element) {
|
|
40
|
+
return new Vue({
|
|
41
|
+
name: 'GithubRepoCardWidget',
|
|
42
|
+
template: '#template-github-repo-card',
|
|
43
|
+
el: document.getElementById(target_element),
|
|
44
|
+
data: function () {
|
|
45
|
+
return {
|
|
46
|
+
ready: false,
|
|
47
|
+
failed: false,
|
|
48
|
+
error: '',
|
|
49
|
+
repo_name: repo_name,
|
|
50
|
+
repo: {},
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
created () {
|
|
54
|
+
var that = this
|
|
55
|
+
fetch('https://api.github.com/repos/' + this.repo_name, {method: 'GET'})
|
|
56
|
+
.then(function (res) {
|
|
57
|
+
if(res.ok){
|
|
58
|
+
res.json().then(function (data) {
|
|
59
|
+
that.repo = data
|
|
60
|
+
that.ready = true
|
|
61
|
+
})
|
|
62
|
+
} else {
|
|
63
|
+
that.failed = true
|
|
64
|
+
that.error = res.statusText
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
.catch(function (err) {
|
|
68
|
+
that.failed = true
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
%script{ type: 'text/x-template', id: 'template-github-user-card' }
|
|
2
|
+
.github-card{ 'v-if': 'ready && !failed' }
|
|
3
|
+
.icon.icon--avatar
|
|
4
|
+
= icon 'github', %w[fw avatar-badge], 'fab'
|
|
5
|
+
%img.avatar{ ':src': 'user.avatar_url' }
|
|
6
|
+
.content
|
|
7
|
+
%h2
|
|
8
|
+
%a{ ':href': 'user.url', target: '_blank' } {{user.name}}
|
|
9
|
+
%small ({{user.login}})
|
|
10
|
+
%ul.infos
|
|
11
|
+
%li{ 'v-if': 'user.blog' }
|
|
12
|
+
= icon 'home', ['fw']
|
|
13
|
+
%a{ ':href': 'user.blog', target: '_blank' }= _('Home page')
|
|
14
|
+
%li
|
|
15
|
+
= icon_text 'book', _('Public repos:'), ['fw']
|
|
16
|
+
{{user.public_repos}}
|
|
17
|
+
%li
|
|
18
|
+
= icon_text 'pencil-alt', _('Public gists:'), ['fw']
|
|
19
|
+
{{user.public_gists}}
|
|
20
|
+
.github-card{ 'v-else-if': 'failed', ':disabled': 'failed' }
|
|
21
|
+
.alert.alert--warning
|
|
22
|
+
= icon_text 'bug', _("We can't display the user infos. Github responded with the following error:"), ['fw']
|
|
23
|
+
%code {{error}}
|
|
24
|
+
.github-card{ 'v-else': '' }
|
|
25
|
+
.icon.icon--avatar
|
|
26
|
+
= icon 'github', %w[fw avatar-badge], 'fab'
|
|
27
|
+
= icon 'user', %w[3x fw avatar]
|
|
28
|
+
.alert
|
|
29
|
+
= icon_text 'spinner', _('Loading data from Github. Please wait.'), %w[fw pulse]
|
|
30
|
+
|
|
31
|
+
:javascript
|
|
32
|
+
function githubUserCard (userName, targetElement) {
|
|
33
|
+
return new Vue({
|
|
34
|
+
name: 'GithubUserCardWidget',
|
|
35
|
+
template: '#template-github-user-card',
|
|
36
|
+
el: document.getElementById(targetElement),
|
|
37
|
+
data: function () {
|
|
38
|
+
return {
|
|
39
|
+
ready: false,
|
|
40
|
+
failed: false,
|
|
41
|
+
userName: userName,
|
|
42
|
+
user: {},
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
created () {
|
|
46
|
+
var that = this
|
|
47
|
+
fetch('https://api.github.com/users/' + this.userName, {method: 'GET'})
|
|
48
|
+
.then(function (res) {
|
|
49
|
+
if(res.ok){
|
|
50
|
+
res.json().then(function (data) {
|
|
51
|
+
that.user = data
|
|
52
|
+
that.ready = true
|
|
53
|
+
})
|
|
54
|
+
} else {
|
|
55
|
+
that.failed = true
|
|
56
|
+
that.error = res.statusText
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
.catch(function (err) {
|
|
60
|
+
that.failed = true
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
%script{ type: 'text/x-template', id: 'template-gitlab-group-card' }
|
|
2
|
+
.gitlab-card{ 'v-if': 'ready && !failed' }
|
|
3
|
+
.icon.icon--avatar
|
|
4
|
+
= icon 'gitlab', %w[fw avatar-badge], 'fab'
|
|
5
|
+
%img.avatar{ ':src': 'group.avatar_url' }
|
|
6
|
+
.content
|
|
7
|
+
%h2
|
|
8
|
+
%a{ ':href': 'group.web_url', target: '_blank' } {{group.name}}
|
|
9
|
+
%small (#{format _('group on %<link>s'), link: '{{url.site}}'})
|
|
10
|
+
%ul.infos
|
|
11
|
+
%li{ 'v-if': 'group.website_url' }
|
|
12
|
+
= icon 'home', ['fw']
|
|
13
|
+
%a{ ':href': 'group.website_url', target: '_blank' }= _('Home page')
|
|
14
|
+
%li
|
|
15
|
+
= icon_text 'book', _('Public repos:'), ['fw']
|
|
16
|
+
{{group.projects.length}}
|
|
17
|
+
%li
|
|
18
|
+
= icon_text 'book', _('Shared repos:'), ['fw']
|
|
19
|
+
{{group.shared_projects.length}}
|
|
20
|
+
%pre.description{ 'v-if': 'group.description' } {{group.description}}
|
|
21
|
+
.gitlab-card{ 'v-else-if': 'failed', ':disabled': 'failed' }
|
|
22
|
+
.alert.alert--warning
|
|
23
|
+
= icon_text 'bug', _('An error occured when fetching a Gitlab group.'), ['fw']
|
|
24
|
+
.gitlab-card{ 'v-else': '' }
|
|
25
|
+
.icon.icon--avatar
|
|
26
|
+
= icon 'gitlab', %w[fw avatar-badge], 'fab'
|
|
27
|
+
= icon 'group', %w[fw avatar]
|
|
28
|
+
.alert
|
|
29
|
+
= icon_text 'spinner', _('Loading data from a Gitlab instance. Please wait.'), %w[fw pulse]
|
|
30
|
+
|
|
31
|
+
:javascript
|
|
32
|
+
function gitlabGroupCard (url, targetElement) {
|
|
33
|
+
return new Vue({
|
|
34
|
+
name: 'GitlabGroupCardWidget',
|
|
35
|
+
template: '#template-gitlab-group-card',
|
|
36
|
+
el: document.getElementById(targetElement),
|
|
37
|
+
data: function () {
|
|
38
|
+
return {
|
|
39
|
+
ready: false,
|
|
40
|
+
reposReady: true,
|
|
41
|
+
failed: false,
|
|
42
|
+
url: url,
|
|
43
|
+
group: {},
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
created () {
|
|
47
|
+
var that = this
|
|
48
|
+
fetch('https://' + this.url.site + '/api/v4/groups/' + encodeURIComponent(url.groupName), {method: 'GET'})
|
|
49
|
+
.then(function (res) {
|
|
50
|
+
if(res.ok){
|
|
51
|
+
res.json().then(function (data) {
|
|
52
|
+
that.group = data
|
|
53
|
+
that.ready = true
|
|
54
|
+
})
|
|
55
|
+
} else {
|
|
56
|
+
that.failed = true
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
.catch(function (res) {
|
|
60
|
+
that.failed = true
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}
|