Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

udata-front

udata customizations for Etalab / Data.gouv.fr.

Notes on this repo

This is a new version of udata-gouvfr This is a udata extension, you should read the udata documentation first.

Compatibility

udata-front requires Python 3.7+ and udata.

Installation

Install udata.

Remain in the same Python virtual environment and install udata-front:

pip install udata-front

Create a local configuration file udata.cfg in your udata directory (or where your UDATA_SETTINGS point out) or modify an existing one as following:

PLUGINS = ['front']
THEME = 'gouvfr'

Development

Prepare a udata development environment.

Note that we're using pip-tools on this repository too.

It is recommended to have a workspace with the following layout:

$WORKSPACE
├── fs
├── udata
│   ├── ...
│   └── setup.py
├── udata-front
│   ├── ...
│   └── setup.py
└── udata.cfg

The following steps use the same Python virtual environment and the same version of npm (for JS) as udata.

Clone the udata-front repository into your workspace and install it in development mode:

git clone https://github.com/etalab/udata-front.git
cd udata-front
pre-commit install
pip install -e . -r requirements/test.pip -r requirements/develop.pip

NB: the udata.(in|pip) files are used by the CI to stay in sync with udata requirements. You shouldn't need to tinker with them on your local environment, but they might be updated by the CI when you make a Pull Request.

Modify your local udata.cfg configuration file as following:

PLUGINS = ['front']
THEME = 'gouvfr'

You can execute udata-front specific tasks from the udata-front directory.

ex: Build the assets:

cd udata-front
npm install
inv assets-build

You can list available development commands with:

inv -l

Theme

The front-end theme for the public facing website, is split into two parts :

  • The Jinja templates are located inside udata_front/theme/templates.
  • The Less & other sourcefiles for the are located in theme.

In addition we have a nice litle set of CSS Utilities to quickly build front end components, inspired by bootstrap, most of its documentation lives in the css located in theme/less/ and is built using Stylemark, you can read the live documentation in udata_front/theme/stylemark/ after building it using npm run build-stylemark.

When building pages, here are a few templates to look out for in udata_front/theme/gouvfr/templates :

  • home.html : well, duh.
  • header.html and footer.html : same idea.
  • raw.html : contains the general html structure exposing a body block where we can write our page's body.
  • base.html : contains some extra html structure exposing a content block for our page's content.
  • subnav-large.html, publish-action-modal.html and carousel.html : TODO

Here are our reusable components :

  • dataset : datasets listings used in many pages.
  • reuse : cards for displaying dataset reused in the real world.
  • participez : is the large blue callout seen on multiple pages.
  • macros : TODO
  • svg : contains SVG assets to be included in our pages.

TODO

Front docs todo :

  • Parcel 2 architecture
    • Static copy
    • Stylemark build
    • VueJS compiler mode
  • VanillaJS IIFE architecture
  • Vue 3 architecture
    • Modals
    • I18n
    • Config plugin
    • Components Back docs todo :
  • CSS/JS file inclusion
  • Static route for UI-Kit

Whenever a components needs some special styling, you can find their corresponding definitions inside theme/less/specific/<component>, it's best if we can avoid having too much specific styling, but sometimes you just really need it.

Finally, we have a bunch of commands to make your life a tad easier, that you can run through npm run.

  • build: Builds the final CSS/JS files and the UI-Kit Documentation. You should probably use this one.
  • build:app: Builds the final CSS/JS files without the UI-Kit
  • build:stylemark: Builds the UI-Kit files and also the CSS/JS files but unminifed (do not use those static files in production)
  • i18n:report: Generates a report of the i18n missing and unused keys
  • i18n:extract: Same as above, but also automatically adds missing keys to translation files
  • clean: Cleans Parcel cache. Use this if you stumble upon weird bugs to start anew.
  • start: Get to coding with live reload and things

Changelog

Current (in progress)

  • Add Cypress front-end tests stub #9
  • Add read only mode back on frontend #10
  • Add a request membership action on organization page #12

1.0.0 (2021-09-16)

  • :warning: breaking change: Package renamming and new repository #1:
    • udata-gouvfr is now udata-front
  • Update feedparser following setuptools 58.0.2 release that drops support for use_2to3 #6
  • Show correct number of latest reuses on homepage #3
  • Fix next value on login to prevent infinite loop #4 #8

Previous udata-gouvfr changelog

If you're migrating from udata-gouvfr, see previous changelog here

Metadata

Release files for udata-front 1.0.1.dev303

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for udata-front 1.0.1.dev303
File Interpreter ABI Platform
udata_front-1.0.1.dev303-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / udata_front-1.0.1.dev303-py2.py3-none-any.whl

Download URL udata_front-1.0.1.dev303-py2.py3-none-any.whl
Size 7.7 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8f21876a0cc478c04486d9babb1830bffe5086ba3f6abea5bea48e289a81e403
BLAKE2b-256 checksum
How to use checksums
19d7fb99eb29c17d69846e2f4f8b30f9e6d16007304ac3b5d5931aeb3fb789ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.6

Security for udata-front 1.0.1.dev303

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page