├── website ├── __init__.py ├── frontend │ ├── babel.cfg │ ├── static │ │ ├── img │ │ │ ├── picard-icon.png │ │ │ ├── quick_start-01.gif │ │ │ ├── quick_start-02.gif │ │ │ ├── quick_start-03.gif │ │ │ ├── quick_start-04.gif │ │ │ ├── quick_start-05.gif │ │ │ ├── quick_start-06.gif │ │ │ ├── quick_start-07.png │ │ │ ├── quick_start-08.gif │ │ │ ├── quick_start-09.png │ │ │ ├── quick_start-10.gif │ │ │ ├── quick_start-11.png │ │ │ ├── picard_demo_500.png │ │ │ ├── screenshots │ │ │ │ ├── picard-cover-art.png │ │ │ │ ├── picard-main-windows.png │ │ │ │ ├── picard-options-about.png │ │ │ │ ├── picard-options-lookup.png │ │ │ │ └── picard-options-plugins.png │ │ │ ├── meb-icons │ │ │ │ ├── bookbrainz-icon.svg │ │ │ │ ├── critiquebrainz-icon.svg │ │ │ │ ├── listenbrainz-icon.svg │ │ │ │ ├── metabrainz-icon.svg │ │ │ │ ├── musicbrainz-icon.svg │ │ │ │ └── coverartarchive-icon.svg │ │ │ └── picard-navbar-icon.svg │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── roboto │ │ │ │ ├── KFOmCnqEu92Fr1Mu4mxK.woff2 │ │ │ │ ├── KFOkCnqEu92Fr1MmgVxIIzI.woff2 │ │ │ │ ├── KFOmCnqEu92Fr1Mu4WxKOzY.woff2 │ │ │ │ ├── KFOmCnqEu92Fr1Mu5mxKOzY.woff2 │ │ │ │ ├── KFOmCnqEu92Fr1Mu72xKOzY.woff2 │ │ │ │ ├── KFOmCnqEu92Fr1Mu7GxKOzY.woff2 │ │ │ │ ├── KFOmCnqEu92Fr1Mu7WxKOzY.woff2 │ │ │ │ ├── KFOmCnqEu92Fr1Mu7mxKOzY.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmSU5fBBc4.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmWUlfBBc4.woff2 │ │ │ │ ├── KFOkCnqEu92Fr1MmgVxEIzIFKw.woff2 │ │ │ │ ├── KFOkCnqEu92Fr1MmgVxFIzIFKw.woff2 │ │ │ │ ├── KFOkCnqEu92Fr1MmgVxGIzIFKw.woff2 │ │ │ │ ├── KFOkCnqEu92Fr1MmgVxHIzIFKw.woff2 │ │ │ │ ├── KFOkCnqEu92Fr1MmgVxLIzIFKw.woff2 │ │ │ │ ├── KFOkCnqEu92Fr1MmgVxMIzIFKw.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2 │ │ │ │ ├── KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2 │ │ │ │ └── KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2 │ │ │ └── sintony │ │ │ │ ├── XoHm2YDqR7-98cVUETMtug.woff2 │ │ │ │ ├── XoHm2YDqR7-98cVUET0tuu8o.woff2 │ │ │ │ ├── XoHj2YDqR7-98cVUGYgIr9AJkw.woff2 │ │ │ │ └── XoHj2YDqR7-98cVUGYgIr94JkwLp.woff2 │ │ ├── js │ │ │ ├── dataTables.min.js │ │ │ └── js.cookie.min.js │ │ └── less │ │ │ ├── fontawesome │ │ │ ├── fixed-width.less │ │ │ ├── core.less │ │ │ ├── bordered-pulled.less │ │ │ ├── rotated-flipped.less │ │ │ ├── larger.less │ │ │ ├── list.less │ │ │ ├── font-awesome.less │ │ │ ├── stacked.less │ │ │ ├── path.less │ │ │ ├── mixins.less │ │ │ └── spinning.less │ │ │ ├── theme │ │ │ ├── boostrap │ │ │ │ ├── mixins │ │ │ │ │ ├── center-block.less │ │ │ │ │ ├── text-emphasis.less │ │ │ │ │ ├── size.less │ │ │ │ │ ├── opacity.less │ │ │ │ │ ├── background-variant.less │ │ │ │ │ ├── text-overflow.less │ │ │ │ │ ├── tab-focus.less │ │ │ │ │ ├── resize.less │ │ │ │ │ ├── labels.less │ │ │ │ │ ├── progress-bar.less │ │ │ │ │ ├── reset-filter.less │ │ │ │ │ ├── nav-divider.less │ │ │ │ │ ├── alerts.less │ │ │ │ │ ├── nav-vertical-align.less │ │ │ │ │ ├── responsive-visibility.less │ │ │ │ │ ├── pagination.less │ │ │ │ │ ├── border-radius.less │ │ │ │ │ ├── panels.less │ │ │ │ │ ├── list-group.less │ │ │ │ │ ├── hide-text.less │ │ │ │ │ ├── clearfix.less │ │ │ │ │ ├── table-row.less │ │ │ │ │ ├── image.less │ │ │ │ │ ├── buttons.less │ │ │ │ │ ├── forms.less │ │ │ │ │ ├── grid-framework.less │ │ │ │ │ ├── grid.less │ │ │ │ │ └── gradients.less │ │ │ │ ├── wells.less │ │ │ │ ├── breadcrumbs.less │ │ │ │ ├── responsive-embed.less │ │ │ │ ├── component-animations.less │ │ │ │ ├── close.less │ │ │ │ ├── thumbnails.less │ │ │ │ ├── utilities.less │ │ │ │ ├── media.less │ │ │ │ ├── pager.less │ │ │ │ ├── jumbotron.less │ │ │ │ ├── mixins.less │ │ │ │ ├── labels.less │ │ │ │ ├── boostrap.less │ │ │ │ ├── badges.less │ │ │ │ ├── code.less │ │ │ │ ├── grid.less │ │ │ │ ├── alerts.less │ │ │ │ ├── progress-bars.less │ │ │ │ ├── pagination.less │ │ │ │ ├── print.less │ │ │ │ ├── tooltip.less │ │ │ │ ├── list-group.less │ │ │ │ ├── scaffolding.less │ │ │ │ ├── popovers.less │ │ │ │ ├── modals.less │ │ │ │ ├── buttons.less │ │ │ │ ├── input-groups.less │ │ │ │ ├── responsive-utilities.less │ │ │ │ ├── tables.less │ │ │ │ └── dropdowns.less │ │ │ ├── theme.less │ │ │ ├── buttons.less │ │ │ ├── links.less │ │ │ └── navbars.less │ │ │ ├── pages │ │ │ ├── mappings.less │ │ │ ├── plugins.less │ │ │ ├── changelog.less │ │ │ ├── downloads.less │ │ │ └── index.less │ │ │ ├── highlightjs │ │ │ ├── picard.less │ │ │ └── default.less │ │ │ ├── styles.less │ │ │ └── docs.less │ ├── views │ │ ├── humans.py │ │ ├── humans_test.py │ │ ├── plugins_test.py │ │ ├── changelog_test.py │ │ ├── plugins.py │ │ ├── __init__.py │ │ ├── docs_test.py │ │ ├── changelog.py │ │ └── docs.py │ ├── templates │ │ ├── changelog.html │ │ ├── docs │ │ │ ├── base.html │ │ │ └── development.html │ │ ├── errors │ │ │ └── 404.html │ │ └── plugins.html │ ├── errors.py │ ├── humans.txt │ ├── scheduler.py │ ├── views_test.py │ ├── testing.py │ ├── __init__.py │ └── babel.py ├── plugin_utils.py ├── expand.py ├── config.py.example ├── build_plugins_test.py ├── expand_test.py └── default_config.py ├── pytest.ini ├── INSTALL.md ├── run.py ├── docker ├── common.yml ├── docker-compose.test.yml ├── uwsgi.ini └── docker-compose.prod.yml ├── .eslintrc ├── .dockerignore ├── README.md ├── .github ├── dependabot.yml ├── workflows │ └── docker-ci.yml └── PULL_REQUEST_TEMPLATE.md ├── plugins-generate.py ├── package.json ├── .gitignore ├── Dockerfile ├── INSTALL-LINUX.md ├── INSTALL-WINDOWS.md └── pyproject.toml /website/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | testpaths = website 3 | addopts = --cov=website 4 | -------------------------------------------------------------------------------- /website/frontend/babel.cfg: -------------------------------------------------------------------------------- 1 | [extractors] 2 | jinja2 = jinja2.ext:babel_extract 3 | 4 | [python: **.py] 5 | [jinja2: **/templates/**.html] 6 | -------------------------------------------------------------------------------- /website/frontend/static/img/picard-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/picard-icon.png -------------------------------------------------------------------------------- /website/frontend/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-01.gif -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-02.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-02.gif -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-03.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-03.gif -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-04.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-04.gif -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-05.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-05.gif -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-06.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-06.gif -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-07.png -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-08.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-08.gif -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-09.png -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-10.gif -------------------------------------------------------------------------------- /website/frontend/static/img/quick_start-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/quick_start-11.png -------------------------------------------------------------------------------- /website/frontend/static/js/dataTables.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/js/dataTables.min.js -------------------------------------------------------------------------------- /website/frontend/static/img/picard_demo_500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/picard_demo_500.png -------------------------------------------------------------------------------- /website/frontend/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /website/frontend/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /website/frontend/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /website/frontend/static/img/screenshots/picard-cover-art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/screenshots/picard-cover-art.png -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | ## Linux 4 | 5 | See [Linux installation](INSTALL-LINUX.md) 6 | 7 | ## Windows 8 | 9 | See [Windows installation](INSTALL-WINDOWS.md) 10 | -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu4mxK.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu4mxK.woff2 -------------------------------------------------------------------------------- /website/frontend/static/img/screenshots/picard-main-windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/screenshots/picard-main-windows.png -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxIIzI.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxIIzI.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu4WxKOzY.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu4WxKOzY.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu5mxKOzY.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu5mxKOzY.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu72xKOzY.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu72xKOzY.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu7GxKOzY.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu7GxKOzY.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu7WxKOzY.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu7WxKOzY.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu7mxKOzY.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOmCnqEu92Fr1Mu7mxKOzY.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/sintony/XoHm2YDqR7-98cVUETMtug.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/sintony/XoHm2YDqR7-98cVUETMtug.woff2 -------------------------------------------------------------------------------- /website/frontend/static/img/screenshots/picard-options-about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/screenshots/picard-options-about.png -------------------------------------------------------------------------------- /website/frontend/static/img/screenshots/picard-options-lookup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/screenshots/picard-options-lookup.png -------------------------------------------------------------------------------- /website/frontend/static/img/screenshots/picard-options-plugins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/img/screenshots/picard-options-plugins.png -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fBBc4.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fBBc4.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfBBc4.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfBBc4.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/sintony/XoHm2YDqR7-98cVUET0tuu8o.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/sintony/XoHm2YDqR7-98cVUET0tuu8o.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxEIzIFKw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxEIzIFKw.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxFIzIFKw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxFIzIFKw.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxGIzIFKw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxGIzIFKw.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxHIzIFKw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxHIzIFKw.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxLIzIFKw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxLIzIFKw.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxMIzIFKw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOkCnqEu92Fr1MmgVxMIzIFKw.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/roboto/KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2 -------------------------------------------------------------------------------- /website/frontend/static/fonts/sintony/XoHj2YDqR7-98cVUGYgIr9AJkw.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/sintony/XoHj2YDqR7-98cVUGYgIr9AJkw.woff2 -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /website/frontend/static/fonts/sintony/XoHj2YDqR7-98cVUGYgIr94JkwLp.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metabrainz/picard-website/HEAD/website/frontend/static/fonts/sintony/XoHj2YDqR7-98cVUGYgIr94JkwLp.woff2 -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /website/frontend/static/less/pages/mappings.less: -------------------------------------------------------------------------------- 1 | #mappings { 2 | table { 3 | .comment { 4 | color: lighten(black, 50%); 5 | font-size: 90%; 6 | font-weight: normal; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /website/frontend/static/less/pages/plugins.less: -------------------------------------------------------------------------------- 1 | #plugin-table { 2 | table { 3 | margin-top: 25px; 4 | table-layout: fixed; 5 | 6 | td { 7 | overflow: hidden; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /website/frontend/views/humans.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint, send_file 2 | 3 | humans_bp = Blueprint('humans', __name__) 4 | 5 | 6 | @humans_bp.get('/humans.txt') 7 | def show_humans(): 8 | return send_file('humans.txt') 9 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from werkzeug.serving import run_simple 4 | from website.frontend import create_app 5 | 6 | app = create_app() 7 | 8 | if __name__ == '__main__': 9 | run_simple(app.config['SERVER_HOSTNAME'], app.config['SERVER_PORT'], app) 10 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /website/frontend/views/humans_test.py: -------------------------------------------------------------------------------- 1 | from website.frontend.testing import FrontendTestCase 2 | 3 | 4 | class ViewsTestCase(FrontendTestCase): 5 | 6 | def test_humans_txt(self): 7 | response = self.client.get("/humans.txt") 8 | self.assert200(response) 9 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docker/common.yml: -------------------------------------------------------------------------------- 1 | # Docker Compose file with common services 2 | # See https://docs.docker.com/compose/extends/#extending-services 3 | version: "2" 4 | services: 5 | 6 | nginx: 7 | restart: always 8 | build: 9 | context: ./nginx_custom/ 10 | dockerfile: Dockerfile 11 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docker/docker-compose.test.yml: -------------------------------------------------------------------------------- 1 | # Docker Compose file for testing 2 | version: "2" 3 | services: 4 | 5 | web_test: 6 | build: 7 | context: .. 8 | dockerfile: ./Dockerfile 9 | network_mode: bridge 10 | command: py.test --junitxml=/data/test_report.xml --cov-report xml:/data/coverage.xml 11 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "es6": true 5 | }, 6 | "rules": { 7 | "arrow-parens": "off", 8 | "camelcase": "off", 9 | "curly": ["error", "multi-line"], 10 | "no-console": "off", 11 | "semi": ["error", "never"], 12 | "quotes": ["warn", "single"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /website/frontend/static/img/meb-icons/bookbrainz-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/frontend/static/img/meb-icons/critiquebrainz-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/frontend/static/img/meb-icons/listenbrainz-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/frontend/static/img/meb-icons/metabrainz-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/frontend/static/img/meb-icons/musicbrainz-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /website/frontend/static/img/meb-icons/coverartarchive-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /website/frontend/templates/changelog.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% set active_page = "changelog" %} 3 | {% set page_title = _("What’s New") %} 4 | {% block content %} 5 |
6 |
7 | {{ changelog | safe }} 8 |
9 |
10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /website/frontend/templates/docs/base.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% set active_page = "docs" %} 3 | {% set page_title = [doc_title, _("Documentation")]|join(' - ') %} 4 | {%- block content_header %} 5 |
6 |
7 |

{{ doc_title }}

8 |
9 |
10 | {% endblock -%} 11 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font-family: FontAwesome; 7 | font-style: normal; 8 | font-weight: normal; 9 | line-height: 1; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | -------------------------------------------------------------------------------- /website/frontend/templates/errors/404.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% set active_page = "404" %} 3 | {% set page_title = _("404 Not Found") %} 4 | {% block content %} 5 |
6 |

{{ _("You don't have to worry, someone is working on fixing things as you're reading this.") }}

7 |
8 | {% endblock%} 9 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | 3 | # Docker configuration 4 | /docker 5 | !docker/uwsgi.ini 6 | 7 | # Byte-compiled / optimized / DLL files 8 | __pycache__/ 9 | *.py[cod] 10 | 11 | # Virtual environment 12 | env 13 | venv 14 | /build 15 | 16 | # Node 17 | node_modules 18 | 19 | # Logs 20 | *.log 21 | pip-log.txt 22 | pip-delete-this-directory.txt 23 | 24 | # Test results 25 | htmlcov 26 | .coverage 27 | -------------------------------------------------------------------------------- /docker/uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | uid = www-data 3 | gid = www-data 4 | master = true 5 | socket = 0.0.0.0:3031 6 | module = website.frontend 7 | callable = create_app() 8 | chdir = /code/website/ 9 | processes = 20 10 | enable-threads = true 11 | log-x-forwarded-for=true 12 | ; quit uwsgi if the python app fails to load 13 | need-app = true 14 | ; when uwsgi gets a sighup, quit completely and let runit restart us 15 | exit-on-reload = true 16 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .@{fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MusicBrainz Picard's Website 2 | 3 | Website for MusicBrainz [Picard](https://picard.musicbrainz.org/). 4 | 5 | Please report issues here: https://tickets.musicbrainz.org/browse/PW 6 | 7 | Docker image is available at: https://hub.docker.com/r/metabrainz/picard-website 8 | 9 | Translations: https://translations.metabrainz.org/projects/picard/website/ 10 | 11 | ## Updating `website/frontend/messages.pot` from sources 12 | 13 | Run `npm run extract_strings` 14 | -------------------------------------------------------------------------------- /docker/docker-compose.prod.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | 4 | picard-website: 5 | build: 6 | context: .. 7 | dockerfile: ./Dockerfile 8 | restart: always 9 | environment: 10 | DEPLOY_ENV: "prod" 11 | SERVICE_3031_NAME: "picard-website" 12 | SERVICE_3031_CHECK_TCP: "true" 13 | SERVICE_3031_CHECK_INTERVAL: "15s" 14 | SERVICE_3031_CHECK_TIMEOUT: "3s" 15 | network_mode: bridge 16 | ports: 17 | - "13034:3031" 18 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: -@fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /website/frontend/views/plugins_test.py: -------------------------------------------------------------------------------- 1 | from website.frontend.testing import FrontendTestCase 2 | from flask import url_for 3 | 4 | 5 | class ViewsTestCase(FrontendTestCase): 6 | 7 | def test_plugins_404(self): 8 | "Test /plugins/ invalid subpage" 9 | response = self.client.get("/plugins/404") 10 | self.assert404(response) 11 | 12 | def test_plugins_root(self): 13 | "Test /plugins/" 14 | response = self.client.get("/plugins/") 15 | self.assert200(response) 16 | -------------------------------------------------------------------------------- /website/frontend/errors.py: -------------------------------------------------------------------------------- 1 | from flask import ( 2 | jsonify, 3 | make_response, 4 | render_template, 5 | request 6 | ) 7 | 8 | 9 | _API_ROOT_PATHS = ["/api", "/api/"] 10 | 11 | 12 | def init_error_handlers(app): 13 | 14 | @app.errorhandler(404) 15 | def not_found_handler(error): 16 | if request.path in _API_ROOT_PATHS: 17 | return make_response( 18 | jsonify({"message": "No API version specified"}), 404) 19 | 20 | return render_template('errors/404.html', error=error), 404 21 | -------------------------------------------------------------------------------- /website/frontend/humans.txt: -------------------------------------------------------------------------------- 1 | This website was created during Google Summer of Code 2014. 2 | 3 | The complete source code is available on GitHub: 4 | https://github.com/musicbrainz/picard-website/ 5 | 6 | /* TEAM */ 7 | 8 | Project Mentor: Michael Wiencek 9 | Freenode: @bitmap 10 | From: United States 11 | 12 | Student: Shadab Zafar 13 | Freenode: @dufferzafar 14 | Twitter: @dufferzafar 15 | From: New Delhi, India 16 | 17 | /* SITE */ 18 | 19 | Language: English 20 | 21 | Software: Microsoft Windows 7, Sublime Text 3 22 | 23 | Technologies: Python/Flask, Bootstrap, Font Awesome 24 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "spinning.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /website/frontend/views/changelog_test.py: -------------------------------------------------------------------------------- 1 | from website.frontend.testing import FrontendTestCase 2 | from flask import url_for 3 | 4 | 5 | class ViewsTestCase(FrontendTestCase): 6 | 7 | def test_changelog(self): 8 | "Test /changelog/" 9 | response = self.client.get("/changelog/") 10 | self.assert200(response) 11 | self.assertIn(b'Version', response.data) 12 | 13 | def test_changelog_redirect(self): 14 | "Test /changelog" 15 | response = self.client.get("/changelog") 16 | self.assertRedirects(response, url_for("changelog.show_changelog")) 17 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /website/frontend/static/less/highlightjs/picard.less: -------------------------------------------------------------------------------- 1 | /* 2 | Minimal syntax highlighting mimicking the look of tagger script inside MusicBrainz Picard. 3 | */ 4 | 5 | .hljs { 6 | word-break: break-word; 7 | } 8 | 9 | 10 | /* Base color: saturation 0; */ 11 | .taggerscript { 12 | color: #444; 13 | 14 | .hljs-comment { 15 | font-weight: bold; 16 | font-style: italic; 17 | color: #808080; 18 | } 19 | 20 | .hljs-keyword { 21 | font-weight: bold; 22 | color: #0000FF; 23 | } 24 | 25 | .hljs-variable { 26 | color: #008298; 27 | } 28 | 29 | .hljs-symbol { 30 | color: #800000 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /website/frontend/static/less/pages/changelog.less: -------------------------------------------------------------------------------- 1 | #log { 2 | h3 { 3 | font-size: 28px; 4 | margin-top: 25px; 5 | margin-bottom: 25px; 6 | 7 | span { 8 | font-size: 20px; 9 | padding-left: 15px; 10 | color: lighten(#000, 50%); 11 | } 12 | } 13 | 14 | p { 15 | font-size: 15px; 16 | line-height: 20px; 17 | font-family: Tahoma, Geneva, sans-serif; 18 | padding-left: 38px; 19 | 20 | &.newLine { 21 | padding-left: 20px; 22 | &:before { 23 | content: "\2022"; // Who needs
  • ;) 24 | padding-right: 10px; 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "pip" 9 | directory: "/" 10 | schedule: 11 | interval: "monthly" 12 | 13 | - package-ecosystem: "npm" 14 | directory: "/" 15 | schedule: 16 | interval: "monthly" 17 | 18 | - package-ecosystem: "github-actions" 19 | directory: "/" 20 | schedule: 21 | interval: "monthly" 22 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /plugins-generate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Generate plugins.json and zipped plugin archive files 4 | # Clone or pull repository from GitHub and run generate.py script 5 | 6 | 7 | import website.frontend 8 | from website.build_plugins import generate_plugins 9 | 10 | 11 | config = website.frontend.create_app().config 12 | versions = [z['title'] for z in config['PLUGIN_VERSIONS'].values()] 13 | build_dir = config['PLUGINS_BUILD_DIR'] 14 | for version in versions: 15 | print(build_dir, version) 16 | try: 17 | generate_plugins(build_dir, version) 18 | print("Plugin files for version %s have been generated successfully." % version) 19 | except Exception as e: 20 | print("Plugin generation for version %s has FAILED.\nError occurred: %s" % (version, e)) 21 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: ~"url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}')"; 7 | src: ~"url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype')", 8 | ~"url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff')", 9 | ~"url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype')", 10 | ~"url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg')"; 11 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon-rotate(@degrees, @rotation) { 5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 6 | -webkit-transform: rotate(@degrees); 7 | -moz-transform: rotate(@degrees); 8 | -ms-transform: rotate(@degrees); 9 | -o-transform: rotate(@degrees); 10 | transform: rotate(@degrees); 11 | } 12 | 13 | .fa-icon-flip(@horiz, @vert, @rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 15 | -webkit-transform: scale(@horiz, @vert); 16 | -moz-transform: scale(@horiz, @vert); 17 | -ms-transform: scale(@horiz, @vert); 18 | -o-transform: scale(@horiz, @vert); 19 | transform: scale(@horiz, @vert); 20 | } 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "picard-website", 3 | "version": "0.0.0", 4 | "devDependencies": { 5 | "clean-css-cli": "^5.6.3", 6 | "less": "^4.4.2" 7 | }, 8 | "private": true, 9 | "scripts": { 10 | "clean": "rm -rf website/frontend/static/css/", 11 | "styles": "lessc website/frontend/static/less/styles.less | cleancss -o website/frontend/static/css/styles.css", 12 | "build": "npm run clean && npm run styles && npm run translate", 13 | "translate": "poetry run pybabel compile -d website/frontend/translations", 14 | "extract_strings": "poetry run pybabel extract -F website/frontend/babel.cfg -k lazy_gettext -o website/frontend/messages.pot website/frontend", 15 | "resync_po_files_from_pot": "poetry run pybabel update -i website/frontend/messages.pot -d website/frontend/translations/" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated from static/less using lessc 2 | website/frontend/static/css/ 3 | 4 | # coverage output 5 | cover/ 6 | 7 | # The build used during testing 8 | tmp/ 9 | 10 | # Python 3.3 Virtualenv 11 | env/ 12 | 13 | website/config.py 14 | node_modules/ 15 | plugins/ 16 | 17 | ###Python### 18 | 19 | # Byte-compiled / optimized / DLL files 20 | __pycache__/ 21 | *.py[cod] 22 | 23 | # Distribution / packaging 24 | .Python 25 | env/ 26 | bin/ 27 | build/ 28 | develop-eggs/ 29 | dist/ 30 | eggs/ 31 | lib/ 32 | lib64/ 33 | parts/ 34 | sdist/ 35 | var/ 36 | *.egg-info/ 37 | .installed.cfg 38 | *.egg 39 | 40 | # Installer logs 41 | pip-log.txt 42 | pip-delete-this-directory.txt 43 | 44 | # Unit test / coverage reports 45 | htmlcov/ 46 | .tox/ 47 | .coverage 48 | .cache 49 | nosetests.xml 50 | coverage.xml 51 | 52 | # Translations 53 | *.mo 54 | 55 | # OS X crap 56 | .DS_Store 57 | -------------------------------------------------------------------------------- /website/frontend/static/less/fontawesome/spinning.less: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: spin 2s infinite linear; 6 | -moz-animation: spin 2s infinite linear; 7 | -o-animation: spin 2s infinite linear; 8 | animation: spin 2s infinite linear; 9 | } 10 | 11 | @-moz-keyframes spin { 12 | 0% { -moz-transform: rotate(0deg); } 13 | 100% { -moz-transform: rotate(359deg); } 14 | } 15 | @-webkit-keyframes spin { 16 | 0% { -webkit-transform: rotate(0deg); } 17 | 100% { -webkit-transform: rotate(359deg); } 18 | } 19 | @-o-keyframes spin { 20 | 0% { -o-transform: rotate(0deg); } 21 | 100% { -o-transform: rotate(359deg); } 22 | } 23 | @keyframes spin { 24 | 0% { 25 | -webkit-transform: rotate(0deg); 26 | transform: rotate(0deg); 27 | } 28 | 100% { 29 | -webkit-transform: rotate(359deg); 30 | transform: rotate(359deg); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /website/plugin_utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | from flask import json 3 | 4 | 5 | def plugins_build_dir(app): 6 | return app.config['PLUGINS_BUILD_DIR'] 7 | 8 | 9 | def plugins_json_file(app, version): 10 | """Returns the file that contains json data""" 11 | return os.path.join(plugins_build_dir(app), version, "plugins.json") 12 | 13 | 14 | def plugins_dir(app, version): 15 | """Returns the directory which contains plugin files""" 16 | return os.path.join(plugins_build_dir(app), version) 17 | 18 | 19 | def load_json_data(app, version, force_refresh=False): 20 | """Load JSON Data""" 21 | key = 'plugins_json_data_%s' % version 22 | data = app.cache.get(key) if not force_refresh else None 23 | if data is None: 24 | with open(plugins_json_file(app, version)) as fp: 25 | data = json.load(fp)['plugins'] 26 | app.cache.set(key, data, 27 | timeout=app.config['PLUGINS_CACHE_TIMEOUT']) 28 | return data 29 | -------------------------------------------------------------------------------- /website/frontend/views/plugins.py: -------------------------------------------------------------------------------- 1 | from collections import OrderedDict 2 | import json 3 | from flask import current_app, Blueprint, render_template 4 | from website.plugin_utils import plugins_json_file 5 | plugins_bp = Blueprint('plugins', __name__) 6 | 7 | 8 | @plugins_bp.get('/') 9 | def show_plugins(): 10 | all_plugins = OrderedDict() 11 | versions = current_app.config['PLUGIN_VERSIONS'] 12 | for version, build_version in sorted([(key, versions[key]['title']) for key in versions]): 13 | ordered_plugins = OrderedDict() 14 | build_json_file = plugins_json_file(current_app, build_version) 15 | with open(build_json_file, "r", encoding='utf-8') as fp: 16 | plugins = json.loads(fp.read())['plugins'] 17 | for key in sorted(plugins, key=lambda k: plugins[k]['name'].lower()): 18 | ordered_plugins[key] = plugins[key] 19 | all_plugins[version[1:]] = ordered_plugins 20 | return render_template('plugins.html', all_plugins=all_plugins) 21 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /website/frontend/views/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint, render_template, current_app 2 | from packaging import version 3 | 4 | from .changelog import * 5 | from .humans import * 6 | from .plugins import * 7 | from .docs import * 8 | from .api import * 9 | 10 | 11 | frontend_bp = Blueprint('frontend', __name__) 12 | 13 | 14 | @frontend_bp.get('/') 15 | def show_index(): 16 | return render_template('index.html', 17 | **current_app.config['PICARD_VERSIONS']['stable']) 18 | 19 | 20 | @frontend_bp.get('/downloads/') 21 | def show_downloads(): 22 | version_config = current_app.config['PICARD_VERSIONS'] 23 | beta_version = version.parse(version_config['beta']['tag']) 24 | stable_version = version.parse(version_config['stable']['tag']) 25 | show_beta = beta_version > stable_version 26 | return render_template('downloads.html', 27 | **version_config, show_beta=show_beta) 28 | 29 | 30 | @frontend_bp.get('/quick-start/') 31 | def show_quick_start(): 32 | return render_template('quick-start.html') 33 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | } 23 | 24 | .media-right, 25 | .media > .pull-right { 26 | padding-left: 10px; 27 | } 28 | 29 | .media-left, 30 | .media > .pull-left { 31 | padding-right: 10px; 32 | } 33 | 34 | .media-left, 35 | .media-right, 36 | .media-body { 37 | display: table-cell; 38 | vertical-align: top; 39 | } 40 | 41 | .media-middle { 42 | vertical-align: middle; 43 | } 44 | 45 | .media-bottom { 46 | vertical-align: bottom; 47 | } 48 | 49 | // Reset margins on headings for tighter default spacing 50 | .media-heading { 51 | margin-top: 0; 52 | margin-bottom: 5px; 53 | } 54 | 55 | // Media list variation 56 | // 57 | // Undo default ul/ol styles 58 | .media-list { 59 | padding-left: 0; 60 | list-style: none; 61 | } 62 | -------------------------------------------------------------------------------- /website/frontend/views/docs_test.py: -------------------------------------------------------------------------------- 1 | from website.frontend.testing import FrontendTestCase 2 | from flask import url_for 3 | from flask import current_app as app 4 | 5 | 6 | class ViewsTestCase(FrontendTestCase): 7 | 8 | def test_docs_root(self): 9 | "Test /docs/ main page" 10 | response = self.client.get("/docs/") 11 | self.assertStatus(response, status_code=301) 12 | self.assert_redirects(response, app.config['DOCS_BASE_URL'] + '/') 13 | 14 | def test_docs_redirect(self): 15 | "Test /docs/ valid sub-page" 16 | response = self.client.get("/docs/basics/") 17 | self.assertStatus(response, status_code=301) 18 | self.assert_redirects(response, app.config['DOCS_BASE_URL'] + '/en/introduction.html') 19 | 20 | def test_docs_subpage(self): 21 | "Test /docs/ valid sub-page" 22 | response = self.client.get("/docs/development/") 23 | self.assert200(response) 24 | 25 | def test_docs_404(self): 26 | "Test /docs/ invalid sub-page" 27 | response = self.client.get("/docs/404/") 28 | self.assert404(response) 29 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /website/frontend/scheduler.py: -------------------------------------------------------------------------------- 1 | 2 | from flask_apscheduler import APScheduler 3 | 4 | from website.build_plugins import generate_plugins 5 | from website.plugin_utils import load_json_data 6 | 7 | 8 | def init_scheduler(app): 9 | logger = app.logger 10 | config = app.config 11 | scheduler = APScheduler() 12 | scheduler.init_app(app) 13 | 14 | @scheduler.task('interval', id='plugins_generate', seconds=config['PLUGINS_REFRESH_INTERVAL_SECONDS']) 15 | def plugins_generate(): 16 | versions = [z['title'] for z in config['PLUGIN_VERSIONS'].values()] 17 | build_dir = config['PLUGINS_BUILD_DIR'] 18 | for version in versions: 19 | logger.info("Generating plugins for version %s in %s", version, build_dir) 20 | try: 21 | generate_plugins(build_dir, version) 22 | # Prefill the cache 23 | load_json_data(app, version, force_refresh=True) 24 | logger.info("Plugin generation for version %s successful.", version) 25 | except Exception as e: 26 | logger.error("Plugin generation for version %s failed: %s", version, e) 27 | 28 | 29 | scheduler.start() 30 | return scheduler 31 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | 17 | p { 18 | margin-bottom: (@jumbotron-padding / 2); 19 | font-size: @jumbotron-font-size; 20 | font-weight: 200; 21 | } 22 | 23 | > hr { 24 | border-top-color: darken(@jumbotron-bg, 10%); 25 | } 26 | 27 | .container &, 28 | .container-fluid & { 29 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 30 | } 31 | 32 | .container { 33 | max-width: 100%; 34 | } 35 | 36 | @media screen and (min-width: @screen-sm-min) { 37 | padding: (@jumbotron-padding * 1.6) 0; 38 | 39 | .container &, 40 | .container-fluid & { 41 | padding-left: (@jumbotron-padding * 2); 42 | padding-right: (@jumbotron-padding * 2); 43 | } 44 | 45 | h1, 46 | .h1 { 47 | font-size: (@font-size-base * 4.5); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/theme.less: -------------------------------------------------------------------------------- 1 | @import "boostrap/boostrap.less"; 2 | @import "variables.less"; 3 | @import "links.less"; 4 | @import "buttons.less"; 5 | @import "navbars.less"; 6 | @import "fonts.less"; 7 | 8 | // Fonts 9 | @font-family-sans-serif: 'Sintony', sans-serif; 10 | @headings-font-family: 'Roboto', sans-serif; 11 | @headings-font-weight: 300; 12 | @headings-line-height: 1.3; 13 | 14 | // Headings 15 | h1, h2, h3, h4, h5, h6, 16 | .h1, .h2, .h3, .h4, .h5, .h6 { 17 | color: @headings-font-color; 18 | small { 19 | font-size: 0.65em; 20 | font-weight: @headings-small-font-weight; 21 | } 22 | } 23 | 24 | .panel { 25 | color: @text-color; 26 | -webkit-box-shadow: none; 27 | box-shadow: none; 28 | border-bottom-color: @panel-inner-border; 29 | .panel-heading { 30 | font-family: @headings-font-family; 31 | font-weight: 200; 32 | line-height: @headings-line-height; 33 | outline: 1px solid @panel-inner-border; 34 | border-bottom-width: 1px; 35 | } 36 | } 37 | 38 | ul.hexagonBullet li:before, .hexagonBullet:not(ul):before { 39 | content: "\2B22"; 40 | margin-right: 0.5em; 41 | font-size: 0.5em; 42 | opacity: 0.42; 43 | vertical-align: middle; 44 | } 45 | 46 | ul.hexagonBullet { 47 | list-style: none; 48 | } 49 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:hover, 12 | &:focus, 13 | &.focus, 14 | &:active, 15 | &.active, 16 | .open > .dropdown-toggle& { 17 | color: @color; 18 | background-color: darken(@background, 10%); 19 | border-color: darken(@border, 12%); 20 | } 21 | &:active, 22 | &.active, 23 | .open > .dropdown-toggle& { 24 | background-image: none; 25 | } 26 | &.disabled, 27 | &[disabled], 28 | fieldset[disabled] & { 29 | &, 30 | &:hover, 31 | &:focus, 32 | &.focus, 33 | &:active, 34 | &.active { 35 | background-color: @background; 36 | border-color: @border; 37 | } 38 | } 39 | 40 | .badge { 41 | color: @background; 42 | background-color: @color; 43 | } 44 | } 45 | 46 | // Button sizes 47 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 48 | padding: @padding-vertical @padding-horizontal; 49 | font-size: @font-size; 50 | line-height: @line-height; 51 | border-radius: @border-radius; 52 | } 53 | -------------------------------------------------------------------------------- /website/frontend/views_test.py: -------------------------------------------------------------------------------- 1 | from website.frontend.testing import FrontendTestCase 2 | 3 | 4 | class ViewsTestCase(FrontendTestCase): 5 | 6 | def test_home_page(self): 7 | "Test /" 8 | response = self.client.get("/") 9 | self.assert200(response) 10 | 11 | def test_404(self): 12 | "Test 404 error" 13 | response = self.client.get("/404") 14 | self.assert404(response) 15 | 16 | def test_downloads(self): 17 | "Test /downloads/" 18 | response = self.client.get("/downloads/") 19 | self.assert200(response) 20 | 21 | def test_quick_start(self): 22 | "Test /quick-start/" 23 | response = self.client.get("/quick-start/") 24 | self.assert200(response) 25 | 26 | def test_home_page_french_cookie(self): 27 | "Test / in french (cookie)" 28 | server_name = self.app.config.get('SERVER_NAME') or 'localhost' 29 | self.client.set_cookie('language', 'fr', domain=server_name) 30 | response = self.client.get("/") 31 | self.assert200(response) 32 | self.assertIn(b'fichiers audio', response.data) 33 | 34 | def test_home_page_french_url(self): 35 | "Test / in french (url parameter)" 36 | response = self.client.get("/?l=fr") 37 | self.assert200(response) 38 | self.assertIn(b'fichiers audio', response.data) 39 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/buttons.less: -------------------------------------------------------------------------------- 1 | .btn { 2 | border: 0; 3 | border-radius: 0; 4 | transition: all 0.2s; 5 | margin: 0.15em; 6 | .button-size(@padding-small-vertical; @padding-small-horizontal * 2; @font-size-small; @line-height-small; 0px); 7 | } 8 | 9 | .button-variant(@color; @background:transparent; @border:@background) { 10 | color: @color; 11 | background: @background; 12 | &:hover, &:focus, &:active, &.active, .open .dropdown-toggle& { 13 | background: lighten(@background, 7%); 14 | } 15 | &.disabled, &[disabled], fieldset[disabled] & { 16 | &, &:hover, &:focus, &:active, &.active { 17 | color: lighten(@color, 10%); 18 | background: desaturate(@background, 15%); 19 | } 20 | } 21 | } 22 | 23 | .btn-link:before { 24 | border-color: transparent; 25 | &:hover, &:focus, &:active { border-color: @btn-primary-border; } 26 | } 27 | 28 | .btn-lg { 29 | // line-height: ensure even-numbered height of button next to large input 30 | .button-size(@padding-large-vertical; @padding-large-horizontal * 3; @font-size-large; @line-height-large; 0px); 31 | } 32 | 33 | .btn-sm, .btn-xs { 34 | // line-height: ensure proper height of button next to small input 35 | .button-size(@padding-small-vertical; @padding-small-horizontal * 1.5; @font-size-small; @line-height-small; 0px); 36 | } 37 | 38 | .btn-xs { 39 | padding: 1px 5px; 40 | } 41 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/boostrap.less: -------------------------------------------------------------------------------- 1 | // Feel free to disable modules that you don't need. 2 | 3 | 4 | // Core variables and mixins 5 | @import "variables.less"; 6 | @import "mixins.less"; 7 | 8 | // Reset and dependencies 9 | @import "normalize.less"; 10 | @import "print.less"; 11 | @import "glyphicons.less"; 12 | 13 | // Core CSS 14 | @import "scaffolding.less"; 15 | @import "type.less"; 16 | @import "code.less"; 17 | @import "grid.less"; 18 | @import "tables.less"; 19 | @import "forms.less"; 20 | @import "buttons.less"; 21 | 22 | // Components 23 | @import "component-animations.less"; 24 | @import "dropdowns.less"; 25 | @import "button-groups.less"; 26 | @import "input-groups.less"; 27 | @import "navs.less"; 28 | @import "navbar.less"; 29 | //@import "breadcrumbs.less"; 30 | @import "pagination.less"; 31 | @import "pager.less"; 32 | //@import "labels.less"; 33 | //@import "badges.less"; 34 | //@import "jumbotron.less"; 35 | @import "thumbnails.less"; 36 | @import "alerts.less"; 37 | //@import "progress-bars.less"; 38 | //@import "media.less"; 39 | @import "list-group.less"; 40 | @import "panels.less"; 41 | //@import "responsive-embed.less"; 42 | @import "wells.less"; 43 | //@import "close.less"; 44 | 45 | // Components w/ JavaScript 46 | //@import "modals.less"; 47 | @import "tooltip.less"; 48 | //@import "popovers.less"; 49 | @import "carousel.less"; 50 | 51 | // Utility classes 52 | @import "utilities.less"; 53 | @import "responsive-utilities.less"; 54 | -------------------------------------------------------------------------------- /website/expand.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import html 3 | import re 4 | 5 | 6 | def encode_entities(string, quote=True): 7 | return html.escape(string, quote).encode('ascii', 'xmlcharrefreplace').decode('utf8') 8 | 9 | 10 | def expand(string, args, tag='a', default_attribute='href'): 11 | 12 | def make_link(match): 13 | var = match.group(1) 14 | text = match.group(2) 15 | if text in args.keys(): 16 | final_text = args[text] 17 | else: 18 | final_text = text 19 | 20 | if isinstance(args[var], dict): 21 | d = args[var] 22 | else: 23 | if default_attribute: 24 | d = {default_attribute: args[var]} 25 | else: 26 | d = {} 27 | attribs = ' '.join(["%s=\"%s\"" % (k, encode_entities(d[k])) for k 28 | in sorted(d.keys())]) 29 | if attribs: 30 | attribs = ' ' + attribs 31 | return '<%s%s>%s' % (tag, attribs, final_text, tag) 32 | 33 | def simple_expr(match): 34 | var = match.group(1) 35 | if var in args.keys(): 36 | return args[var] 37 | return '{' + var + '}' 38 | 39 | r = '|'.join([re.escape(k) for k in args.keys()]) 40 | 41 | r1 = re.compile('\{(' + r + ')\|(.*?)\}', re.UNICODE) 42 | r2 = re.compile('\{(' + r + ')\}', re.UNICODE) 43 | 44 | string = r1.sub(make_link, string) 45 | string = r2.sub(simple_expr, string) 46 | 47 | return string 48 | -------------------------------------------------------------------------------- /website/frontend/views/changelog.py: -------------------------------------------------------------------------------- 1 | from urllib.request import urlopen 2 | from flask import current_app, Blueprint, render_template 3 | import re 4 | import mistune 5 | 6 | 7 | changelog_bp = Blueprint('changelog', __name__) 8 | re_version = re.compile(r'^Version\s+(.*?)\s+-\s+(.*?)$') 9 | version_header = '

    Version {0} {1}

    ' 10 | 11 | 12 | class ChangelogRenderer(mistune.HTMLRenderer): 13 | def heading(self, text, level, **attrs): 14 | if level == 1: 15 | match = re_version.match(text) 16 | if match: 17 | version = match.group(1) 18 | date = match.group(2).replace("xxxx-xx-xx", "Yet to be released") 19 | return version_header.format(version, date) 20 | return super().heading(text, level + 2) 21 | 22 | 23 | renderer = ChangelogRenderer() 24 | markdown = mistune.Markdown(renderer=renderer) 25 | 26 | 27 | def load_changelog(app): 28 | key = 'changelog_data' 29 | data = app.cache.get(key) 30 | if data is None: 31 | url = app.config['CHANGELOG_URL'] 32 | with urlopen(url) as conn: 33 | data = conn.read().decode("utf-8-sig") 34 | data = markdown(data) 35 | app.cache.set(key, data, timeout=app.config['CHANGELOG_CACHE_TIMEOUT']) 36 | return data 37 | 38 | 39 | @changelog_bp.get('/') 40 | def show_changelog(): 41 | app = current_app 42 | return render_template('changelog.html', changelog=load_changelog(app)) 43 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // Hover state, but only for links 39 | a& { 40 | &:hover, 41 | &:focus { 42 | color: @badge-link-hover-color; 43 | text-decoration: none; 44 | cursor: pointer; 45 | } 46 | } 47 | 48 | // Account for badges in navs 49 | .list-group-item.active > &, 50 | .nav-pills > .active > a > & { 51 | color: @badge-active-color; 52 | background-color: @badge-active-bg; 53 | } 54 | 55 | .list-group-item > & { 56 | float: right; 57 | } 58 | 59 | .list-group-item > & + & { 60 | margin-right: 5px; 61 | } 62 | 63 | .nav-pills > li > a > & { 64 | margin-left: 3px; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /website/frontend/static/less/highlightjs/default.less: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original highlight.js style (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | } 11 | 12 | 13 | /* Base color: saturation 0; */ 14 | 15 | .hljs, 16 | .hljs-subst { 17 | color: #444; 18 | } 19 | 20 | .hljs-comment { 21 | color: #888888; 22 | } 23 | 24 | .hljs-keyword, 25 | .hljs-attribute, 26 | .hljs-selector-tag, 27 | .hljs-meta-keyword, 28 | .hljs-doctag, 29 | .hljs-name { 30 | font-weight: bold; 31 | } 32 | 33 | 34 | /* User color: hue: 0 */ 35 | 36 | .hljs-type, 37 | .hljs-string, 38 | .hljs-number, 39 | .hljs-selector-id, 40 | .hljs-selector-class, 41 | .hljs-quote, 42 | .hljs-template-tag, 43 | .hljs-deletion { 44 | color: #880000; 45 | } 46 | 47 | .hljs-title, 48 | .hljs-section { 49 | color: #880000; 50 | font-weight: bold; 51 | } 52 | 53 | .hljs-regexp, 54 | .hljs-symbol, 55 | .hljs-variable, 56 | .hljs-template-variable, 57 | .hljs-link, 58 | .hljs-selector-attr, 59 | .hljs-selector-pseudo { 60 | color: #BC6060; 61 | } 62 | 63 | 64 | /* Language color: hue: 90; */ 65 | 66 | .hljs-literal { 67 | color: #78A960; 68 | } 69 | 70 | .hljs-built_in, 71 | .hljs-bullet, 72 | .hljs-code, 73 | .hljs-addition { 74 | color: #397300; 75 | } 76 | 77 | 78 | /* Meta color: hue: 200 */ 79 | 80 | .hljs-meta { 81 | color: #1f7199; 82 | } 83 | 84 | .hljs-meta-string { 85 | color: #4d99bf; 86 | } 87 | 88 | 89 | /* Misc effects */ 90 | 91 | .hljs-emphasis { 92 | font-style: italic; 93 | } 94 | 95 | .hljs-strong { 96 | font-weight: bold; 97 | } 98 | -------------------------------------------------------------------------------- /.github/workflows/docker-ci.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | permissions: 3 | contents: read 4 | 5 | on: 6 | push: 7 | branches: [ master ] 8 | tags: 9 | - 'v[0-9]+.*' 10 | 11 | jobs: 12 | 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Check Out Repo 19 | uses: actions/checkout@v5 20 | - 21 | name: Docker meta 22 | id: meta 23 | uses: docker/metadata-action@v5 24 | with: 25 | # list of Docker images to use as base name for tags 26 | images: | 27 | metabrainz/picard-website 28 | # generate Docker tags based on the following events/attributes 29 | tags: | 30 | type=ref,event=tag 31 | type=edge,branch=master 32 | flavor: | 33 | latest=auto 34 | prefix= 35 | suffix= 36 | - name: Login to Docker Hub 37 | uses: docker/login-action@v3 38 | with: 39 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 40 | password: ${{ secrets.DOCKER_HUB_PASSWORD }} 41 | 42 | - name: Set up Docker Buildx 43 | id: buildx 44 | uses: docker/setup-buildx-action@v3 45 | 46 | - name: Build and push 47 | id: docker_build 48 | uses: docker/build-push-action@v6 49 | with: 50 | context: ./ 51 | file: ./Dockerfile 52 | push: ${{ github.event_name != 'pull_request' }} 53 | tags: ${{ steps.meta.outputs.tags }} 54 | labels: ${{ steps.meta.outputs.labels }} 55 | 56 | - name: Image digest 57 | run: echo ${{ steps.docker_build.outputs.digest }} 58 | -------------------------------------------------------------------------------- /website/frontend/testing.py: -------------------------------------------------------------------------------- 1 | from flask_testing import TestCase 2 | from website.frontend import create_app 3 | from urllib.parse import urlparse, urljoin 4 | 5 | 6 | class FrontendTestCase(TestCase): 7 | 8 | def create_app(self): 9 | app = create_app() 10 | app.config['TESTING'] = True 11 | return app 12 | 13 | def setUp(self): 14 | pass 15 | 16 | def tearDown(self): 17 | pass 18 | 19 | # This overwrites https://github.com/jarus/flask-testing/blob/17f19d7fee0e1e176703fc7cb04917a77913ba1a/flask_testing/utils.py#L289 20 | # for status code 308 as used by Werkzeug >= 0.15 21 | def assertRedirects(self, response, location, message=None): 22 | """ 23 | Checks if response is an HTTP redirect to the 24 | given location. 25 | :param response: Flask response 26 | :param location: relative URL path to SERVER_NAME or an absolute URL 27 | """ 28 | parts = urlparse(location) 29 | 30 | if parts.netloc: 31 | expected_location = location 32 | else: 33 | server_name = self.app.config.get('SERVER_NAME') or 'localhost' 34 | expected_location = urljoin("http://%s" % server_name, location) 35 | 36 | valid_status_codes = (301, 302, 303, 305, 307, 308) 37 | valid_status_code_str = ', '.join(str(code) for code in valid_status_codes) 38 | not_redirect = "HTTP Status %s expected but got %d" % (valid_status_code_str, response.status_code) 39 | self.assertTrue(response.status_code in valid_status_codes, message or not_redirect) 40 | self.assertEqual(response.location, expected_location, message) 41 | -------------------------------------------------------------------------------- /website/frontend/static/js/js.cookie.min.js: -------------------------------------------------------------------------------- 1 | /*! js-cookie v3.0.1 | MIT */ 2 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t li > &:visited { color: @link-color; } 21 | .nav-pills > li > &:visited { color: @link-color; } 22 | .nav-pills > li.active > &:visited { 23 | &, &:hover, &:focus { color: @nav-pills-active-link-hover-color; } 24 | } 25 | .dropdown-menu > li > &:visited { 26 | color: @dropdown-link-color; 27 | &:hover, 28 | &:focus { 29 | color: @dropdown-link-hover-color; 30 | background-color: @dropdown-link-hover-bg; 31 | } 32 | } 33 | .dropdown-menu > li.disabled > &:visited { 34 | &, &:hover, &:focus { color: @dropdown-link-disabled-color; } 35 | } 36 | .pager > li > &:visited, .pagination > li > &:visited { 37 | &, &:hover, &:focus { color: @link-color; } 38 | } 39 | .pagination > .active > &:visited { 40 | &, &:hover, &:focus { color: @pagination-active-color; } 41 | } 42 | .pagination > .disabled > &:visited { 43 | &, &:hover, &:focus { color: @pagination-disabled-color; } 44 | } 45 | &.alert-link:visited { 46 | color: inherit; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /INSTALL-LINUX.md: -------------------------------------------------------------------------------- 1 | # Installation on Linux 2 | 3 | Pre-requisites: 4 | - python >= 3.3 5 | - python-dev (required to build some dependencies) 6 | - [poetry](https://python-poetry.org/) 7 | - git 8 | - nodejs 9 | - npm 10 | 11 | To install those on Ubuntu: 12 | ```bash 13 | sudo apt-get install python3 python3-dev python3-poetry git nodejs npm 14 | ``` 15 | 16 | Checkout picard-website and configure it: 17 | 18 | ```bash 19 | git clone https://github.com/musicbrainz/picard-website/ 20 | cd picard-website 21 | cp website/config.py.example website/config.py 22 | ``` 23 | 24 | Edit `website/config.py` so that `PLUGINS_BUILD_DIR` points to the directory where the plugin builds are to be generated: 25 | 26 | ```bash 27 | vim website/config.py 28 | ``` 29 | 30 | Install Python dependencies: 31 | 32 | ```bash 33 | poetry install 34 | ``` 35 | 36 | Install node dependencies (requires [Node.js](http://nodejs.org/download/)): 37 | 38 | ```bash 39 | npm install 40 | ``` 41 | 42 | Node dependencies (including less and cleancss, which are required to compile/minify CSS) are installed to `./node_modules`, and binaries are symlinked into `./node_modules/.bin`. You may want to add the latter into your `$PATH`. 43 | 44 | To retrieve [picard-plugins](https://github.com/musicbrainz/picard-plugins) repository and generate `plugins.json` and zipped plugin archives needed by Picard Website and plugins webservice, run: 45 | 46 | ```bash 47 | poetry run python plugins-generate.py 48 | ``` 49 | 50 | Compile CSS and translations: 51 | 52 | ```bash 53 | npm run build 54 | ``` 55 | 56 | To run the development server, do: 57 | 58 | ```bash 59 | poetry run python run.py 60 | ``` 61 | 62 | By default, it listens on 127.0.0.1 port 6060. 63 | This can be changed in `config.py` by modifying `SERVER_HOSTNAME` and `SERVER_PORT`. 64 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: @alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 13 | 14 | # Summary 15 | 16 | 19 | 20 | * This is a… 21 | * [x] Bug fix 22 | * [ ] Feature addition 23 | * [ ] Refactoring 24 | * [ ] Minor / simple change (like a typo) 25 | * [ ] Other 26 | * **Describe this change in 1-2 sentences**: 27 | 28 | # Problem 29 | 30 | 34 | 35 | * JIRA ticket (_optional_): [PW-XXX](https://tickets.metabrainz.org/browse/PW-XXX) 36 | 40 | 41 | 42 | 43 | # Solution 44 | 45 | 50 | 51 | 52 | # Action 53 | 54 | 58 | 59 | -------------------------------------------------------------------------------- /website/frontend/templates/docs/development.html: -------------------------------------------------------------------------------- 1 | {% extends 'docs/base.html' %} 2 | {% set git_doc = "development.html" %} 3 | {% set doc_title = _("Developing") %} 4 | {% block content %} 5 |
    6 |
    7 |
    8 |

    9 | The source code of Picard is maintained in Git and you can get it with all its history using: 10 |

    11 | 12 |
    git clone git://github.com/musicbrainz/picard.git
    13 | 14 |

    15 | or you can fork or clone the 16 | repository from GitHub in the normal 17 | GitHub way. Pull requests and discussion on GitHub is generally preferred and all such requests will 18 | be considered. 19 |

    20 | 21 |

    22 | If you are interested in providing development assistance, contact us in the 23 | MetaBrainz chat. 24 | To help by reporting bugs or finding a list of available tickets to work on, please have a look at the 25 | {{ _("Troubleshooting") }} page. 26 |

    27 | 28 |

    29 | If you want to install Picard from source, see 30 | MusicBrainz Picard Installation. 31 |

    32 | 33 |

    34 | For a more detailed setup of a development environment and our contribution guidelines see 35 | Contributing to Picard. 36 |

    37 | 38 |

    License

    39 |

    40 | Picard is licensed under the GPL 2.0 or later. 41 |

    42 |
    43 |
    44 |
    45 | {% endblock %} 46 | -------------------------------------------------------------------------------- /INSTALL-WINDOWS.md: -------------------------------------------------------------------------------- 1 | # Installation on Windows 2 | 3 | Pre-requisites: 4 | - python >= 3.3 5 | - [poetry](https://python-poetry.org/) 6 | - Github for Windows or equivalent 7 | - nodejs and npm 8 | 9 | Download and install `Python 3+` from https://www.python.org/downloads/ 10 | 11 | Download and install `Node.js` from https://nodejs.org/en/download/current/ 12 | 13 | Open a new **Administrator** command prompt and check that both `Python` and `Node.js` are in your path environment variable. 14 | You may need to reboot for this to become visible. 15 | 16 | Download and install [`GitHub for Windows`](https://desktop.github.com/) 17 | 18 | Use GitHub for Windows to fork and clone the `metabrainz/Picard-Website` repo(sitory). 19 | 20 | In the command prompt, navigate to the directory for your new clone and run: 21 | 22 | ``` 23 | copy website/config.py.example website/config.py 24 | ``` 25 | 26 | Edit `website/config.py` so that `PLUGINS_REPOSITORY` points to your local copy of the picard-plugins repository etc. 27 | 28 | If not already installed, install poetry now: 29 | 30 | ``` 31 | pip install poetry 32 | ``` 33 | 34 | Install Python dependencies: 35 | ``` 36 | poetry install 37 | ``` 38 | 39 | Install node dependencies: 40 | ``` 41 | npm install 42 | ``` 43 | 44 | Node dependencies (including less and cleancss, which are required to compile/minify CSS) are installed to `./node_modules`, 45 | and batch files are installed into `./node_modules/.bin`. You may want to add the latter into your path environment variable. 46 | 47 | To retrieve [picard-plugins](https://github.com/musicbrainz/picard-plugins) repository 48 | and generate `plugins.json` and zipped plugin archives needed by Picard Website and plugins webservice, run: 49 | 50 | ``` 51 | poetry run python plugins-generate.py 52 | ``` 53 | 54 | Compile CSS and translations: 55 | 56 | ``` 57 | npm run build 58 | ``` 59 | 60 | To run the development server, do: 61 | 62 | ``` 63 | poetry run python run.py 64 | ``` 65 | 66 | By default, it listens on 127.0.0.1 port 6060. 67 | This can be changed in `config.py` by modifying `SERVER_HOSTNAME` and `SERVER_PORT`. 68 | -------------------------------------------------------------------------------- /website/frontend/views/docs.py: -------------------------------------------------------------------------------- 1 | from website.frontend import template_folder 2 | from flask import ( 3 | Blueprint, 4 | abort, 5 | current_app as app, 6 | redirect, 7 | render_template, 8 | ) 9 | 10 | import os 11 | 12 | docs_bp = Blueprint('docs', __name__) 13 | 14 | 15 | def redirect_docs(path): 16 | return redirect(app.config['DOCS_BASE_URL'] + path, code=301) 17 | 18 | @docs_bp.get('/') 19 | def show_docs(): 20 | return redirect_docs('/') 21 | 22 | @docs_bp.get('/basics/') 23 | def show_basics(): 24 | return redirect_docs('/en/introduction.html') 25 | 26 | @docs_bp.get('/options/') 27 | def show_options(): 28 | return redirect_docs('/en/config/configuration.html') 29 | 30 | @docs_bp.get('/faq/') 31 | def show_faq(): 32 | return redirect_docs('/en/faq/faq.html') 33 | 34 | @docs_bp.get('/troubleshooting/') 35 | def show_troubleshooting(): 36 | return redirect_docs('/en/troubleshooting/troubleshooting.html') 37 | 38 | @docs_bp.get('/scripting/') 39 | def show_scripting(): 40 | return redirect_docs('/en/scripting.html') 41 | 42 | @docs_bp.get('/tags/') 43 | def show_tags(): 44 | return redirect_docs('/en/variables/variables.html') 45 | 46 | @docs_bp.get('/mappings/') 47 | def show_mappings(): 48 | return redirect_docs('/en/appendices/tag_mapping.html') 49 | 50 | @docs_bp.get('/plugin-api/') 51 | def show_plugin_api(): 52 | return redirect_docs('/en/appendices/plugins_api.html') 53 | 54 | @docs_bp.get('/linux/') 55 | def show_install_linux(): 56 | return redirect_docs('/en/getting_started/download.html#installing-picard-on-linux') 57 | 58 | @docs_bp.get('/build-osx/') 59 | def show_build_osx(): 60 | return redirect('https://github.com/metabrainz/picard/blob/master/INSTALL.md') 61 | 62 | @docs_bp.get('/build-windows/') 63 | def show_build_windows(): 64 | return redirect('https://github.com/metabrainz/picard/blob/master/INSTALL.md') 65 | 66 | @docs_bp.get('//') 67 | def show_pages(page): 68 | if os.path.isfile(os.path.join(template_folder, 'docs', page + '.html')): 69 | return render_template('docs/' + page + '.html') 70 | else: 71 | abort(404) 72 | -------------------------------------------------------------------------------- /website/frontend/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | import os 4 | from .errors import init_error_handlers 5 | from .babel import init_app 6 | from .scheduler import init_scheduler 7 | 8 | frontend_folder = os.path.dirname(os.path.abspath(__file__)) 9 | template_folder = os.path.join(frontend_folder, 'templates') 10 | static_folder = os.path.join(frontend_folder, 'static') 11 | 12 | 13 | def create_app(): 14 | app = Flask(__name__, static_folder=static_folder, 15 | template_folder=template_folder) 16 | app.debug = True 17 | 18 | # Configuration files 19 | app.config.from_pyfile(os.path.join( 20 | os.path.dirname(os.path.realpath(__file__)), 21 | '..', 'default_config.py' 22 | )) 23 | app.config.from_pyfile(os.path.join( 24 | os.path.dirname(os.path.realpath(__file__)), 25 | '..', 'config.py' 26 | ), silent=True) 27 | 28 | # Error handling 29 | init_error_handlers(app) 30 | 31 | # I18n 32 | init_app(app) 33 | 34 | # Caching 35 | try: 36 | from cachelib import UWSGICache 37 | app.cache = UWSGICache() 38 | except (ModuleNotFoundError, RuntimeError): 39 | from cachelib import SimpleCache 40 | app.cache = SimpleCache() 41 | 42 | # Initialize scheduler 43 | init_scheduler(app) 44 | 45 | # Template utilities 46 | app.jinja_env.add_extension('jinja2.ext.do') 47 | 48 | from website.expand import expand 49 | app.jinja_env.filters['expand'] = expand 50 | 51 | # Blueprints 52 | from .views import frontend_bp 53 | from .views.changelog import changelog_bp 54 | from .views.humans import humans_bp 55 | from .views.plugins import plugins_bp 56 | from .views.docs import docs_bp 57 | from .views.api import api_bp 58 | 59 | app.register_blueprint(frontend_bp) 60 | app.register_blueprint(changelog_bp, url_prefix='/changelog') 61 | app.register_blueprint(humans_bp) 62 | app.register_blueprint(plugins_bp, url_prefix='/plugins') 63 | app.register_blueprint(docs_bp, url_prefix='/docs') 64 | app.register_blueprint(api_bp, url_prefix='/api') 65 | 66 | return app 67 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "picard-website" 3 | version = "0.1.0" 4 | description = "Website for MusicBrainz Picard" 5 | authors = [ 6 | "Shadab Zafar ", 7 | "Michael Wiencek ", 8 | "Laurent Monin ", 9 | "Sambhav Kothari ", 10 | "Philipp Wolfer ", 11 | "Sophist ", 12 | "Bob Swift ", 13 | "Wieland Hoffmann ", 14 | "Raptorial ", 15 | "Roman Tsukanov ", 16 | "TheJYKoder ", 17 | "Frederik “Freso” S. Olesen ", 18 | "Hartama Putra ", 19 | "Wieland Hoffmann ", 20 | "Nicolás Tamargo ", 21 | "Abhigyan Khaund ", 22 | "Aerozol ", 23 | "Mathieu Bridon ", 24 | "Akash Nagaraj ", 25 | "Anjali Ujjainia ", 26 | "Justin W. Flory ", 27 | "LeoVerto ", 28 | "Mark Trolley ", 29 | "Rahul Kumar Gupta ", 30 | "Shen-Ta Hsieh ", 31 | "Sumit Ghosh ", 32 | "Suraj Nath ", 33 | "Theodore Fabian Rudy ", 34 | "Ville Skyttä ", 35 | "jomo ", 36 | "vedantc98 ", 37 | ] 38 | package-mode = false 39 | 40 | 41 | [tool.poetry.dependencies] 42 | python = "^3.9" 43 | blinker = "^1.9" 44 | cachelib = "^0.13.0" 45 | Flask = "^3.1.1" 46 | Flask-APScheduler = "^1.13.1" 47 | Flask-Babel = "^4.0.0" 48 | Markdown = "^3.8" 49 | mistune = "^3.1.3" 50 | packaging = "^25.0" 51 | jinja2 = "^3.1.6" 52 | 53 | [tool.poetry.group.dev.dependencies] 54 | Flask-Testing = "^0.8.1" 55 | pytest = "^8.4.1" 56 | pytest-cov = "^7.0.0" 57 | 58 | [build-system] 59 | requires = ["poetry-core>=1.0.0"] 60 | build-backend = "poetry.core.masonry.api" 61 | -------------------------------------------------------------------------------- /website/frontend/static/less/styles.less: -------------------------------------------------------------------------------- 1 | // Font Awesome 2 | @import "fontawesome/variables.less"; 3 | @import "fontawesome/mixins.less"; 4 | @import "fontawesome/path.less"; 5 | @import "fontawesome/core.less"; 6 | @import "fontawesome/larger.less"; 7 | //@import "fontawesome/fixed-width.less"; 8 | //@import "fontawesome/list.less"; 9 | //@import "fontawesome/bordered-pulled.less"; 10 | @import "fontawesome/spinning.less"; 11 | //@import "fontawesome/rotated-flipped.less"; 12 | //@import "fontawesome/stacked.less"; 13 | @import "fontawesome/icons.less"; 14 | 15 | @icon-font-path: "/static/fonts/"; 16 | @fa-font-path: "/static/fonts/"; 17 | 18 | 19 | @import "theme/theme.less"; 20 | @import "highlightjs/default.less"; 21 | @import "highlightjs/picard.less"; 22 | 23 | @import "pages/index.less"; 24 | @import "pages/downloads.less"; 25 | @import "pages/changelog.less"; 26 | @import "pages/mappings.less"; 27 | @import "pages/plugins.less"; 28 | 29 | @import "docs.less"; 30 | @import "dataTables.less"; 31 | 32 | @brand-primary: @orange; 33 | @brand-secondary: @purple; 34 | 35 | body { 36 | padding-bottom: 25px; 37 | } 38 | 39 | // Navbar 40 | .navbar { 41 | @logo-width: 100px + 15px; 42 | .navbar-variant(@purple, @logo-width); 43 | img { 44 | margin-top: 0px !important; 45 | } 46 | .support-link { 47 | > a { 48 | background-color: @orange !important; 49 | &:hover, &:focus { 50 | background-color: darken(@orange, 6.5%) !important; 51 | } 52 | } 53 | } 54 | } 55 | 56 | // Footer 57 | .footer { 58 | hr { 59 | border: none; 60 | height: 8px; 61 | background: linear-gradient(to right, #771b85, #eb743b); 62 | } 63 | 64 | h3 { 65 | font-size: 2rem; 66 | font-weight: 600; 67 | } 68 | 69 | ul { 70 | line-height: 2; 71 | } 72 | 73 | li > .fa { 74 | padding-right: 8px; 75 | } 76 | 77 | .section-line { 78 | padding-top: 30px; 79 | border-top: 1px solid #ddd; 80 | text-align: center; 81 | } 82 | } 83 | 84 | pre { 85 | margin-top: 15px; 86 | margin-bottom: 15px; 87 | border-left: 10px solid @brand-primary; 88 | 89 | counter-reset: line-numbering; 90 | padding-left: 5px; 91 | border-radius: 3px; 92 | word-break: normal; 93 | } 94 | -------------------------------------------------------------------------------- /website/config.py.example: -------------------------------------------------------------------------------- 1 | #PLUGINS_BUILD_DIR = "/home/user/.config/PW/plugins" 2 | #PLUGINS_REFRESH_INTERVAL_SECONDS = 12 * 60 * 60 3 | #PLUGINS_CACHE_TIMEOUT = 5 * 60 4 | #PLUGIN_VERSIONS = { 5 | # 'v1': { 6 | # 'title': '1.0', 7 | # 'response': 'The endpoints currently available for this api version' \ 8 | # ' are /api/v1/plugins and /api/v1/download', 9 | # }, 10 | # 'v2': { 11 | # 'title': '2.0', 12 | # 'response': 'The endpoints currently available for this api version' \ 13 | # ' are /api/v2/plugins, /api/v2/download and /api/v2/releases', 14 | # }, 15 | #} 16 | # 17 | ## PICARD_VERSIONS dictionary valid keys are: 'stable', 'beta' and 'dev'. 18 | ## The 'version' tuple comprises int_major, int_minor, int_micro, str_type and int_development as defined in PEP-440. 19 | ## The Picard developers have standardized on using only 'dev' or 'final' as the str_type segment of the version tuple. 20 | #PICARD_VERSIONS = { 21 | # 'stable': { 22 | # 'tag': '2.0.1', 23 | # 'version': ( 2, 0, 1, 'final', 0), 24 | # 'urls': { 25 | # 'download': 'https://picard.musicbrainz.org/', 26 | # 'changelog': 'https://picard.musicbrainz.org/changelog/', 27 | # } 28 | # }, 29 | # 'beta': { 30 | # 'tag': '2.0.0.beta3', 31 | # 'version': ( 2, 0, 0, 'dev', 6), 32 | # 'urls': { 33 | # 'download': 'https://github.com/metabrainz/picard/releases/tag/2.0.0dev6', 34 | # 'changelog': 'https://github.com/metabrainz/picard/compare/2.0.0dev6...master', 35 | # } 36 | # }, 37 | # 'dev': { 38 | # 'tag': '2.0.2.dev1', 39 | # 'version': ( 2, 0, 2, 'dev', 1), 40 | # 'urls': { 41 | # 'download': 'https://github.com/metabrainz/picard', 42 | # } 43 | # }, 44 | #} 45 | # 46 | #DOCS_BASE_URL = "https://picard-docs.musicbrainz.org" 47 | #CHANGELOG_URL = "https://raw.githubusercontent.com/musicbrainz/picard/master/NEWS.md" 48 | #FILESERVER_URL = "https://data.musicbrainz.org/pub/musicbrainz/picard" 49 | #CHANGELOG_CACHE_TIMEOUT = 5 * 60 50 | # 51 | #SUPPORTED_LANGUAGES = [ 52 | # 'en', 53 | # 'fr', 54 | #] 55 | # 56 | #SERVER_HOSTNAME = "127.0.0.1" 57 | #SERVER_PORT = 6060 58 | #SCHEDULER_API_ENABLED = True -------------------------------------------------------------------------------- /website/frontend/static/less/pages/index.less: -------------------------------------------------------------------------------- 1 | .masthead { 2 | padding-top: 50px; 3 | padding-bottom: 50px; 4 | 5 | div.row div { 6 | text-align: center; 7 | } 8 | 9 | h1 { 10 | font-size: 2.6em; 11 | width: 100%; 12 | font-weight: 500; 13 | } 14 | 15 | p { 16 | font-size: 16px; 17 | line-height: 2; 18 | } 19 | 20 | .download-btn { 21 | color: #fff; 22 | margin-top: 20px; 23 | padding: 20px 25px; 24 | font-size: 16px; 25 | border: 0px none; 26 | border-radius: 6px; 27 | background-color: #EB743B; 28 | 29 | .download-title { 30 | font-size: 16px; 31 | } 32 | 33 | #download-info { 34 | display: block; 35 | margin-top: 5px; 36 | font-size: 12px; 37 | } 38 | 39 | &:hover { 40 | background-color: #EE8B5B; 41 | } 42 | 43 | &:active { 44 | background-image: none; 45 | background-color: #04C; 46 | } 47 | } 48 | 49 | .masthead-links { 50 | margin: 2em 0; 51 | padding: 0; 52 | list-style: none; 53 | 54 | a { 55 | color: darken(#fff, 45%); 56 | } 57 | 58 | li { 59 | display: inline; 60 | padding-left: 15px; 61 | } 62 | } 63 | 64 | #screenshot { 65 | display: inline; 66 | } 67 | 68 | .picard-icon { 69 | height: 60px; 70 | width: 60px; 71 | } 72 | 73 | @media (min-width: 400px) { 74 | .download-btn { 75 | font-size: 25px; 76 | 77 | .download-title { 78 | font-size: 25px; 79 | } 80 | } 81 | } 82 | 83 | @media (min-width: 590px) { 84 | h1 { 85 | font-size: 3em; 86 | } 87 | } 88 | 89 | @media (min-width: 730px) { 90 | h1 { 91 | font-size: 4em; 92 | } 93 | 94 | p { 95 | font-size: 25px; 96 | } 97 | 98 | .picard-icon { 99 | height: 115px; 100 | width: 115px; 101 | } 102 | } 103 | } 104 | 105 | .features { 106 | text-align: center; 107 | 108 | .row .col-md-4 { 109 | padding-top: 50px; 110 | } 111 | 112 | padding-bottom: 50px; 113 | } 114 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | // Bar itself 23 | // ------------------------- 24 | 25 | // Outer container 26 | .progress { 27 | overflow: hidden; 28 | height: @line-height-computed; 29 | margin-bottom: @line-height-computed; 30 | background-color: @progress-bg; 31 | border-radius: @progress-border-radius; 32 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 33 | } 34 | 35 | // Bar of progress 36 | .progress-bar { 37 | float: left; 38 | width: 0%; 39 | height: 100%; 40 | font-size: @font-size-small; 41 | line-height: @line-height-computed; 42 | color: @progress-bar-color; 43 | text-align: center; 44 | background-color: @progress-bar-bg; 45 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 46 | .transition(width .6s ease); 47 | } 48 | 49 | // Striped bars 50 | // 51 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 52 | // `.progress-bar-striped` class, which you just add to an existing 53 | // `.progress-bar`. 54 | .progress-striped .progress-bar, 55 | .progress-bar-striped { 56 | #gradient > .striped(); 57 | background-size: 40px 40px; 58 | } 59 | 60 | // Call animation for the active one 61 | // 62 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 63 | // `.progress-bar.active` approach. 64 | .progress.active .progress-bar, 65 | .progress-bar.active { 66 | .animation(progress-bar-stripes 2s linear infinite); 67 | } 68 | 69 | 70 | // Variations 71 | // ------------------------- 72 | 73 | .progress-bar-success { 74 | .progress-bar-variant(@progress-bar-success-bg); 75 | } 76 | 77 | .progress-bar-info { 78 | .progress-bar-variant(@progress-bar-info-bg); 79 | } 80 | 81 | .progress-bar-warning { 82 | .progress-bar-variant(@progress-bar-warning-bg); 83 | } 84 | 85 | .progress-bar-danger { 86 | .progress-bar-variant(@progress-bar-danger-bg); 87 | } 88 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | color: @pagination-hover-color; 44 | background-color: @pagination-hover-bg; 45 | border-color: @pagination-hover-border; 46 | } 47 | } 48 | 49 | > .active > a, 50 | > .active > span { 51 | &, 52 | &:hover, 53 | &:focus { 54 | z-index: 2; 55 | color: @pagination-active-color; 56 | background-color: @pagination-active-bg; 57 | border-color: @pagination-active-border; 58 | cursor: default; 59 | } 60 | } 61 | 62 | > .disabled { 63 | > span, 64 | > span:hover, 65 | > span:focus, 66 | > a, 67 | > a:hover, 68 | > a:focus { 69 | color: @pagination-disabled-color; 70 | background-color: @pagination-disabled-bg; 71 | border-color: @pagination-disabled-border; 72 | cursor: @cursor-disabled; 73 | } 74 | } 75 | } 76 | 77 | // Sizing 78 | // -------------------------------------------------- 79 | 80 | // Large 81 | .pagination-lg { 82 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 83 | } 84 | 85 | // Small 86 | .pagination-sm { 87 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 88 | } 89 | -------------------------------------------------------------------------------- /website/frontend/babel.py: -------------------------------------------------------------------------------- 1 | from flask import g, request, abort 2 | from flask_babel import Babel, Locale, get_locale 3 | 4 | 5 | def init_app(app): 6 | with app.app_context(): 7 | babel = Babel(app) 8 | available_locales = babel.list_translations() 9 | desired_languages = app.config['SUPPORTED_LANGUAGES'] 10 | 11 | found_locales = {} 12 | for language in desired_languages: 13 | try: 14 | locale = Locale.parse(language) 15 | if locale in available_locales: 16 | found_locales[language] = locale.language_name 17 | except BaseException as e: 18 | app.logger.error('%s', e) 19 | 20 | if not found_locales: 21 | found_locales = {str(l): l.language_name for l in available_locales} 22 | 23 | app.config['LANGUAGES'] = found_locales 24 | app.logger.debug('Languages: %r', list(app.config['LANGUAGES'])) 25 | 26 | @app.after_request 27 | def call_after_request_callbacks(response): 28 | for callback in getattr(g, 'after_request_callbacks', ()): 29 | callback(response) 30 | return response 31 | 32 | def after_this_request(f): 33 | if not hasattr(g, 'after_request_callbacks'): 34 | g.after_request_callbacks = [] 35 | g.after_request_callbacks.append(f) 36 | return f 37 | 38 | def get_locale(): 39 | languages = list(app.config['LANGUAGES']) 40 | language_arg = request.args.get('l') 41 | if language_arg is not None: 42 | if language_arg in languages: 43 | @after_this_request 44 | def remember_language(response): 45 | response.set_cookie('language', language_arg) 46 | 47 | return language_arg 48 | else: 49 | abort(400) 50 | else: 51 | language_cookie = request.cookies.get('language') 52 | if language_cookie is not None: 53 | if language_cookie in languages: 54 | return language_cookie 55 | else: 56 | abort(400) 57 | 58 | return request.accept_languages.best_match(languages) 59 | 60 | @app.context_processor 61 | def inject_language_var(): 62 | return { 63 | 'active_language': get_locale(), 64 | } 65 | 66 | babel.init_app(app, locale_selector=get_locale) 67 | -------------------------------------------------------------------------------- /website/frontend/static/img/picard-navbar-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 19 | 23 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/print.less: -------------------------------------------------------------------------------- 1 | /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 2 | 3 | // ========================================================================== 4 | // Print styles. 5 | // Inlined to avoid the additional HTTP request: h5bp.com/r 6 | // ========================================================================== 7 | 8 | @media print { 9 | *, 10 | *:before, 11 | *:after { 12 | background: transparent !important; 13 | color: #000 !important; // Black prints faster: h5bp.com/s 14 | box-shadow: none !important; 15 | text-shadow: none !important; 16 | } 17 | 18 | a, 19 | a:visited { 20 | text-decoration: underline; 21 | } 22 | 23 | a[href]:after { 24 | content: " (" attr(href) ")"; 25 | } 26 | 27 | abbr[title]:after { 28 | content: " (" attr(title) ")"; 29 | } 30 | 31 | // Don't show links that are fragment identifiers, 32 | // or use the `javascript:` pseudo protocol 33 | a[href^="#"]:after, 34 | a[href^="javascript:"]:after { 35 | content: ""; 36 | } 37 | 38 | pre, 39 | blockquote { 40 | border: 1px solid #999; 41 | page-break-inside: avoid; 42 | } 43 | 44 | thead { 45 | display: table-header-group; // h5bp.com/t 46 | } 47 | 48 | tr, 49 | img { 50 | page-break-inside: avoid; 51 | } 52 | 53 | img { 54 | max-width: 100% !important; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Bootstrap specific changes start 70 | // 71 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 72 | // Once fixed, we can just straight up remove this. 73 | select { 74 | background: #fff !important; 75 | } 76 | 77 | // Bootstrap components 78 | .navbar { 79 | display: none; 80 | } 81 | .btn, 82 | .dropup > .btn { 83 | > .caret { 84 | border-top-color: #000 !important; 85 | } 86 | } 87 | .label { 88 | border: 1px solid #000; 89 | } 90 | 91 | .table { 92 | border-collapse: collapse !important; 93 | 94 | td, 95 | th { 96 | background-color: #fff !important; 97 | } 98 | } 99 | .table-bordered { 100 | th, 101 | td { 102 | border: 1px solid #ddd !important; 103 | } 104 | } 105 | 106 | // Bootstrap specific changes end 107 | } 108 | -------------------------------------------------------------------------------- /website/frontend/static/less/docs.less: -------------------------------------------------------------------------------- 1 | #docs 2 | { 3 | h1 4 | { 5 | margin: 40px 0px 20px; 6 | padding-bottom: 10px; 7 | border-bottom: 1px solid #EEE; 8 | } 9 | 10 | h3 11 | { 12 | margin: 40px 0px 10px; 13 | } 14 | 15 | ul.options 16 | { 17 | margin-top: 15px; 18 | 19 | & > li 20 | { 21 | margin-bottom: 10px; 22 | } 23 | } 24 | 25 | ol.guide 26 | { 27 | margin-top: 15px; 28 | 29 | & > li 30 | { 31 | margin-bottom: 15px; 32 | 33 | img.img-thumbnail 34 | { 35 | margin-top: 10px; 36 | margin-bottom: 10px; 37 | } 38 | } 39 | } 40 | } 41 | 42 | #sidebar 43 | { 44 | 45 | list-style: none outside none; 46 | 47 | a { 48 | display: block; 49 | padding: 4px 15px; 50 | font-size: 14px; 51 | color: #999; 52 | 53 | &:hover, &:focus, &:active { 54 | color: #771B85; 55 | text-decoration: none; 56 | background-color: transparent; 57 | padding-left: 14px; 58 | border-left: 1px solid #771B85; 59 | } 60 | } 61 | 62 | .nav 63 | { 64 | ul 65 | { 66 | display: none; 67 | } 68 | 69 | .active 70 | { 71 | ul 72 | { 73 | display: block; 74 | padding-left: 13px; 75 | padding-bottom: 10px; 76 | } 77 | } 78 | 79 | & > .active, & > .active:hover, & > .active:focus 80 | { 81 | & > a 82 | { 83 | color: #771B85; 84 | text-decoration: none; 85 | background-color: transparent; 86 | padding-left: 13px; 87 | border-left: 2px solid #771B85; 88 | } 89 | } 90 | } 91 | 92 | .affix 93 | { 94 | position: fixed; 95 | top: 15px; 96 | } 97 | } 98 | 99 | 100 | #scripting_technical_variables, #scripting_functions 101 | { 102 | ul 103 | { 104 | list-style-type: none; 105 | 106 | li.added 107 | { 108 | font-style: italic; 109 | font-size: 90%; 110 | } 111 | 112 | li.note 113 | { 114 | background-color: #ffeeee; 115 | margin-top: 10px; 116 | } 117 | } 118 | 119 | h3 120 | { 121 | font-family: @font-family-monospace; 122 | margin-top: 16px; 123 | font-size: 110%; 124 | color: darkred; 125 | background-color: transparent; 126 | white-space: nowrap; 127 | border-radius: @border-radius-base; 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /website/frontend/static/less/theme/boostrap/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `@input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | .form-control-focus(@color: @input-border-focus) { 56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 57 | &:focus { 58 | border-color: @color; 59 | outline: 0; 60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. `