{"id":24093223,"url":"https://github.com/umd-lib/django-umd-lib-style","last_synced_at":"2026-01-03T08:57:11.005Z","repository":{"id":232609127,"uuid":"784761367","full_name":"umd-lib/django-umd-lib-style","owner":"umd-lib","description":"Django app that provides theming for UMD Libraries applications.","archived":false,"fork":false,"pushed_at":"2024-07-26T14:12:04.000Z","size":208,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T23:23:21.827Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umd-lib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-10T14:00:53.000Z","updated_at":"2024-07-24T15:05:01.000Z","dependencies_parsed_at":"2024-06-14T19:05:53.618Z","dependency_job_id":"fd24c9f7-4b8f-4f3a-8720-0d97a290f6f4","html_url":"https://github.com/umd-lib/django-umd-lib-style","commit_stats":null,"previous_names":["umd-lib/django-umd-lib-style"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fdjango-umd-lib-style","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fdjango-umd-lib-style/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fdjango-umd-lib-style/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fdjango-umd-lib-style/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umd-lib","download_url":"https://codeload.github.com/umd-lib/django-umd-lib-style/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244306069,"owners_count":20431737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-10T09:26:15.018Z","updated_at":"2026-01-03T08:57:11.000Z","avatar_url":"https://github.com/umd-lib.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-umd-lib-style\n\nDjango app that provides theming for UMD Libraries applications.\n\n## Installation\n\n```zsh\npip install django-umd-lib-style\n```\n\n## Setup\n\nAdd `umd_lib_style` to the `INSTALLED_APPS` list in your Django\nproject's `settings.py` file:\n\n```python\nINSTALLED_APPS = [\n    ...,\n    'umd_lib_style',\n    ...,\n]\n```\n\nTo get some useful values (application name and version, navigation links)\nin the context for every request, add this context processor to your\nproject's `settings.py`:\n\n```python\nTEMPLATES = [\n    {\n        'OPTIONS': {\n            'context_processors': [\n                ...,\n                'umd_lib_style.context_processors.app_info',\n            ],\n        },\n    },\n]\n```\n\n## Templates\n\nThis app comes with a base template that provides the basic layout for the\npage (header with environment banner, logo, application name, navigation\nlinks, and a footer with the application name and version, and the UMD web\naccessibility link).\n\nThe easiest way to get the default page layout on your app's pages is to\ncreate a `base.html` template for your views that extends the\n`umd_lib_style/base.html` template:\n\n```html\n{% extends 'umd_lib_style/base.html' %}\n{% block head %}\n... any HTML that should go into every page's \u0026lt;head\u0026gt; element ...\n{% endblock %}\n{% block main %}\n... any HTML that should precede a specific page's content ...\n{% block content %}{% endblock %}\n... any HTML that should follow a specific page's content ...\n{% endblock %}\n```\n\nThen, your individual page templates would extend this template, and\nsupply their content in the `content` block:\n\n```html\n{% extends 'my_app/base.html` %}\n{% block content %}\n\u003cp\u003eHello, world!\u003c/p\u003e\n{% endblock %}\n```\n\nThe umd-lib-style base template includes an `h1` element whose content is\ntaken from the value of the `title` context variable. It will also render\nany messages in the context. Both of these are rendered before the `main`\nblock.\n\n### Context Values\n\nIf you have enabled the `umd_lib_style.context_processors.app_info`\ncontext processor, then you will have access to the following variables in\nall of your templates:\n\n* `application_name` (str)\n* `application_version` (str)\n* `navigation_links` (dict)\n* `footer_links` (dict)\n\nMany of these are controlled by settings from your `settings.py` file.\n\n## Settings\n\nThere are some additional values you should set in your `settings.py`:\n\n### `PROJECT_PACKAGE_NAME`\n\n- Type: String\n- Default value: `None`\n\nThe application version is taken from this package's version using\n`importlib.metadata.version(PROJECT_PACKAGE_NAME)`. That version is\navailable in templates as `application_version`.\n\n### `APPLICATION_NAME`\n\n- Type: String\n- Default value: `\"App\"`\n\nApplication name to be displayed in the header and footer. Available in\ntemplates as `application_name`.\n\n### `NAVIGATION_LINKS`\n\n- Type: Dictionary or string\n- Default value: `{}`\n\nDictionary mapping view names to labels. It is used to generate the\nnavigation links in the header. Available in templates as `navigation_links`.\n\nIf a string is given, it is interpreted as the fully qualified name for a \ncallable that will be run to generate the navigation links dictionary at \nrequest time. It must accept a single argument, a `django.http.HttpRequest`\nobject representing the current request.\n\n### `FOOTER_LINKS`\n\n- Type: Dictionary or string\n- Default value: `{}`\n\nDictionary mapping view names to labels. It is used to generate the\nnavigation links in the footer. Available in templates as `footer_links`.\n\nIf a string is given, it is interpreted as the fully qualified name for a\ncallable that will be run to generate the navigation links dictionary at\nrequest time. It must accept a single argument, a `django.http.HttpRequest`\nobject representing the current request.\n\n### `ENVIRONMENT`\n\n- Type: String\n- Default value: `\"development\"`\n\nUsed to trigger the display of the standard environment banner at the top\nof every page. Should be one of `\"development\"`, `\"test\"`, or `\"qa\"`. Any\nother value will suppress the display of the environment banner.\n\n## CSS\n\n### Custom Properties (a.k.a.\"Variables\")\n\nThe included stylesheet defines a number of values using CSS custom\nproperties. Many of these are color values, but a few deal with fonts and\nlayout. They are all applied using the `:root` pseudo-element. See\n[umd_lib_style.css](src/umd_lib_style/static/umd_lib_style/umd_lib_style.css)\nfor the full list.\n\n### Button Styles\n\nIn addition to providing basic thematic and layout styling in accordance\nwith UMD's brand guidelines and the design of the UMD Libraries' other web\nUIs, the included CSS also provides some semantic classes for styling\nindividual `button` or `a.button` elements.\n\n| Class name | Use for buttons that ...                                    |\n|------------|-------------------------------------------------------------|\n| `create`   | ... immediately create or add a resource.                   |\n| `edit`     | ... display a form or other method of modifying a resource. |\n| `update`   | ... immediately save an already existing resource.          |\n| `delete`   | ... immediately remove a resource.                          |\n| `login`    | ... send the user to a login form.                          |\n| `publish`  | ... immediately publish a resource.                         |\n\n### Form Styles\n\nFor forms that consist of a single button (plus, optionally, one or more \nhidden fields), use the `.button` class on the `form` element to display \nthat form as an inline element. This allows it, for instance, to sit in \nthe regular content flow next to links or other inline content. \n\n### Table Styles\n\nThere are two included table styles that can be selected by adding one of \nthese classes to the `table` element:\n\n| Class name | Description                                                                |\n|------------|----------------------------------------------------------------------------|\n| `grid`     | Full borders around all cells, zebra striping, dark background for headers |\n| `lined`    | Only a single line between rows, headers bold                              |\n\n## License\n\nSee the [LICENSE](LICENSE.md) file for license rights and limitations\n(Apache 2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumd-lib%2Fdjango-umd-lib-style","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumd-lib%2Fdjango-umd-lib-style","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumd-lib%2Fdjango-umd-lib-style/lists"}