{"id":47026249,"url":"https://github.com/ohcnetwork/care_token_display","last_synced_at":"2026-03-11T23:18:44.288Z","repository":{"id":337603260,"uuid":"1126199649","full_name":"ohcnetwork/care_token_display","owner":"ohcnetwork","description":"Care plugin for rendering token display pages with automatic refresh.","archived":false,"fork":false,"pushed_at":"2026-02-10T12:07:41.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-10T15:52:25.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ohcnetwork.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-01T11:16:24.000Z","updated_at":"2026-02-10T12:07:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ohcnetwork/care_token_display","commit_stats":null,"previous_names":["ohcnetwork/care_token_display"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ohcnetwork/care_token_display","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare_token_display","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare_token_display/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare_token_display/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare_token_display/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohcnetwork","download_url":"https://codeload.github.com/ohcnetwork/care_token_display/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare_token_display/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30406531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T22:36:59.286Z","status":"ssl_error","status_checked_at":"2026-03-11T22:36:57.544Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-03-11T23:18:43.583Z","updated_at":"2026-03-11T23:18:44.283Z","avatar_url":"https://github.com/ohcnetwork.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# care_token_display\n\nA Django plugin for Care that provides server-side rendered (SSR) token display pages with automatic refresh using HTMX. The plugin displays current token information for multiple service point sub-queues in a responsive grid layout.\n\n## Local Development\n\nTo develop the plug in local environment along with care, follow the steps below:\n\n1. Go to the care root directory and clone the plugin repository:\n\n```bash\ncd care\ngit clone git@github.com:ohcnetwork/care_token_display.git\n```\n\n2. Add the plugin config in plug_config.py\n\n```python\n...\n\ncare_token_display_plugin = Plug(\n    name=care_token_display, # name of the django app in the plugin\n    package_name=\"/app/care_token_display\", # this has to be /app/ + plugin folder name\n    version=\"\", # keep it empty for local development\n    configs={}, # plugin configurations if any\n)\nplugs = [care_token_display_plugin]\n\n...\n```\n\n3. Tweak the code in plugs/manager.py, install the plugin in editable mode\n\n```python\n...\n\nsubprocess.check_call(\n    [sys.executable, \"-m\", \"pip\", \"install\", \"-e\", *packages] # add -e flag to install in editable mode\n)\n\n...\n```\n\n4. Rebuild the docker image and run the server\n\n```bash\nmake re-build\nmake up\n```\n\n\u003e [!IMPORTANT]\n\u003e Do not push these changes in a PR. These changes are only for local development.\n\n## Production Setup\n\nTo install care care_token_display, you can add the plugin config in [care/plug_config.py](https://github.com/ohcnetwork/care/blob/develop/plug_config.py) as follows:\n\n```python\n...\n\ncare_token_display_plug = Plug(\n    name=care_token_display,\n    package_name=\"git+https://github.com/ohcnetwork/care_token_display.git\",\n    version=\"@master\",\n    configs={},\n)\nplugs = [care_token_display_plug]\n...\n```\n\n[Extended Docs on Plug Installation](https://care-be-docs.ohc.network/pluggable-apps/configuration.html)\n\n## Usage\n\n### URL Structure\n\n#### Main Display Page\n\nTo display tokens for multiple sub-queues:\n\n```\n/token_display/sub_queues/\u003cuuid1\u003e,\u003cuuid2\u003e,\u003cuuid3\u003e,.../\n```\n\nThis will render a responsive grid showing a static snapshot of current token information for all sub-queues. The page must be manually refreshed to see updated data.\n\n**Note**: Only active sub-queues (with `status=active`) are displayed. Invalid or inactive sub-queue IDs are filtered out.\n\n## How It Works\n\nThe plugin provides a simple server-side rendered page that displays current token information:\n\n1. **Request**: The view receives comma-separated sub-queue UUIDs\n2. **Data Fetching**: For each sub-queue, the plugin fetches the current in-progress token\n3. **Rendering**: All data is rendered in a single HTML response with a responsive grid layout\n4. **Static Display**: The page shows a snapshot of data at request time - manual refresh is required to see updates\n\n### Grid Layout\n\nThe plugin automatically adjusts the grid layout based on the number of sub-queues:\n\n- **1 sub-queue**: Single column layout\n- **2-4 sub-queues**: 2-column grid\n- **5+ sub-queues**: 3-column grid (6-column base with smart column spanning)\n\nThe layout handles edge cases like odd numbers of items in the last row.\n\n## Development\n\n### Dependencies\n\n- Django\n- Django REST Framework\n\n### Project Structure\n\n```\nsrc/token_display/\n├── views.py          # View class for token display page\n├── pages.py          # URL routing for UI pages\n├── urls.py           # URL routing for API endpoints\n├── templates/        # Django templates\n│   └── token_display/\n│       └── display.html  # Main display page\n├── utils.py          # Utility functions (formatting helpers)\n├── settings.py       # Plugin settings configuration\n└── authentication.py # Custom authentication classes\n```\n\n## Notes\n\n- The UI is designed to work on displays that may not support modern CSS features\n- The page displays a static snapshot of token data at the time of request\n- Users must manually refresh the browser to see updated token information\n\n\n---\n\nThis plugin was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) using the [ohcnetwork/care-plugin-cookiecutter](https://github.com/ohcnetwork/care-plugin-cookiecutter).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohcnetwork%2Fcare_token_display","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohcnetwork%2Fcare_token_display","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohcnetwork%2Fcare_token_display/lists"}