Put js build through phoenix

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2018-10-10 14:57:35 +02:00
parent 8d5f4d7a53
commit 3b48ac957f
18 changed files with 1637 additions and 1539 deletions

3
.gitignore vendored
View file

@ -18,5 +18,8 @@ erl_crash.dump
.elixir_ls
/doc
priv/static/*
!priv/static/.gitkeep
priv/data/*
!priv/data/.gitkeep
.vscode/
cover/

View file

@ -10,7 +10,7 @@ variables:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_HOST: postgres
GEOLITE_CITIES_PATH: "/builds/tcit/eventos/priv/static/GeoLite2-City.mmdb"
GEOLITE_CITIES_PATH: "/builds/tcit/eventos/priv/data/GeoLite2-City.mmdb"
cache:
key: "$CI_JOB_NAME"
@ -27,7 +27,7 @@ before_script:
- mix deps.get
- MIX_ENV=test mix ecto.create
- MIX_ENV=test mix ecto.migrate
- curl http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz --output GeoLite2-City.tar.gz -s && tar zxf GeoLite2-City.tar.gz && mv GeoLite2-City_*/GeoLite2-City.mmdb priv/static/GeoLite2-City.mmdb
- curl http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz --output GeoLite2-City.tar.gz -s && tar zxf GeoLite2-City.tar.gz && mv GeoLite2-City_*/GeoLite2-City.mmdb priv/data/GeoLite2-City.mmdb
mix:
script:

View file

@ -56,6 +56,6 @@ config :geolix,
%{
id: :city,
adapter: Geolix.Adapter.MMDB2,
source: System.get_env("GEOLITE_CITIES_PATH") || "priv/static/GeoLite2-City.mmdb"
source: System.get_env("GEOLITE_CITIES_PATH") || "priv/data/GeoLite2-City.mmdb"
}
]

3081
js/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build": "vue-cli-service build --modern",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e"
@ -18,21 +18,21 @@
"vue-gravatar": "^1.2.1",
"vue-markdown": "^2.2.4",
"vue-router": "^3.0.1",
"vuetify": "^1.1.1",
"vuetify-google-autocomplete": "^2.0.0-beta.4",
"vuetify": "^1.2.7",
"vuetify-google-autocomplete": "^2.0.0-beta.5",
"vuex": "^3.0.1",
"vuex-i18n": "^1.10.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.1",
"@vue/cli-plugin-e2e-nightwatch": "^3.0.1",
"@vue/cli-plugin-eslint": "^3.0.1",
"@vue/cli-plugin-pwa": "^3.0.1",
"@vue/cli-plugin-unit-mocha": "^3.0.1",
"@vue/cli-service": "^3.0.1",
"@vue/eslint-config-airbnb": "^3.0.1",
"@vue/test-utils": "^1.0.0-beta.24",
"chai": "^4.1.2",
"@vue/cli-plugin-babel": "^3.0.5",
"@vue/cli-plugin-e2e-nightwatch": "^3.0.5",
"@vue/cli-plugin-eslint": "^3.0.5",
"@vue/cli-plugin-pwa": "^3.0.5",
"@vue/cli-plugin-unit-mocha": "^3.0.5",
"@vue/cli-service": "^3.0.5",
"@vue/eslint-config-airbnb": "^3.0.5",
"@vue/test-utils": "^1.0.0-beta.25",
"chai": "^4.2.0",
"dotenv-webpack": "^1.5.7",
"node-sass": "^4.9.3",
"sass-loader": "^7.1.0",

View file

@ -3,7 +3,7 @@
<v-flex xs12 sm6 offset-sm3>
<v-progress-circular v-if="loading" indeterminate color="primary"></v-progress-circular>
<v-card v-if="!loading">
<v-card-media :src="actor.banner" height="400px">
<v-img :src="actor.banner || 'https://picsum.photos/400/'" height="300px">
<v-layout column class="media">
<v-card-title>
<v-btn icon @click="$router.go(-1)">
@ -50,7 +50,7 @@
</v-layout>
</v-container>
</v-layout>
</v-card-media>
</v-img>
<v-list three-line>
<v-list-tile>
<v-list-tile-action>
@ -126,10 +126,10 @@
</v-flex>
</v-layout>
</v-container>
<v-container fluid grid-list-md v-if="actor.organizingEvents && actor.organizingEvents.length > 0">
<v-container fluid grid-list-md v-if="actor.organized_events && actor.organized_events.length > 0">
<v-subheader>Organized events</v-subheader>
<v-layout row wrap>
<v-flex v-for="event in actor.organizingEvents" :key="event.id">
<v-flex v-for="event in actor.organized_events" :key="event.id">
<v-card>
<v-card-media
class="black--text"
@ -204,13 +204,13 @@ export default {
.then((response) => {
this.actor = response.data;
this.loading = false;
console.log(this.actor);
console.log('actor', this.actor);
})
},
logoutUser() {
auth.logout(this.$store);
this.$router.push({ name: 'Home' });
}
},
}
}
</script>

View file

@ -20,7 +20,7 @@
<v-radio label="Phone" value="phone" off-icon="phone"></v-radio>
<v-radio label="Other" value="other"></v-radio>
</v-radio-group>
<vuetify-google-autocomplete
<!-- <vuetify-google-autocomplete
v-if="event.location_type === 'physical'"
id="map"
append-icon="search"
@ -31,7 +31,7 @@
types="geocode"
v-on:placechanged="getAddressData"
>
</vuetify-google-autocomplete>
</vuetify-google-autocomplete> -->
<v-text-field
v-if="event.location_type === 'online'"
label="Meeting adress"

View file

@ -4,7 +4,7 @@
<span v-if="error">Error : event not found</span>
<v-progress-circular v-if="loading" indeterminate color="primary"></v-progress-circular>
<v-card v-if="!loading && !error">
<v-card-media
<v-img
src="https://picsum.photos/600/400/"
height="200px"
>
@ -36,7 +36,7 @@
</v-flex>
</v-layout>
</v-container>
</v-card-media>
</v-img>
<v-container grid-list-md>
<v-layout row wrap>
<v-flex md10>
@ -181,6 +181,7 @@
.then((data) => {
this.loading = false;
this.event = data.data;
console.log('event', this.event);
}).catch((res) => {
Promise.resolve(res).then((data) => {
console.log(data);

View file

@ -1,9 +1,10 @@
<template>
<v-container>
<v-jumbotron
<v-img
:gradient="gradient"
src="https://picsum.photos/1200/900"
dark
height="300"
v-if="$store.state.user === false"
>
<v-container fill-height>
@ -15,7 +16,7 @@
</v-flex>
</v-layout>
</v-container>
</v-jumbotron>
</v-img>
<v-layout v-else>
<v-flex xs12 sm8 offset-sm2>
<v-layout row wrap>

View file

@ -3,6 +3,7 @@ const Dotenv = require('dotenv-webpack');
module.exports = {
lintOnSave: false,
runtimeCompiler: true,
outputDir: '../priv/static',
configureWebpack: {
plugins: [
new Dotenv(),

View file

@ -73,9 +73,9 @@ defmodule Eventos.Actors.Actor do
:banner_url,
:user_id
])
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs["prefered_username"]}")
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs["preferred_username"]}")
|> validate_required([:preferred_username, :keys, :suspended, :url])
|> unique_constraint(:prefered_username, name: :actors_preferred_username_domain_index)
|> unique_constraint(:preferred_username, name: :actors_preferred_username_domain_index)
end
def registration_changeset(%Actor{} = actor, attrs) do
@ -94,7 +94,10 @@ defmodule Eventos.Actors.Actor do
:user_id
])
|> unique_constraint(:preferred_username, name: :actors_preferred_username_domain_index)
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs["prefered_username"]}")
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}")
|> put_change(:inbox_url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}/inbox")
|> put_change(:outbox_url, "#{EventosWeb.Endpoint.url()}/@#{attrs.preferred_username}/outbox")
|> put_change(:shared_inbox_url, "#{EventosWeb.Endpoint.url()}/inbox")
|> validate_required([:preferred_username, :keys, :suspended, :url, :type])
end
@ -157,14 +160,14 @@ defmodule Eventos.Actors.Actor do
])
|> put_change(
:outbox_url,
"#{EventosWeb.Endpoint.url()}/@#{params["prefered_username"]}/outbox"
"#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}/outbox"
)
|> put_change(
:inbox_url,
"#{EventosWeb.Endpoint.url()}/@#{params["prefered_username"]}/inbox"
"#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}/inbox"
)
|> put_change(:shared_inbox_url, "#{EventosWeb.Endpoint.url()}/inbox")
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{params["prefered_username"]}")
|> put_change(:url, "#{EventosWeb.Endpoint.url()}/@#{params["preferred_username"]}")
|> put_change(:domain, nil)
|> put_change(:type, :Group)
|> validate_required([:url, :outbox_url, :inbox_url, :type, :name, :preferred_username])

View file

@ -11,9 +11,16 @@ defmodule EventosWeb.ActivityPubController do
def actor(conn, %{"name" => name}) do
with %Actor{} = actor <- Actors.get_local_actor_by_name(name) do
conn
|> put_resp_header("content-type", "application/activity+json")
|> json(ActorView.render("actor.json", %{actor: actor}))
case get_req_header(conn, "accept") do
["application/activity+json"] ->
conn
|> put_resp_header("content-type", "application/activity+json")
|> json(ActorView.render("actor.json", %{actor: actor}))
_ ->
conn
|> put_resp_content_type("text/html")
|> send_file(200, "priv/static/index.html")
end
else
nil -> {:error, :not_found}
end

View file

@ -7,6 +7,8 @@ defmodule EventosWeb.PageController do
plug(:put_layout, false)
def index(conn, _params) do
render(conn, "index.html")
conn
|> put_resp_content_type("text/html")
|> send_file(200, "priv/static/index.html")
end
end

View file

@ -13,7 +13,7 @@ defmodule EventosWeb.Router do
end
pipeline :activity_pub do
plug(:accepts, ["activity-json"])
plug(:accepts, ["activity-json", "text/html"])
plug(EventosWeb.HTTPSignaturePlug)
end

View file

@ -1 +0,0 @@
<!DOCTYPE html><html><head><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons" rel=stylesheet><script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBF37pw38j0giICt73TCAPNogc07Upe_Q4&libraries=places"></script><meta charset=utf-8><title>libre-event</title><link href=/css/app.a3c38b40a31fa078b9acdba649983cb5.css rel=stylesheet></head><body><noscript>Mets du JS.</noscript><div id=app></div><script type=text/javascript src=/js/manifest.881ff1dba0c9e5d0130f.js></script><script type=text/javascript src=/js/vendor.0d63a19c6680451dd336.js></script><script type=text/javascript src=/js/app.29c4f33994925affb616.js></script></body></html>

0
priv/data/.gitkeep Normal file
View file

0
priv/static/.gitkeep Normal file
View file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB