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,7 @@
|
|
|
1
|
+
<div id="inbox-items" data-next-page="<%= next_page || '' %>">
|
|
2
|
+
<% if items.any? %>
|
|
3
|
+
<%= render partial: 'collavre/inbox_items/items', locals: { items: items } %>
|
|
4
|
+
<% else %>
|
|
5
|
+
<div class="inbox-empty"><%= t('collavre.inbox.no_messages') %></div>
|
|
6
|
+
<% end %>
|
|
7
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= render partial: 'collavre/inbox_items/list', locals: { items: @inbox_items, next_page: @next_page } %>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<h1><%= t('collavre.inbox_mailer.daily_summary.greeting') %></h1>
|
|
2
|
+
<ul>
|
|
3
|
+
<% @items.each do |item| %>
|
|
4
|
+
<li>
|
|
5
|
+
<%= item.localized_message %>
|
|
6
|
+
<% if item.link.present? %>
|
|
7
|
+
(<a href="<%= item.link %>"><%= t('collavre.inbox_mailer.daily_summary.view') %></a>)
|
|
8
|
+
<% end %>
|
|
9
|
+
</li>
|
|
10
|
+
<% end %>
|
|
11
|
+
</ul>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<h1 class="no-top-margin"><%= t('.title') %></h1>
|
|
2
|
+
<p><%= t('collavre.invites.show.invited_by', inviter: @invitation.inviter.display_name, email: @invitation.inviter.email, creative: strip_tags(@invitation.creative.effective_origin.description)) %></p>
|
|
3
|
+
<p><%= t('collavre.invites.show.prompt') %></p>
|
|
4
|
+
<p>
|
|
5
|
+
<%= link_to t('collavre.invites.show.login'), new_session_path(invite_token: params[:token]) %> |
|
|
6
|
+
<%= link_to t('collavre.invites.show.sign_up'), new_user_path(invite_token: params[:token]) %>
|
|
7
|
+
</p>
|
|
8
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<h1 class="no-top-margin"><%= t('collavre.users.change_password') %></h1>
|
|
2
|
+
|
|
3
|
+
<%= tag.div(flash[:alert], class: "flash-alert") if flash[:alert] %>
|
|
4
|
+
|
|
5
|
+
<%= form_with url: collavre.password_path(params[:token]), method: :put do |form| %>
|
|
6
|
+
<%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: t('collavre.users.new_password'), minlength: Collavre::SystemSetting.password_min_length, maxlength: 72 %>
|
|
7
|
+
<div class="help-text" style="font-size: 0.85em; color: var(--color-text-muted); margin-top: 0.25em; margin-bottom: 0.5em;">
|
|
8
|
+
<%= t('collavre.users.password_min_length_hint', count: Collavre::SystemSetting.password_min_length) %>
|
|
9
|
+
</div>
|
|
10
|
+
<%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: t('collavre.users.confirm_new_password'), minlength: Collavre::SystemSetting.password_min_length, maxlength: 72 %><br>
|
|
11
|
+
<%= form.submit t('app.save') %>
|
|
12
|
+
<% end %>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<h1 class="no-top-margin"><%= t('collavre.users.forgot_password') %></h1>
|
|
2
|
+
|
|
3
|
+
<%= tag.div(flash[:alert], class: "flash-alert") if flash[:alert] %>
|
|
4
|
+
|
|
5
|
+
<%= form_with url: passwords_path, class: "stacked-form" do |form| %>
|
|
6
|
+
<%= form.email_field :email,
|
|
7
|
+
required: true,
|
|
8
|
+
autofocus: true,
|
|
9
|
+
autocomplete: "username",
|
|
10
|
+
placeholder: t("collavre.users.new.enter_your_email"),
|
|
11
|
+
value: params[:email],
|
|
12
|
+
class: "stacked-form-control" %>
|
|
13
|
+
<%= form.submit t('collavre.users.send_password_reset_instructions'), class: "primary-action-button" %>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<br/>
|
|
17
|
+
<%= link_to t('collavre.users.new.back_to_sign_in'), new_session_path %>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<%= render 'collavre/users/app_header' %>
|
|
2
|
+
|
|
3
|
+
<%= tag.div(flash[:alert], class: "flash-alert") if flash[:alert] %>
|
|
4
|
+
|
|
5
|
+
<%= form_with url: collavre.session_path, class: "stacked-form" do |form| %>
|
|
6
|
+
<% if auth_provider_enabled?(:email) %>
|
|
7
|
+
<%= render 'collavre/users/id_pwd_fields', form: form, skip_name_field: true %>
|
|
8
|
+
<%= form.hidden_field :timezone, id: 'login-timezone' %>
|
|
9
|
+
<%= form.hidden_field :invite_token, value: params[:invite_token] if params[:invite_token] %>
|
|
10
|
+
<%= form.submit t('app.sign_in'), id: 'sign-in-submit', class: "primary-action-button" %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<% Rails.application.config.auth_providers.sort_by { |p| p[:priority] }.each do |provider| %>
|
|
15
|
+
<% next if provider[:key] == :email %>
|
|
16
|
+
<% if auth_provider_enabled?(provider[:key]) && provider[:partial_path].present? %>
|
|
17
|
+
<div class="auth-alt-action">
|
|
18
|
+
<%= render provider[:partial_path] %>
|
|
19
|
+
</div>
|
|
20
|
+
<% end %>
|
|
21
|
+
<% end %>
|
|
22
|
+
|
|
23
|
+
<% if auth_provider_enabled?(:email) %>
|
|
24
|
+
<%= link_to t('collavre.users.sessions.new.forgot_password'), collavre.new_password_path %>
|
|
25
|
+
<br>
|
|
26
|
+
<%= link_to t("collavre.users.new.sign_up"), params[:invite_token] ? collavre.new_user_path(invite_token: params[:invite_token]) : collavre.new_user_path, class: "sign-up-link" %>
|
|
27
|
+
<% end %>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<div id="link-creative-modal" class="common-popup" style="display:none;" data-controller="link-creative">
|
|
2
|
+
<button type="button" id="close-link-creative-modal" class="popup-close-btn" data-link-creative-target="close">×</button>
|
|
3
|
+
<h3><%= t('collavre.creatives.index.link', default: 'Link') %></h3>
|
|
4
|
+
<input type="text" id="link-creative-search" class="shared-input-surface" style="width:100%;margin-bottom:0.5em;" placeholder="<%= t('collavre.creatives.index.search_placeholder', default: 'Search creative') %>" data-link-creative-target="input">
|
|
5
|
+
<ul id="link-creative-results" class="common-popup-list" data-popup-list data-link-creative-target="list"></ul>
|
|
6
|
+
</div>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<nav>
|
|
2
|
+
<%# Search Section %>
|
|
3
|
+
<% navigation_items_for(:search).each do |item| %>
|
|
4
|
+
<%= render_navigation_item(item) %>
|
|
5
|
+
<% end %>
|
|
6
|
+
|
|
7
|
+
<%# Mobile Plans Button (special: outside popup) %>
|
|
8
|
+
<% if (mobile_plans = Navigation::Registry.instance.find(:mobile_plans)) && navigation_item_visible?(mobile_plans, desktop: false) %>
|
|
9
|
+
<%= render_navigation_item(mobile_plans, mobile: true) %>
|
|
10
|
+
<% end %>
|
|
11
|
+
|
|
12
|
+
<%# Desktop Navigation %>
|
|
13
|
+
<div class="desktop-only">
|
|
14
|
+
<% navigation_items_for(:main, desktop: true).each do |item| %>
|
|
15
|
+
<%= render_navigation_item(item) %>
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<%# Mobile Popup Menu %>
|
|
20
|
+
<%= render PopupMenuComponent.new(
|
|
21
|
+
button_content: safe_join(['...', (render(Inbox::BadgeComponent.new(user: Current.user, badge_id: 'mobile-inbox-badge')) if Current.user)]),
|
|
22
|
+
button_classes: 'mobile-only',
|
|
23
|
+
menu_id: 'mobile-more-menu',
|
|
24
|
+
align: :right
|
|
25
|
+
) do %>
|
|
26
|
+
<% navigation_items_for(:main, desktop: false).reject { |i| i[:key] == :mobile_plans }.each do |item| %>
|
|
27
|
+
<%= render_mobile_navigation_item(item) %>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% end %>
|
|
30
|
+
|
|
31
|
+
<%# User Menu %>
|
|
32
|
+
<% navigation_items_for(:user).each do |item| %>
|
|
33
|
+
<%= render_navigation_item_with_children(item) %>
|
|
34
|
+
<% end %>
|
|
35
|
+
</nav>
|
|
36
|
+
|
|
37
|
+
<%= render "collavre/shared/navigation/panels" %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= button_tag "?", id: "creative-guide-link", class: "creative-guide-link", data: { help_url: SystemSetting.help_menu_link } %>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<% if Current.user %>
|
|
2
|
+
<form id="inbox_button_to">
|
|
3
|
+
<button id="inbox-menu-btn" class="inbox-menu-btn" type="button"><%= t('app.inbox') %><%= render Inbox::BadgeComponent.new(user: Current.user, badge_id: local_assigns[:badge_id] || 'desktop-inbox-badge') %></button>
|
|
4
|
+
</form>
|
|
5
|
+
<% end %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<button class="plans-menu-btn mobile-only" type="button"><%= t('app.plans') %></button>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div id="plans-list-area" style="display:none;">
|
|
2
|
+
<%= render PlansTimelineComponent.new(plans: Plan.none) %>
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<div id="inbox-panel" class="slide-panel">
|
|
6
|
+
<div class="inbox-panel-header">
|
|
7
|
+
<button id="close-inbox" type="button">×</button>
|
|
8
|
+
<label><input type="checkbox" id="toggle-inbox-read"> <%= t('collavre.inbox.show_read') %></label>
|
|
9
|
+
</div>
|
|
10
|
+
<div id="inbox-list" data-loading-text="<%= t('app.loading') %>" data-empty-text="<%= t('collavre.inbox.no_messages') %>"></div>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div id="creative-guide-popover" style="display:none; position:fixed; top:60px; left:50%; transform:translateX(-50%); background:white; border:1px solid var(--color-border); box-shadow:0 2px 8px rgba(0,0,0,0.12); padding:1.2em; max-width:400px; z-index:1000; border-radius:8px;">
|
|
14
|
+
<span style="float:right; cursor:pointer; font-weight:bold;" id="close-creative-guide">×</span>
|
|
15
|
+
<div style="margin-top:0.5em; color:#444; font-size:1em; line-height:1.5;">
|
|
16
|
+
<%= t('app.creative_guide') %>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<form action="<%= collavre.creatives_path %>" method="get">
|
|
2
|
+
<% if params[:id].present? %>
|
|
3
|
+
<input type="hidden" name="id" value="<%= params[:id] %>" />
|
|
4
|
+
<% end %>
|
|
5
|
+
<input type="text" id="search" class="shared-input-surface" name="search" value="<%= params[:search] %>" placeholder="<%= t('app.search_placeholder') %>" />
|
|
6
|
+
</form>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<div style="max-width: 960px; margin: 0 auto; padding: 1rem;">
|
|
2
|
+
<h1><%= t('collavre.themes.manage_themes') %></h1>
|
|
3
|
+
|
|
4
|
+
<div class="card" style="margin-bottom: 2rem; padding: 1.5rem; background: var(--color-section-bg); border: 1px solid var(--color-border); border-radius: 8px;">
|
|
5
|
+
<h3><%= t('collavre.themes.create_new') %></h3>
|
|
6
|
+
<%= form_with url: collavre.user_themes_path, method: :post, local: true do |f| %>
|
|
7
|
+
<div class="stacked-form-control">
|
|
8
|
+
<%= f.text_area :description, rows: 3, class: "shared-input-surface", style: "width: 100%; box-sizing: border-box;", required: true, value: params[:description], placeholder: t('collavre.themes.description_prompt') %>
|
|
9
|
+
<% if @error %>
|
|
10
|
+
<div style="color: red; font-size: 0.9em; margin-top: 5px;"><%= @error %></div>
|
|
11
|
+
<% end %>
|
|
12
|
+
</div>
|
|
13
|
+
<%= f.submit t('collavre.themes.generate'), class: "btn-primary", style: "width: 100%; margin-top: 10px; box-sizing: border-box;", data: { turbo_submits_with: "..." } %>
|
|
14
|
+
<% end %>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<h3><%= t('collavre.themes.your_themes') %></h3>
|
|
18
|
+
|
|
19
|
+
<div class="table-scroll">
|
|
20
|
+
<table class="table">
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th><%= t('collavre.themes.name') %></th>
|
|
24
|
+
<th><%= t('collavre.themes.preview') %></th>
|
|
25
|
+
<th><%= t('collavre.themes.created_at') %></th>
|
|
26
|
+
<th><%= t('collavre.themes.actions') %></th>
|
|
27
|
+
</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
<tbody>
|
|
30
|
+
<% @themes.each do |theme| %>
|
|
31
|
+
<tr>
|
|
32
|
+
<td>
|
|
33
|
+
<strong><%= theme.name %></strong>
|
|
34
|
+
<% if Current.user.theme == theme.id.to_s %>
|
|
35
|
+
<span class="badge badge-success"><%= t('collavre.themes.active') %></span>
|
|
36
|
+
<% end %>
|
|
37
|
+
</td>
|
|
38
|
+
<td>
|
|
39
|
+
<div style="display: flex; gap: 4px;">
|
|
40
|
+
<%
|
|
41
|
+
preview_vars = theme.variables.slice("--color-bg", "--color-text", "--color-btn-bg", "--color-link")
|
|
42
|
+
%>
|
|
43
|
+
<% preview_vars.each do |k, v| %>
|
|
44
|
+
<div title="<%= k %>: <%= v %>" style="width: 20px; height: 20px; background-color: <%= v %>; border: 1px solid var(--color-border); border-radius: 4px;"></div>
|
|
45
|
+
<% end %>
|
|
46
|
+
</div>
|
|
47
|
+
</td>
|
|
48
|
+
<td><%= l theme.created_at, format: :short %></td>
|
|
49
|
+
<td>
|
|
50
|
+
<div style="display: flex; gap: 0.5rem;">
|
|
51
|
+
<% if Current.user.theme == theme.id.to_s %>
|
|
52
|
+
<span class="badge badge-success"><%= t('collavre.themes.active') %></span>
|
|
53
|
+
<% else %>
|
|
54
|
+
<%= button_to t('collavre.themes.apply'), collavre.apply_user_theme_path(theme), method: :post, class: "btn-sm" %>
|
|
55
|
+
<% end %>
|
|
56
|
+
<%= button_to t('collavre.themes.delete'), collavre.user_theme_path(theme), method: :delete, class: "btn-sm btn-danger", form_class: "inline-block", onclick: "return confirm('#{t('collavre.themes.confirm_delete')}')" %>
|
|
57
|
+
</div>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
60
|
+
<% end %>
|
|
61
|
+
<% if @themes.empty? %>
|
|
62
|
+
<tr>
|
|
63
|
+
<td colspan="4" style="text-align: center; color: var(--color-muted); padding: 2rem;">
|
|
64
|
+
<p><%= t('collavre.themes.no_themes') %></p>
|
|
65
|
+
</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<% end %>
|
|
68
|
+
</tbody>
|
|
69
|
+
</table>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div style="margin-top: 1rem;">
|
|
73
|
+
<%= link_to t('app.back_to_profile', default: 'Back to Profile'), collavre.user_path(Current.user), class: "unstyled-link", style: "text-decoration: underline;" %>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<header style="margin-bottom: 1em;">
|
|
2
|
+
<h1 style="margin: 0; font-size: 2em;"> <%= t('app.name') %> </h1>
|
|
3
|
+
<div style="font-size: 1.2em;"><%= t('.your_creativeness_is_coming') %></div>
|
|
4
|
+
<div style="font-size: 1.2em;"><%= t('.a_tracker_of_your_creatives') %></div>
|
|
5
|
+
</header>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<div class="contact-management">
|
|
2
|
+
<div class="flex-row-center-between">
|
|
3
|
+
<p class="text-muted"><%= t('collavre.contacts.description') %></p>
|
|
4
|
+
<%= link_to t('collavre.users.add_ai_user'), collavre.new_ai_users_path, class: "primary-action-button" %>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<% show_actions = (contacts || []).any? { |c| c.contact_user.ai_user? && c.contact_user.created_by_id == Current.user.id } %>
|
|
8
|
+
|
|
9
|
+
<% if contacts.present? %>
|
|
10
|
+
<div class="table-scroll">
|
|
11
|
+
<table class="contacts-table">
|
|
12
|
+
<thead>
|
|
13
|
+
<tr>
|
|
14
|
+
<th><%= t('collavre.users.table.avatar') %></th>
|
|
15
|
+
<th><%= t('collavre.users.table.name') %></th>
|
|
16
|
+
<th><%= t('collavre.users.table.email') %></th>
|
|
17
|
+
<th><%= t('collavre.contacts.table.shared_creatives') %></th>
|
|
18
|
+
<th><%= t('collavre.contacts.table.shared_with_me') %></th>
|
|
19
|
+
<% if show_actions %>
|
|
20
|
+
<th><%= t('collavre.users.table.actions') %></th>
|
|
21
|
+
<% end %>
|
|
22
|
+
</tr>
|
|
23
|
+
</thead>
|
|
24
|
+
<tbody>
|
|
25
|
+
<% contacts.each do |contact| %>
|
|
26
|
+
<% contact_user = contact.contact_user %>
|
|
27
|
+
<tr>
|
|
28
|
+
<td>
|
|
29
|
+
<%= render AvatarComponent.new(
|
|
30
|
+
user: contact_user,
|
|
31
|
+
size: 32,
|
|
32
|
+
classes: "avatar"
|
|
33
|
+
) %>
|
|
34
|
+
</td>
|
|
35
|
+
<td><%= contact_user.display_name %></td>
|
|
36
|
+
<td><%= contact_user.email %></td>
|
|
37
|
+
<td class="creative-cell">
|
|
38
|
+
<%= render_contact_creatives(shared_by_me.fetch(contact_user.id, [])) %>
|
|
39
|
+
</td>
|
|
40
|
+
<td class="creative-cell">
|
|
41
|
+
<%= render_contact_creatives(shared_with_me.fetch(contact_user.id, [])) %>
|
|
42
|
+
</td>
|
|
43
|
+
<% if show_actions %>
|
|
44
|
+
<td class="text-right">
|
|
45
|
+
<% if contact_user.ai_user? && contact_user.created_by_id == Current.user.id %>
|
|
46
|
+
<%= link_to t('collavre.users.edit_ai.link'), collavre.edit_ai_user_path(contact_user), class: "btn btn-sm btn-secondary mr-1" %>
|
|
47
|
+
<%= button_to t('collavre.users.destroy.delete_ai_user'),
|
|
48
|
+
collavre.user_path(contact_user),
|
|
49
|
+
method: :delete,
|
|
50
|
+
form: { data: { turbo_confirm: t('collavre.users.destroy.confirm_ai') } },
|
|
51
|
+
class: "danger-link" %>
|
|
52
|
+
<% end %>
|
|
53
|
+
</td>
|
|
54
|
+
<% end %>
|
|
55
|
+
</tr>
|
|
56
|
+
<% end %>
|
|
57
|
+
</tbody>
|
|
58
|
+
</table>
|
|
59
|
+
</div>
|
|
60
|
+
<% else %>
|
|
61
|
+
<p class="text-muted"><%= t('collavre.contacts.empty_state') %></p>
|
|
62
|
+
<% end %>
|
|
63
|
+
|
|
64
|
+
<% if total_contact_pages.to_i > 1 %>
|
|
65
|
+
<nav class="contact-pagination">
|
|
66
|
+
<% prev_page = contact_page.to_i - 1 %>
|
|
67
|
+
<% next_page = contact_page.to_i + 1 %>
|
|
68
|
+
<% if contact_page.to_i > 1 %>
|
|
69
|
+
<%= link_to t('collavre.contacts.pagination.prev'), collavre.user_path(Current.user, tab: 'contacts', contact_page: prev_page), class: 'pagination-button' %>
|
|
70
|
+
<% end %>
|
|
71
|
+
<span class="pagination-status"><%= t('collavre.contacts.pagination.page_info', current: contact_page, total: total_contact_pages) %></span>
|
|
72
|
+
<% if contact_page.to_i < total_contact_pages.to_i %>
|
|
73
|
+
<%= link_to t('collavre.contacts.pagination.next'), collavre.user_path(Current.user, tab: 'contacts', contact_page: next_page), class: 'pagination-button' %>
|
|
74
|
+
<% end %>
|
|
75
|
+
</nav>
|
|
76
|
+
<% end %>
|
|
77
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<% unless local_assigns[:skip_name_field] %>
|
|
2
|
+
<%= form.text_field :name,
|
|
3
|
+
autofocus: true,
|
|
4
|
+
required: true,
|
|
5
|
+
placeholder: t('collavre.users.new.enter_your_name'),
|
|
6
|
+
class: "stacked-form-control" %>
|
|
7
|
+
<% end %>
|
|
8
|
+
<%= form.email_field :email,
|
|
9
|
+
required: true,
|
|
10
|
+
autocomplete: "username",
|
|
11
|
+
placeholder: t('collavre.users.new.enter_your_email'),
|
|
12
|
+
value: (form.object.respond_to?(:email) && form.object.email.presence) || params[:email],
|
|
13
|
+
readonly: local_assigns[:disable_email],
|
|
14
|
+
class: "stacked-form-control" %>
|
|
15
|
+
<% is_login_form = local_assigns[:skip_name_field] %>
|
|
16
|
+
<%= form.password_field :password,
|
|
17
|
+
required: true,
|
|
18
|
+
autocomplete: is_login_form ? "current-password" : "new-password",
|
|
19
|
+
placeholder: t('collavre.users.new.enter_your_password'),
|
|
20
|
+
minlength: is_login_form ? nil : Collavre::SystemSetting.password_min_length,
|
|
21
|
+
maxlength: 72,
|
|
22
|
+
class: "stacked-form-control" %>
|
|
23
|
+
<% unless is_login_form %>
|
|
24
|
+
<div class="help-text" style="font-size: 0.85em; color: var(--color-text-muted); margin-top: 0.25em; margin-bottom: 0.5em;">
|
|
25
|
+
<%= t('collavre.users.password_min_length_hint', count: Collavre::SystemSetting.password_min_length) %>
|
|
26
|
+
</div>
|
|
27
|
+
<% end %>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<h1 class="text-center" style="margin-top: 0;"><%= t('collavre.users.edit_ai.title') %></h1>
|
|
2
|
+
|
|
3
|
+
<%= form_with model: @user, url: collavre.update_ai_user_path(@user), method: :patch, class: "stacked-form" do |form| %>
|
|
4
|
+
<div class="form-group">
|
|
5
|
+
<%= form.label :name, t('collavre.users.new_ai.name_label') %>
|
|
6
|
+
<%= form.text_field :name, required: true, class: "stacked-form-control", placeholder: "e.g. My Bot" %>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="form-group">
|
|
10
|
+
<%= form.label :system_prompt, t('collavre.users.new_ai.system_prompt_label') %>
|
|
11
|
+
<%= form.text_area :system_prompt, required: true, class: "stacked-form-control", rows: 5 %>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="form-group">
|
|
15
|
+
<%= form.label :routing_expression, "Routing Expression (Liquid)" %>
|
|
16
|
+
<%= form.text_area :routing_expression, class: "stacked-form-control", rows: 2, placeholder: "chat.mentioned_user.id == agent.id" %>
|
|
17
|
+
<small class="form-text text-muted">Liquid expression to determine if this agent should handle an event. Example: <code>chat.mentioned_user.id == agent.id</code></small>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="form-group">
|
|
21
|
+
<%= form.label :llm_model, t('collavre.users.new_ai.model_label') %>
|
|
22
|
+
<div style="position: relative;"
|
|
23
|
+
data-controller="llm-model"
|
|
24
|
+
data-llm-model-menu-id-value="llm-model-suggestions"
|
|
25
|
+
data-llm-model-models-value="<%= Collavre::User::SUPPORTED_LLM_MODELS.to_json %>">
|
|
26
|
+
<%= form.text_field :llm_model,
|
|
27
|
+
required: true,
|
|
28
|
+
class: "stacked-form-control",
|
|
29
|
+
autocomplete: "off",
|
|
30
|
+
data: {
|
|
31
|
+
llm_model_target: "input",
|
|
32
|
+
action: "input->llm-model#search focus->llm-model#focus blur->llm-model#blur keydown->llm-model#handleKeydown"
|
|
33
|
+
} %>
|
|
34
|
+
<%= render UserMentionMenuComponent.new(menu_id: 'llm-model-suggestions') %>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="form-group">
|
|
39
|
+
<%= form.label :llm_api_key, t('collavre.users.new_ai.api_key_label') %>
|
|
40
|
+
<%= form.password_field :llm_api_key, class: "stacked-form-control", placeholder: "sk-...", value: @user.llm_api_key %>
|
|
41
|
+
<small class="form-text text-muted"><%= t('collavre.users.new_ai.api_key_help') %></small>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="form-group">
|
|
45
|
+
<label class="form-label"><%= t('collavre.users.edit_ai.tools_title') %></label>
|
|
46
|
+
<p class="text-muted small"><%= t('collavre.users.edit_ai.tools_description') %></p>
|
|
47
|
+
|
|
48
|
+
<% if @available_tools.any? %>
|
|
49
|
+
<div class="tools-selection">
|
|
50
|
+
<% @available_tools.each do |tool| %>
|
|
51
|
+
<div class="form-check mb-2">
|
|
52
|
+
<%= check_box_tag "user[tools][]", tool[:name], (@user.tools || []).include?(tool[:name]), id: "tool_#{tool[:name]}", class: "form-check-input" %>
|
|
53
|
+
<label class="form-check-label" for="tool_<%= tool[:name] %>">
|
|
54
|
+
<strong><%= tool[:name] %></strong>
|
|
55
|
+
<br>
|
|
56
|
+
<span class="text-muted small"><%= tool[:description] %></span>
|
|
57
|
+
</label>
|
|
58
|
+
<details class="ml-4">
|
|
59
|
+
<summary class="text-muted small" style="cursor: pointer;">Parameters</summary>
|
|
60
|
+
<pre class="small bg-light p-2 mt-1"><code><%= JSON.pretty_generate(tool[:parameters]) %></code></pre>
|
|
61
|
+
</details>
|
|
62
|
+
</div>
|
|
63
|
+
<% end %>
|
|
64
|
+
</div>
|
|
65
|
+
<% else %>
|
|
66
|
+
<p class="text-muted"><%= t('collavre.users.edit_ai.no_tools_found') %></p>
|
|
67
|
+
<% end %>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div class="form-group">
|
|
71
|
+
<div class="form-check">
|
|
72
|
+
<%= form.check_box :searchable, { class: "form-check-input" }, true, false %>
|
|
73
|
+
<%= form.label :searchable, t('collavre.users.new_ai.searchable_label'), class: "form-check-label" %>
|
|
74
|
+
</div>
|
|
75
|
+
<small class="form-text text-muted"><%= t('collavre.users.new_ai.searchable_help') %></small>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<%= form.button t('common.save'), type: "submit", class: "primary-action-button" %>
|
|
79
|
+
<% end %>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<h1 class="no-top-margin"><%= t('collavre.users.change_password') %></h1>
|
|
2
|
+
|
|
3
|
+
<%= form_with(model: @user, url: collavre.update_password_user_path(@user), method: :patch, local: true) do |form| %>
|
|
4
|
+
<%= tag.div(flash[:alert], class: "flash-alert") if flash[:alert] %>
|
|
5
|
+
<div>
|
|
6
|
+
<%= form.label :current_password, t('collavre.users.current_password') %><br>
|
|
7
|
+
<%= form.password_field :current_password, autocomplete: 'current-password', maxlength: 72 %>
|
|
8
|
+
</div>
|
|
9
|
+
<div>
|
|
10
|
+
<%= form.label :password, t('collavre.users.new_password') %><br>
|
|
11
|
+
<%= form.password_field :password, autocomplete: 'new-password', minlength: Collavre::SystemSetting.password_min_length, maxlength: 72 %>
|
|
12
|
+
<div class="help-text" style="font-size: 0.85em; color: var(--color-text-muted); margin-top: 0.25em;">
|
|
13
|
+
<%= t('collavre.users.password_min_length_hint', count: Collavre::SystemSetting.password_min_length) %>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div>
|
|
17
|
+
<%= form.label :password_confirmation, t('collavre.users.confirm_new_password') %><br>
|
|
18
|
+
<%= form.password_field :password_confirmation, autocomplete: 'new-password', minlength: Collavre::SystemSetting.password_min_length, maxlength: 72 %>
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<%= form.submit t('collavre.users.change_password') %>
|
|
22
|
+
</div>
|
|
23
|
+
<% end %>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<%= link_to t('collavre.users.back'), collavre.user_path(@user) %>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<% content_for :head do %>
|
|
2
|
+
<%= stylesheet_link_tag 'collavre/comments_popup', media: 'all' %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
<h1 class="no-top-margin"><%= t('collavre.users.index_title') %></h1>
|
|
6
|
+
|
|
7
|
+
<%= render "admin/shared/tabs" %>
|
|
8
|
+
|
|
9
|
+
<table>
|
|
10
|
+
<thead>
|
|
11
|
+
<tr>
|
|
12
|
+
<th><%= t('collavre.users.table.avatar') %></th>
|
|
13
|
+
<th><%= t('collavre.users.table.name') %></th>
|
|
14
|
+
<th><%= t('collavre.users.table.email') %></th>
|
|
15
|
+
<th><%= t('collavre.users.table.last_login_at') %></th>
|
|
16
|
+
<th><%= t('collavre.users.table.push_token') %></th>
|
|
17
|
+
<th><%= t('collavre.users.table.notifications') %></th>
|
|
18
|
+
<th><%= t('collavre.users.table.actions') %></th>
|
|
19
|
+
</tr>
|
|
20
|
+
</thead>
|
|
21
|
+
<tbody>
|
|
22
|
+
<% @users.each do |user| %>
|
|
23
|
+
<% last_login_at = user.sessions.max_by(&:updated_at)&.updated_at %>
|
|
24
|
+
<tr>
|
|
25
|
+
<td>
|
|
26
|
+
<%= render AvatarComponent.new(
|
|
27
|
+
user: user,
|
|
28
|
+
size: 20,
|
|
29
|
+
classes: "avatar comment-presence-avatar#{' inactive' if user.sessions.empty?}" ) %>
|
|
30
|
+
</td>
|
|
31
|
+
<td>
|
|
32
|
+
<% if user.ai_user? %>
|
|
33
|
+
<%= link_to user.display_name, collavre.edit_ai_user_path(user) %>
|
|
34
|
+
<% else %>
|
|
35
|
+
<%= user.display_name %>
|
|
36
|
+
<% end %>
|
|
37
|
+
</td>
|
|
38
|
+
<td><%= user.email %></td>
|
|
39
|
+
<td>
|
|
40
|
+
<% if last_login_at %>
|
|
41
|
+
<%= I18n.l(last_login_at, format: :short) %>
|
|
42
|
+
<% else %>
|
|
43
|
+
<%= t('collavre.users.table.last_login_unknown') %>
|
|
44
|
+
<% end %>
|
|
45
|
+
</td>
|
|
46
|
+
<td><%= user.devices.any? ? t('collavre.users.push_token_present') : t('collavre.users.push_token_absent') %></td>
|
|
47
|
+
<td>
|
|
48
|
+
<% case user.notifications_enabled %>
|
|
49
|
+
<% when true %>
|
|
50
|
+
<%= t('collavre.users.table.notifications_enabled') %>
|
|
51
|
+
<% when false %>
|
|
52
|
+
<%= t('collavre.users.table.notifications_disabled') %>
|
|
53
|
+
<% else %>
|
|
54
|
+
<%= t('collavre.users.table.notifications_unset') %>
|
|
55
|
+
<% end %>
|
|
56
|
+
</td>
|
|
57
|
+
<td>
|
|
58
|
+
<% if user != Current.user %>
|
|
59
|
+
<% if user.system_admin? %>
|
|
60
|
+
<%= button_to t('collavre.users.make_normal_user'),
|
|
61
|
+
collavre.revoke_system_admin_user_path(user),
|
|
62
|
+
method: :patch %>
|
|
63
|
+
<% else %>
|
|
64
|
+
<%= button_to t('collavre.users.make_system_admin'),
|
|
65
|
+
collavre.grant_system_admin_user_path(user),
|
|
66
|
+
method: :patch,
|
|
67
|
+
form: { data: { turbo_confirm: t('collavre.users.confirm_grant_system_admin') } } %>
|
|
68
|
+
<% end %>
|
|
69
|
+
<%= button_to t('collavre.users.delete'),
|
|
70
|
+
collavre.user_path(user),
|
|
71
|
+
method: :delete,
|
|
72
|
+
form: { data: { turbo_confirm: t('collavre.users.confirm_destroy') } } %>
|
|
73
|
+
<% else %>
|
|
74
|
+
<span class="text-muted"><%= t('collavre.users.table.current_user') %></span>
|
|
75
|
+
<% end %>
|
|
76
|
+
</td>
|
|
77
|
+
</tr>
|
|
78
|
+
<% end %>
|
|
79
|
+
</tbody>
|
|
80
|
+
</table>
|