From 707b1f9b945d1b887ab9c6612af917a42bdd75b0 Mon Sep 17 00:00:00 2001 From: emielvdveen Date: Tue, 5 Dec 2023 21:08:25 +0100 Subject: [PATCH] Added support for self hosting [WIP] --- .github/workflows/release.yml | 4 +- README.md | 11 +- SELFHOSTING.md | 156 +++++++ core/assets/static/images/icons/self.svg | 8 + core/assets/static/images/icons/self_wide.svg | 9 + core/bundles/link/.credo.exs | 145 ------ core/bundles/link/.formatter.exs | 5 - core/bundles/link/.gitignore | 1 - core/bundles/link/.projections.json | 8 - core/bundles/link/COPYING.md | 1 - core/bundles/link/bundle.ex | 50 -- core/bundles/link/config/config.exs | 32 -- core/bundles/link/config/dev.exs | 7 - core/bundles/link/lib/console/page.ex | 117 ----- core/bundles/link/lib/debug/page.ex | 67 --- core/bundles/link/lib/index/page.ex | 110 ----- .../link/lib/layouts/stripped/menu_builder.ex | 19 - .../link/lib/layouts/website/menu_builder.ex | 32 -- .../lib/layouts/workspace/menu_builder.ex | 58 --- core/bundles/link/lib/marketplace/page.ex | 140 ------ core/bundles/link/lib/menu/items.ex | 69 --- .../link/lib/onboarding/welcome_view.ex | 39 -- .../link/lib/onboarding/wizard_page.ex | 122 ----- .../link/lib/start_page_translations.ex | 3 - core/bundles/link/lib/start_pages.ex | 32 -- .../link/lib/user/session_controller.ex | 49 -- core/bundles/link/lib/user/session_html.ex | 14 - .../link/lib/user/session_html/new.html.heex | 135 ------ core/bundles/link/seeds.exs | 278 ----------- core/bundles/link/students.exs | 122 ----- core/bundles/next/config/config.exs | 4 +- .../next/lib/layouts/website/menu_builder.ex | 2 +- core/bundles/port/config/config.exs | 16 - .../port/lib/home/landing_page_controller.ex | 9 - .../port/lib/home/landing_page_html.ex | 5 - .../lib/home/landing_page_html/show.html.eex | 437 ------------------ core/bundles/port/start_page_translations.ex | 3 - core/bundles/{port => self}/bundle.ex | 20 +- core/bundles/self/config/config.exs | 16 + .../{port => self}/lib/console/page.ex | 55 ++- .../lib/layouts/stripped/menu_builder.ex | 4 +- .../lib/layouts/website/menu_builder.ex | 10 +- .../lib/layouts/workspace/menu_builder.ex | 12 +- core/bundles/{port => self}/lib/menu/items.ex | 4 +- .../lib/user/session_controller.ex | 2 +- .../{port => self}/lib/user/session_html.ex | 2 +- .../lib/user/session_html/new.html.heex | 0 core/bundles/self/start_page_translations.ex | 3 + core/bundles/{port => self}/start_pages.ex | 4 +- core/config/runtime.exs | 51 +- core/systems/admin/login_page.ex | 2 +- core/test/core/surfconext/plug_test.exs | 8 +- .../user_session_controller_test.exs | 2 +- .../core_web/live/user/confirm_token_test.exs | 2 +- 54 files changed, 309 insertions(+), 2207 deletions(-) create mode 100644 SELFHOSTING.md create mode 100644 core/assets/static/images/icons/self.svg create mode 100644 core/assets/static/images/icons/self_wide.svg delete mode 100644 core/bundles/link/.credo.exs delete mode 100644 core/bundles/link/.formatter.exs delete mode 100644 core/bundles/link/.gitignore delete mode 100644 core/bundles/link/.projections.json delete mode 100644 core/bundles/link/COPYING.md delete mode 100644 core/bundles/link/bundle.ex delete mode 100644 core/bundles/link/config/config.exs delete mode 100644 core/bundles/link/config/dev.exs delete mode 100644 core/bundles/link/lib/console/page.ex delete mode 100644 core/bundles/link/lib/debug/page.ex delete mode 100644 core/bundles/link/lib/index/page.ex delete mode 100644 core/bundles/link/lib/layouts/stripped/menu_builder.ex delete mode 100644 core/bundles/link/lib/layouts/website/menu_builder.ex delete mode 100644 core/bundles/link/lib/layouts/workspace/menu_builder.ex delete mode 100644 core/bundles/link/lib/marketplace/page.ex delete mode 100644 core/bundles/link/lib/menu/items.ex delete mode 100644 core/bundles/link/lib/onboarding/welcome_view.ex delete mode 100644 core/bundles/link/lib/onboarding/wizard_page.ex delete mode 100644 core/bundles/link/lib/start_page_translations.ex delete mode 100644 core/bundles/link/lib/start_pages.ex delete mode 100644 core/bundles/link/lib/user/session_controller.ex delete mode 100644 core/bundles/link/lib/user/session_html.ex delete mode 100644 core/bundles/link/lib/user/session_html/new.html.heex delete mode 100644 core/bundles/link/seeds.exs delete mode 100644 core/bundles/link/students.exs delete mode 100644 core/bundles/port/config/config.exs delete mode 100644 core/bundles/port/lib/home/landing_page_controller.ex delete mode 100644 core/bundles/port/lib/home/landing_page_html.ex delete mode 100644 core/bundles/port/lib/home/landing_page_html/show.html.eex delete mode 100644 core/bundles/port/start_page_translations.ex rename core/bundles/{port => self}/bundle.ex (64%) create mode 100644 core/bundles/self/config/config.exs rename core/bundles/{port => self}/lib/console/page.ex (57%) rename core/bundles/{port => self}/lib/layouts/stripped/menu_builder.ex (73%) rename core/bundles/{port => self}/lib/layouts/website/menu_builder.ex (65%) rename core/bundles/{port => self}/lib/layouts/workspace/menu_builder.ex (63%) rename core/bundles/{port => self}/lib/menu/items.ex (93%) rename core/bundles/{port => self}/lib/user/session_controller.ex (97%) rename core/bundles/{port => self}/lib/user/session_html.ex (89%) rename core/bundles/{port => self}/lib/user/session_html/new.html.heex (100%) create mode 100644 core/bundles/self/start_page_translations.ex rename core/bundles/{port => self}/start_pages.ex (85%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a623f7019..c4260b394 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: bundle: - description: "Bundle ID (link / next etc.)" + description: "Bundle ID (next)" required: true - default: "link" + default: "next" jobs: tagged-release: runs-on: ubuntu-20.04 diff --git a/README.md b/README.md index 0b5c68d5e..ef2239dac 100644 --- a/README.md +++ b/README.md @@ -21,20 +21,19 @@ Project implementing a SaaS platform based on interlinked modules called Systems * Lab * Questionnaire * Pool -* Data Donation * .. ### Bundles * Next -Primary bundle with all features available except Link specific features. -Next is hosted on: https://eyra.co +Primary bundle with all features available. Next is configured and maintained by Eyra and hosted on: https://eyra.co -* Link +* Self + +Customizable bundle that can be used to run Core on one of your own servers. +See [SELFHOSTING.md](SELFHOSTING.md) for detailed instructions. -Secundary bundle with only Panl specific features. -Link is hosted on: https://researchpanl.eu ## Banking Proxy diff --git a/SELFHOSTING.md b/SELFHOSTING.md new file mode 100644 index 000000000..6c102f7ef --- /dev/null +++ b/SELFHOSTING.md @@ -0,0 +1,156 @@ +# Self hosting + +## Development instructions + +### Setup + +0. Pre-requisite + + * Install [asdf](https://asdf-vm.com) + * Install [PostgreSQL Server](https://www.postgresql.org) + * Fork and clone branch `master` of this Mono repo. + * Register application on [Unsplash](https://unsplash.com/) which is used as an Image Catalog. + +1. Create a PostgreSQL database and replace the configurated values in `core/config/dev.exs` with your own: + + ```Elixir + # Configure your database + config :core, Core.Repo, + username: "postgres", + password: "postgres", + database: "self_dev", + ``` + +2. Install tools: + + ```sh + $ asdf plugin-add erlang + $ asdf plugin-add elixir + $ asdf plugin-add nodejs + + $ asdf install + ``` + + See `.tool-versions` for the exact versions that will be installed + +3. Install dependencies: + ```sh + $ cd core + $ make install + ``` + +4. Build Core (from core folder): + + ```sh + $ BUNDLE=self make build + ``` + +5. Run database migrations (from core folder) + + ```sh + $ mix ecto.migrate + ``` + +6. Run Core locally (from core folder): + + ```sh + $ BUNDLE=self make run + ``` + +8. Go to browser + + The Core app is running at: http://localhost:4000 + + +## Customizing + +### Branding + +* Replace [self.svg](core/assets/static/images/icons/self.svg) and [self_wide.svg](core/assets/static/images/icons/self_wide.svg) with your icons of choice. +* Change [footer.ex](core/lib/core_web/ui/footer.ex) to format the platform footer or remove it completely + +### Menu items + +* In [items.ex](core/bundles/self/lib/menu/items.ex) you will find all the menu items. Add custom items when required. + +Core supports the following page layouts: +* Stripped: minimalistic page without menu +* Website: menu at the top +* Workspace: menu on the left + +Change the menus here: +* [Stripped](core/bundles/self/lib/layouts/stripped/menu_builder.ex) +* [Website](core/bundles/self/lib/layouts/website/menu_builder.ex) +* [Workspace](core/bundles/self/lib/layouts/workspace/menu_builder.ex) + + +### Rate limiters + +To prevent users from exhausting resources on external services, Core uses rate limiters. The local configuration of rate limiters can be found in `core/config/dev.exs`: + +```Elixir +config :core, :rate, + prune_interval: 5 * 1000, + quotas: [ + [service: :azure_blob, limit: 1, unit: :call, window: :second, scope: :local], + [service: :azure_blob, limit: 100, unit: :byte, window: :second, scope: :local] + ] +``` + +.. and the production configuration can be found in `core/config/config.exs`: + +```Elixir +config :core, :rate, + prune_interval: 60 * 60 * 1000, + quotas: [ + [service: :azure_blob, limit: 1000, unit: :call, window: :minute, scope: :local], + [service: :azure_blob, limit: 10_000_000, unit: :byte, window: :day, scope: :local], + [service: :azure_blob, limit: 1_000_000_000, unit: :byte, window: :day, scope: :global] + ] +``` + +## Release instructions + +1. Create a Docker image + +```sh +$ cd core +$ docker build --build-arg VERSION=1.0.0 --build-arg BUNDLE=self . -t self:latest +$ docker image save self -o self.zip +``` + +2. Run the Docker image + +Required environment variables: + +| Variable | Description | Example value | +|---|---|---| +| APP_NAME | Core app name | "Self" | +| APP_DOMAIN | domain where the Core app is hosted | "my.server.com" | +| APP_MAIL_DOMAIN | Domain of your email (after the @) | "self.com" | +| APP_ADMINS | String with space seperated email adresses of the system admins, supports wildcards | "person1@self.com person2@self.com" | +| DB_USER | Username | \ | +| DB_PASS | Password | \ | +| DB_HOST | Hostname | "domain.where.database.lives" | +| DB_NAME | Name of the database in the PostgreSQL| "self_prod" | +| SECRET_KEY_BASE | 64-bit sequence of random characters | \ | +| STATIC_PATH | Path to folder where uploaded files can be stored | "/home/self/uploads" | +| UNSPLASH_ACCESS_KEY | Application access key registered on [Unsplash](https://unsplash.com/) (Image Catalog) | "hcejpnHRuFWL-fKXLYqhGBt1Dz0_tTjeNifgD01VkGE" | +| UNSPLASH_APP_NAME | Application name registered on [Unsplash](https://unsplash.com/) (Image Catalog) | "Self" | + +Optional environment variables: + +| Variable | Description | Example value | +|---|---|---| +| LOG_LEVEL | Console log level | "debug", "info", "warn", "error" | +| SENTRY_DSN | app monitoring | https://1234febac1234365cfe2d1fad616845b@o1234721120555008.ingest.sentry.io/1235721234883520" +| GOOGLE_SIGN_IN_CLIENT_ID | | "123466465353-mui7en8912341rpn6qaevb89rd01234.apps.googleusercontent.com" | +| GOOGLE_SIGN_IN_CLIENT_SECRET | | "Q_lSWMy1234nPhxof1234Xyc" | +| SURFCONEXT_SITE | SURFconext site | "https://connect.test.surfconext.nl" | +| SURFCONEXT_CLIENT_ID | SURFconext client ID | "self.com" | +| SURFCONEXT_CLIENT_SECRET | SURFconext client secret | "12343HieOjb1234hcBpL" | +| CONTENT_S3_PREFIX | Prefix for S3 content storage | "content" | +| FELDSPAR_S3_PREFIX | Prefix for S3 feldspar storage | "feldspar" | +| PUBLIC_S3_URL | Public accessable url of an S3 service | "https://self-public.s3.eu-central-1.amazonaws.com" | +| PUBLIC_S3_BUCKET | Name of the bucket on the S3 service | "self-prod" | +| DIST_HOSTS | Comma seperated list of hosts in the cluster, see: [OTP Distribution](https://elixirschool.com/en/lessons/advanced/otp_distribution) | "one, two" | \ No newline at end of file diff --git a/core/assets/static/images/icons/self.svg b/core/assets/static/images/icons/self.svg new file mode 100644 index 000000000..00b692120 --- /dev/null +++ b/core/assets/static/images/icons/self.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/assets/static/images/icons/self_wide.svg b/core/assets/static/images/icons/self_wide.svg new file mode 100644 index 000000000..65ba8143d --- /dev/null +++ b/core/assets/static/images/icons/self_wide.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/core/bundles/link/.credo.exs b/core/bundles/link/.credo.exs deleted file mode 100644 index 488f77fc7..000000000 --- a/core/bundles/link/.credo.exs +++ /dev/null @@ -1,145 +0,0 @@ -%{ - configs: [ - %{ - name: "default", - files: %{ - included: [ - "lib/", - "src/", - "test/", - "web/", - "apps/*/lib/", - "apps/*/src/", - "apps/*/test/", - "apps/*/web/" - ], - excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] - }, - plugins: [], - requires: [], - strict: false, - parse_timeout: 5000, - color: true, - checks: [ - # - ## Consistency Checks - # - {Credo.Check.Consistency.ExceptionNames, []}, - {Credo.Check.Consistency.LineEndings, []}, - {Credo.Check.Consistency.ParameterPatternMatching, []}, - {Credo.Check.Consistency.SpaceAroundOperators, []}, - {Credo.Check.Consistency.SpaceInParentheses, []}, - {Credo.Check.Consistency.TabsOrSpaces, []}, - - # - ## Design Checks - # - # You can customize the priority of any check - # Priority values are: `low, normal, high, higher` - # - {Credo.Check.Design.AliasUsage, - [priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, - # You can also customize the exit_status of each check. - # If you don't want TODO comments to cause `mix credo` to fail, just - # set this value to 0 (zero). - # - {Credo.Check.Design.TagTODO, [exit_status: 2]}, - {Credo.Check.Design.TagFIXME, false}, - - # - ## Readability Checks - # - {Credo.Check.Readability.AliasOrder, []}, - {Credo.Check.Readability.FunctionNames, []}, - {Credo.Check.Readability.LargeNumbers, []}, - {Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, - {Credo.Check.Readability.ModuleAttributeNames, []}, - {Credo.Check.Readability.ModuleDoc, false}, - {Credo.Check.Readability.ModuleNames, []}, - {Credo.Check.Readability.ParenthesesInCondition, []}, - {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}, - {Credo.Check.Readability.PredicateFunctionNames, []}, - {Credo.Check.Readability.PreferImplicitTry, []}, - {Credo.Check.Readability.RedundantBlankLines, []}, - {Credo.Check.Readability.Semicolons, []}, - {Credo.Check.Readability.SpaceAfterCommas, []}, - {Credo.Check.Readability.StringSigils, []}, - {Credo.Check.Readability.TrailingBlankLine, []}, - {Credo.Check.Readability.TrailingWhiteSpace, []}, - {Credo.Check.Readability.UnnecessaryAliasExpansion, []}, - {Credo.Check.Readability.VariableNames, []}, - - # - ## Refactoring Opportunities - # - {Credo.Check.Refactor.CondStatements, []}, - {Credo.Check.Refactor.CyclomaticComplexity, []}, - {Credo.Check.Refactor.FunctionArity, []}, - {Credo.Check.Refactor.LongQuoteBlocks, []}, - # {Credo.Check.Refactor.MapInto, []}, - {Credo.Check.Refactor.MatchInCondition, []}, - {Credo.Check.Refactor.NegatedConditionsInUnless, []}, - {Credo.Check.Refactor.NegatedConditionsWithElse, []}, - {Credo.Check.Refactor.Nesting, []}, - {Credo.Check.Refactor.UnlessWithElse, []}, - {Credo.Check.Refactor.WithClauses, []}, - - # - ## Warnings - # - {Credo.Check.Warning.ApplicationConfigInModuleAttribute, []}, - {Credo.Check.Warning.BoolOperationOnSameValues, []}, - {Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, - {Credo.Check.Warning.IExPry, []}, - {Credo.Check.Warning.IoInspect, []}, - # {Credo.Check.Warning.LazyLogging, []}, - {Credo.Check.Warning.MixEnv, false}, - {Credo.Check.Warning.OperationOnSameValues, []}, - {Credo.Check.Warning.OperationWithConstantResult, []}, - {Credo.Check.Warning.RaiseInsideRescue, []}, - {Credo.Check.Warning.UnusedEnumOperation, []}, - {Credo.Check.Warning.UnusedFileOperation, []}, - {Credo.Check.Warning.UnusedKeywordOperation, []}, - {Credo.Check.Warning.UnusedListOperation, []}, - {Credo.Check.Warning.UnusedPathOperation, []}, - {Credo.Check.Warning.UnusedRegexOperation, []}, - {Credo.Check.Warning.UnusedStringOperation, []}, - {Credo.Check.Warning.UnusedTupleOperation, []}, - {Credo.Check.Warning.UnsafeExec, []}, - - # - # Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) - - # - # Controversial and experimental checks (opt-in, just replace `false` with `[]`) - # - {Credo.Check.Consistency.MultiAliasImportRequireUse, false}, - {Credo.Check.Consistency.UnusedVariableNames, false}, - {Credo.Check.Design.DuplicatedCode, []}, - {Credo.Check.Readability.AliasAs, []}, - {Credo.Check.Readability.BlockPipe, false}, - {Credo.Check.Readability.ImplTrue, false}, - {Credo.Check.Readability.MultiAlias, false}, - {Credo.Check.Readability.SeparateAliasRequire, false}, - {Credo.Check.Readability.SinglePipe, false}, - {Credo.Check.Readability.Specs, false}, - {Credo.Check.Readability.StrictModuleLayout, false}, - {Credo.Check.Readability.WithCustomTaggedTuple, false}, - {Credo.Check.Refactor.ABCSize, false}, - {Credo.Check.Refactor.AppendSingleItem, false}, - {Credo.Check.Refactor.DoubleBooleanNegation, false}, - {Credo.Check.Refactor.ModuleDependencies, false}, - {Credo.Check.Refactor.NegatedIsNil, false}, - {Credo.Check.Refactor.PipeChainStart, false}, - {Credo.Check.Refactor.VariableRebinding, false}, - {Credo.Check.Warning.LeakyEnvironment, false}, - {Credo.Check.Warning.MapGetUnsafePass, false}, - {Credo.Check.Warning.UnsafeToAtom, false} - - # - # Custom checks can be created using `mix credo.gen.check`. - # - ] - } - ] -} diff --git a/core/bundles/link/.formatter.exs b/core/bundles/link/.formatter.exs deleted file mode 100644 index 8a6391c6a..000000000 --- a/core/bundles/link/.formatter.exs +++ /dev/null @@ -1,5 +0,0 @@ -[ - import_deps: [:ecto, :phoenix], - inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"], - subdirectories: ["priv/*/migrations"] -] diff --git a/core/bundles/link/.gitignore b/core/bundles/link/.gitignore deleted file mode 100644 index 82520ca12..000000000 --- a/core/bundles/link/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/tmp/ diff --git a/core/bundles/link/.projections.json b/core/bundles/link/.projections.json deleted file mode 100644 index d4ed001f2..000000000 --- a/core/bundles/link/.projections.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "test/*_test.exs": {"type": "test", "alternate": "lib/{}.ex"}, - "lib/*.ex": {"type": "code", "alternate": "test/{}_test.exs"}, - "lib/*.html.eex": {"type": "template"}, - "priv/**/migrations/*.exs": {"type": "migration"}, - "guides/*.md": {"type": "guide"}, - "config/*.exs": {"type": "config"} -} diff --git a/core/bundles/link/COPYING.md b/core/bundles/link/COPYING.md deleted file mode 100644 index 6b07d29bf..000000000 --- a/core/bundles/link/COPYING.md +++ /dev/null @@ -1 +0,0 @@ -(c) Copyright 2021 Vrije Universiteit Amsterdam, all rights reserved. diff --git a/core/bundles/link/bundle.ex b/core/bundles/link/bundle.ex deleted file mode 100644 index 8d8a05829..000000000 --- a/core/bundles/link/bundle.ex +++ /dev/null @@ -1,50 +0,0 @@ -# (c) Copyright 2021 Vrije Universiteit Amsterdam, all rights reserved. - -defmodule Link.Bundle do - defp include?() do - Application.fetch_env!(:core, :bundle) == :link - end - - def routes do - if include?() do - quote do - scope "/", Link do - pipe_through([:browser, :redirect_if_user_is_authenticated]) - get("/user/session", User.SessionController, :new) - post("/user/session", User.SessionController, :create) - end - - scope "/", Link do - pipe_through([:browser]) - delete("/user/session", User.SessionController, :delete) - end - - scope "/", Link do - pipe_through(:browser) - live("/", Index.Page) - end - - scope "/", Link do - pipe_through([:browser, :require_authenticated_user]) - live("/debug", Debug.Page) - live("/console", Console.Page) - live("/onboarding", Onboarding.WizardPage) - live("/marketplace", Marketplace.Page) - end - end - end - end - - def grants do - if include?() do - quote do - grant_access(Link.Debug.Page, [:visitor, :member]) - grant_access(Link.Index.Page, [:visitor, :member]) - grant_access(Link.Console.Page, [:member]) - grant_access(Link.Onboarding.WizardPage, [:member]) - grant_access(Link.Marketplace.Page, [:member]) - grant_access(Systems.Promotion.LandingPage, [:visitor, :member, :owner]) - end - end - end -end diff --git a/core/bundles/link/config/config.exs b/core/bundles/link/config/config.exs deleted file mode 100644 index 519a61f92..000000000 --- a/core/bundles/link/config/config.exs +++ /dev/null @@ -1,32 +0,0 @@ -import Config - -config :core, - start_pages: Link.StartPages, - menu_items: Link.Menu.Items, - workspace_menu_builder: Link.Layouts.Workspace.MenuBuilder, - website_menu_builder: Link.Layouts.Website.MenuBuilder, - stripped_menu_builder: Link.Layouts.Stripped.MenuBuilder - -config :core, CoreWeb.UserAuth, - researcher_signed_in_page: "/console", - participant_signed_in_page: "/console", - participant_onboarding_page: "/onboarding" - -config :core, :features, - sign_in_with_apple: false, - member_google_sign_in: false, - password_sign_in: false, - notification_mails: false, - debug_expire_force: false - -config :core, Core.SurfConext, limit_schac_home_organization: "vu.nl" - -config :core, :meta, - bundle_title: "Panl", - bundle: :link - -config :core, :rate, quotas: [] - -if config_env() === :dev do - import_config "#{config_env()}.exs" -end diff --git a/core/bundles/link/config/dev.exs b/core/bundles/link/config/dev.exs deleted file mode 100644 index 3a878508f..000000000 --- a/core/bundles/link/config/dev.exs +++ /dev/null @@ -1,7 +0,0 @@ -import Config - -config :core, :features, - member_google_sign_in: true, - google_sign_in: false, - password_sign_in: true, - debug_expire_force: true diff --git a/core/bundles/link/lib/console/page.ex b/core/bundles/link/lib/console/page.ex deleted file mode 100644 index aab5dd85b..000000000 --- a/core/bundles/link/lib/console/page.ex +++ /dev/null @@ -1,117 +0,0 @@ -defmodule Link.Console.Page do - @moduledoc """ - The console screen. - """ - use CoreWeb, :live_view - use CoreWeb.Layouts.Workspace.Component, :console - - alias Systems.{ - Campaign, - Budget - } - - alias Frameworks.Utility.ViewModelBuilder - - import CoreWeb.UI.Content - import CoreWeb.Layouts.Workspace.Component - - alias Frameworks.Pixel.Text - alias Systems.NextAction - - def mount(_params, _session, %{assigns: %{current_user: user} = assigns} = socket) do - preload = Campaign.Model.preload_graph(:down) - - next_best_action = NextAction.Public.next_best_action(user) - - wallets = - Budget.Public.list_wallets(user) - |> filter_wallets() - |> Enum.map(&Budget.WalletViewBuilder.view_model(&1, user)) - - contributions = - user - |> Campaign.Public.list_subject_campaigns(preload: preload) - |> Enum.map(&ViewModelBuilder.view_model(&1, {__MODULE__, :contribution}, assigns)) - - content_items = - user - |> Campaign.Public.list_owned_campaigns(preload: preload) - |> Enum.map(&ViewModelBuilder.view_model(&1, {__MODULE__, :content}, assigns)) - - socket = - socket - |> update_menus() - |> assign( - next_best_action: next_best_action, - wallets: wallets, - contributions: contributions, - content_items: content_items - ) - - {:ok, socket} - end - - defp filter_wallets(wallets) do - wallets - |> Enum.filter(&Budget.Public.wallet_is_active?(&1)) - end - - def handle_info({:handle_auto_save_done, _}, socket) do - socket |> update_menus() - {:noreply, socket} - end - - @impl true - def render(assigns) do - ~H""" - <.workspace title={dgettext("link-dashboard", "title")} menus={@menus}> - - - <%= if @next_best_action do %> -
- -
- <% end %> - <%= if Enum.count(@wallets) > 0 do %> -
- - <%= dgettext("link-dashboard", "book.accounts.title") %> - - - <.spacing value="XL" /> -
- <% end %> - <%= if Enum.count(@contributions) > 0 do %> -
- - <%= dgettext("eyra-campaign", "campaign.subject.title") %> - - <%= Enum.count(@contributions) %> - - <.list items={@contributions} /> - <.spacing value="XL" /> -
- <% end %> - <%= if Enum.count(@content_items) > 0 do %> -
- - <%= dgettext("link-dashboard", "recent-items.title") %> - - <.list items={@content_items} /> - <.spacing value="XL" /> -
- <% end %> - <%= if Enum.count(@contributions) + Enum.count(@content_items) == 0 do %> -
- <.empty - title={dgettext("eyra-dashboard", "empty.title")} - body={dgettext("eyra-dashboard", "empty.description")} - illustration="items" - /> -
- <% end %> -
- - """ - end -end diff --git a/core/bundles/link/lib/debug/page.ex b/core/bundles/link/lib/debug/page.ex deleted file mode 100644 index 11f1d4344..000000000 --- a/core/bundles/link/lib/debug/page.ex +++ /dev/null @@ -1,67 +0,0 @@ -defmodule Link.Debug.Page do - @moduledoc """ - The debug screen. - """ - use CoreWeb, :live_view - use CoreWeb.Layouts.Workspace.Component, :debug - alias CoreWeb.Router.Helpers, as: Routes - - alias CoreWeb.User - alias Systems.Email - import CoreWeb.Layouts.Workspace.Component - - def mount(_params, _session, socket) do - start_button = %{ - action: %{ - type: :redirect, - to: Routes.live_path(socket, Link.Onboarding.WizardPage) - }, - face: %{ - type: :primary, - label: "Start onboarding flow" - } - } - - { - :ok, - socket - |> assign( - start_button: start_button, - changesets: %{} - ) - |> update_menus() - } - end - - @impl true - def handle_event("save", _, socket) do - {:noreply, socket} - end - - def handle_info({:handle_auto_save_done, _}, socket) do - socket |> update_menus() - {:noreply, socket} - end - - @impl true - def render(assigns) do - ~H""" - <.workspace title={dgettext("link-ui", "debug.title")} menus={@menus}> - - - - Onboarding - <.spacing value="S" /> - <.wrap> - - - - - <.spacing value="XL" /> - <.live_component module={User.Forms.Debug} id={:user_debug} user={@current_user} /> - <.spacing value="XL" /> - <.live_component module={Email.DebugForm} id={:mail_debug} user={@current_user} /> - - """ - end -end diff --git a/core/bundles/link/lib/index/page.ex b/core/bundles/link/lib/index/page.ex deleted file mode 100644 index 78ea86d19..000000000 --- a/core/bundles/link/lib/index/page.ex +++ /dev/null @@ -1,110 +0,0 @@ -defmodule Link.Index.Page do - @moduledoc """ - The home screen. - """ - use CoreWeb, :live_view - use CoreWeb.Layouts.Website.Component, :index - - alias Frameworks.Pixel.Grid - alias Frameworks.Pixel.Card - alias Frameworks.Pixel.Panel - alias Frameworks.Pixel.Text - alias Frameworks.Pixel.Hero - - def mount(_params, _session, socket) do - { - :ok, - socket - |> update_menus() - } - end - - def cta_title(nil) do - dgettext("eyra-link", "member.card.title") - end - - def cta_title(current_user) do - dgettext("eyra-link", "member.profile.card.title", user: current_user.displayname) - end - - @impl true - def handle_event("menu-item-clicked", %{"action" => action}, socket) do - # toggle menu - {:noreply, push_redirect(socket, to: action)} - end - - def primary_cta_button_label(current_user) do - if current_user.researcher do - dgettext("eyra-link", "console-button") - else - dgettext("eyra-link", "marketplace.button") - end - end - - def primary_cta_path(socket, current_user) do - if current_user.researcher do - Routes.live_path(socket, Link.Console.Page) - else - Routes.live_path(socket, Link.Marketplace.Page) - end - end - - # data(current_user, :any) - @impl true - def render(assigns) do - ~H""" - <.website user={@current_user} user_agent={Browser.Ua.to_ua(@socket)} menus={@menus}> - <:hero> - - - - - -
- - <%= dgettext("eyra-link", "link.title") %> - - - <%= dgettext("eyra-link", "link.message") %> - - - <%= dgettext("eyra-link", "link.message.interested") %> - info@researchpanl.eu. - -
-
- <%= if @current_user do %> - - <% else %> - - <% end %> -
- - - -
-
- - """ - end -end diff --git a/core/bundles/link/lib/layouts/stripped/menu_builder.ex b/core/bundles/link/lib/layouts/stripped/menu_builder.ex deleted file mode 100644 index 0a6b7db49..000000000 --- a/core/bundles/link/lib/layouts/stripped/menu_builder.ex +++ /dev/null @@ -1,19 +0,0 @@ -defmodule Link.Layouts.Stripped.MenuBuilder do - @home_flags [ - desktop_navbar: [:wide], - mobile_menu: [:narrow] - ] - - @item_flags [ - desktop_navbar: [:icon], - mobile_navbar: [:icon] - ] - - @primary [] - @secondary [:language] - - use CoreWeb.Menu.Builder, home: :link - - @impl true - def include_map(_user), do: %{} -end diff --git a/core/bundles/link/lib/layouts/website/menu_builder.ex b/core/bundles/link/lib/layouts/website/menu_builder.ex deleted file mode 100644 index bad1cf69a..000000000 --- a/core/bundles/link/lib/layouts/website/menu_builder.ex +++ /dev/null @@ -1,32 +0,0 @@ -defmodule Link.Layouts.Website.MenuBuilder do - @home_flags [ - desktop_navbar: [:wide], - mobile_navbar: [:wide] - ] - - @item_flags [ - desktop_navbar: [default: [:title], language: [:icon]], - mobile_menu: [:icon, :title, :counter], - mobile_navbar: [:title] - ] - - @primary [ - :console, - :marketplace - ] - - @secondary [ - desktop_navbar: [:signin, :profile, :language], - mobile_menu: [:language, :signin, :profile], - mobile_navbar: [:menu] - ] - - use CoreWeb.Menu.Builder, home: :link - alias Core.Authorization - - @impl true - def include_map(user), - do: %{ - console: Authorization.can_access?(user, Link.Console.Page) - } -end diff --git a/core/bundles/link/lib/layouts/workspace/menu_builder.ex b/core/bundles/link/lib/layouts/workspace/menu_builder.ex deleted file mode 100644 index 574728e27..000000000 --- a/core/bundles/link/lib/layouts/workspace/menu_builder.ex +++ /dev/null @@ -1,58 +0,0 @@ -defmodule Link.Layouts.Workspace.MenuBuilder do - @home_flags [ - desktop_menu: [:wide], - tablet_menu: [:narrow], - mobile_navbar: [:wide] - ] - - @item_flags [ - desktop_menu: [:icon, :title, :counter], - tablet_menu: [:icon], - mobile_navbar: [:title], - mobile_menu: [:icon, :title, :counter] - ] - - @primary [ - default: [ - :console, - :admin, - :recruitment, - :pools, - :marketplace, - :funding, - :support, - :todo - ], - mobile_navbar: [] - ] - - @secondary [ - default: [ - :language, - :helpdesk, - :profile, - :debug - ], - mobile_navbar: [:menu] - ] - - use CoreWeb.Menu.Builder, home: :link - alias Core.Authorization - - alias Systems.{ - Pool, - Budget - } - - @impl true - def include_map(user), - do: %{ - console: Authorization.can_access?(user, Link.Console.Page), - funding: Authorization.can_access?(user, Budget.FundingPage), - recruitment: is_researcher?(user), - pools: has_pools?(user) - } - - defp is_researcher?(user), do: Map.get(user, :researcher, false) - defp has_pools?(user), do: not Enum.empty?(Pool.Public.list_owned(user)) -end diff --git a/core/bundles/link/lib/marketplace/page.ex b/core/bundles/link/lib/marketplace/page.ex deleted file mode 100644 index 3a262a700..000000000 --- a/core/bundles/link/lib/marketplace/page.ex +++ /dev/null @@ -1,140 +0,0 @@ -defmodule Link.Marketplace.Page do - @moduledoc """ - The home screen. - """ - use CoreWeb, :live_view - use CoreWeb.Layouts.Workspace.Component, :marketplace - - alias Systems.{ - Pool, - NextAction, - Campaign - } - - import CoreWeb.Layouts.Workspace.Component - alias Frameworks.Pixel.Grid - alias Frameworks.Pixel.Text - - def mount(_params, _session, %{assigns: %{current_user: user} = assigns} = socket) do - next_best_action = NextAction.Public.next_best_action(user) - user = socket.assigns[:current_user] - - preload = Campaign.Model.preload_graph(:down) - - subject_campaigns = Campaign.Public.list_subject_campaigns(user, preload: preload) - excluded_campaigns = Campaign.Public.list_excluded_campaigns(subject_campaigns) - exclude = subject_campaigns ++ excluded_campaigns - - exclusion_list = - exclude - |> Stream.map(fn campaign -> campaign.id end) - |> Enum.into(MapSet.new()) - - campaigns = - Pool.Public.list_by_user(user) - |> Campaign.Public.list_by_pools_and_submission_status([:accepted], - exclude: exclusion_list, - preload: preload - ) - |> filter_campaigns(socket) - |> sort_by_open_spot_count() - |> Enum.map(&ViewModelBuilder.view_model(&1, {__MODULE__, :card}, assigns)) - - campaign_count = Enum.count(campaigns) - - socket = - socket - |> update_menus() - |> assign(next_best_action: next_best_action) - |> assign(campaigns: campaigns) - |> assign(campaign_count: campaign_count) - - {:ok, socket} - end - - defp sort_by_open_spot_count(campaigns) when is_list(campaigns) do - Enum.sort_by(campaigns, &Campaign.Public.open_spot_count/1, :desc) - end - - defp filter_campaigns(campaigns, socket) when is_list(campaigns) do - Enum.filter(campaigns, &filter_campaign(&1, socket)) - end - - defp filter_campaign( - campaign, - %{assigns: %{current_user: user}} - ) do - case Campaign.Public.validate_open(campaign, user) do - :ok -> true - _ -> false - end - end - - def handle_info({:handle_auto_save_done, _}, socket) do - socket |> update_menus() - {:noreply, socket} - end - - @impl true - def handle_event( - "card_clicked", - %{"item" => card_id}, - %{assigns: %{campaigns: campaigns}} = socket - ) do - card_id = String.to_integer(card_id) - %{path: path} = Enum.find(campaigns, &(&1.id == card_id)) - - { - :noreply, - push_redirect(socket, to: path) - } - end - - @impl true - def handle_event("menu-item-clicked", %{"action" => action}, socket) do - # toggle menu - {:noreply, push_redirect(socket, to: action)} - end - - def render_empty?(%{campaign_count: campaign_count}) do - not feature_enabled?(:marketplace) or campaign_count == 0 - end - - @impl true - def render(assigns) do - ~H""" - <.workspace title={dgettext("eyra-ui", "marketplace.title")} menus={@menus}> - - - <%= if @next_best_action do %> -
- -
-
- <% end %> - <%= if render_empty?(assigns) do %> - <.empty - title={dgettext("eyra-marketplace", "empty.title")} - body={dgettext("eyra-marketplace", "empty.description")} - illustration="cards" - /> - <% else %> - - <%= dgettext("eyra-campaign", "campaign.all.title") %> - <%= @campaign_count %> - - - <%= for card <- @campaigns do %> -
- -
- <% end %> -
- <% end %> - - - """ - end -end diff --git a/core/bundles/link/lib/menu/items.ex b/core/bundles/link/lib/menu/items.ex deleted file mode 100644 index 76b9fb5ba..000000000 --- a/core/bundles/link/lib/menu/items.ex +++ /dev/null @@ -1,69 +0,0 @@ -defmodule Link.Menu.Items do - @behaviour CoreWeb.Menu.ItemsProvider - - use CoreWeb, :verified_routes - import CoreWeb.Gettext - - @impl true - def values() do - %{ - debug: %{ - action: %{type: :redirect, to: "/debug"}, - title: dgettext("eyra-ui", "menu.item.debug") - }, - marketplace: %{ - action: %{type: :redirect, to: "/marketplace"}, - title: dgettext("eyra-ui", "menu.item.marketplace") - }, - link: %{action: %{type: :redirect, to: ~p"/"}, title: "Panl"}, - admin: %{ - action: %{type: :redirect, to: ~p"/admin/config"}, - title: dgettext("eyra-ui", "menu.item.admin") - }, - support: %{ - action: %{type: :redirect, to: ~p"/support/ticket"}, - title: dgettext("eyra-ui", "menu.item.support") - }, - console: %{ - action: %{type: :redirect, to: ~p"/console"}, - title: dgettext("eyra-ui", "menu.item.console") - }, - todo: %{ - action: %{type: :redirect, to: ~p"/todo"}, - title: dgettext("eyra-ui", "menu.item.todo") - }, - helpdesk: %{ - action: %{type: :redirect, to: ~p"/support/helpdesk"}, - title: dgettext("eyra-ui", "menu.item.helpdesk") - }, - profile: %{ - action: %{type: :redirect, to: ~p"/user/profile"}, - title: dgettext("eyra-ui", "menu.item.profile") - }, - signout: %{ - action: %{type: :http_delete, to: ~p"/user/session"}, - title: dgettext("eyra-ui", "menu.item.signout") - }, - signin: %{ - action: %{type: :http_get, to: ~p"/user/signin"}, - title: dgettext("eyra-ui", "menu.item.signin") - }, - funding: %{ - action: %{type: :redirect, to: ~p"/funding"}, - title: dgettext("eyra-ui", "menu.item.funding") - }, - pools: %{ - action: %{type: :redirect, to: ~p"/pool"}, - title: dgettext("link-ui", "menu.item.pools") - }, - recruitment: %{ - action: %{type: :redirect, to: ~p"/recruitment"}, - title: dgettext("link-ui", "menu.item.recruitment") - }, - menu: %{ - action: %{type: :click, code: "mobile_menu = !mobile_menu"}, - title: dgettext("eyra-ui", "menu.item.menu") - } - } - end -end diff --git a/core/bundles/link/lib/onboarding/welcome_view.ex b/core/bundles/link/lib/onboarding/welcome_view.ex deleted file mode 100644 index 5e29c43f7..000000000 --- a/core/bundles/link/lib/onboarding/welcome_view.ex +++ /dev/null @@ -1,39 +0,0 @@ -defmodule Link.Onboarding.WelcomeView do - use CoreWeb, :live_component - - alias Frameworks.Pixel.Text - @impl true - def update(%{id: id, props: %{user: user}}, socket) do - title = dgettext("link-ui", "onboarding.welcome.title", member: user.displayname || "") - - { - :ok, - socket - |> assign(id: id) - |> assign(user: user) - |> assign(title: title) - } - end - - @impl true - def render(assigns) do - ~H""" -
- - - -
-
- -
- <%= @title %> -
- <%= dgettext("link-ui", "onboarding.welcome.description") %> -
-
-
-
-
- """ - end -end diff --git a/core/bundles/link/lib/onboarding/wizard_page.ex b/core/bundles/link/lib/onboarding/wizard_page.ex deleted file mode 100644 index 40e124a32..000000000 --- a/core/bundles/link/lib/onboarding/wizard_page.ex +++ /dev/null @@ -1,122 +0,0 @@ -defmodule Link.Onboarding.WizardPage do - @moduledoc """ - The home screen. - """ - use CoreWeb, :live_view - use CoreWeb.Layouts.Stripped.Component, :onboarding - - import CoreWeb.Gettext - - alias Core.Accounts - alias Link.Onboarding.WelcomeView, as: Welcome - alias CoreWeb.User.Forms.Student, as: StudentForm - alias CoreWeb.User.Forms.Features, as: FeaturesForm - - alias CoreWeb.UI.Tabbar - alias Frameworks.Pixel.Button - alias CoreWeb.UI.Navigation - - def mount(_params, _session, socket) do - tabs = create_tabs(socket) - tabbar_id = "onboarding" - - finish_button = %{ - action: %{ - type: :send, - event: "finish" - }, - face: %{ - type: :primary, - label: dgettext("eyra-ui", "onboarding.forward") - } - } - - { - :ok, - socket - |> assign( - tabbar_id: tabbar_id, - tabs: tabs, - finish_button: finish_button, - changesets: %{} - ) - |> update_menus() - } - end - - @impl true - def handle_event("finish", _, %{assigns: %{current_user: current_user}} = socket) do - Accounts.mark_as_visited(current_user, :onboarding) - {:noreply, push_redirect(socket, to: forward_path(socket))} - end - - def handle_info({:handle_auto_save_done, _}, socket) do - socket |> update_menus() - {:noreply, socket} - end - - defp append(list, extra, cond \\ true) do - if cond, do: list ++ [extra], else: list - end - - defp create_tabs(%{assigns: %{current_user: current_user}}) do - [] - |> append(%{ - id: :welcome, - title: dgettext("eyra-ui", "tabbar.item.welcome"), - forward_title: dgettext("eyra-ui", "tabbar.item.welcome.forward"), - live_component: Welcome, - props: %{user: current_user}, - type: :sheet, - active: true - }) - |> append( - %{ - id: :student, - title: dgettext("eyra-ui", "tabbar.item.student"), - forward_title: dgettext("eyra-ui", "tabbar.item.student.forward"), - live_component: StudentForm, - props: %{user: current_user}, - type: :form - }, - current_user.student - ) - |> append(%{ - id: :features, - action: nil, - title: dgettext("eyra-ui", "tabbar.item.features"), - forward_title: dgettext("eyra-ui", "tabbar.item.features.forward"), - live_component: FeaturesForm, - props: %{user: current_user}, - type: :form - }) - end - - defp forward_path(socket) do - page = forward_page(socket) - Routes.live_path(socket, page) - end - - defp forward_page(%{assigns: %{current_user: %{researcher: true}}}), do: Link.Console.Page - defp forward_page(_), do: Link.Marketplace.Page - - # data(tabbar_id, :string) - # data(user_agent, :string, default: "") - # data(current_user, :any) - # data(tabs, :any) - - @impl true - def render(assigns) do - ~H""" - <.stripped menus={@menus}> - - - - - - - - - """ - end -end diff --git a/core/bundles/link/lib/start_page_translations.ex b/core/bundles/link/lib/start_page_translations.ex deleted file mode 100644 index 7d7a80ec9..000000000 --- a/core/bundles/link/lib/start_page_translations.ex +++ /dev/null @@ -1,3 +0,0 @@ -defmodule Link.StartPageTranslations do - use Link.StartPages -end diff --git a/core/bundles/link/lib/start_pages.ex b/core/bundles/link/lib/start_pages.ex deleted file mode 100644 index 6c428170b..000000000 --- a/core/bundles/link/lib/start_pages.ex +++ /dev/null @@ -1,32 +0,0 @@ -defmodule Link.StartPages do - @behaviour CoreWeb.StartPageProvider - - def pages(), - do: %{ - console: %{id: :console, path: "/console", domain: "eyra-ui"}, - marketplace: %{id: :marketplace, path: "/marketplace", domain: "eyra-ui"} - } - - @impl true - def values(), - do: %{ - researcher: pages().console, - student: pages().console, - coordinator: pages().console, - member: pages().console - } - - defmacro __using__(_opts) do - quote do - import CoreWeb.Gettext - - unquote do - for {id, %{domain: domain}} <- Link.StartPages.pages() do - quote do - dgettext(unquote(domain), unquote("start.page.#{id}")) - end - end - end - end - end -end diff --git a/core/bundles/link/lib/user/session_controller.ex b/core/bundles/link/lib/user/session_controller.ex deleted file mode 100644 index 47aaeb1ef..000000000 --- a/core/bundles/link/lib/user/session_controller.ex +++ /dev/null @@ -1,49 +0,0 @@ -defmodule Link.User.SessionController do - use CoreWeb, :controller - import CoreWeb.Gettext - - plug(:setup_sign_in_with_apple, :core when action != :delete) - - defp setup_sign_in_with_apple(conn, otp_app) do - if feature_enabled?(:signin_with_apple) do - conf = Application.fetch_env!(otp_app, SignInWithApple) - SignInWithApple.Helpers.setup_session(conn, conf) - end - end - - def new(conn, _params) do - conn - |> set_return_to() - |> render_new() - end - - defp set_return_to(conn) do - return_to = Map.get(conn.query_params, "return_to") - if return_to, do: put_session(conn, :user_return_to, return_to), else: conn - end - - def create(conn, %{"user" => user_params}) do - require_feature(:password_sign_in) - %{"email" => email, "password" => password} = user_params - - if user = Core.Accounts.get_user_by_email_and_password(email, password) do - CoreWeb.UserAuth.log_in_user(conn, user, false, user_params) - else - message = dgettext("eyra-user", "Invalid email or password") - - conn - |> put_flash(:error, message) - |> render_new() - end - end - - defp render_new(conn) do - redirect(conn, to: ~p"/user/signin") - end - - def delete(conn, _params) do - conn - |> put_flash(:info, dgettext("eyra-user", "Signed out successfully")) - |> CoreWeb.UserAuth.log_out_user() - end -end diff --git a/core/bundles/link/lib/user/session_html.ex b/core/bundles/link/lib/user/session_html.ex deleted file mode 100644 index b02ce6aa0..000000000 --- a/core/bundles/link/lib/user/session_html.ex +++ /dev/null @@ -1,14 +0,0 @@ -defmodule Link.User.SessionHTML do - use CoreWeb, :html - - import CoreWeb.UI.Footer - import CoreWeb.UI.Language - import Frameworks.Pixel.Form - - embed_templates("session_html/*") - - def sign_in_with_apple_button(conn) do - config = Application.fetch_env!(:core, SignInWithApple) - {:safe, SignInWithApple.Helpers.html_sign_in_button(conn, config)} - end -end diff --git a/core/bundles/link/lib/user/session_html/new.html.heex b/core/bundles/link/lib/user/session_html/new.html.heex deleted file mode 100644 index 724191173..000000000 --- a/core/bundles/link/lib/user/session_html/new.html.heex +++ /dev/null @@ -1,135 +0,0 @@ -
-
-
-
-
-
-
-
-
-
- - {@bundle_title} - -
-
-
-
-
<.language redir={@request_path}/>
-
-
-
-
-
-
- -
-
- -
- <%= dgettext("eyra-account", "login.title") %> -
- -
-
- <%= dgettext("eyra-account", "login.surf.message.part1") %> - SURFconext. - <%= dgettext("eyra-account", "login.surf.message.part2") %> - <%= dgettext("eyra-account", "login.surf.message.part3")%>. -
-
- -
-
-
- -
-
-
-
- <%= dgettext("eyra-account", "login.surf.button") %> -
-
-
-
-
-
-
- - <%= if feature_enabled?(:member_google_sign_in) do %> - -
-
-
- -
-
-
-
- <%= dgettext("eyra-account", "login.google.button") %> -
-
-
-
-
-
- -
- <% end %> - - <%= if feature_enabled?(:sign_in_with_apple) do %> -
-
- <%= sign_in_with_apple_button(@conn) %> -
- -
- <% end %> - - <%= if feature_enabled?(:password_sign_in) do %> -
- - <%= form_for @conn, ~p"/user/session", [as: :user], fn f -> %> - <.email_input form={f} field={:email} label_text="aap" reserve_error_space={false} /> - <.password_input form={f} field={:password} label_text={dgettext("eyra-account", "password.label")} reserve_error_space={false} /> - -
- <%= submit "Log in", class: "w-full pt-15px pb-15px active:pt-4 active:pb-14px active:shadow-top4px leading-none font-button text-button text-white focus:outline-none rounded pr-4 pl-4 bg-grey1" %> -
- -
-
- <%= checkbox f, :remember_me %> -
- <%= label f, :remember_me, "Blijf ingelogd voor 60 dagen" %> -
-
- - <% end %> - -
-
- <%= link dgettext("eyra-user", "register.link"), to: Routes.live_path(@conn, CoreWeb.User.Signup), class: "text-primary text-link font-link hover:text-black underline focus:outline-none" %> -
|
- <%= link dgettext("eyra-user", "reset.link"), to: Routes.live_path(@conn, CoreWeb.User.ResetPassword), class: "text-primary text-link font-link hover:text-black underline focus:outline-none" %> -
- <% end %> -
-
-
-
-
- <.content_footer /> -
-
-
-
-
-
-
-
diff --git a/core/bundles/link/seeds.exs b/core/bundles/link/seeds.exs deleted file mode 100644 index 0ffd58e0a..000000000 --- a/core/bundles/link/seeds.exs +++ /dev/null @@ -1,278 +0,0 @@ -# Script for populating the database. You can run it as: -# -# mix run priv/repo/seeds.exs -# -# Inside the script, you can read and write to any of your -# repositories directly: -# -# Core.Repo.insert!(%Link.SomeSchema{}) -# -# We recommend using the bang functions (`insert!`, `update!` -# and so on) as they will fail if something goes wrong. -# -# -student_count = 1500 -researcher_count = 100 -researchers_per_campaign = 5 -lab_count = 200 -alliance_count = 600 -time_slots_per_lab = 20 -seats_per_time_slot = 20 - -alliance_url = "https://vuamsterdam.eu.qualtrics.com/jfe/form/SV_4Po8iTxbvcxtuaW" - -images = [ - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1600614908054-57142d1eec2b%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=seonghojang95&name=Seongho+Jang&blur_hash=LKLy%5B%2AMd0L%3FG%3B0XSE2xDyC%25f%24zI%3B", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1615884465870-85b936e70330%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=allthestories&name=Stori%C3%A8s&blur_hash=LMD9q%5BxuNGV%4000WBs%3Boz-qs%3As%3AR%2A", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1619035712435-a04e435edd4d%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=kirchhkreative&name=David+Kirchner&blur_hash=LOD%2BJ94%3A5%3B%3Dv0L%252rqozkrxDt7Io", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1623093177725-639e36469032%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=sjanelle&name=Sarah+Janelle&blur_hash=L69GR14%3A0z%25gTKRk%3DxNI56%25MjGV%40", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1624431403074-c83ccfe2475f%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=lukacskrisztina&name=Luk%C3%A1cs+Krisztina&blur_hash=LPEV%7B14noxt7~p9F%253t7ohITxbbH", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625080232707-722c9539124f%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=theshuttervision&name=Jonathan+Cooper&blur_hash=LVIhmWxuMxRj_NWBxuWB%25gS%24W.oz", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625088863595-59ef8d1fa12c%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=kevinwolf&name=Kevin+Wolf&blur_hash=LuLzEXozWBof~qxaWCay%25MRkoLay", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625125887424-ac3d7b1b96b5%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=timmossholder&name=Tim+Mossholder&blur_hash=LHCG%7DLIUHYt6%40ZI%3ATxsAH%40xaWCkW", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625153806634-28fc701e0499%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=sblaps&name=Scandinavian+Biolabs&blur_hash=LBO%7CeEozogj%5B~qofRkWBS5aeIUt7", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625220966725-4d43a556c7ba%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=andrew_haimerl&name=Andrew+Haimerl&blur_hash=LDCqK9%7DI5hEdNtS3jua%7D5g-E%3DgNY", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625265861167-d72dee66b913%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=chuko&name=Chuko+Cribb&blur_hash=LD9H2_-%3BIUIU00IUxuxu%3FbxuM%7BWB", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625267640835-93159f268cb9%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=vitormonthay&name=Vitor+Monthay&blur_hash=LUIz%40qWXayj%5Bp%7Boff6j%5BF%7Doej%40fk", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625301840042-f9323a348b62%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=markusspiske&name=Markus+Spiske&blur_hash=LIAwxN%2529ED%25pIxvRiIU4TNG%25h%25M", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625323906339-e6d57833ab3d%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=bbiddac&name=BBIDDAC+%E2%9C%A8&blur_hash=LB7%2Ci9Rk0%24xsOqWCrst69_oK-TWC", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625398523918-e525414db705%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=sebastianmark&name=Sebastian+Mark&blur_hash=LaLIpC1i%2CJ%24k%7Czn-SdJj5%2A%24fJ%24JP", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625425280013-3d7e38f88fd0%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=reddalec&name=Redd&blur_hash=LI9Zl%24t79uxa%252oeR%2Aj%5B0fRj-VNH", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625429911820-6039a76bd2f2%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=marekpiwnicki&name=Marek+Piwnicki&blur_hash=LdI464%24%23%24%25j%40~BkAbIs.%5EhX8kBW%3B", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625442634318-04e28fd12782%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=kalaniparker&name=Kellen+Riggin&blur_hash=LoH1%3D9-oIUxC~A-qRkt7%25ht7RjbH", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625482107418-828242ae20be%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=kristapsungurs&name=Kristaps+Ungurs&blur_hash=LvI%3Bq-WYIoWB~WWXf6js%3FHWXs%3Aj%5B", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625520997045-e3c7366ff76e%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=thisbaptista&name=Baptista+Ime+James&blur_hash=LFB.%3DcxFkWIp0%23WB%252R%2AS%25Ip%252%24%2A", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625523214628-4dec27885b68%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=kristapsungurs&name=Kristaps+Ungurs&blur_hash=LsHB-.n%24WCt7_NWAayof%3FaRjRjWB", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625590619376-90b9fc3e8fc9%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=gleblucky&name=Gleb+Lucky&blur_hash=LxF~s_RjtRj%5B_4ayofj%5Bx%5Dofaeae", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625602006137-f50c8e2e72b6%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=lackingnothing&name=Parker+Coffman&blur_hash=LEC~SCx%5BMwv%7D9Zwu%3D%7B-%3A0g-UxuIo", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625653769024-e3173efc4c6d%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=rubercuber&name=Ruben+Frivold&blur_hash=LTH_%23-~VwvsA-%3BS4S2oetmW%3Dj%5BWX", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625664241434-4a0d28032988%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=rylomedia&name=Ryan+Loughlin&blur_hash=LGB%3Aphoe%25MNG%3FwM%7BxuRjoNIoofWB", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625670332473-a91cc3f06766%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=thelifeofdev&name=Devon+Hawkins&blur_hash=L~Mj%3AhR-R%2Aof_NayayazWAayj%5BWB", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625672705429-48bb88df3c07%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=weareambitious&name=Ambitious+Creative+Co.++-+Rick+Barrett&blur_hash=LEGkg%5E595Dx%5DrpxuR%2An%24DNtPI.RP", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625685218928-84b31dc343fa%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=_iammax&name=Maximilian+Zahn&blur_hash=LMDcdgM%7B9aoI%3FwoexZNGb_t7RPt7", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625691988243-535762feee61%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=derickray&name=Derick+McKinney&blur_hash=LaJ%2An%3D-qW%3BR%2AITxut7t7_NWCxaxb", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625706982596-3c1cc516744c%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=vitormonthay&name=Vitor+Monthay&blur_hash=LIFEu%3DWX9baeIpxYxZWq0f%24%25f%2BNb", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625739839403-115ced427495%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=gbcaptured&name=Gelmis+Bartulis&blur_hash=LdP6%5Di%25M%25MRj%3FbRjf6WB~qM%7CM%7Bt7", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625762183076-471915509461%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=gaspo3&name=gaspar+zaldo&blur_hash=LA9s%7C%5E01-%3BIV%3FGD%25%3FaNGfkxaaKa%7C", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625775021321-01a40460b775%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=bullettrainnnnn&name=Oleg+Kryzhanovskyi&blur_hash=L96an--oIoV%40xuxaoJay0fIp%252t7", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625804863005-f69d16bd09e4%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=ryanbyrne&name=Ryan+Byrne&blur_hash=LoHvbT%24%25EMkB%3DdoLR%2BfQ0%23NbxZn%25", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625826961950-7a6bc29fdf57%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=ngocntmn&name=Minh+Ng%E1%BB%8Dc&blur_hash=LeI%7DCK%5E%25~V%25L%5E%25D%2As%3AWV%3D%7BM%7CRkxa", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625857695225-ddd5f160c064%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=rubercuber&name=Ruben+Frivold&blur_hash=LYLEWqIUIUIU~qWBjsaypJWWWVj%5B", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625859133277-8a0833ae984a%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=kerry_hu&name=Kerry+Hu&blur_hash=LLJHs%5BIoIUae~qM%7BV%40aeRkof%252Rj", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625910729129-a1a7e6095ec7%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=dayee&name=%E5%A4%A7%E7%88%B7+%E6%82%A8&blur_hash=LUDJt_WVR%2Ajs%3FwWVWCayS4oeWBj%5D", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625912720286-07e38d6689a7%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=msohebzaidi&name=Soheb+Zaidi&blur_hash=LOAc_F%25NM%7BR%2A_Nx%5DRPni%25%23xvVsWB", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625913952228-8d3fcc4ff5ac%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=andrew_haimerl&name=Andrew+Haimerl&blur_hash=LM7A%24PsqabkE%257juf5j%5DacWVkEad", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625924461741-e9b9ace57daf%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=eyespeak&name=Louisse+Lemuel+Enad&blur_hash=LVCZ%40Uxt8%5EM%7CMvWB%25Nt7M_ofxuWA", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1625941195536-c21885e3e8b2%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=zhpix&name=Pascal+Meier&blur_hash=LIC6omRk4oof-ooMM%7Baz01of-%3Bay", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626014318477-fda0efaaf3d8%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=fkaregan&name=Samuel+Regan-Asante&blur_hash=LNL%7B9%23xFNGxZ2bkWoJNb5%2CWXWVo0", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626024550745-6a1d664f73a5%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=bullettrainnnnn&name=Oleg+Kryzhanovskyi&blur_hash=L78%7D3-IUIUxu%25gxuayof00xu%25MRj", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626049728199-0aa4eeefb2e1%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=kalenemsley&name=Kalen+Emsley&blur_hash=LD9Z%2Bfi_Inozo%23RjWBs%3B0Jt7xuRj", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626073191564-f2257e44b965%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=star7a&name=Edwin+Chen&blur_hash=LcJk4VoKAcfQR4j%5BpJj%5B0Lj%5B%23%2Aa%7D", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626125903674-2ab25abf3030%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=timumphreys&name=Tim+Umphreys&blur_hash=L68%3B77-m0eXn4n9a-%3AaL4TSk-pa0", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626186282285-d7b87d60e867%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=kjenkz&name=Korie+Jenkins&blur_hash=LNA%2CUlad0KtR%3FbjED%25g4xwWAROkD", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626285954411-1b94da59b998%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=karsten116&name=Karsten+Winegeart&blur_hash=LKE.qm-%3AE%25xa%251-%3BoMRj0yjY%24iIo", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626286031129-aa1e2c113dc9%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=karsten116&name=Karsten+Winegeart&blur_hash=LnHoqIozRjo%23_4ozR%2CbIMyt7M%7CRj", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626336496111-d111e6139943%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=chuko&name=Chuko+Cribb&blur_hash=L%2CGlO%5DkDRjt7~qkDWAog%25MkCjsWC", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626341457473-a78bf16272fa%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=davidclode&name=David+Clode&blur_hash=LG5OXAWBIRoft8fQW9fjDzoexxWB", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626379801357-537572de4ad6%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=madalyncox&name=Madalyn+Cox&blur_hash=LJK%2C%3FH0zERRjNFE2E1kCEf9FNHad", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626497994786-88b134bd4a83%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=naomi_august&name=Naomi+August&blur_hash=LxH.QbD%2Aadt700sSozR%2BxuxuozV%40", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626497994786-88b134bd4a83%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=naomi_august&name=Naomi+August&blur_hash=LxH.QbD%2Aadt700sSozR%2BxuxuozV%40", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626515728846-d09aacfee23d%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=patrick_janser&name=Patrick+Janser&blur_hash=LhEUlh%251ofoe-Vs%3AoLj%5B0%23RljZay", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626546557620-6083b26916c8%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=shoots_of_bapt_&name=Baptiste&blur_hash=L44-X.NI10%24%24ENs.xYR%2C10xF%3DwNI", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626554539583-b8ac93f9159e%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=byfoul&name=Frankie+Cordoba&blur_hash=LDGu%2Cm_3~qxu_3WBfQayRjRjWBt7", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626609106372-ddad9ce60404%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=92designed&name=Christina+Deravedisian&blur_hash=LDBfz%2B%3FGofof~Vt6WVj%5BWDayayay", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626617977270-d7adb351c13d%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=chuttersnap&name=CHUTTERSNAP&blur_hash=LiKUs4IU4n%252~qWAR%25WBIBt7xuRj", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626631047919-3ebbbb76ddf3%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=purzlbaum&name=Claudio+Schwarz&blur_hash=L4D%5DuMt8-%3BM%7BtjRjt7M%7B8%5EofRiWA", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626696691538-77d05aab5baf%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=melonbelon&name=J+Lyu&blur_hash=LhKK~I%25M%25hRO_Nxtt6aeWUoejZtR", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626743715381-fe28d408ae3e%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=jayson_hinrichsen&name=Jayson+Hinrichsen&blur_hash=LKD9q%7BnMV%3FRk%3FwaKRiNHE2WVRjWV", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626827793937-a7897ded0424%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=tanleemarquis&name=Tanner+Marquis&blur_hash=LPD9%23O~qM%7BD%25xuayRjj%5BIURjt7ay", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626857719664-92a9b08d5a58%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=drskdr&name=Dasha+Yukhymyuk&blur_hash=LTF%3D~%3F%25ND%25.8D%25t7t7ay00M%7Bt7IU", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626861932431-737a6c4bca98%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=emmaou&name=Emma+Ou&blur_hash=LWL%3B4D0jE4kBM%7DM~a%23%25INHIqD-t3", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626926594516-0d884ec13614%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=zinco&name=Raul+De+Los+Santos&blur_hash=LGCG77Dh%251sS0Ks%3AxuWB4.tRR%2BNH", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626947245642-3e6dafa921fd%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=rcsalbum&name=Debashis+RC+Biswas&blur_hash=LA7.i%5Dj%5B8%24j%3FR%2BfPovkBH_ayt5j%5B", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1626978772479-a31d318224de%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=heftiba&name=Toa+Heftiba&blur_hash=LJA%5D%7BO9FM%7Cs.RkoLoLoe0K-%3BxaWC", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627020730845-1efa46677f0e%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=lgnwvr&name=LOGAN+WEAVER&blur_hash=LBECUm-%3DD%25_3H%3FR5V%3Fxa00s9o%7D9F", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627032171075-ed4c3c0ea490%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=r1ot&name=Yafiu+Ibrahim&blur_hash=Lc6wvFt%2CR4WBHYV%5Btlofxti_Rjbb", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627092611011-36459563a538%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=isaacmartin&name=Isaac+Martin&blur_hash=L23bdo%3D%7CDiD%24WYj%5BxZxZ0eEL%25g-%3B", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627140111251-efb505594a9b%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=jorikkleen&name=Jorik+Kleen&blur_hash=LUG%5BZnM%7BMx-%3B~WWAMxx%5DR-f5IVbc", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627244714766-94dab62ed964%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=nublson&name=Nubelson+Fernandes&blur_hash=L45g%7C%3F~CaHITNgI%5BM%7BRi54Int9xc", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627272145449-1cfd030037e7%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=jayson_hinrichsen&name=Jayson+Hinrichsen&blur_hash=LGFFd9w%5B~q_3%5E%2BD%25NeNH%3FbM_%25Lxa", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627301044065-fc950957c311%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=smithy_512&name=Ethan+Smith&blur_hash=LJLqX%3D_3D%25t7_NofR%2Bae%3FvITxtxu", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627346980717-02226f9ff7f6%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=tanleemarquis&name=Tanner+Marquis&blur_hash=L99%3F2t6M0eR%2AC5%3BOELs.56Na%5EjXS", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627361793048-a3550d91b34f%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=grievek1610begur&name=Kevin+Grieve&blur_hash=LQGJBL9FD%25oe8%5ERPtRRP4T%25goft7", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627382046740-15bf3a1a1fe7%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=galen_crout&name=Galen+Crout&blur_hash=LNIOnV9Z%3Fcnh~W%25MxuoK%25h-pxaSh", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627400334996-d9b4550a1516%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=sixteenmilesout&name=Sixteen+Miles+Out&blur_hash=LAHUwoxu_3-p~o-%3DIUbbM~RiD%24jG", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627433488375-61f25ad84e29%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=jxk&name=Jan+Kop%C5%99iva&blur_hash=LaL4mGRjt7xt3FD%2Axuoftmt7RjRk", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627481639106-2020e8d6ab20%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=andrew_haimerl&name=Andrew+Haimerl&blur_hash=LPDklIxZ5SjF0~R%2B-7fkELa%7Dozf%2B", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627552245715-77d79bbf6fe2%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=eberhardgross&name=eberhard+%F0%9F%96%90+grossgasteiger&blur_hash=LGEfA-~VNItRWVkW%25L%25LIpn%24IUt7", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627597324431-911a27b10899%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=s_midili&name=serjan+midili&blur_hash=LNFFa5R%2A%25gof0Kj%5Bj%5Bay%25hf6sVay", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627616031178-6ba663540b98%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=ralphkayden&name=Ralph+%28Ravi%29+Kayden&blur_hash=LaF62lV%3D0eIVRkoJs%3Ao2RQt7aKt7", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627627045944-a6171e94783a%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=phillipgold&name=Phillip+Goldsberry&blur_hash=LXF68%40ogW%3DoJ~qWBRjfPRjM%7BRiWB", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627631502740-db08f1bd686c%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=markbasarabvisuals&name=Mark+Basarab&blur_hash=LXEU.CIpW%3BoL%251oLWqay0g-oWCWV", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627651522140-94cf2e2a5ac0%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5OTM%26ixlib%3Drb-1.2.1&username=721y&name=chutipon+youngcharoen&blur_hash=L142C%2B%5ElHqD%25Y%2APUR4ml0%7Bo%23-pvz", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627673680358-b43bbf96f6f1%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDc5MzY%26ixlib%3Drb-1.2.1&username=reisgekkie&name=Gwenn+Klabbers&blur_hash=LYE%7B%25%3FIVs%3AkClVxaWBayo%23RjbIfQ", - "raw_url=https%3A%2F%2Fimages.unsplash.com%2Fphoto-1627682315217-2913898b6af8%3Fixid%3DMnwyMTY0MzZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2Mjc4MDgwNTk%26ixlib%3Drb-1.2.1&username=sushimi&name=Susanna+Marsiglia&blur_hash=LLNmi%7CxG9a%3Fw_N.9NF%3FIIqM_Ri%3Fc" -] - -password = "asdf;lkjASDF0987" - -_member = - Core.Factories.insert!(:member, %{ - email: "member@eyra.co", - password: password - }) - -_admin = - Core.Factories.insert!(:member, %{ - email: "admin@example.org", - password: password - }) - -researcher = - Core.Factories.insert!(:member, %{ - researcher: true, - email: "researcher@eyra.co", - password: password - }) - -{:ok, students} = - Core.Repo.transaction(fn -> - for _ <- 1..student_count do - Core.Factories.insert!(:member) - end - end) - -{:ok, researchers} = - Core.Repo.transaction(fn -> - for _ <- 1..researcher_count do - Core.Factories.insert!(:member, %{researcher: true}) - end - end) - -{:ok, labs} = - Core.Repo.transaction(fn -> - for _ <- 1..lab_count do - number_of_seats = :random.uniform(time_slots_per_lab) - reservation_count = :random.uniform(number_of_seats) - - %{ - type: :lab_tool, - promotion: %{ - title: Faker.Lorem.sentence() <> " (lab)", - subtitle: Faker.Lorem.sentence(), - description: Faker.Lorem.paragraph(), - image_id: Enum.random(images), - marks: ["vu"], - plugin: "lab" - }, - lab_tool: %{ - time_slots: - for _ <- 0..:random.uniform(time_slots_per_lab) do - %{ - start_time: Faker.DateTime.forward(365) |> DateTime.truncate(:second), - location: Faker.Lorem.sentence(), - number_of_seats: number_of_seats, - reservations: - Enum.take_random(students, reservation_count) - |> Enum.map(&%{user: &1, status: :reserved}) - } - end - } - } - end - end) - -{:ok, surveys} = - Core.Repo.transaction(fn -> - for _ <- 1..alliance_count do - %{ - type: :alliance_tool, - promotion: %{ - title: Faker.Lorem.sentence() <> " (survey)", - subtitle: Faker.Lorem.sentence(), - description: Faker.Lorem.paragraph(), - image_id: Enum.random(images), - marks: ["vu"], - plugin: "survey" - }, - alliance_tool: %{ - url: Faker.Internet.url(), - # desktop_enabled: true, - # phone_enabled: true, - # tablet_enabled: true, - subject_count: 56, - duration: "a while" - } - } - end - end) - -studies = labs ++ surveys - -Core.Repo.transaction( - fn -> - for campaign_data <- campaigns do - submission = - Core.Factories.build(:submission, %{ - parent_content_node: tool_content_node, - status: :accepted - }) - - campaign = - Core.Factories.insert!(:campaign, %{ - title: campaign_data.promotion.title, - description: "", - submissions: [submission] - }) - - {tool_type, campaign_data} = Map.pop!(campaign_data, :type) - {tool_data, campaign_data} = Map.pop!(campaign_data, tool_type) - {promotion_data, campaign_data} = Map.pop!(campaign_data, :promotion) - - promotion = - Core.Factories.insert!( - :promotion, - Map.merge( - %{ - parent_content_node: tool_content_node, - campaign: campaign - }, - promotion_data - ) - ) - - tool = - Core.Factories.insert!( - tool_type, - Map.merge( - %{content_node: tool_content_node, campaign: campaign, promotion: promotion}, - tool_data - ) - ) - - if tool_type == :alliance_tool do - participant_count = :random.uniform(tool.subject_count) - - for student <- Enum.take_random(students, participant_count) do - Systems.Survey.Public.apply_participant(tool, student) - end - end - - for owner <- - Enum.take_random(researchers, max(:random.uniform(researchers_per_campaign), 1)) do - Core.Authorization.assign_role( - owner, - campaign, - :owner - ) - end - - Core.Authorization.assign_role( - researcher, - campaign, - :owner - ) - end - end, - timeout: :infinity -) diff --git a/core/bundles/link/students.exs b/core/bundles/link/students.exs deleted file mode 100644 index 45f0700c1..000000000 --- a/core/bundles/link/students.exs +++ /dev/null @@ -1,122 +0,0 @@ -# Script for populating the database. You can run it as: -# -# mix run priv/repo/students.exs -# -# Inside the script, you can read and write to any of your -# repositories directly: -# -# Core.Repo.insert!(%Link.SomeSchema{}) -# -# We recommend using the bang functions (`insert!`, `update!` -# and so on) as they will fail if something goes wrong. -# -# -bk_1_student_count = 100 -bk_1_h_student_count = 10 -bk_2_student_count = 100 -bk_2_h_student_count = 10 -iba_1_student_count = 100 -iba_1_h_student_count = 10 -iba_2_student_count = 100 -iba_2_h_student_count = 10 - -password = "asdf;lkjASDF0987" - -{:ok, students} = - Core.Repo.transaction(fn -> - for _ <- 1..bk_1_student_count do - attrs = %{ - student: true, - password: password, - features: %Core.Accounts.Features{ - study_program_codes: [:vu_sbe_bk_1_year1_2021] - } - } - - Core.Factories.insert!(:student, attrs) - end - - for _ <- 1..bk_1_h_student_count do - attrs = %{ - student: true, - password: password, - features: %Core.Accounts.Features{ - study_program_codes: [:vu_sbe_bk_1_h_year1_2021] - } - } - - Core.Factories.insert!(:student, attrs) - end - - for _ <- 1..bk_2_student_count do - attrs = %{ - student: true, - password: password, - features: %Core.Accounts.Features{ - study_program_codes: [:vu_sbe_bk_2_year1_2021] - } - } - - Core.Factories.insert!(:student, attrs) - end - - for _ <- 1..bk_2_h_student_count do - attrs = %{ - student: true, - password: password, - features: %Core.Accounts.Features{ - study_program_codes: [:vu_sbe_bk_2_h_year1_2021] - } - } - - Core.Factories.insert!(:student, attrs) - end - - for _ <- 1..iba_1_student_count do - attrs = %{ - student: true, - password: password, - features: %Core.Accounts.Features{ - study_program_codes: [:vu_sbe_iba_1_year1_2021] - } - } - - Core.Factories.insert!(:student, attrs) - end - - for _ <- 1..iba_1_h_student_count do - attrs = %{ - student: true, - password: password, - features: %Core.Accounts.Features{ - study_program_codes: [:vu_sbe_iba_1_h_year1_2021] - } - } - - Core.Factories.insert!(:student, attrs) - end - - for _ <- 1..iba_2_student_count do - attrs = %{ - student: true, - password: password, - features: %Core.Accounts.Features{ - study_program_codes: [:vu_sbe_iba_2_year1_2021] - } - } - - Core.Factories.insert!(:student, attrs) - end - - for _ <- 1..iba_2_h_student_count do - attrs = %{ - student: true, - password: password, - features: %Core.Accounts.Features{ - study_program_codes: [:vu_sbe_iba_2_h_year1_2021] - } - } - - Core.Factories.insert!(:student, attrs) - end - end) diff --git a/core/bundles/next/config/config.exs b/core/bundles/next/config/config.exs index b237e91f7..bbc8626cf 100644 --- a/core/bundles/next/config/config.exs +++ b/core/bundles/next/config/config.exs @@ -8,8 +8,8 @@ config :core, stripped_menu_builder: Next.Layouts.Stripped.MenuBuilder config :core, CoreWeb.UserAuth, - researcher_signed_in_page: "/console", - participant_signed_in_page: "/console" + researcher_signed_in_page: "/project", + participant_signed_in_page: "/project" config :core, :features, sign_in_with_apple: false, diff --git a/core/bundles/next/lib/layouts/website/menu_builder.ex b/core/bundles/next/lib/layouts/website/menu_builder.ex index 11301d136..5fb947d13 100644 --- a/core/bundles/next/lib/layouts/website/menu_builder.ex +++ b/core/bundles/next/lib/layouts/website/menu_builder.ex @@ -24,6 +24,6 @@ defmodule Next.Layouts.Website.MenuBuilder do @impl true def include_map(user), do: %{ - console: Authorization.can_access?(user, Link.Console.Page) + console: Authorization.can_access?(user, Next.Console.Page) } end diff --git a/core/bundles/port/config/config.exs b/core/bundles/port/config/config.exs deleted file mode 100644 index 5160bd517..000000000 --- a/core/bundles/port/config/config.exs +++ /dev/null @@ -1,16 +0,0 @@ -import Config - -config :core, - start_pages: Port.StartPages, - menu_items: Port.Menu.Items, - workspace_menu_builder: Port.Layouts.Workspace.MenuBuilder, - website_menu_builder: Port.Layouts.Website.MenuBuilder, - stripped_menu_builder: Port.Layouts.Stripped.MenuBuilder - -config :core, CoreWeb.UserAuth, - researcher_signed_in_page: "/console", - participant_signed_in_page: "/console" - -config :core, :meta, - bundle_title: "Port", - bundle: :port diff --git a/core/bundles/port/lib/home/landing_page_controller.ex b/core/bundles/port/lib/home/landing_page_controller.ex deleted file mode 100644 index 21be5e5fd..000000000 --- a/core/bundles/port/lib/home/landing_page_controller.ex +++ /dev/null @@ -1,9 +0,0 @@ -defmodule Port.Home.LandingPageController do - use CoreWeb, :controller - - def show(conn, _) do - render(conn, "show.html") - end - - def layout(_), do: false -end diff --git a/core/bundles/port/lib/home/landing_page_html.ex b/core/bundles/port/lib/home/landing_page_html.ex deleted file mode 100644 index 9442794c7..000000000 --- a/core/bundles/port/lib/home/landing_page_html.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule Port.Home.LandingPageHTML do - use CoreWeb, :html - - embed_templates("landing_page_html/*") -end diff --git a/core/bundles/port/lib/home/landing_page_html/show.html.eex b/core/bundles/port/lib/home/landing_page_html/show.html.eex deleted file mode 100644 index cf9333c86..000000000 --- a/core/bundles/port/lib/home/landing_page_html/show.html.eex +++ /dev/null @@ -1,437 +0,0 @@ - - - - - - - - - - - - - - Home - - - - - - - - - - - -
- - - - -
- - -
-
-
-
-
-
- logo slack-2 -
-
-
-
-
-
- - - -
-
-
-
-
-
-

- Empowering
Science -

-
-
-
-
- illustration -
-
-
-
- - - -
-
-
-
-
-
-

- Co-creating sustainable research infrastructure -

-

- Co-creating sustainable research infrastructure -

-
-
-
-
-
-
- - - - - - - - -
-
-
-
-
-
- -
-

- Eyra Link -

-

- In collaboration with the VU, UvA and SURF, we are developing a sustainable online participant recruitment platform for social sciences and humanities research.

Funded by the PDI-SSH.
-

-
- vu - uva - surf -
-
-
-
-
-
-
-
-
-
-

- Project -

Rectangle%2023 -
-
-
-

- Eyra Port -

-

- In collaboration with the UU and UvA we are working on a tool that enables citizens to easily and safely donate their data from social media platforms like Instagram or Google for research.

Funded by the UU and PDI-SSH. -

-
- uu - uva -
-
-
-
-
-
-
-
-
-
-

- Project -

Rectangle%2023 -
-
-
-

- Eyra Next -

-

- A sustainable science dissemination platform that empowers transparent scientific practice and enables everyone to monitor the state-of-the-art in science.

Funded by Eyra. -

eyra logo -
-
-
-
-
-
-
- - - -
-
-
-
-

-

-
-
-
-
- Adrienne -
- Adriënne Mendrik -
-

- Adriënne is a visionary who reads between the lines and encourages people to improve upon the status quo, while keeping a close eye on how new ideas connect to existing frameworks.
-

-
-
- Emiel -
- Emiel van der Veen -
-

- Emiel is a visionary who excels in systematic thinking, challenges people to step up, and guides them into developing robust and high quality products that withstand the test of time.
-

-
-
- Peter -
- Peter Waterman -
-

- Peter is a people-oriented quick thinker with great listening skills who advices on long term company health, based on a broad experience in finance and general management.
-

-
-
- Neo -
- Neo Cheung -
-

- With his sharp eye and organised way of working, Neo quickly translates thoughts into design, while finding the right balance between client needs and user experience.
-

-
-
- Jeroen -
- Jeroen Vloothuis -
-

- With extensive technical knowledge and great analytical skills, Jeroen quickly solves complex problems with exceptional precision and elegance, while keeping things as simple as possible.
-

-
-
- Tjerk -
- Tjerk Nan -
-

- Products run smoothly and secure due to Tjerks eye for detail and passion for automation combined with extensive experience in security and DevOps.
-

-
-
- Rowdy -
- Rowdy van Looy -
-

- Rowdy excels in striking the right balance between stakeholder interests and technical feasibility, to find product and marketing strategies that fit the Eyra mission and vision.
-

-
-
- Pien -
- Pien Chrispijn -
-

- Pien is driven by curiosity and a genuin interest in people, in order to learn from them and find ways to break new ground, while regenerating symbiosis.
-

-
-
- Naiyara -
- Naiyara van der Veen -
-

- Naiyara has a deep understanding of what people need and the ability to translate this into concrete actions that make both an organisation as well as the people within thrive.
-

-
-
-
-
- - - - - - - -
-
-
-
-

- Scientific advisory board -

-
-
-
-
- martha -

- Martha Larson -

-

- Professor of Multimedia Information Technology at Radboud University and a member of the Multimedia Computing Group at Delft University of Technology. She is the coordinator of the MediaEval Benchmarking Initiative for Multimedia Evaluation, which she co-founded in 2008.
-

-
-
- daniel -
- Daniel Oberski -
-

- Professor of data science methodology with a joint appointment at Utrecht University’s Department of Methodology & Statistics, and the department of Biostatistics at the Julius Center, University Medical Center Utrecht (UMCU). Daniel is a member of "de Jonge Akademie" KNAW.
-

-
-
- stephan -
- Stephen Aylward -
-

- Senior Director of Strategic Initiatives at Kitware and a successful researcher in the field of medical image analysis. After being an associate professor at UNC, Stephen founded Kitware NC in 2005 and is and has been the driving force behind the open source community for medical image analysis.
-

-
-
-
-
- - - -
-
-
-
-
-
-

- We are part of Apollo 14 
-

-

- Home for startups that innovate for a better world -

Find out more -
-
-
-
-
-
- - - -
-
-
-
-

- Collaborators -

-
-
-
-
- logo_vu -
-
-
-
- logo_uva -
-
- logo_surf -
-
- logo_uu -
-
-
-
-
-
- - - - - - -
- - - - - - - - - - - diff --git a/core/bundles/port/start_page_translations.ex b/core/bundles/port/start_page_translations.ex deleted file mode 100644 index a1db28b30..000000000 --- a/core/bundles/port/start_page_translations.ex +++ /dev/null @@ -1,3 +0,0 @@ -defmodule Port.StartPageTranslations do - use Port.StartPages -end diff --git a/core/bundles/port/bundle.ex b/core/bundles/self/bundle.ex similarity index 64% rename from core/bundles/port/bundle.ex rename to core/bundles/self/bundle.ex index 8e2acf12d..208baefba 100644 --- a/core/bundles/port/bundle.ex +++ b/core/bundles/self/bundle.ex @@ -1,29 +1,26 @@ -defmodule Port.Bundle do +defmodule Self.Bundle do defp include?() do - Application.fetch_env!(:core, :bundle) == :port + Application.fetch_env!(:core, :bundle) == :self end def routes do if include?() do quote do - scope "/", Port do - pipe_through([:browser]) - get("/", Home.LandingPageController, :show) - end - - scope "/", Port do + scope "/", Self do pipe_through([:browser, :redirect_if_user_is_authenticated]) + live("/user/signin", User.Signin) get("/user/session", User.SessionController, :new) post("/user/session", User.SessionController, :create) end - scope "/", Port do + scope "/", Self do pipe_through([:browser]) delete("/user/session", User.SessionController, :delete) end - scope "/", Port do + scope "/", Self do pipe_through([:browser, :require_authenticated_user]) + live("/", Console.Page) live("/console", Console.Page) end end @@ -33,7 +30,8 @@ defmodule Port.Bundle do def grants do if include?() do quote do - grant_access(Port.Console.Page, [:member]) + grant_access(Self.Console.Page, [:member]) + grant_access(Self.User.Signin, [:visitor, :member]) end end end diff --git a/core/bundles/self/config/config.exs b/core/bundles/self/config/config.exs new file mode 100644 index 000000000..c478a688e --- /dev/null +++ b/core/bundles/self/config/config.exs @@ -0,0 +1,16 @@ +import Config + +config :core, + start_pages: Self.StartPages, + menu_items: Self.Menu.Items, + workspace_menu_builder: Self.Layouts.Workspace.MenuBuilder, + website_menu_builder: Self.Layouts.Website.MenuBuilder, + stripped_menu_builder: Self.Layouts.Stripped.MenuBuilder + +config :core, CoreWeb.UserAuth, + researcher_signed_in_page: "/project", + participant_signed_in_page: "/project" + +config :core, :meta, + bundle_title: "Self", + bundle: :port diff --git a/core/bundles/port/lib/console/page.ex b/core/bundles/self/lib/console/page.ex similarity index 57% rename from core/bundles/port/lib/console/page.ex rename to core/bundles/self/lib/console/page.ex index b96dc81cc..7cfa2d530 100644 --- a/core/bundles/port/lib/console/page.ex +++ b/core/bundles/self/lib/console/page.ex @@ -1,7 +1,4 @@ -defmodule Port.Console.Page do - @moduledoc """ - The console screen. - """ +defmodule Self.Console.Page do use CoreWeb, :live_view use CoreWeb.Layouts.Workspace.Component, :console import CoreWeb.Layouts.Workspace.Component @@ -12,17 +9,23 @@ defmodule Port.Console.Page do alias Systems.{ Project, - NextAction + NextAction, + Benchmark } def mount(_params, _session, %{assigns: %{current_user: user}} = socket) do - preload = Project.Model.preload_graph(:down) + spot_items = + user + |> Benchmark.Public.list_spots(Benchmark.SpotModel.preload_graph([:tool])) + |> Enum.map(&convert_to_vm(socket, &1)) - content_items = + project_items = user - |> Project.Public.list_owned_projects(preload: preload) + |> Project.Public.list_owned_projects(preload: Project.Model.preload_graph(:down)) |> Enum.map(&convert_to_vm(socket, &1)) + content_items = spot_items ++ project_items + socket = socket |> update_menus() @@ -51,6 +54,7 @@ defmodule Port.Console.Page do <% end %> <%= dgettext("eyra-dashboard", "recent-items.title") %> + <%= Enum.count(@content_items) %> <.list items={@content_items} /> @@ -63,12 +67,12 @@ defmodule Port.Console.Page do %{ name: name, root: %{ - items: [item] + id: root_node_id } } ) do %{ - path: ~p"/project/item/#{item.id}/content", + path: ~p"/project/node/#{root_node_id}", title: name, subtitle: "", tag: %{text: "Concept", type: :success}, @@ -81,20 +85,37 @@ defmodule Port.Console.Page do def convert_to_vm( _socket, %{ + id: spot_id, name: name, - root: %{ - id: root_node_id + updated_at: updated_at, + tool: %{ + id: tool_id, + title: title, + status: status } } ) do + tag = get_tag(status) + + quick_summary = + updated_at + |> CoreWeb.UI.Timestamp.apply_timezone() + |> CoreWeb.UI.Timestamp.humanize() + |> Macro.camelize() + %{ - path: ~p"/project/node/#{root_node_id}", - title: name, - subtitle: "", - tag: nil, + path: ~p"/benchmark/#{tool_id}/#{spot_id}", + title: title, + subtitle: "#{name}", + tag: tag, level: :critical, image: nil, - quick_summary: "" + quick_summary: quick_summary } end + + defp get_tag(:concept), do: %{type: :warning, text: dgettext("eyra-project", "label.concept")} + defp get_tag(:online), do: %{type: :success, text: dgettext("eyra-project", "label.online")} + defp get_tag(:offline), do: %{type: :delete, text: dgettext("eyra-project", "label.offline")} + defp get_tag(:idle), do: %{type: :idle, text: dgettext("eyra-project", "label.idle")} end diff --git a/core/bundles/port/lib/layouts/stripped/menu_builder.ex b/core/bundles/self/lib/layouts/stripped/menu_builder.ex similarity index 73% rename from core/bundles/port/lib/layouts/stripped/menu_builder.ex rename to core/bundles/self/lib/layouts/stripped/menu_builder.ex index f51cb4ddd..2e0c1645d 100644 --- a/core/bundles/port/lib/layouts/stripped/menu_builder.ex +++ b/core/bundles/self/lib/layouts/stripped/menu_builder.ex @@ -1,4 +1,4 @@ -defmodule Port.Layouts.Stripped.MenuBuilder do +defmodule Self.Layouts.Stripped.MenuBuilder do @home_flags [ desktop_navbar: [:wide], mobile_navbar: [:wide] @@ -12,7 +12,7 @@ defmodule Port.Layouts.Stripped.MenuBuilder do @primary [] @secondary [:language] - use CoreWeb.Menu.Builder, home: :eyra + use CoreWeb.Menu.Builder, home: :self @impl true def include_map(_user), do: %{} diff --git a/core/bundles/port/lib/layouts/website/menu_builder.ex b/core/bundles/self/lib/layouts/website/menu_builder.ex similarity index 65% rename from core/bundles/port/lib/layouts/website/menu_builder.ex rename to core/bundles/self/lib/layouts/website/menu_builder.ex index 53aa38372..6c46e0f0c 100644 --- a/core/bundles/port/lib/layouts/website/menu_builder.ex +++ b/core/bundles/self/lib/layouts/website/menu_builder.ex @@ -1,4 +1,4 @@ -defmodule Port.Layouts.Website.MenuBuilder do +defmodule Self.Layouts.Website.MenuBuilder do @home_flags [ desktop_navbar: [:wide], mobile_menu: [:narrow] @@ -18,12 +18,8 @@ defmodule Port.Layouts.Website.MenuBuilder do mobile_navbar: [:menu] ] - use CoreWeb.Menu.Builder, home: :eyra - alias Core.Authorization + use CoreWeb.Menu.Builder, home: :self @impl true - def include_map(user), - do: %{ - console: Authorization.can_access?(user, Link.Console.Page) - } + def include_map(_user), do: %{} end diff --git a/core/bundles/port/lib/layouts/workspace/menu_builder.ex b/core/bundles/self/lib/layouts/workspace/menu_builder.ex similarity index 63% rename from core/bundles/port/lib/layouts/workspace/menu_builder.ex rename to core/bundles/self/lib/layouts/workspace/menu_builder.ex index b60d2f125..fe62860ee 100644 --- a/core/bundles/port/lib/layouts/workspace/menu_builder.ex +++ b/core/bundles/self/lib/layouts/workspace/menu_builder.ex @@ -1,4 +1,4 @@ -defmodule Port.Layouts.Workspace.MenuBuilder do +defmodule Self.Layouts.Workspace.MenuBuilder do @home_flags [ desktop_menu: [:wide], tablet_menu: [:narrow], @@ -14,6 +14,7 @@ defmodule Port.Layouts.Workspace.MenuBuilder do @primary [ default: [ + :console, :projects, :admin, :support, @@ -32,8 +33,13 @@ defmodule Port.Layouts.Workspace.MenuBuilder do mobile_navbar: [:menu] ] - use CoreWeb.Menu.Builder, home: :eyra + use CoreWeb.Menu.Builder, home: :self + alias Core.Authorization @impl true - def include_map(_user), do: %{} + def include_map(user), + do: %{ + console: Authorization.can_access?(user, Self.Console.Page), + projects: Systems.Admin.Public.admin?(user) or user.researcher + } end diff --git a/core/bundles/port/lib/menu/items.ex b/core/bundles/self/lib/menu/items.ex similarity index 93% rename from core/bundles/port/lib/menu/items.ex rename to core/bundles/self/lib/menu/items.ex index f1becb85d..86681e406 100644 --- a/core/bundles/port/lib/menu/items.ex +++ b/core/bundles/self/lib/menu/items.ex @@ -1,4 +1,4 @@ -defmodule Port.Menu.Items do +defmodule Self.Menu.Items do @behaviour CoreWeb.Menu.ItemsProvider use CoreWeb, :verified_routes @@ -7,7 +7,7 @@ defmodule Port.Menu.Items do @impl true def values() do %{ - eyra: %{action: %{type: :http_get, to: ~p"/"}, title: "Eyra"}, + self: %{action: %{type: :http_get, to: ~p"/project"}, title: "Self"}, admin: %{ action: %{type: :redirect, to: ~p"/admin/config"}, title: dgettext("eyra-ui", "menu.item.admin") diff --git a/core/bundles/port/lib/user/session_controller.ex b/core/bundles/self/lib/user/session_controller.ex similarity index 97% rename from core/bundles/port/lib/user/session_controller.ex rename to core/bundles/self/lib/user/session_controller.ex index c72fef199..c59091428 100644 --- a/core/bundles/port/lib/user/session_controller.ex +++ b/core/bundles/self/lib/user/session_controller.ex @@ -1,4 +1,4 @@ -defmodule Port.User.SessionController do +defmodule Self.User.SessionController do use CoreWeb, :controller import CoreWeb.Gettext diff --git a/core/bundles/port/lib/user/session_html.ex b/core/bundles/self/lib/user/session_html.ex similarity index 89% rename from core/bundles/port/lib/user/session_html.ex rename to core/bundles/self/lib/user/session_html.ex index 7e29055a6..e10e9cf15 100644 --- a/core/bundles/port/lib/user/session_html.ex +++ b/core/bundles/self/lib/user/session_html.ex @@ -1,4 +1,4 @@ -defmodule Port.User.SessionHTML do +defmodule Self.User.SessionHTML do use CoreWeb, :html import CoreWeb.UI.Footer diff --git a/core/bundles/port/lib/user/session_html/new.html.heex b/core/bundles/self/lib/user/session_html/new.html.heex similarity index 100% rename from core/bundles/port/lib/user/session_html/new.html.heex rename to core/bundles/self/lib/user/session_html/new.html.heex diff --git a/core/bundles/self/start_page_translations.ex b/core/bundles/self/start_page_translations.ex new file mode 100644 index 000000000..3d0ee5510 --- /dev/null +++ b/core/bundles/self/start_page_translations.ex @@ -0,0 +1,3 @@ +defmodule Self.StartPageTranslations do + use Self.StartPages +end diff --git a/core/bundles/port/start_pages.ex b/core/bundles/self/start_pages.ex similarity index 85% rename from core/bundles/port/start_pages.ex rename to core/bundles/self/start_pages.ex index b8fb4ef9a..cd30b173e 100644 --- a/core/bundles/port/start_pages.ex +++ b/core/bundles/self/start_pages.ex @@ -1,4 +1,4 @@ -defmodule Port.StartPages do +defmodule Self.StartPages do @behaviour CoreWeb.StartPageProvider def pages(), @@ -20,7 +20,7 @@ defmodule Port.StartPages do import CoreWeb.Gettext unquote do - for {id, %{domain: domain}} <- Port.StartPages.pages() do + for {id, %{domain: domain}} <- Self.StartPages.pages() do quote do dgettext(unquote(domain), unquote("start.page.#{id}")) end diff --git a/core/config/runtime.exs b/core/config/runtime.exs index 9ca024712..4981cf4ce 100644 --- a/core/config/runtime.exs +++ b/core/config/runtime.exs @@ -5,6 +5,7 @@ if config_env() == :prod do app_domain = System.fetch_env!("APP_DOMAIN") app_mail_domain = System.fetch_env!("APP_MAIL_DOMAIN") app_mail_noreply = "no-reply@#{app_mail_domain}" + static_path = System.fetch_env!("STATIC_PATH") # Allow enabling of features from an environment variable config :core, @@ -18,7 +19,7 @@ if config_env() == :prod do :admins, System.get_env("APP_ADMINS", "") |> String.split() |> Systems.Admin.Public.compile() - config :core, :static_path, System.fetch_env!("STATIC_PATH") + config :core, :static_path, static_path config :core, CoreWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json", @@ -119,23 +120,37 @@ if config_env() == :prod do config :logger, level: System.get_env("LOG_LEVEL", "info") |> String.to_existing_atom() - config :sentry, - dsn: System.get_env("SENTRY_DSN"), - environment_name: System.get_env("RELEASE_ENV") || "prod" - - config :core, :content, - backend: Systems.Content.S3, - bucket: System.get_env("PUBLIC_S3_BUCKET"), - public_url: System.get_env("PUBLIC_S3_URL"), - prefix: System.get_env("CONTENT_S3_PREFIX", nil) - - config :core, :feldspar, - backend: Systems.Feldspar.S3, - bucket: System.get_env("PUBLIC_S3_BUCKET"), - # The public URL must point to the root's (bucket) publicly accessible URL. - # It should have a policy that allows anonymous users to read all files. - public_url: System.get_env("PUBLIC_S3_URL"), - prefix: System.get_env("FELDSPAR_S3_PREFIX", nil) + if sentry_dsn = System.get_env("SENTRY_DSN") do + config :sentry, + dsn: sentry_dsn, + environment_name: System.get_env("RELEASE_ENV") || "prod" + end + + if content_s3_prefix = System.get_env("CONTENT_S3_PREFIX") do + config :core, :content, + backend: Systems.Content.S3, + bucket: System.get_env("PUBLIC_S3_BUCKET"), + public_url: System.get_env("PUBLIC_S3_URL"), + prefix: content_s3_prefix + else + config :core, :content, + backend: Systems.Content.LocalFS, + local_fs_root_path: static_path + end + + if feldspar_s3_prefix = System.get_env("FELDSPAR_S3_PREFIX") do + config :core, :feldspar, + backend: Systems.Feldspar.S3, + bucket: System.get_env("PUBLIC_S3_BUCKET"), + # The public URL must point to the root's (bucket) publicly accessible URL. + # It should have a policy that allows anonymous users to read all files. + public_url: System.get_env("PUBLIC_S3_URL"), + prefix: feldspar_s3_prefix + else + config :core, :feldspar, + backend: Systems.Feldspar.LocalFS, + local_fs_root_path: static_path + end config :core, :dist_hosts, diff --git a/core/systems/admin/login_page.ex b/core/systems/admin/login_page.ex index 9493981c7..22d2fcaf6 100644 --- a/core/systems/admin/login_page.ex +++ b/core/systems/admin/login_page.ex @@ -42,7 +42,7 @@ defmodule Systems.Admin.LoginPage do
- Sign in with Eyra account + Sign in with Google account
diff --git a/core/test/core/surfconext/plug_test.exs b/core/test/core/surfconext/plug_test.exs index 251906d66..7d74d3ce4 100644 --- a/core/test/core/surfconext/plug_test.exs +++ b/core/test/core/surfconext/plug_test.exs @@ -114,7 +114,7 @@ defmodule Core.SurfConext.CallbackController.Test do describe "authenticate/1" do test "creates a user", %{conn: conn} do conn = conn |> get("/surfconext/auth") - assert redirected_to(conn) == "/console" + assert redirected_to(conn) == "/project" end test "redirects when the changeset is invalid", %{conn: conn, conf: conf} do @@ -140,7 +140,7 @@ defmodule Core.SurfConext.CallbackController.Test do }) conn = conn |> get("/surfconext/auth") - assert redirected_to(conn) == "/console" + assert redirected_to(conn) == "/project" end test "authenticates an existing researcher", %{conn: conn} do @@ -154,7 +154,7 @@ defmodule Core.SurfConext.CallbackController.Test do }) conn = conn |> get("/surfconext/auth") - assert redirected_to(conn) == "/console" + assert redirected_to(conn) == "/project" end test "authenticates an existing student", %{conn: conn} do @@ -181,7 +181,7 @@ defmodule Core.SurfConext.CallbackController.Test do conn = conn |> get("/surfconext/auth") # no onboarding yet for researchers - assert redirected_to(conn) == "/console" + assert redirected_to(conn) == "/project" end test "authenticates new student", %{conn: conn, conf: conf} do diff --git a/core/test/core_web/controllers/user_session_controller_test.exs b/core/test/core_web/controllers/user_session_controller_test.exs index 493a5cfd4..8995e153f 100644 --- a/core/test/core_web/controllers/user_session_controller_test.exs +++ b/core/test/core_web/controllers/user_session_controller_test.exs @@ -25,7 +25,7 @@ defmodule CoreWeb.UserSessionControllerTest do test "redirects if already logged in", %{conn: conn} do conn = get(conn, ~p"/user/signin") - assert redirected_to(conn) == "/console" + assert redirected_to(conn) == "/project" end end diff --git a/core/test/core_web/live/user/confirm_token_test.exs b/core/test/core_web/live/user/confirm_token_test.exs index dd7f69c00..371fb2b76 100644 --- a/core/test/core_web/live/user/confirm_token_test.exs +++ b/core/test/core_web/live/user/confirm_token_test.exs @@ -103,7 +103,7 @@ defmodule CoreWeb.Live.User.ConfirmToken.Test do setup [:login_as_member] test "opening activation mail with expired (invalid) token should redirect", %{conn: conn} do - {:error, {:redirect, %{to: "/console"}}} = + {:error, {:redirect, %{to: "/project"}}} = live(conn, Routes.live_path(conn, ConfirmToken, "abc")) end end