add make test and Remove vue-cli serve

This commit is contained in:
Vincent
2019-04-17 17:13:20 +02:00
committed by Thomas Citharel
parent e1e410d595
commit ff7fd460f0
14 changed files with 47 additions and 79 deletions

View File

@@ -3,19 +3,15 @@ defmodule MobilizonWeb.PageController do
Controller to load our webapp
"""
use MobilizonWeb, :controller
alias Mobilizon.Service.Metadata
alias Mobilizon.Actors
alias Mobilizon.Actors.Actor
alias Mobilizon.Events
alias Mobilizon.Events.{Event, Comment}
plug(:put_layout, false)
action_fallback(MobilizonWeb.FallbackController)
def index(conn, _params) do
conn
|> put_resp_content_type("text/html")
|> send_file(200, "priv/static/index.html")
render conn, "app.html"
end
def actor(conn, %{"name" => name}) do
@@ -77,16 +73,6 @@ defmodule MobilizonWeb.PageController do
# Inject OpenGraph information
defp render_with_meta(conn, object) do
{:ok, index_content} = File.read(index_file_path())
tags = Metadata.build_tags(object)
response = String.replace(index_content, "<!--server-generated-meta-->", tags)
conn
|> put_resp_content_type("text/html")
|> send_resp(200, response)
end
defp index_file_path() do
Path.join(Application.app_dir(:mobilizon, "priv/static/"), "index.html")
render conn, "app.html", object: object
end
end

View File

@@ -21,7 +21,7 @@ defmodule MobilizonWeb.Endpoint do
at: "/",
from: :mobilizon,
gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt index.html)
only: ~w(css fonts images js favicon.ico robots.txt)
)
# Code reloading can be explicitly enabled under the

View File

@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html class="has-navbar-fixed-top">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= static_path(@conn, "/js/favicon.ico") %>">
<link rel="stylesheet" href="//cdn.materialdesignicons.com/3.5.95/css/materialdesignicons.min.css">
<title>mobilizon</title>
<%= if assigns[:object], do: Metadata.build_tags(@object) %>
</head>
<body>
<noscript>
<strong>We're sorry but mobilizon doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script src="<%= static_path(@conn, "/js/app.js") %>"></script>
</body>
</html>

View File

@@ -0,0 +1,5 @@
defmodule MobilizonWeb.LayoutView do
use MobilizonWeb, :view
alias Mobilizon.Service.Metadata
end