Skip to content

Commit

Permalink
fix sidebar project links (#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon authored Jun 11, 2024
1 parent 76672f9 commit a0808d9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions projectroles/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def get_project_app_links(
ret = []
# Add project related links
if project:
project_display_name = get_display_name(project.type, title=True)
# Add project overview link
ret.append(
{
Expand All @@ -191,7 +192,7 @@ def get_project_app_links(
'projectroles:detail',
kwargs={'project': project.sodar_uuid},
),
'label': 'Project Overview',
'label': f'{project_display_name} Overview',
'icon': (
'mdi:rhombus-split'
if project.type == PROJECT_TYPE_CATEGORY
Expand Down Expand Up @@ -249,7 +250,7 @@ def get_project_app_links(
'projectroles:update',
kwargs={'project': project.sodar_uuid},
),
'label': 'Update Project',
'label': f'Update {project_display_name}',
'icon': 'mdi:lead-pencil',
'active': self._is_active_projectroles(
link_names=['update'],
Expand All @@ -274,7 +275,9 @@ def get_project_app_links(
'projectroles:create',
kwargs={'project': project.sodar_uuid},
),
'label': 'Create Project or Category',
'label': 'Create '
f'{get_display_name(PROJECT_TYPE_PROJECT, title=True)} '
f'or {get_display_name(PROJECT_TYPE_CATEGORY, title=True)}',
'icon': 'mdi:plus-thick',
'active': self._is_active_projectroles(
link_names=['create'],
Expand All @@ -291,7 +294,8 @@ def get_project_app_links(
{
'name': 'project-create',
'url': reverse('projectroles:create'),
'label': 'Create Project',
'label': 'Create '
f'{get_display_name(PROJECT_TYPE_PROJECT, title=True)}',
'icon': 'mdi:plus-thick',
'active': self._is_active_projectroles(
link_names=['create'],
Expand All @@ -309,7 +313,8 @@ def get_project_app_links(
{
'name': 'home-project-create',
'url': reverse('projectroles:create'),
'label': 'Create Category',
'label': 'Create '
f'{get_display_name(PROJECT_TYPE_CATEGORY, title=True)}',
'icon': 'mdi:plus-thick',
'active': self._is_active_projectroles(
link_names=['create'],
Expand Down

0 comments on commit a0808d9

Please sign in to comment.