Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form proper labels for Category/Project update link #1422

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'],
mikkonie marked this conversation as resolved.
Show resolved Hide resolved
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
Loading