Metadata-Version: 2.4
Name: aa-external-links
Version: 1.0.0
Summary: Alliance Auth app that adds external website links to the sidebar, opening in a new window.
Author: Casey
License-Expression: GPL-2.0-or-later
Keywords: allianceauth,eveonline,django,menu,links
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.2
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: allianceauth<6,>=4
Dynamic: license-file

# AA External Links

An [Alliance Auth](https://gitlab.com/allianceauth/allianceauth) plugin that lets admins add
links to external websites in the left sidebar. Links open in a new tab/window
(`target="_blank"`, `rel="noopener noreferrer"`) or, optionally, a separate sized popup window.

Works with Alliance Auth 4.x and 5.x.

## Features

- Manage links in Django admin: name, URL, Font Awesome icon, order, enabled flag
- Open mode per link: browser default new tab/window, or a popup window with custom width/height
- Optional visibility restriction by **groups** and/or **states** (empty = all logged-in users;
  superusers see everything)
- No restart needed when adding/editing links

## Installation

1. Install into your Alliance Auth virtualenv:

   ```bash
   pip install aa-external-links
   ```

2. Add the app to `myauth/settings/local.py`:

   ```python
   INSTALLED_APPS += ["externallinks"]

   # Optional: position of the links block in the sidebar (default 1000)
   EXTERNAL_LINKS_MENU_ORDER = 1000
   ```

3. Migrate, collect static and restart:

   ```bash
   python manage.py migrate
   python manage.py collectstatic --noinput
   supervisorctl restart myauth:
   ```

## Usage

Go to **Admin → External Links → External links → Add**.

| Field | Notes |
|---|---|
| Name | Text shown in the sidebar |
| URL | Full `http(s)://` URL |
| Icon | Font Awesome classes, e.g. `fa-brands fa-discord`, `fa-solid fa-book` |
| Order | Lower numbers first (within the links block) |
| Open in | *New tab / window* or *Separate popup window* |
| Groups / States | Leave empty to show to everyone |

All links render together at one position in the sidebar. You can move that block (or put it
inside a folder) via Alliance Auth's own **Admin → Menu → Menu items**, where it is listed as
"External Links".

Non-superuser admins need the `externallinks | external link` add/change/delete permissions.

## Development

```bash
pip install allianceauth fakeredis
python runtests.py test externallinks
```

`testauth_settings.py` uses SQLite and fakeredis, so no MySQL/Redis is needed for tests.

### Releasing

1. Bump `__version__` in `externallinks/__init__.py` (PyPI never accepts the same version twice).
2. Build and check:

   ```bash
   pip install build twine
   python -m build
   twine check dist/*
   ```

3. Upload with a PyPI API token (username `__token__`):

   ```bash
   twine upload dist/*
   ```

## License

GPL-2.0-or-later. See the `LICENSE` file.
