collavre 0.1.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 +7 -0
- data/README.md +221 -0
- data/Rakefile +8 -0
- data/app/assets/stylesheets/collavre/actiontext.css +577 -0
- data/app/assets/stylesheets/collavre/activity_logs.css +99 -0
- data/app/assets/stylesheets/collavre/comments_popup.css +692 -0
- data/app/assets/stylesheets/collavre/creatives.css +559 -0
- data/app/assets/stylesheets/collavre/dark_mode.css +118 -0
- data/app/assets/stylesheets/collavre/mention_menu.css +43 -0
- data/app/assets/stylesheets/collavre/popup.css +160 -0
- data/app/assets/stylesheets/collavre/print.css +37 -0
- data/app/assets/stylesheets/collavre/slide_view.css +79 -0
- data/app/assets/stylesheets/collavre/user_menu.css +34 -0
- data/app/channels/collavre/comments_presence_channel.rb +54 -0
- data/app/channels/collavre/slide_view_channel.rb +11 -0
- data/app/channels/collavre/topics_channel.rb +12 -0
- data/app/components/collavre/avatar_component.html.erb +15 -0
- data/app/components/collavre/avatar_component.rb +59 -0
- data/app/components/collavre/inbox/badge_component.html.erb +6 -0
- data/app/components/collavre/inbox/badge_component.rb +18 -0
- data/app/components/collavre/plans_timeline_component.html.erb +14 -0
- data/app/components/collavre/plans_timeline_component.rb +56 -0
- data/app/components/collavre/popup_menu_component.html.erb +6 -0
- data/app/components/collavre/popup_menu_component.rb +30 -0
- data/app/components/collavre/progress_filter_component.html.erb +5 -0
- data/app/components/collavre/progress_filter_component.rb +10 -0
- data/app/components/collavre/user_mention_menu_component.html.erb +3 -0
- data/app/components/collavre/user_mention_menu_component.rb +8 -0
- data/app/controllers/collavre/application_controller.rb +15 -0
- data/app/controllers/collavre/attachments_controller.rb +44 -0
- data/app/controllers/collavre/calendar_events_controller.rb +15 -0
- data/app/controllers/collavre/comment_read_pointers_controller.rb +80 -0
- data/app/controllers/collavre/comments/activity_logs_controller.rb +26 -0
- data/app/controllers/collavre/comments/reactions_controller.rb +82 -0
- data/app/controllers/collavre/comments_controller.rb +464 -0
- data/app/controllers/collavre/contacts_controller.rb +10 -0
- data/app/controllers/collavre/creative_expanded_states_controller.rb +27 -0
- data/app/controllers/collavre/creative_imports_controller.rb +24 -0
- data/app/controllers/collavre/creative_plans_controller.rb +69 -0
- data/app/controllers/collavre/creative_shares_controller.rb +79 -0
- data/app/controllers/collavre/creatives_controller.rb +535 -0
- data/app/controllers/collavre/devices_controller.rb +19 -0
- data/app/controllers/collavre/email_verifications_controller.rb +16 -0
- data/app/controllers/collavre/emails_controller.rb +11 -0
- data/app/controllers/collavre/github_auth_controller.rb +25 -0
- data/app/controllers/collavre/google_auth_controller.rb +43 -0
- data/app/controllers/collavre/inbox_items_controller.rb +64 -0
- data/app/controllers/collavre/invites_controller.rb +27 -0
- data/app/controllers/collavre/notion_auth_controller.rb +25 -0
- data/app/controllers/collavre/passwords_controller.rb +37 -0
- data/app/controllers/collavre/plans_controller.rb +110 -0
- data/app/controllers/collavre/sessions_controller.rb +57 -0
- data/app/controllers/collavre/topics_controller.rb +58 -0
- data/app/controllers/collavre/user_themes_controller.rb +58 -0
- data/app/controllers/collavre/users_controller.rb +390 -0
- data/app/helpers/collavre/application_helper.rb +4 -0
- data/app/helpers/collavre/comments_helper.rb +9 -0
- data/app/helpers/collavre/creatives_helper.rb +343 -0
- data/app/helpers/collavre/navigation_helper.rb +163 -0
- data/app/helpers/collavre/user_themes_helper.rb +4 -0
- data/app/javascript/collavre.js +26 -0
- data/app/javascript/components/InlineLexicalEditor.jsx +889 -0
- data/app/javascript/components/LinkPopup.jsx +112 -0
- data/app/javascript/components/creative_tree_row.js +503 -0
- data/app/javascript/components/plugins/attachment_cleanup_plugin.jsx +95 -0
- data/app/javascript/components/plugins/image_upload_plugin.jsx +162 -0
- data/app/javascript/controllers/click_target_controller.js +13 -0
- data/app/javascript/controllers/comment_controller.js +162 -0
- data/app/javascript/controllers/comments/__tests__/popup_controller.test.js +68 -0
- data/app/javascript/controllers/comments/form_controller.js +530 -0
- data/app/javascript/controllers/comments/list_controller.js +715 -0
- data/app/javascript/controllers/comments/mention_menu_controller.js +41 -0
- data/app/javascript/controllers/comments/popup_controller.js +385 -0
- data/app/javascript/controllers/comments/presence_controller.js +311 -0
- data/app/javascript/controllers/comments/topics_controller.js +338 -0
- data/app/javascript/controllers/common_popup_controller.js +55 -0
- data/app/javascript/controllers/creatives/drag_drop_controller.js +45 -0
- data/app/javascript/controllers/creatives/expansion_controller.js +222 -0
- data/app/javascript/controllers/creatives/import_controller.js +116 -0
- data/app/javascript/controllers/creatives/row_editor_controller.js +8 -0
- data/app/javascript/controllers/creatives/select_mode_controller.js +231 -0
- data/app/javascript/controllers/creatives/set_plan_modal_controller.js +107 -0
- data/app/javascript/controllers/creatives/tree_controller.js +218 -0
- data/app/javascript/controllers/index.js +79 -0
- data/app/javascript/controllers/link_creative_controller.js +91 -0
- data/app/javascript/controllers/popup_menu_controller.js +82 -0
- data/app/javascript/controllers/progress_filter_controller.js +35 -0
- data/app/javascript/controllers/reaction_picker_controller.js +107 -0
- data/app/javascript/controllers/share_invite_controller.js +15 -0
- data/app/javascript/controllers/share_user_search_controller.js +121 -0
- data/app/javascript/controllers/tabs_controller.js +43 -0
- data/app/javascript/creatives/drag_drop/dom.js +170 -0
- data/app/javascript/creatives/drag_drop/event_handlers.js +846 -0
- data/app/javascript/creatives/drag_drop/indicator.js +35 -0
- data/app/javascript/creatives/drag_drop/operations.js +116 -0
- data/app/javascript/creatives/drag_drop/state.js +31 -0
- data/app/javascript/creatives/tree_renderer.js +248 -0
- data/app/javascript/lib/api/__tests__/queue_manager.test.js +153 -0
- data/app/javascript/lib/api/creatives.js +79 -0
- data/app/javascript/lib/api/csrf_fetch.js +22 -0
- data/app/javascript/lib/api/drag_drop.js +31 -0
- data/app/javascript/lib/api/queue_manager.js +423 -0
- data/app/javascript/lib/apply_lexical_styles.js +15 -0
- data/app/javascript/lib/common_popup.js +195 -0
- data/app/javascript/lib/lexical/__tests__/action_text_attachment_node.test.jsx +91 -0
- data/app/javascript/lib/lexical/__tests__/attachment_payload.test.js +194 -0
- data/app/javascript/lib/lexical/action_text_attachment_node.js +459 -0
- data/app/javascript/lib/lexical/attachment_node.jsx +170 -0
- data/app/javascript/lib/lexical/attachment_payload.js +293 -0
- data/app/javascript/lib/lexical/dom_attachment_utils.js +66 -0
- data/app/javascript/lib/lexical/image_node.jsx +159 -0
- data/app/javascript/lib/lexical/style_attributes.js +40 -0
- data/app/javascript/lib/responsive_images.js +54 -0
- data/app/javascript/lib/turbo_stream_actions.js +33 -0
- data/app/javascript/lib/utils/markdown.js +23 -0
- data/app/javascript/modules/creative_guide.js +53 -0
- data/app/javascript/modules/creative_row_editor.js +1841 -0
- data/app/javascript/modules/creative_row_swipe.js +43 -0
- data/app/javascript/modules/creatives.js +15 -0
- data/app/javascript/modules/export_to_markdown.js +34 -0
- data/app/javascript/modules/inbox_panel.js +226 -0
- data/app/javascript/modules/lexical_inline_editor.jsx +133 -0
- data/app/javascript/modules/mention_menu.js +77 -0
- data/app/javascript/modules/plans_menu.js +39 -0
- data/app/javascript/modules/plans_timeline.js +397 -0
- data/app/javascript/modules/share_modal.js +73 -0
- data/app/javascript/modules/share_user_popup.js +77 -0
- data/app/javascript/modules/slide_view.js +163 -0
- data/app/javascript/services/cable.js +32 -0
- data/app/javascript/slide_view.js +2 -0
- data/app/javascript/utils/caret_position.js +42 -0
- data/app/javascript/utils/clipboard.js +40 -0
- data/app/jobs/collavre/ai_agent_job.rb +27 -0
- data/app/jobs/collavre/inbox_summary_job.rb +24 -0
- data/app/jobs/collavre/notion_export_job.rb +30 -0
- data/app/jobs/collavre/notion_sync_job.rb +48 -0
- data/app/jobs/collavre/permission_cache_cleanup_job.rb +36 -0
- data/app/jobs/collavre/permission_cache_job.rb +71 -0
- data/app/jobs/collavre/push_notification_job.rb +86 -0
- data/app/mailers/collavre/application_mailer.rb +17 -0
- data/app/mailers/collavre/creative_mailer.rb +9 -0
- data/app/mailers/collavre/email_verification_mailer.rb +20 -0
- data/app/mailers/collavre/inbox_mailer.rb +19 -0
- data/app/mailers/collavre/invitation_mailer.rb +16 -0
- data/app/mailers/collavre/passwords_mailer.rb +10 -0
- data/app/models/collavre/activity_log.rb +13 -0
- data/app/models/collavre/application_record.rb +5 -0
- data/app/models/collavre/calendar_event.rb +20 -0
- data/app/models/collavre/comment.rb +307 -0
- data/app/models/collavre/comment_presence_store.rb +30 -0
- data/app/models/collavre/comment_reaction.rb +11 -0
- data/app/models/collavre/comment_read_pointer.rb +26 -0
- data/app/models/collavre/contact.rb +23 -0
- data/app/models/collavre/creative.rb +413 -0
- data/app/models/collavre/creative_expanded_state.rb +11 -0
- data/app/models/collavre/creative_share.rb +122 -0
- data/app/models/collavre/creative_shares_cache.rb +18 -0
- data/app/models/collavre/current.rb +14 -0
- data/app/models/collavre/device.rb +13 -0
- data/app/models/collavre/email.rb +14 -0
- data/app/models/collavre/github_account.rb +10 -0
- data/app/models/collavre/github_repository_link.rb +19 -0
- data/app/models/collavre/inbox_item.rb +95 -0
- data/app/models/collavre/invitation.rb +22 -0
- data/app/models/collavre/label.rb +47 -0
- data/app/models/collavre/mcp_tool.rb +30 -0
- data/app/models/collavre/notion_account.rb +17 -0
- data/app/models/collavre/notion_block_link.rb +10 -0
- data/app/models/collavre/notion_page_link.rb +19 -0
- data/app/models/collavre/plan.rb +20 -0
- data/app/models/collavre/session.rb +24 -0
- data/app/models/collavre/system_setting.rb +144 -0
- data/app/models/collavre/tag.rb +10 -0
- data/app/models/collavre/task.rb +10 -0
- data/app/models/collavre/task_action.rb +10 -0
- data/app/models/collavre/topic.rb +12 -0
- data/app/models/collavre/user.rb +174 -0
- data/app/models/collavre/user_theme.rb +10 -0
- data/app/models/collavre/variation.rb +5 -0
- data/app/models/collavre/webauthn_credential.rb +11 -0
- data/app/services/collavre/ai_agent_service.rb +193 -0
- data/app/services/collavre/ai_client.rb +183 -0
- data/app/services/collavre/ai_system_prompt_renderer.rb +38 -0
- data/app/services/collavre/auto_theme_generator.rb +198 -0
- data/app/services/collavre/comment_link_formatter.rb +60 -0
- data/app/services/collavre/comments/action_executor.rb +262 -0
- data/app/services/collavre/comments/action_validator.rb +58 -0
- data/app/services/collavre/comments/calendar_command.rb +97 -0
- data/app/services/collavre/comments/command_processor.rb +37 -0
- data/app/services/collavre/comments/mcp_command.rb +109 -0
- data/app/services/collavre/comments/mcp_command_builder.rb +32 -0
- data/app/services/collavre/creatives/filter_pipeline.rb +196 -0
- data/app/services/collavre/creatives/filters/assignee_filter.rb +30 -0
- data/app/services/collavre/creatives/filters/base_filter.rb +24 -0
- data/app/services/collavre/creatives/filters/comment_filter.rb +21 -0
- data/app/services/collavre/creatives/filters/date_filter.rb +58 -0
- data/app/services/collavre/creatives/filters/progress_filter.rb +25 -0
- data/app/services/collavre/creatives/filters/search_filter.rb +28 -0
- data/app/services/collavre/creatives/filters/tag_filter.rb +16 -0
- data/app/services/collavre/creatives/importer.rb +47 -0
- data/app/services/collavre/creatives/index_query.rb +191 -0
- data/app/services/collavre/creatives/path_exporter.rb +131 -0
- data/app/services/collavre/creatives/permission_cache_builder.rb +194 -0
- data/app/services/collavre/creatives/permission_checker.rb +42 -0
- data/app/services/collavre/creatives/plan_tagger.rb +53 -0
- data/app/services/collavre/creatives/progress_service.rb +89 -0
- data/app/services/collavre/creatives/reorderer.rb +187 -0
- data/app/services/collavre/creatives/tree_builder.rb +231 -0
- data/app/services/collavre/creatives/tree_formatter.rb +36 -0
- data/app/services/collavre/gemini_parent_recommender.rb +77 -0
- data/app/services/collavre/github/client.rb +112 -0
- data/app/services/collavre/github/pull_request_analyzer.rb +280 -0
- data/app/services/collavre/github/pull_request_processor.rb +181 -0
- data/app/services/collavre/github/webhook_provisioner.rb +130 -0
- data/app/services/collavre/google_calendar_service.rb +149 -0
- data/app/services/collavre/link_preview_fetcher.rb +230 -0
- data/app/services/collavre/markdown_importer.rb +202 -0
- data/app/services/collavre/mcp_service.rb +217 -0
- data/app/services/collavre/notion_client.rb +231 -0
- data/app/services/collavre/notion_creative_exporter.rb +296 -0
- data/app/services/collavre/notion_service.rb +249 -0
- data/app/services/collavre/ppt_importer.rb +76 -0
- data/app/services/collavre/ruby_llm_interaction_logger.rb +34 -0
- data/app/services/collavre/system_events/context_builder.rb +41 -0
- data/app/services/collavre/system_events/dispatcher.rb +19 -0
- data/app/services/collavre/system_events/router.rb +72 -0
- data/app/services/collavre/tools/creative_retrieval_service.rb +138 -0
- data/app/views/admin/shared/_tabs.html.erb +4 -0
- data/app/views/collavre/comments/_activity_log_details.html.erb +23 -0
- data/app/views/collavre/comments/_comment.html.erb +147 -0
- data/app/views/collavre/comments/_comments_popup.html.erb +46 -0
- data/app/views/collavre/comments/_list.html.erb +10 -0
- data/app/views/collavre/comments/_presence_avatars.html.erb +8 -0
- data/app/views/collavre/comments/_reaction_picker.html.erb +15 -0
- data/app/views/collavre/comments/_read_receipts.html.erb +19 -0
- data/app/views/collavre/creatives/_add_button.html.erb +20 -0
- data/app/views/collavre/creatives/_delete_button.html.erb +12 -0
- data/app/views/collavre/creatives/_github_integration_modal.html.erb +77 -0
- data/app/views/collavre/creatives/_import_upload_zone.html.erb +10 -0
- data/app/views/collavre/creatives/_inline_edit_form.html.erb +89 -0
- data/app/views/collavre/creatives/_mobile_actions_menu.html.erb +24 -0
- data/app/views/collavre/creatives/_notion_integration_modal.html.erb +90 -0
- data/app/views/collavre/creatives/_set_plan_modal.html.erb +25 -0
- data/app/views/collavre/creatives/_share_button.html.erb +55 -0
- data/app/views/collavre/creatives/edit.html.erb +4 -0
- data/app/views/collavre/creatives/index.html.erb +192 -0
- data/app/views/collavre/creatives/new.html.erb +4 -0
- data/app/views/collavre/creatives/show.html.erb +29 -0
- data/app/views/collavre/creatives/slide_view.html.erb +20 -0
- data/app/views/collavre/email_verification_mailer/verify.html.erb +4 -0
- data/app/views/collavre/email_verification_mailer/verify.text.erb +2 -0
- data/app/views/collavre/emails/index.html.erb +19 -0
- data/app/views/collavre/emails/show.html.erb +5 -0
- data/app/views/collavre/inbox_items/_item.html.erb +18 -0
- data/app/views/collavre/inbox_items/_items.html.erb +3 -0
- data/app/views/collavre/inbox_items/_list.html.erb +7 -0
- data/app/views/collavre/inbox_items/index.html.erb +1 -0
- data/app/views/collavre/inbox_mailer/daily_summary.html.erb +11 -0
- data/app/views/collavre/inbox_mailer/daily_summary.text.erb +8 -0
- data/app/views/collavre/invitation_mailer/invite.html.erb +5 -0
- data/app/views/collavre/invitation_mailer/invite.text.erb +3 -0
- data/app/views/collavre/invites/show.html.erb +8 -0
- data/app/views/collavre/passwords/edit.html.erb +12 -0
- data/app/views/collavre/passwords/new.html.erb +17 -0
- data/app/views/collavre/passwords_mailer/reset.html.erb +4 -0
- data/app/views/collavre/passwords_mailer/reset.text.erb +2 -0
- data/app/views/collavre/sessions/new.html.erb +27 -0
- data/app/views/collavre/sessions/providers/_google.html.erb +7 -0
- data/app/views/collavre/sessions/providers/_passkey.html.erb +3 -0
- data/app/views/collavre/shared/_link_creative_modal.html.erb +6 -0
- data/app/views/collavre/shared/_navigation.html.erb +37 -0
- data/app/views/collavre/shared/navigation/_help_button.html.erb +1 -0
- data/app/views/collavre/shared/navigation/_inbox_button.html.erb +5 -0
- data/app/views/collavre/shared/navigation/_mobile_inbox_button.html.erb +3 -0
- data/app/views/collavre/shared/navigation/_mobile_plans_button.html.erb +1 -0
- data/app/views/collavre/shared/navigation/_panels.html.erb +18 -0
- data/app/views/collavre/shared/navigation/_plans_button.html.erb +3 -0
- data/app/views/collavre/shared/navigation/_search_form.html.erb +6 -0
- data/app/views/collavre/user_themes/index.html.erb +75 -0
- data/app/views/collavre/users/_app_header.html.erb +5 -0
- data/app/views/collavre/users/_contact_management.html.erb +77 -0
- data/app/views/collavre/users/_id_pwd_fields.html.erb +27 -0
- data/app/views/collavre/users/edit_ai.html.erb +79 -0
- data/app/views/collavre/users/edit_password.html.erb +27 -0
- data/app/views/collavre/users/index.html.erb +80 -0
- data/app/views/collavre/users/new.html.erb +33 -0
- data/app/views/collavre/users/new_ai.html.erb +87 -0
- data/app/views/collavre/users/passkeys.html.erb +43 -0
- data/app/views/collavre/users/show.html.erb +143 -0
- data/app/views/inbox/badge_component/_count.html.erb +2 -0
- data/app/views/layouts/collavre/slide.html.erb +29 -0
- data/config/locales/comments.en.yml +114 -0
- data/config/locales/comments.ko.yml +110 -0
- data/config/locales/contacts.en.yml +16 -0
- data/config/locales/contacts.ko.yml +16 -0
- data/config/locales/creatives.en.yml +183 -0
- data/config/locales/creatives.ko.yml +164 -0
- data/config/locales/invites.en.yml +19 -0
- data/config/locales/invites.ko.yml +17 -0
- data/config/locales/notifications.en.yml +8 -0
- data/config/locales/notifications.ko.yml +8 -0
- data/config/locales/plans.en.yml +12 -0
- data/config/locales/plans.ko.yml +19 -0
- data/config/locales/themes.en.yml +29 -0
- data/config/locales/themes.ko.yml +27 -0
- data/config/locales/users.en.yml +151 -0
- data/config/locales/users.ko.yml +146 -0
- data/config/routes.rb +92 -0
- data/db/migrate/20241201000000_create_notion_integrations.rb +29 -0
- data/db/migrate/20250128110017_create_creatives.rb +11 -0
- data/db/migrate/20250128120122_create_users.rb +11 -0
- data/db/migrate/20250128120123_create_sessions.rb +11 -0
- data/db/migrate/20250128123633_create_subscribers.rb +10 -0
- data/db/migrate/20250312000000_create_notion_block_links.rb +16 -0
- data/db/migrate/20250312010000_allow_multiple_notion_blocks_per_creative.rb +5 -0
- data/db/migrate/20250522115048_remove_name_from_creatives.rb +5 -0
- data/db/migrate/20250522190651_add_parent_id_to_creatives.rb +5 -0
- data/db/migrate/20250523133100_rename_inventory_count_to_progress.rb +13 -0
- data/db/migrate/20250523133101_add_sequence_to_creatives.rb +5 -0
- data/db/migrate/20250525205100_add_user_id_to_creatives.rb +10 -0
- data/db/migrate/20250527014217_create_creative_shares.rb +12 -0
- data/db/migrate/20250528142349_add_origin_id_to_creatives.rb +5 -0
- data/db/migrate/20250530060200_create_tags.rb +9 -0
- data/db/migrate/20250531105150_add_value_to_tags.rb +5 -0
- data/db/migrate/20250531140142_create_labels.rb +12 -0
- data/db/migrate/20250531140145_change_tag_to_label_reference.rb +6 -0
- data/db/migrate/20250601000000_create_comments.rb +10 -0
- data/db/migrate/20250601061830_drop_plans_and_variations.rb +6 -0
- data/db/migrate/20250604122600_add_owner_to_labels.rb +5 -0
- data/db/migrate/20250606000000_rename_email_address_to_email_in_users.rb +7 -0
- data/db/migrate/20250606150329_create_creative_hierarchies.rb +16 -0
- data/db/migrate/20250610142000_create_creative_expanded_states.rb +11 -0
- data/db/migrate/20250611030138_create_invitations.rb +15 -0
- data/db/migrate/20250611105524_create_inbox_items.rb +14 -0
- data/db/migrate/20250612150000_update_permissions.rb +43 -0
- data/db/migrate/20250612232913_add_email_verified_at_to_users.rb +5 -0
- data/db/migrate/20250616065905_add_avatar_to_users.rb +5 -0
- data/db/migrate/20250617092111_add_display_level_to_users.rb +5 -0
- data/db/migrate/20250620004558_create_emails.rb +13 -0
- data/db/migrate/20250621000000_create_comment_read_pointers.rb +11 -0
- data/db/migrate/20250622000000_add_completion_mark_to_users.rb +5 -0
- data/db/migrate/20250623000000_add_theme_to_users.rb +5 -0
- data/db/migrate/20250624000000_add_name_to_users.rb +18 -0
- data/db/migrate/20250714190000_create_devices.rb +17 -0
- data/db/migrate/20250715120000_add_notifications_enabled_to_users.rb +5 -0
- data/db/migrate/20250823000000_add_no_access_permission.rb +25 -0
- data/db/migrate/20250826000000_add_calendar_id_to_users.rb +5 -0
- data/db/migrate/20250827000000_add_google_oauth_tokens_to_users.rb +8 -0
- data/db/migrate/20250827061238_add_timezone_to_users.rb +5 -0
- data/db/migrate/20250828000000_create_calendar_events.rb +16 -0
- data/db/migrate/20250828060000_add_creative_to_calendar_events.rb +5 -0
- data/db/migrate/20250830141052_add_locale_to_users.rb +5 -0
- data/db/migrate/20250830141101_add_message_key_to_inbox_items.rb +6 -0
- data/db/migrate/20250902025423_remove_description_and_featured_image_from_creatives.rb +6 -0
- data/db/migrate/20250910000000_add_private_to_comments.rb +5 -0
- data/db/migrate/20250910105640_migrate_write_permissions_to_admin.rb +17 -0
- data/db/migrate/20250911084338_backfill_creative_in_comment_inbox_items.rb +27 -0
- data/db/migrate/20250923002959_deduplicate_device_fcm_tokens.rb +25 -0
- data/db/migrate/20250924000000_add_system_admin_to_users.rb +6 -0
- data/db/migrate/20250925000000_create_github_integrations.rb +26 -0
- data/db/migrate/20250927000000_add_webhook_secret_to_github_repository_links.rb +29 -0
- data/db/migrate/20250928000000_add_action_and_approver_to_comments.rb +6 -0
- data/db/migrate/20250928010000_add_action_execution_tracking_to_comments.rb +6 -0
- data/db/migrate/20250928105957_add_github_gemini_prompt_to_creatives.rb +5 -0
- data/db/migrate/20250929000000_add_comment_and_creative_refs_to_inbox_items.rb +6 -0
- data/db/migrate/20251001000001_create_contacts.rb +71 -0
- data/db/migrate/20251002000000_add_shared_by_to_creative_shares.rb +14 -0
- data/db/migrate/20251124120902_add_ai_fields_to_users.rb +7 -0
- data/db/migrate/20251124122218_add_created_by_id_to_users.rb +5 -0
- data/db/migrate/20251124124521_add_llm_api_key_to_users.rb +5 -0
- data/db/migrate/20251124130000_add_searchable_to_users.rb +6 -0
- data/db/migrate/20251125072705_migrate_linked_creative_children_to_origin.rb +28 -0
- data/db/migrate/20251126040752_add_description_to_creatives.rb +75 -0
- data/db/migrate/20251127000000_move_comments_from_linked_creatives_to_origins.rb +18 -0
- data/db/migrate/20251201073823_add_tools_to_users.rb +5 -0
- data/db/migrate/20251202062715_create_mcp_tools.rb +16 -0
- data/db/migrate/20251204125754_create_tasks_and_task_actions.rb +23 -0
- data/db/migrate/20251204125756_add_routing_expression_to_users.rb +5 -0
- data/db/migrate/20251204161133_set_default_routing_expression_for_ai_agents.rb +13 -0
- data/db/migrate/20251211033025_nullify_self_referencing_origins.rb +9 -0
- data/db/migrate/20251211080040_create_topics_and_add_topic_to_comments.rb +15 -0
- data/db/migrate/20251215143500_create_activity_logs.rb +16 -0
- data/db/migrate/20251222125727_create_webauthn_credentials.rb +14 -0
- data/db/migrate/20251222125839_add_webauthn_id_to_users.rb +5 -0
- data/db/migrate/20251223022315_create_comment_reactions.rb +13 -0
- data/db/migrate/20251223072625_create_user_themes.rb +11 -0
- data/db/migrate/20251230074456_add_creative_id_to_labels.rb +5 -0
- data/db/migrate/20251230113607_refactor_labels.rb +38 -0
- data/db/migrate/20251231010012_backfill_tags_for_labels.rb +15 -0
- data/db/migrate/20251231013234_drop_subscribers.rb +9 -0
- data/db/migrate/20260106090544_allow_null_user_id_in_creative_shares.rb +6 -0
- data/db/migrate/20260106160643_create_system_settings.rb +11 -0
- data/db/migrate/20260116000000_create_creative_shares_cache.rb +15 -0
- data/db/migrate/20260116000001_populate_creative_shares_cache.rb +23 -0
- data/db/migrate/20260119022933_make_source_share_id_nullable_in_creative_shares_caches.rb +7 -0
- data/db/migrate/20260119023446_populate_owner_cache_entries.rb +25 -0
- data/db/migrate/20260119100000_add_account_lockout_to_users.rb +6 -0
- data/db/migrate/20260119110000_add_last_active_at_to_sessions.rb +6 -0
- data/db/migrate/20260120045354_encrypt_oauth_tokens.rb +60 -0
- data/db/migrate/20260120162259_remove_fk_from_creative_shares_caches.rb +7 -0
- data/db/migrate/20260120163856_remove_timestamps_from_creative_shares_caches.rb +6 -0
- data/lib/collavre/configuration.rb +14 -0
- data/lib/collavre/engine.rb +77 -0
- data/lib/collavre/user_extensions.rb +29 -0
- data/lib/collavre/version.rb +3 -0
- data/lib/collavre.rb +26 -0
- data/lib/generators/collavre/install/install_generator.rb +105 -0
- data/lib/generators/collavre/install/templates/build.cjs.tt +100 -0
- data/lib/tasks/collavre_assets.rake +15 -0
- metadata +591 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div id="import-markdown-area" data-creatives--import-target="area" style="display:none; margin: 1em 0;">
|
|
2
|
+
<div id="import-markdown-dropzone"
|
|
3
|
+
style="border:2px dashed var(--color-border);padding:2em;text-align:center;cursor:pointer;"
|
|
4
|
+
data-creatives--import-target="dropzone"
|
|
5
|
+
data-action="dragover->creatives--import#dragOver dragleave->creatives--import#dragLeave drop->creatives--import#drop click->creatives--import#pickFile">
|
|
6
|
+
<%= t('collavre.creatives.index.drop_or_click_markdown') %>
|
|
7
|
+
<input type="file" id="import-markdown-input" accept=".md,.ppt,.pptx" style="display:none;" data-creatives--import-target="input" data-action="change->creatives--import#fileChanged" />
|
|
8
|
+
<div id="import-markdown-progress" style="margin-top:1em;color:#0074d9;display:none;" data-creatives--import-target="progress"></div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<div id="inline-edit-form" class="inline-edit-form-shell" style="display:none;">
|
|
2
|
+
<form id="inline-edit-form-element" method="post">
|
|
3
|
+
<input type="hidden" id="inline-method" name="_method" value="patch" />
|
|
4
|
+
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>" />
|
|
5
|
+
<input type="hidden" id="inline-creative-description" name="creative[description]" />
|
|
6
|
+
<input type="hidden" id="inline-parent-id" name="creative[parent_id]" />
|
|
7
|
+
<input type="hidden" id="inline-before-id" name="before_id" />
|
|
8
|
+
<input type="hidden" id="inline-after-id" name="after_id" />
|
|
9
|
+
<input type="hidden" id="inline-child-id" name="child_id" />
|
|
10
|
+
<input type="hidden" id="inline-origin-id" name="creative[origin_id]" />
|
|
11
|
+
<div id="lexical-inline-editor"
|
|
12
|
+
data-lexical-editor-root
|
|
13
|
+
class="lexical-inline-editor"
|
|
14
|
+
data-direct-upload-url="<%= main_app.rails_direct_uploads_url %>"
|
|
15
|
+
data-blob-url-template="<%= main_app.rails_service_blob_url(':signed_id', ':filename') %>"
|
|
16
|
+
data-placeholder="<%= t('collavre.creatives.inline_editor.placeholder') %>"></div>
|
|
17
|
+
<div id="actions-inline-editor" style="padding: 0px 8px;">
|
|
18
|
+
<div style="margin-top:0.5em;display:flex;align-items:center;gap:0.5em;">
|
|
19
|
+
<input type="range" id="inline-creative-progress" name="creative[progress]" min="0" max="1" step="0.01">
|
|
20
|
+
<span id="inline-progress-value">0%</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div style="margin-top:0.5em;">
|
|
23
|
+
<button type="button" id="inline-move-up" class="creative-action-btn" title="<%= t('collavre.creatives.index.inline_move_up_tooltip') %>">
|
|
24
|
+
<%= svg_tag 'arrow-up.svg', class: 'icon-svg', width: 24, height: 24 %>
|
|
25
|
+
</button>
|
|
26
|
+
<button type="button" id="inline-move-down" class="creative-action-btn" title="<%= t('collavre.creatives.index.inline_move_down_tooltip') %>">
|
|
27
|
+
<%= svg_tag 'arrow-down.svg',class: 'icon-svg', width: 24, height: 24 %>
|
|
28
|
+
</button>
|
|
29
|
+
<button type="button" id="inline-add" class="creative-action-btn add-creative-btn" title="<%= t('collavre.creatives.index.inline_add_sibling_tooltip') %>">
|
|
30
|
+
<%= svg_tag 'add.svg',class: 'icon-svg', width: 24, height: 24 %>
|
|
31
|
+
</button>
|
|
32
|
+
<button type="button" id="inline-level-down" class="creative-action-btn add-creative-btn" title="<%= t('collavre.creatives.index.inline_level_down_tooltip') %>">
|
|
33
|
+
|
|
34
|
+
<%= svg_tag 'hierarchy-child.svg',class: 'icon-svg', width: 24, height: 24 %>
|
|
35
|
+
</button>
|
|
36
|
+
<button type="button" id="inline-level-up" class="creative-action-btn add-creative-btn" title="<%= t('collavre.creatives.index.inline_level_up_tooltip') %>">
|
|
37
|
+
|
|
38
|
+
<%= svg_tag 'hierarchy-parent.svg',class: 'icon-svg', width: 24, height: 24 %>
|
|
39
|
+
</button>
|
|
40
|
+
<% inline_delete_button_content = capture do %>
|
|
41
|
+
<%= svg_tag 'trash-bold-outline.svg', class: 'icon-svg', width: 24, height: 24 %>
|
|
42
|
+
<% end %>
|
|
43
|
+
<%= render PopupMenuComponent.new(
|
|
44
|
+
button_content: inline_delete_button_content,
|
|
45
|
+
button_classes: 'creative-action-btn danger-link',
|
|
46
|
+
button_attributes: { id: 'inline-delete-popup-toggle' },
|
|
47
|
+
menu_id: 'inline-delete-popup-menu'
|
|
48
|
+
) do %>
|
|
49
|
+
<button type="button"
|
|
50
|
+
id="inline-delete"
|
|
51
|
+
class="popup-menu-item danger-link"
|
|
52
|
+
title="<%= t('collavre.creatives.index.delete_only_this') %>"
|
|
53
|
+
data-confirm="<%= t('collavre.creatives.index.are_you_sure_delete_only_this') %>">
|
|
54
|
+
<%= t('collavre.creatives.index.delete_only_this') %>
|
|
55
|
+
</button>
|
|
56
|
+
<button type="button"
|
|
57
|
+
id="inline-delete-with-children"
|
|
58
|
+
class="popup-menu-item danger-link"
|
|
59
|
+
title="<%= t('collavre.creatives.index.delete_with_children') %>"
|
|
60
|
+
data-confirm="<%= t('collavre.creatives.index.are_you_sure_delete_with_children') %>">
|
|
61
|
+
<%= t('collavre.creatives.index.delete_with_children') %>
|
|
62
|
+
</button>
|
|
63
|
+
<% end %>
|
|
64
|
+
<button type="button" id="inline-link" class="creative-action-btn" title="<%= t('collavre.creatives.index.link') %>">
|
|
65
|
+
<%= svg_tag 'link.svg',class: 'icon-svg', width: 24, height: 24 %>
|
|
66
|
+
</button>
|
|
67
|
+
<button type="button"
|
|
68
|
+
id="inline-unconvert"
|
|
69
|
+
class="creative-action-btn"
|
|
70
|
+
title="<%= t('collavre.creatives.index.unconvert') %>"
|
|
71
|
+
data-confirm="<%= t('collavre.creatives.index.unconvert_confirm') %>"
|
|
72
|
+
data-error="<%= t('collavre.creatives.index.unconvert_failed') %>">
|
|
73
|
+
<%= svg_tag 'hierarchy-parent.svg',class: 'icon-svg', width: 16, height: 16 %>
|
|
74
|
+
<%= svg_tag 'comment.svg',class: 'icon-svg', width: 24, height: 24 %>
|
|
75
|
+
</button>
|
|
76
|
+
<button type="button" id="inline-unlink" class="creative-action-btn danger-link" title="<%= t('collavre.creatives.index.unlink') %>" data-confirm="<%= t('collavre.creatives.index.are_you_sure_unlink') %>" style="display:none;">
|
|
77
|
+
<%= svg_tag 'unlink.svg',class: 'icon-svg', width: 24, height: 24 %>
|
|
78
|
+
</button>
|
|
79
|
+
<button type="button" id="inline-close" class="creative-action-btn" title="<%= t('collavre.creatives.index.inline_close_tooltip') %>">
|
|
80
|
+
<%= svg_tag 'close.svg',class: 'icon-svg', width: 24, height: 24 %>
|
|
81
|
+
</button>
|
|
82
|
+
</div>
|
|
83
|
+
<button type="button" id="inline-recommend-parent" class="creative-action-btn" style="margin-top:0.5em;" title="<%= t('collavre.creatives.index.recommend_parent') %>">✨<%= t('collavre.creatives.index.recommend_parent') %></button>
|
|
84
|
+
<select id="parent-suggestions" size="5" style="display:none;margin-top:0.5em;width:100%;"></select>
|
|
85
|
+
</div>
|
|
86
|
+
</form>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<div class="mobile-only">
|
|
2
|
+
<%= render PopupMenuComponent.new(
|
|
3
|
+
button_content: '...',
|
|
4
|
+
menu_id: 'mobile-actions-menu',
|
|
5
|
+
align: :right
|
|
6
|
+
) do %>
|
|
7
|
+
<% current_creative = local_assigns[:current_creative] || @parent_creative || @creative %>
|
|
8
|
+
<% can_manage_integrations = local_assigns.fetch(:can_manage_integrations, current_creative&.has_permission?(Current.user, :admin)) %>
|
|
9
|
+
<% if current_creative&.has_permission?(Current.user, :write) %>
|
|
10
|
+
<button type="button" class="popup-menu-item" data-controller="click-target" data-click-target-id-value="share-creative-btn" data-action="click->click-target#trigger"><%= t('collavre.creatives.index.share') %></button>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% if can_manage_integrations %>
|
|
13
|
+
<button type="button" class="popup-menu-item" data-controller="click-target" data-click-target-id-value="github-integration-btn" data-action="click->click-target#trigger"><%= t('collavre.creatives.index.integrations', default: '연동') %> - Github</button>
|
|
14
|
+
<button type="button" class="popup-menu-item" data-controller="click-target" data-click-target-id-value="notion-integration-btn" data-action="click->click-target#trigger"><%= t('collavre.creatives.index.integrations', default: '연동') %> - Notion</button>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% if @parent_creative.present? %>
|
|
17
|
+
<%= button_to t('collavre.creatives.index.slide_view'), slide_view_creative_path(@parent_creative), method: :get, class: 'popup-menu-item' %>
|
|
18
|
+
<% end %>
|
|
19
|
+
<% if authenticated? && (!params[:id] || (current_creative && current_creative.has_permission?(Current.user, :write))) %>
|
|
20
|
+
<button type="button" class="popup-menu-item" data-controller="click-target" data-click-target-id-value="import-markdown-btn" data-action="click->click-target#trigger"><%= t('collavre.creatives.index.import_markdown') %></button>
|
|
21
|
+
<% end %>
|
|
22
|
+
<button type="button" class="popup-menu-item" data-controller="click-target" data-click-target-id-value="export-markdown-btn" data-action="click->click-target#trigger"><%= t('collavre.creatives.index.export_markdown') %></button>
|
|
23
|
+
<% end %>
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<div id="notion-integration-modal"
|
|
2
|
+
data-success-message="<%= t('collavre.creatives.index.notion_integration_saved', default: 'Notion integration saved successfully.') %>"
|
|
3
|
+
data-login-required="<%= t('collavre.creatives.index.notion_integration_login_required', default: 'Sign in with your Notion account to start the integration.') %>"
|
|
4
|
+
data-no-creative="<%= t('collavre.creatives.index.notion_integration_missing_creative', default: 'No Creative selected for integration.') %>"
|
|
5
|
+
data-existing-message="<%= t('collavre.creatives.index.notion_integration_existing_message', default: 'You\'re already connected to Notion pages below.') %>"
|
|
6
|
+
data-delete-confirm="<%= t('collavre.creatives.index.notion_integration_delete_confirm', default: 'Do you want to remove the Notion integration?') %>"
|
|
7
|
+
data-delete-success="<%= t('collavre.creatives.index.notion_integration_delete_success', default: 'Notion integration removed successfully.') %>"
|
|
8
|
+
data-delete-error="<%= t('collavre.creatives.index.notion_integration_delete_error', default: 'Failed to remove the Notion integration.') %>"
|
|
9
|
+
data-delete-button-label="<%= t('collavre.creatives.index.notion_integration_delete_button', default: 'Remove integration') %>"
|
|
10
|
+
data-export-success="<%= t('collavre.creatives.index.notion_export_success', default: 'Creative exported to Notion successfully.') %>"
|
|
11
|
+
data-sync-success="<%= t('collavre.creatives.index.notion_sync_success', default: 'Creative synced to Notion successfully.') %>"
|
|
12
|
+
style="display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1000;align-items:center;justify-content:center;">
|
|
13
|
+
<div class="popup-box" style="min-width:360px;max-width:90vw;">
|
|
14
|
+
<button type="button" id="close-notion-modal" class="popup-close-btn">×</button>
|
|
15
|
+
<h2><%= t('collavre.creatives.index.notion_integration_title', default: 'Configure Notion integration') %></h2>
|
|
16
|
+
<p id="notion-integration-status" class="notion-modal-status"></p>
|
|
17
|
+
|
|
18
|
+
<div class="notion-wizard-step" id="notion-step-connect">
|
|
19
|
+
<p id="notion-connect-message" class="notion-modal-subtext"><%= t('collavre.creatives.index.notion_integration_connect', default: 'Sign in with your Notion account to start exporting.') %></p>
|
|
20
|
+
<form id="notion-login-form" action="/auth/notion" method="get" target="notion-auth-window" style="display:none;">
|
|
21
|
+
</form>
|
|
22
|
+
<button type="button" id="notion-login-btn" class="btn btn-primary" data-window-width="620" data-window-height="720">
|
|
23
|
+
<%= t('collavre.creatives.index.notion_login_button', default: 'Sign in with Notion') %>
|
|
24
|
+
</button>
|
|
25
|
+
<div id="notion-existing-connections" style="display:none;margin-top:1.25em;">
|
|
26
|
+
<p style="margin-bottom:0.5em;"><%= t('collavre.creatives.index.notion_integration_existing_intro', default: 'Linked Notion pages:') %></p>
|
|
27
|
+
<ul id="notion-existing-page-list" style="padding-left:1.2em;margin-bottom:0.75em;color:var(--color-text);"></ul>
|
|
28
|
+
<div style="display:flex;gap:0.5em;">
|
|
29
|
+
<button type="button" id="notion-sync-btn" class="btn btn-secondary" style="display:none;">
|
|
30
|
+
<%= t('collavre.creatives.index.notion_sync_button', default: 'Sync to Notion') %>
|
|
31
|
+
</button>
|
|
32
|
+
<button type="button" id="notion-delete-btn" class="btn btn-danger" style="display:none;">
|
|
33
|
+
<%= t('collavre.creatives.index.notion_integration_delete_button', default: 'Remove link') %>
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="notion-wizard-step" id="notion-step-workspace" style="display:none;">
|
|
40
|
+
<p class="notion-modal-subtext"><%= t('collavre.creatives.index.notion_integration_workspace', default: 'Your Notion workspace is connected. Choose how to export your creative.') %></p>
|
|
41
|
+
<div id="notion-workspace-info" style="margin-bottom:1em;padding:1em;background:var(--color-bg-alt);border-radius:4px;">
|
|
42
|
+
<strong id="notion-workspace-name"></strong>
|
|
43
|
+
</div>
|
|
44
|
+
<div style="margin-bottom:1em;">
|
|
45
|
+
<label style="display:block;margin-bottom:0.5em;">
|
|
46
|
+
<%= t('collavre.creatives.index.notion_export_option', default: 'Export option:') %>
|
|
47
|
+
</label>
|
|
48
|
+
<div style="display:flex;flex-direction:column;gap:0.5em;">
|
|
49
|
+
<label style="display:flex;align-items:center;gap:0.5em;">
|
|
50
|
+
<input type="radio" name="notion-export-type" value="new-page" checked>
|
|
51
|
+
<%= t('collavre.creatives.index.notion_export_new_page', default: 'Create new page') %>
|
|
52
|
+
</label>
|
|
53
|
+
<label style="display:flex;align-items:center;gap:0.5em;">
|
|
54
|
+
<input type="radio" name="notion-export-type" value="select-parent">
|
|
55
|
+
<%= t('collavre.creatives.index.notion_export_under_page', default: 'Create as subpage under existing page') %>
|
|
56
|
+
</label>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div id="notion-parent-page-section" style="display:none;margin-bottom:1em;">
|
|
60
|
+
<label for="notion-parent-page-select" style="display:block;margin-bottom:0.5em;">
|
|
61
|
+
<%= t('collavre.creatives.index.notion_parent_page', default: 'Parent page:') %>
|
|
62
|
+
</label>
|
|
63
|
+
<select id="notion-parent-page-select" style="width:100%;padding:0.5em;border:1px solid var(--color-border);border-radius:4px;">
|
|
64
|
+
<option value=""><%= t('collavre.creatives.index.notion_loading', default: 'Loading pages...') %></option>
|
|
65
|
+
</select>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="notion-wizard-step" id="notion-step-summary" style="display:none;">
|
|
70
|
+
<p class="notion-modal-subtext"><%= t('collavre.creatives.index.notion_integration_summary', default: 'Ready to export your creative tree to Notion:') %></p>
|
|
71
|
+
<div id="notion-export-summary" style="margin:1em 0;padding:1em;background:var(--color-bg-alt);border-radius:4px;">
|
|
72
|
+
<div><strong><%= t('collavre.creatives.index.notion_creative_title', default: 'Root Creative:') %></strong> <span id="notion-creative-title"></span></div>
|
|
73
|
+
<div><strong><%= t('collavre.creatives.index.notion_workspace', default: 'Workspace:') %></strong> <span id="notion-workspace-summary"></span></div>
|
|
74
|
+
<div><strong><%= t('collavre.creatives.index.notion_export_as', default: 'Export as:') %></strong> <span id="notion-export-type-summary"></span></div>
|
|
75
|
+
<div id="notion-parent-summary" style="display:none;"><strong><%= t('collavre.creatives.index.notion_parent_page', default: 'Parent page:') %></strong> <span id="notion-parent-page-summary"></span></div>
|
|
76
|
+
<div style="margin-top:0.5em;color:var(--color-text-secondary);font-size:0.9em;"><%= t('collavre.creatives.index.notion_tree_note', default: 'This will export the selected creative and all its descendants as a structured document.') %></div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div id="notion-wizard-error" style="display:none;margin:0.5em 0;color:#c0392b;font-weight:bold;"></div>
|
|
81
|
+
|
|
82
|
+
<div class="notion-wizard-footer" style="display:flex;justify-content:space-between;gap:0.5em;margin-top:1.5em;">
|
|
83
|
+
<button type="button" id="notion-prev-btn" class="btn btn-secondary" style="display:none;"><%= t('app.previous', default: 'Previous') %></button>
|
|
84
|
+
<div style="margin-left:auto;display:flex;gap:0.5em;">
|
|
85
|
+
<button type="button" id="notion-next-btn" class="btn btn-primary" style="display:none;"><%= t('app.next', default: 'Next') %></button>
|
|
86
|
+
<button type="button" id="notion-export-btn" class="btn btn-primary" style="display:none;"><%= t('collavre.creatives.index.notion_export_button', default: 'Export to Notion') %></button>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div id="set-plan-modal" data-creatives--set-plan-modal-target="modal" data-action="click->creatives--set-plan-modal#backdrop" style="display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1000;align-items:center;justify-content:center;">
|
|
2
|
+
<div class="popup-box" style="min-width:320px;max-width:90vw;">
|
|
3
|
+
<button id="close-set-plan-modal" class="popup-close-btn" data-action="creatives--set-plan-modal#close">×</button>
|
|
4
|
+
<h2><%= t('collavre.creatives.index.set_plan_title', default: 'Set Plan for Selected Creatives') %></h2>
|
|
5
|
+
<form id="set-plan-form" method="post" action="<%= collavre.creative_plan_path %>" data-creatives--set-plan-modal-target="form" data-action="submit->creatives--set-plan-modal#submit">
|
|
6
|
+
<%= csrf_meta_tags %>
|
|
7
|
+
<div style="margin-bottom:1em;">
|
|
8
|
+
<label for="plan-id-select"><%= t('collavre.creatives.index.select_plan', default: 'Select Plan') %></label>
|
|
9
|
+
<select id="plan-id-select" name="plan_id" required style="width:100%;" data-creatives--set-plan-modal-target="planSelect">
|
|
10
|
+
<% Plan.all.each do |plan| %>
|
|
11
|
+
<option value="<%= plan.id %>"><%= plan.creative&.effective_description(nil, false).presence || plan.target_date %></option>
|
|
12
|
+
<% end %>
|
|
13
|
+
</select>
|
|
14
|
+
</div>
|
|
15
|
+
<!-- Hidden field for creative IDs, filled by JS -->
|
|
16
|
+
<input type="hidden" name="creative_ids" id="selected-creative-ids-input" data-creatives--set-plan-modal-target="idsInput" />
|
|
17
|
+
<div style="display:flex; gap:1em; align-items:center;">
|
|
18
|
+
<button type="button" id="remove-plan-btn" data-remove-path="<%= collavre.creative_plan_path %>" class="btn btn-danger" style="margin-right:0.5em;" data-action="click->creatives--set-plan-modal#remove">
|
|
19
|
+
<%= t('collavre.creatives.index.remove_plan', default: 'Remove Plan') %>
|
|
20
|
+
</button>
|
|
21
|
+
<button type="submit" class="btn btn-primary"><%= t('collavre.creatives.index.add_plan', default: 'Add Plan') %></button>
|
|
22
|
+
</div>
|
|
23
|
+
</form>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<button id="share-creative-btn" class="btn btn-primary desktop-only">
|
|
2
|
+
<span aria-hidden="true"><%= svg_tag 'share.svg', class: 'icon-up', width: 22, height: 20 %></span>
|
|
3
|
+
</button>
|
|
4
|
+
<!-- Share Creative Modal -->
|
|
5
|
+
<div id="share-creative-modal" style="display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1000;align-items:center;justify-content:center;" data-creative-id="<%= (@parent_creative || @creative).id %>">
|
|
6
|
+
<div class="popup-box" style="min-width:320px;max-width:90vw;">
|
|
7
|
+
<button id="close-share-modal" class="popup-close-btn">×</button>
|
|
8
|
+
<h2><%= t('collavre.creatives.index.share_creative') %></h2>
|
|
9
|
+
<form id="share-creative-form" action="<%= collavre.creative_creative_shares_path(@parent_creative || @creative) %>" method="post" data-controller="share-invite">
|
|
10
|
+
<%= csrf_meta_tags %>
|
|
11
|
+
<div style="margin-bottom:1em; position:relative;"
|
|
12
|
+
data-controller="share-user-search"
|
|
13
|
+
data-share-user-search-creative-id-value="<%= (@parent_creative || @creative).id %>"
|
|
14
|
+
data-share-user-search-scope-value="contacts">
|
|
15
|
+
<label for="share-user-email"><%= t('collavre.creatives.index.user_email') %></label>
|
|
16
|
+
<input type="email" name="user_email" id="share-user-email" style="width:100%;"
|
|
17
|
+
data-share-invite-target="email"
|
|
18
|
+
data-share-user-search-target="input"
|
|
19
|
+
data-action="blur->share-invite#check input->share-user-search#input focus->share-user-search#focus keydown->share-user-search#handleKey"
|
|
20
|
+
autocomplete="off" />
|
|
21
|
+
<%= render UserMentionMenuComponent.new(menu_id: 'share-user-suggestions') %>
|
|
22
|
+
</div>
|
|
23
|
+
<div style="margin-bottom:1em;">
|
|
24
|
+
<select name="permission" id="share-permission" style="width:100%;">
|
|
25
|
+
<option value="no_access"><%= t('collavre.creatives.index.permission_no_access') %></option>
|
|
26
|
+
<option value="read"><%= t('collavre.creatives.index.permission_read') %></option>
|
|
27
|
+
<option value="feedback"><%= t('collavre.creatives.index.permission_feedback') %></option>
|
|
28
|
+
<option value="write"><%= t('collavre.creatives.index.permission_write') %></option>
|
|
29
|
+
<option value="admin"><%= t('collavre.creatives.index.permission_admin') %></option>
|
|
30
|
+
</select>
|
|
31
|
+
</div>
|
|
32
|
+
<button type="submit" class="btn btn-primary" data-share-invite-target="submit" data-share="<%= t('collavre.creatives.index.share') %>" data-invite="<%= t('collavre.creatives.index.invite') %>"><%= t('collavre.creatives.index.share') %></button>
|
|
33
|
+
<button type="button" id="creative-invite-link" class="btn btn-secondary" data-creative-id="<%= (@parent_creative || @creative).id %>" data-no-access-message="<%= t('collavre.creatives.index.invite_link_no_access') %>" data-copied-template="<%= t('collavre.creatives.index.invite_link_copied_permission', permission: '__PERMISSION__') %>"><%= t('collavre.creatives.index.invite_link') %></button>
|
|
34
|
+
</form>
|
|
35
|
+
<% if @shared_list.any? %>
|
|
36
|
+
<div style="margin-top:1em;">
|
|
37
|
+
<strong><%= t('collavre.creatives.index.shared_with') %>:</strong>
|
|
38
|
+
<ul class="share-grid">
|
|
39
|
+
<% @shared_list.each do |share| %>
|
|
40
|
+
<li>
|
|
41
|
+
<span>
|
|
42
|
+
<%= render AvatarComponent.new(user: share.user, size: 20, classes: 'avatar share-avatar') %>
|
|
43
|
+
</span>
|
|
44
|
+
<span><%= share.user&.display_name || (share.user_id.nil? ? t('collavre.creatives.index.public_share') : t('collavre.creatives.index.unknown_user')) %></span>
|
|
45
|
+
<span><%= t("collavre.creatives.index.permission_#{share.permission}") %></span>
|
|
46
|
+
<span>
|
|
47
|
+
<%= button_to '×', collavre.creative_creative_share_path(@parent_creative || @creative, share), method: :delete, form: { data: { turbo_confirm: t('collavre.creatives.index.are_you_sure_delete_share') } }, class: 'delete-share-btn', style: 'padding:0 0.5em;' %>
|
|
48
|
+
</span>
|
|
49
|
+
</li>
|
|
50
|
+
<% end %>
|
|
51
|
+
</ul>
|
|
52
|
+
</div>
|
|
53
|
+
<% end %>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<%= tag.div(flash[:alert], class: "flash-alert") if flash[:alert] %>
|
|
2
|
+
|
|
3
|
+
<div data-controller="creatives--import creatives--select-mode creatives--drag-drop creatives--expansion creatives--row-editor creatives--set-plan-modal"
|
|
4
|
+
data-creatives--import-parent-id-value="<%= @parent_creative&.id %>"
|
|
5
|
+
data-creatives--import-uploading-value="<%= t('collavre.creatives.index.import_uploading') %>"
|
|
6
|
+
data-creatives--import-success-value="<%= t('collavre.creatives.index.import_success') %>"
|
|
7
|
+
data-creatives--import-failed-value="<%= t('collavre.creatives.index.import_failed') %>"
|
|
8
|
+
data-creatives--import-only-markdown-value="<%= t('collavre.creatives.index.only_markdown') %>"
|
|
9
|
+
data-creatives--set-plan-modal-select-one-value="<%= t('collavre.creatives.index.select_one_creative') %>"
|
|
10
|
+
data-creatives--set-plan-modal-select-plan-value="<%= t('collavre.creatives.index.select_plan_to_remove') %>">
|
|
11
|
+
<div class="creative-actions-row">
|
|
12
|
+
<%= render 'add_button' if authenticated? && (!params[:id] || (@parent_creative && @parent_creative.has_permission?(Current.user, :write))) %>
|
|
13
|
+
<% if @parent_creative&.parent_id.present? %>
|
|
14
|
+
<%= button_to creative_path(@parent_creative.owning_parent), method: :get, aria: { label: t('.up') } do %>
|
|
15
|
+
<span aria-hidden="true"><%= svg_tag 'arrow-up.svg', class: 'icon-up', width: 16, height: 16 %></span>
|
|
16
|
+
<% end %>
|
|
17
|
+
<% elsif @parent_creative.present? %>
|
|
18
|
+
<%= button_to creatives_path, class: "up-link", method: :get, aria: { label: t('.up') } do %>
|
|
19
|
+
<span aria-hidden="true"><%= svg_tag 'arrow-up.svg', class: 'icon-up', width: 16, height: 16 %></span>
|
|
20
|
+
<% end %>
|
|
21
|
+
<% end %>
|
|
22
|
+
|
|
23
|
+
<% current_creative = @parent_creative || @creative %>
|
|
24
|
+
<% can_manage_integrations = current_creative&.has_permission?(Current.user, :admin) %>
|
|
25
|
+
<% if (@parent_creative || @creative) && (@parent_creative || @creative).has_permission?(Current.user, :write) %>
|
|
26
|
+
<%= render 'share_button' %>
|
|
27
|
+
<% end %>
|
|
28
|
+
|
|
29
|
+
<% if can_manage_integrations %>
|
|
30
|
+
<%= render PopupMenuComponent.new(
|
|
31
|
+
button_content: t('collavre.creatives.index.integrations', default: '연동'),
|
|
32
|
+
menu_id: 'creative-integrations-menu',
|
|
33
|
+
align: :left,
|
|
34
|
+
button_classes: 'desktop-only'
|
|
35
|
+
) do %>
|
|
36
|
+
<button type="button" class="popup-menu-item" data-controller="click-target" data-click-target-id-value="github-integration-btn" data-action="click->click-target#trigger">Github</button>
|
|
37
|
+
<button type="button" class="popup-menu-item" data-controller="click-target" data-click-target-id-value="notion-integration-btn" data-action="click->click-target#trigger">Notion</button>
|
|
38
|
+
<% end %>
|
|
39
|
+
<% end %>
|
|
40
|
+
|
|
41
|
+
<% if @parent_creative.present? %>
|
|
42
|
+
<%= button_to slide_view_creative_path(@parent_creative), method: :get, class: 'slide-view-btn desktop-only', aria: { label: t('collavre.creatives.index.slide_view') } do %>
|
|
43
|
+
<span aria-hidden="true"><%= svg_tag 'slide.svg', class: 'icon-slide', width: 22, height: 20 %></span>
|
|
44
|
+
<% end %>
|
|
45
|
+
<% end %>
|
|
46
|
+
|
|
47
|
+
<button id="set-plan-btn" class="set-plan-btn" style="display:none;" data-creatives--select-mode-target="setPlan" data-action="click->creatives--set-plan-modal#open"><%= t('app.set_plan') %></button>
|
|
48
|
+
<input type="checkbox" id="select-all-creatives" style="display:none;vertical-align:middle;" data-action="change->creatives--select-mode#toggleSelectAll" data-creatives--select-mode-target="selectAll" />
|
|
49
|
+
<% if authenticated? %>
|
|
50
|
+
<button id="select-creative-btn" class="select-btn" data-select-text="<%= t('app.select') %>" data-cancel-text="<%= t('app.cancel_select') %>" data-action="click->creatives--select-mode#toggle" data-creatives--select-mode-target="toggle"><%= t('app.select') %></button>
|
|
51
|
+
<% end %>
|
|
52
|
+
<% if (@parent_creative || @creative)&.has_permission?(Current.user, :admin) %>
|
|
53
|
+
<button id="delete-selection-btn" class="danger-link" style="display:none;" data-confirm="<%= t('collavre.creatives.index.are_you_sure_delete_selection') %>" data-action="click->creatives--select-mode#deleteSelected" data-creatives--select-mode-target="deleteButton"><%= t('collavre.creatives.index.delete_selection') %></button>
|
|
54
|
+
<% end %>
|
|
55
|
+
<button id="expand-all-btn" class="expand-btn" style="width: 36px;" data-expand-text="<%= t('app.expand_all') %>" data-collapse-text="<%= t('app.collapse_all') %>" data-action="click->creatives--expansion#toggleAll" data-creatives--expansion-target="expand"><span aria-hidden="true">▼</span></button>
|
|
56
|
+
<button id="toggle-edit-btn" class="edit-toggle-btn mobile-only" aria-label="<%= t('.edit') %>" title="<%= t('.edit') %>">
|
|
57
|
+
<span aria-hidden="true"><%= svg_tag 'edit.svg', class: 'icon-edit', width: 16, height: 16 %></span></button>
|
|
58
|
+
<% if authenticated? && (!params[:id] || (@parent_creative && @parent_creative.has_permission?(Current.user, :write))) %>
|
|
59
|
+
<button id="import-markdown-btn" class="import-btn desktop-only" data-action="click->creatives--import#toggle" data-creatives--import-target="toggle"><%= t('.import_markdown') %></button>
|
|
60
|
+
<% end %>
|
|
61
|
+
<button id="export-markdown-btn" class="export-btn desktop-only" data-parent-creative-id="<%= @parent_creative&.id %>" data-error="<%= t('collavre.creatives.index.export_failed') %>"><%= t('.export_markdown') %></button>
|
|
62
|
+
<%= render 'mobile_actions_menu', current_creative: current_creative, can_manage_integrations: can_manage_integrations %>
|
|
63
|
+
</div>
|
|
64
|
+
<%= render 'import_upload_zone' %>
|
|
65
|
+
|
|
66
|
+
<% if can_manage_integrations %>
|
|
67
|
+
<button id="github-integration-btn" data-creative-id="<%= current_creative&.id %>" style="display:none;"></button>
|
|
68
|
+
<button id="notion-integration-btn" data-creative-id="<%= current_creative&.id %>" style="display:none;"></button>
|
|
69
|
+
<% end %>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
<%= stylesheet_link_tag 'collavre/comments_popup', media: 'all' %>
|
|
74
|
+
<%= stylesheet_link_tag 'collavre/mention_menu', media: 'all' %>
|
|
75
|
+
|
|
76
|
+
<div class="tags">
|
|
77
|
+
<% labels = @parent_creative&.tags&.map { |tag| tag.label }&.compact %>
|
|
78
|
+
<% labels&.each do |label| %>
|
|
79
|
+
<input type="checkbox" class="tag-checkbox"
|
|
80
|
+
<%= "checked" unless params[:tags].present? && params[:tags].include?(label.id.to_s) %>
|
|
81
|
+
value="<%= label.id %>">
|
|
82
|
+
|
|
83
|
+
<%= "##{strip_tags(label.name)}" %>
|
|
84
|
+
<% if label.type == "Plan" %> 🗓<%= label.target_date %><% end %>
|
|
85
|
+
|
|
86
|
+
<% end %>
|
|
87
|
+
<% if labels.present? %>
|
|
88
|
+
<button id="apply-tags"><%= t('app.apply_tags') %></button>
|
|
89
|
+
<% end %>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<% if @parent_creative %>
|
|
93
|
+
<% content_for :head do %>
|
|
94
|
+
<meta property="og:title" content="<%= strip_tags(@parent_creative.effective_origin.description) %>">
|
|
95
|
+
<% end %>
|
|
96
|
+
<% title_templates = [
|
|
97
|
+
content_tag(:template, data: { part: "description" }) { sanitize @parent_creative.effective_description },
|
|
98
|
+
content_tag(:template, data: { part: "progress" }) { render_creative_progress(@parent_creative) }
|
|
99
|
+
] %>
|
|
100
|
+
<% if @parent_creative.origin_id.present? %>
|
|
101
|
+
<% title_templates << content_tag(:template, data: { part: "origin-link" }) do %>
|
|
102
|
+
<%= link_to creative_path(@parent_creative.origin),
|
|
103
|
+
class: "creative-origin-link creative-action-btn unstyled-link",
|
|
104
|
+
title: t("collavre.creatives.index.view_origin"),
|
|
105
|
+
aria: { label: t("collavre.creatives.index.view_origin") } do %>
|
|
106
|
+
<%= svg_tag "arrow-right.svg", class: "creative-origin-link-icon", width: 16, height: 16 %>
|
|
107
|
+
<% end %>
|
|
108
|
+
<% end %>
|
|
109
|
+
<% end %>
|
|
110
|
+
<%
|
|
111
|
+
title_row_content = safe_join(title_templates)
|
|
112
|
+
title_row_content += content_tag(:template, data: { part: "edit-icon" }) { svg_tag("edit.svg", class: "icon-edit") }
|
|
113
|
+
title_row_content += content_tag(:template, data: { part: "edit-off-icon" }) { svg_tag("edit-off.svg", class: "icon-edit") }
|
|
114
|
+
%>
|
|
115
|
+
<%= content_tag(
|
|
116
|
+
"creative-tree-row",
|
|
117
|
+
title_row_content,
|
|
118
|
+
"dom-id": "creative-markdown-block",
|
|
119
|
+
"creative-id": @parent_creative.id,
|
|
120
|
+
"parent-id": @parent_creative.parent_id,
|
|
121
|
+
"can-write": @parent_creative.has_permission?(Current.user, :write) ? "true" : "false",
|
|
122
|
+
"is-title": "",
|
|
123
|
+
"data-description-raw-html": @parent_creative.description,
|
|
124
|
+
"data-progress-value": @parent_creative.progress,
|
|
125
|
+
"data-origin-id": @parent_creative.origin_id
|
|
126
|
+
) %>
|
|
127
|
+
<% else %>
|
|
128
|
+
<%= content_tag(
|
|
129
|
+
"creative-tree-row",
|
|
130
|
+
content_tag(:template, data: { part: "description" }) do
|
|
131
|
+
if params[:tags].present?
|
|
132
|
+
render_tags(Label.where(id: params[:tags]), "unstyled-link")
|
|
133
|
+
else
|
|
134
|
+
t('.creatives')
|
|
135
|
+
end
|
|
136
|
+
end +
|
|
137
|
+
content_tag(:template, data: { part: "progress" }) do
|
|
138
|
+
if @overall_progress.nil?
|
|
139
|
+
"".html_safe
|
|
140
|
+
else
|
|
141
|
+
render_progress_value(@overall_progress)
|
|
142
|
+
end
|
|
143
|
+
end,
|
|
144
|
+
"dom-id": "creative-markdown-block",
|
|
145
|
+
"is-title": ""
|
|
146
|
+
) %>
|
|
147
|
+
<% end %>
|
|
148
|
+
|
|
149
|
+
<%
|
|
150
|
+
empty_html = nil
|
|
151
|
+
if (@creatives || []).blank?
|
|
152
|
+
if params[:search].present?
|
|
153
|
+
empty_html = content_tag(:p, t('.no_search_results'), style: 'text-align: center;')
|
|
154
|
+
elsif params[:id] && @creative && !@creative.has_permission?(Current.user, :read)
|
|
155
|
+
message = content_tag(:p, t('.no_permission'), style: 'text-align: center;')
|
|
156
|
+
action = content_tag(:div, button_to(t('.request_permission'), request_permission_creative_path(@creative), method: :post), style: 'text-align: center;')
|
|
157
|
+
empty_html = message + action
|
|
158
|
+
else
|
|
159
|
+
text = params[:id] ? t('.no_sub_creatives') : t('.no_creatives')
|
|
160
|
+
empty_html = content_tag(:p, text, style: 'text-align: center;')
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
# Only pass filter parameters to avoid unnecessary params in URL
|
|
164
|
+
tree_params = params.to_unsafe_h.slice(
|
|
165
|
+
"id", "tags", "min_progress", "max_progress", "search", "comment",
|
|
166
|
+
"has_comments", "due_before", "due_after", "has_due_date",
|
|
167
|
+
"assignee_id", "unassigned"
|
|
168
|
+
).merge(format: :json)
|
|
169
|
+
tree_url = creatives_path(tree_params)
|
|
170
|
+
%>
|
|
171
|
+
|
|
172
|
+
<%= tag.div(
|
|
173
|
+
empty_html,
|
|
174
|
+
id: 'creatives',
|
|
175
|
+
data: {
|
|
176
|
+
controller: 'creatives--tree',
|
|
177
|
+
'creatives--tree-url-value': tree_url,
|
|
178
|
+
'creatives--tree-empty-html-value': empty_html.to_s,
|
|
179
|
+
edit_icon_html: svg_tag("edit.svg", className: "icon-edit"),
|
|
180
|
+
edit_off_icon_html: svg_tag("edit-off.svg", className: "icon-edit")
|
|
181
|
+
}
|
|
182
|
+
) %>
|
|
183
|
+
|
|
184
|
+
<%= render 'collavre/comments/comments_popup' %>
|
|
185
|
+
<%= render 'inline_edit_form' %>
|
|
186
|
+
|
|
187
|
+
<%= render 'set_plan_modal' %>
|
|
188
|
+
<% if can_manage_integrations %>
|
|
189
|
+
<%= render 'github_integration_modal', creative: current_creative %>
|
|
190
|
+
<%= render 'notion_integration_modal', creative: current_creative %>
|
|
191
|
+
<% end %>
|
|
192
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<%#= TODO: remove this later, currently show uses index template, see controller %>
|
|
2
|
+
<p><%= link_to t('collavre.users.back'), creatives_path %></p>
|
|
3
|
+
|
|
4
|
+
<section class="creative">
|
|
5
|
+
|
|
6
|
+
<section class="creative-info">
|
|
7
|
+
<% cache @creative do %>
|
|
8
|
+
<% if @creative.parent %>
|
|
9
|
+
<h1>
|
|
10
|
+
<%= sanitize @creative.parent.description %>
|
|
11
|
+
</h1>
|
|
12
|
+
<% end %>
|
|
13
|
+
<div>
|
|
14
|
+
<%= embed_youtube_iframe(@creative.description) %>
|
|
15
|
+
</div>
|
|
16
|
+
<% end %>
|
|
17
|
+
|
|
18
|
+
<div class="creative-actions-row">
|
|
19
|
+
<% if authenticated? %>
|
|
20
|
+
<%= link_to t('collavre.creatives.index.new_sub_creative'), @creative&.id ? new_creative_path(parent_id: @creative.id, tags: params[:tags]) : new_creative_path(tags: params[:tags]) %>
|
|
21
|
+
<%= button_to t('collavre.creatives.index.delete'), @creative, method: :delete, data: { turbo_confirm: t('collavre.creatives.index.are_you_sure') } %>
|
|
22
|
+
<%= link_to slide_view_creative_path(@creative), aria: { label: t('collavre.creatives.index.slide_view') } do %>
|
|
23
|
+
<span aria-hidden="true"><%= svg_tag 'slide.svg', class: 'icon-slide', width: 16, height: 16 %></span>
|
|
24
|
+
<% end %>
|
|
25
|
+
<% end %>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
</section>
|
|
29
|
+
</section>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<% depth = (@creative.ancestors.count - @root_depth) + 1 %>
|
|
2
|
+
<% tag_name = case depth
|
|
3
|
+
when 1 then 'h1'
|
|
4
|
+
when 2 then 'h2'
|
|
5
|
+
when 3 then 'h3'
|
|
6
|
+
else 'div'
|
|
7
|
+
end %>
|
|
8
|
+
<% initial_index = params[:slide].to_i.clamp(0, @slide_ids.length - 1) %>
|
|
9
|
+
<% initial_prompt = @creative.prompt_for(Current.user) %>
|
|
10
|
+
<div id="slide-view" data-slide-ids="<%= @slide_ids.join(',') %>" data-initial-index="<%= initial_index %>" data-root-id="<%= @creative.id %>">
|
|
11
|
+
<div id="slide-content"><%= content_tag(tag_name, @creative.effective_description.html_safe) %></div>
|
|
12
|
+
</div>
|
|
13
|
+
<div id="slide-controls">
|
|
14
|
+
<div id="slide-counter"><%= initial_index + 1 %> / <%= @slide_ids.length %></div>
|
|
15
|
+
<%= link_to '→', creative_path(@creative), id: 'slide-goto', aria: { label: t('collavre.creatives.slide_view.go_to_creative') } %>
|
|
16
|
+
</div>
|
|
17
|
+
<div id="slide-swipe">
|
|
18
|
+
<div id="slide-caption"><%= initial_prompt %></div>
|
|
19
|
+
<div id="slide-timer" aria-live="polite">00:00</div>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<h1 class="no-top-margin"><%= t('collavre.emails.index_title') %></h1>
|
|
2
|
+
<table>
|
|
3
|
+
<thead>
|
|
4
|
+
<tr>
|
|
5
|
+
<th><%= t('collavre.emails.list.title.to') %></th>
|
|
6
|
+
<th><%= t('collavre.emails.list.title.event') %></th>
|
|
7
|
+
<th><%= t('collavre.emails.list.title.sent_at') %></th>
|
|
8
|
+
</tr>
|
|
9
|
+
</thead>
|
|
10
|
+
<tbody>
|
|
11
|
+
<% @emails.each do |email| %>
|
|
12
|
+
<tr>
|
|
13
|
+
<td><%= link_to email.email, email_path(email) %></td>
|
|
14
|
+
<td><%= t("collavre.emails.event.#{email.event}") %></td>
|
|
15
|
+
<td><%= l(email.created_at, format: :short) %></td>
|
|
16
|
+
</tr>
|
|
17
|
+
<% end %>
|
|
18
|
+
</tbody>
|
|
19
|
+
</table>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<h1 class="no-top-margin"><%= @email.subject %></h1>
|
|
2
|
+
<p><strong><%= t('collavre.emails.list.title.to') %>:</strong> <%= @email.email %></p>
|
|
3
|
+
<p><strong><%= t('collavre.emails.list.title.event') %>:</strong> <%= t("collavre.emails.event.#{@email.event}") %></p>
|
|
4
|
+
<p><strong><%= t('collavre.emails.list.title.sent_at') %>:</strong> <%= l(@email.created_at, format: :long) %></p>
|
|
5
|
+
<pre><%= @email.body %></pre>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="inbox-item" data-id="<%= item.id %>">
|
|
2
|
+
<div class="message">
|
|
3
|
+
<% if item.link.present? %>
|
|
4
|
+
<%= link_to item.localized_message, item.link, class: 'item-link unstyled-link' %>
|
|
5
|
+
<% else %>
|
|
6
|
+
<%= h item.localized_message %>
|
|
7
|
+
<% end %>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="time"><%= time_ago_in_words(item.created_at) %></div>
|
|
10
|
+
<div class="actions">
|
|
11
|
+
<% if item.state == 'read' %>
|
|
12
|
+
<button class="mark-unread" data-id="<%= item.id %>"><%= t('collavre.inbox.mark_unread') %></button>
|
|
13
|
+
<% else %>
|
|
14
|
+
<button class="mark-read" data-id="<%= item.id %>"><%= t('collavre.inbox.mark_read') %></button>
|
|
15
|
+
<% end %>
|
|
16
|
+
<button class="delete-item" data-id="<%= item.id %>"><%= t('collavre.inbox.delete') %></button>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|