6.2 KiB
6.2 KiB
Standards App Icon Fix Summary
Overview
Updated all standards app templates to use SVG icons from the action_icons template tag instead of FontAwesome icons. This makes the standards app consistent with other apps in the project and removes the dependency on FontAwesome.
Changes Made
Templates Updated
-
source_list.html
- Added
{% load action_icons %}tag - Replaced
<i class="fas fa-plus">with{% action_icon "create" %} - Replaced
<i class="fas fa-edit">with{% action_icon "edit" %} - Replaced
<i class="fas fa-trash">with{% action_icon "delete" %} - Replaced
<i class="fas fa-building">with{% action_icon "folder" %}
- Added
-
category_list.html
- Added
{% load action_icons %}tag - Replaced all FontAwesome icons with SVG action icons
- Used
{% action_icon "create" %}for Add Category button - Used
{% action_icon "edit" %}and{% action_icon "delete" %}for action buttons - Used
{% action_icon "folder" %}for empty state icon
- Added
-
standard_form.html
- Added
{% load action_icons %}tag - Replaced
<i class="fas fa-arrow-left">with{% action_icon "back" %} - Replaced
<i class="fas fa-save">with{% action_icon "save" %}
- Added
-
source_form.html
- Added
{% load action_icons %}tag - Replaced back button icon with
{% action_icon "back" %} - Replaced save button icon with
{% action_icon "save" %}
- Added
-
category_form.html
- Added
{% load action_icons %}tag - Replaced all FontAwesome icons with SVG action icons
- Added
-
source_confirm_delete.html
- Added
{% load action_icons %}tag - Replaced
<i class="fas fa-arrow-left">with{% action_icon "back" %} - Replaced
<i class="fas fa-exclamation-triangle">with{% action_icon "warning" %} - Replaced
<i class="fas fa-trash">with{% action_icon "delete" %}
- Added
-
category_confirm_delete.html
- Added
{% load action_icons %}tag - Replaced all FontAwesome icons with SVG action icons
- Added
-
standard_detail.html
- Added
{% load action_icons %}tag - Replaced back button icon with
{% action_icon "back" %} - Replaced
<i class="fas fa-paperclip">with{% action_icon "attachment" %}
- Added
-
department_standards.html
- Added
{% load action_icons %}tag - Replaced all FontAwesome icons with SVG action icons
- Used
{% action_icon "create" %}for Add Standard button - Used
{% action_icon "back" %}for back button - Used
{% action_icon "attachment" %}for evidence count - Used
{% action_icon "edit" %}for existing assessments - Used
{% action_icon "save" %}for save assessment button
- Added
Benefits
- Consistency: All apps now use the same SVG icon system
- Performance: SVG icons are lightweight and don't require external CSS/JS libraries
- Customization: Icons can be easily customized through the action_icons.py file
- Maintainability: Single source of truth for all action icons
- Accessibility: SVG icons can be made more accessible than FontAwesome
Icon Mapping
| FontAwesome | Action Icon | Usage |
|---|---|---|
fa-plus |
create |
Add/Create actions |
fa-edit |
edit |
Edit/Update actions |
fa-trash |
delete |
Delete actions |
fa-arrow-left |
back |
Back navigation |
fa-save |
save |
Save actions |
fa-exclamation-triangle |
warning |
Warning messages |
fa-paperclip |
attachment |
Attachments |
fa-building |
folder |
Folders/containers |
Technical Details
- The
action_iconstemplate tag is located at:apps/social/templatetags/action_icons.py - Icons are rendered as inline SVG elements
- Icons support size parameter (default: 16px)
- All SVGs include proper accessibility attributes (aria-hidden, role)
Size Control
The action_icon template tag accepts an optional size parameter to control icon dimensions:
{% action_icon "edit" size=20 %} <!-- 20x20 pixels -->
{% action_icon "delete" size=24 %} <!-- 24x24 pixels -->
{% action_icon "create" size=32 %} <!-- 32x32 pixels -->
{% action_icon "folder" size=64 %} <!-- 64x64 pixels -->
Recommended Sizes
| Use Case | Size | Example |
|---|---|---|
| Inline buttons (btn-sm) | 14-16 | {% action_icon "edit" %} |
| Standard buttons | 16-20 | {% action_icon "save" size=20 %} |
| Large buttons (btn-lg) | 20-24 | {% action_icon "create" size=24 %} |
| Empty state icons | 48-64 | {% action_icon "folder" size=64 %} |
| Hero/feature icons | 64-96 | {% action_icon "star" size=96 %} |
Size Examples in Templates
{# Small icon for inline badges #}
<span class="badge bg-info">
{% action_icon "attachment" size=12 %}
3 files
</span>
{# Default size for action buttons #}
<button class="btn btn-primary">
{% action_icon "create" %}
Add Item
</button>
{# Larger icon for primary actions #}
<button class="btn btn-lg btn-success">
{% action_icon "save" size=24 %}
Save Changes
</button>
{# Extra large icon for empty states #}
<div class="text-center py-5">
<span class="text-muted mb-3 d-block">
{% action_icon "folder" size=64 %}
</span>
<h5>No items found</h5>
</div>
Testing Recommendations
- Navigate to all standards app pages
- Verify all buttons display icons correctly
- Check icon alignment with text
- Verify icons work on different screen sizes
- Test with different browser rendering engines
Related Files
apps/social/templatetags/action_icons.py- Icon definitionstemplates/standards/source_list.html- Updatedtemplates/standards/category_list.html- Updatedtemplates/standards/standard_form.html- Updatedtemplates/standards/source_form.html- Updatedtemplates/standards/category_form.html- Updatedtemplates/standards/source_confirm_delete.html- Updatedtemplates/standards/category_confirm_delete.html- Updatedtemplates/standards/standard_detail.html- Updatedtemplates/standards/department_standards.html- Updated
Completion Status
✅ All standards app templates updated with SVG icons ✅ FontAwesome dependency removed from standards app ✅ Consistent with other apps in the project ✅ No breaking changes to functionality