Skip to content

Add sole owner badge on lists of projects #4970

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

Merged
merged 18 commits into from
Oct 28, 2018
Merged

Conversation

rigeon
Copy link
Contributor

@rigeon rigeon commented Oct 28, 2018

Fixes #3127, closes #4396.

Changes:

  • Made a common function "user_projects" to get back projects user is working on
  • Added badge to flag a user project as "Sole owned"

This is built on top of @gabrielgradinaru PR: #4396

@rigeon
Copy link
Contributor Author

rigeon commented Oct 28, 2018

solo_badge


return {
"projects_owned": request.db.query(projects_owned).all(),
"projects_sole_owned": request.db.query(Project)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit, can you reformat this line to be:

"projects_sole_owned": (
    request.db.query(Project).join(with_sole_owner).order_by(Project.name).all()
),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@rigeon
Copy link
Contributor Author

rigeon commented Oct 28, 2018

sole_owner

<h3 class="package-snippet__title">{{ project.name }}</h3>
<h3 class="package-snippet__title">{{ project.name }}
{% if project.name in projects_sole_owned %}
<span class="badge package-snippet__sole-owner-badge">Sole owner</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you wrap this in a link to the collaboration management page?

<a href="{{ request.route_path('manage.project.roles', project_name=project.normalized_name) }}">
  <span class="badge package-snippet__sole-owner-badge">Sole owner</span>
</a>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@rigeon
Copy link
Contributor Author

rigeon commented Oct 28, 2018

deletion_warning

@rigeon
Copy link
Contributor Author

rigeon commented Oct 28, 2018

sole_badge

@di di merged commit 49fba01 into pypi:master Oct 28, 2018
@di
Copy link
Member

di commented Oct 28, 2018

Thanks @rupali-saboo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add 'sole owner' badge on list of projects
2 participants