Unverified Commit 727b2df0 authored by Florent Chehab's avatar Florent Chehab
Browse files

feat(back/front): setup stats entry

parent 4325506e
{% extends "base.html" %}
{% load render_bundle from webpack_loader %}
{% block content %}
<script>
var __StatsData = {{ stats_data }};
</script>
{% render_bundle 'stats' %}
{% endblock %}
...@@ -26,6 +26,7 @@ urlpatterns += [ ...@@ -26,6 +26,7 @@ urlpatterns += [
name="cas_ng_proxy_callback", name="cas_ng_proxy_callback",
), ),
url(r"^app/.*", views.index), url(r"^app/.*", views.index),
url(r"^stats/.*", views.stats),
url(r"^cgu-rgpd/.*", views.cgu_rgpd), url(r"^cgu-rgpd/.*", views.cgu_rgpd),
url(r"^rgpd-raw/.*", views.rgpd_raw), url(r"^rgpd-raw/.*", views.rgpd_raw),
url(r"^banned_note/", views.banned), url(r"^banned_note/", views.banned),
......
import logging import logging
import json
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
from django.shortcuts import render from django.shortcuts import render
...@@ -38,6 +39,14 @@ def index(request): ...@@ -38,6 +39,14 @@ def index(request):
) )
def stats(request):
"""
Render the view that displays stats
"""
stats_data = []
return render(request, "stats.html", dict(stats_data=json.dumps(stats_data)))
def rgpd_raw(request): def rgpd_raw(request):
""" """
Render the view that displays only the RGPD conditions Render the view that displays only the RGPD conditions
......
import React from "react";
import { compose } from "recompose";
import Typography from "@material-ui/core/Typography";
import { withPaddedPaper } from "./shared";
/**
* Component corresponding to the stats page of the site
*/
function PageStats() {
return (
<>
<Typography variant="h3">Vive les stats</Typography>
<br></br>
More to come...
</>
);
}
PageStats.propTypes = {};
export default compose(withPaddedPaper())(PageStats);
import React from "react";
import ReactDOM from "react-dom";
import CssBaseline from "@material-ui/core/CssBaseline";
import OfflineThemeProvider from "../components/common/theme/OfflineThemeProvider";
import Logo from "../components/app/Logo";
import BaseTemplate from "../components/app/BaseTemplate";
import PageStats from "../components/pages/PageStats";
function MainReactEntry() {
const toolbarContent = (
<div style={{ flex: 1 }}>
<Logo />
</div>
);
return (
<OfflineThemeProvider>
<>
<CssBaseline />
<main>
<BaseTemplate toolbarContent={toolbarContent}>
<PageStats />
</BaseTemplate>
</main>
</>
</OfflineThemeProvider>
);
}
const wrapper = document.getElementById("app");
ReactDOM.render(<MainReactEntry />, wrapper);
// eslint-disable-next-line no-undef
if (module.hot) {
// eslint-disable-next-line no-undef
module.hot.accept();
}
...@@ -5,6 +5,7 @@ const CopyPlugin = require("copy-webpack-plugin"); ...@@ -5,6 +5,7 @@ const CopyPlugin = require("copy-webpack-plugin");
const config = { const config = {
entry: { entry: {
main: ["./src/entry/mainApp.jsx"], main: ["./src/entry/mainApp.jsx"],
stats: ["./src/entry/statsApp.jsx"],
rgpdCgu: ["./src/entry/rgpdCguForm.jsx"], rgpdCgu: ["./src/entry/rgpdCguForm.jsx"],
rgpdRaw: ["./src/entry/rgpdRaw.jsx"], rgpdRaw: ["./src/entry/rgpdRaw.jsx"],
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment