Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Add a url to "Transfer ownership" on user profile #126

Closed
15 tasks done
ana-balica opened this issue Jun 20, 2015 · 2 comments
Closed
15 tasks done

Add a url to "Transfer ownership" on user profile #126

ana-balica opened this issue Jun 20, 2015 · 2 comments
Labels
Type: Enhancement New feature or request.

Comments

@ana-balica
Copy link
Contributor

ana-balica commented Jun 20, 2015

Hi @veniemi1
Here is a simple task to get you started. Please comment to this issue to let us know that you are on to it. Also mark checkboxes to let us know that you did this step.

Preparing:

To the code:

  • Start the development server with python systers_portal/manage.py runserver.
  • Go to 127.0.0.1:8000 address in your browser.
  • If you didn't create a superuser, follow point 10 from https://github.com/systers/portal#setup-for-developers. Then go to 127.0.0.1:8000/admin and login with your superuser credentials (username and password).
  • Scroll down to find a section called Community. Click on Communities link, then click on create a new community. Set yourself as the admin of that community. Fill in any dummy data you want for the res of the form.
  • Go back to 127.0.0.1:8000 aka Portal landing page.
  • In the right corner of the top navigation bar you should see your username. This means you have logged in successfully. Click on it and there should be a dropdown there. Click on "Profile". In the "Membership" box you should see the community you have created and a button that says "Transfer ownership".

The issue is that "Transfer ownership" button has no URL and we need to fix this.
In order to fix this, do the following:

  • Open the file portal/systers_portal/templates/users/snippets/membership.html and find the anchor tag (a) that has an empty URL property, in other words href="#".
  • We need to replace the # with a valid URL that will allow the user to transfer the ownership of a community. Therefore instead of #, put {% url 'transfer_ownership' community.slug %}. {% %} are special Django template tags that allow us to execute a set of functions inside the HTML code. url is this function of Django template language that constructs a URL based on its name. transfer_ownership is the name of the URL, we have set it up ourselves before in code. And finally community.slug extracts the slug of the community object. This is necessary to let the function know what community we want to manipulate.

Committing and making a pull request.

@shriyanka
Copy link
Contributor

@ana-balica
Hi, I want to start contributing to Systers open source projects. Can I work on this issue as it seems to be good for beginners to start with ?

Thanks,
Kajal

@ankita-2798
Copy link

ankita-2798 commented Oct 2, 2017

@tapasweni-pathak
Hey, I was checking this issue when I found out that it had been fixed and is working properly. So I think it should be closed now.
Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

4 participants