Have active class only on the element that is associated with the current URL.
While making changes for the sidebar elements with active class, it was observed that the element that is associated with the home url is always active on all the pages.
active
On analysis, it was found that since the following code in happinesspackets\messaging\urls.py is true for all cases of url patterns,
happinesspackets\messaging\urls.py
. . . urlpatterns = [ url(r'^$', StartView.as_view(), name='start'), . . .
it results in the active class being added to the corresponding element for all pages that utilize templates\base.html template.
templates\base.html
. . . {% url 'messaging:start' as url %} <li role="presentation" {% if url in request.path %}class="active"{% endif %}><a href="{{ url }}">What are Happiness Packets?</a></li> . . .
Only the element that is mapped with the current url should have an active class.
<img alt="active-issue.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/2d019d78b78aa9d2afd4b65c1a7a3811a7dd902c3678d07aa9db402a49667508-active-issue.png" />
<img alt="active-issue-expected.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/d6304b4edbfb58aac1ae26b65a8acf78cb7a57c7d7e30b73ca70648d5771f7f5-active-issue-expected.png" />
I won't be able to take this up due to my unfamiliarity with the Django framework. So, if someone can take this up, please do :smile: :smile: :smile: :smile: :smile:
This is a good first issue. Currently in the list item tag for What are Happiness Packets the if statement checks if the url for messaging:start which maps to localhost:8000 is present in the url. Instead of this, the condition needs to be if the url and localhost:8000 match exactly.
What are Happiness Packets
messaging:start
localhost:8000
Hello, @phoenixabhishek and @shraddhaag , I am Chetan Shinde from (PICT college) India I have done full stack development with Django will like to work on it... :)
Metadata Update from @jflory7: - Issue priority set to: waiting on assignee (was: awaiting triage) - Issue tagged with: PASSED, good first issue, new change, type - frontend, type - summer coding
@phoenixabhishek Thanks for opening this. We are going to revise the upstream contribution instructions in the contributing guidelines. Instead of filing a new pull request to upstream, could you open this same issue in mxsasha/happinesspackets to see if upstream would like to accept this change?
Hi @chetanshinde911! You're welcome to work on this. I think there is enough helpful info above to get you started, but if you need guidance, don't hesitate to ask here. :thumbsup:
Metadata Update from @jflory7: - Issue assigned to chetanshinde911
@jflory7 issue opened in upstream #50
@jflory7 as @phoenixabhishek had suggested, i was able to highlight the current page in navigation. And as you had suggested as https://github.com/mxsasha/happinesspackets is the upstream branch i tried to create a Pull request for the upstream repository.
<img alt="Upstream_problem.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/7773eab30ddba85039630332dadb355113bafc7501ec9f7b83164f57dacdaa2b-Upstream_problem.png" />
but it is not allowing to create a pull request.
can you please help regarding how to create a pull request for the upstream. The method that i used was...
git remote add upstream https://github.com/css911/happinesspackets.git git push --set-upstream upstream [the topic branch name on which i was working]
<img alt="after_commit.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/b690384f73f83595b759a5326d96d32e313d02dbbf45e48d312c275a0364d710-after_commit.png" />
the push request is not been processed.
git remote add upstream https://github.com/css911/happinesspackets.git git push --set-upstream upstream [the topic branch name on which i was working] [after_commit.png] the push request is not been processed.
@chetanshinde911 Is this repo from your fedora-happiness-packets fork? This message likely comes up if so, because even though we are a downstream, we have diverged significantly enough from upstream where our git histories are not reconcilable.
fedora-happiness-packets
However in ticket #149, we will revise our contributing guidelines. Instead of sending a pull request to upstream, we can open an issue instead so they have a chance to decide if they want to accept a change. In this case, you can skip sending a pull request to the upstream project. @phoenixabhishek already filed mxsasha/happinesspackets#50.
With your existing code, you can submit a pull request here and we'll review it. :thumbsup:
@jflory7 I was able to make the changes as suggested by @phoenixabhishek .
<img alt="done.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/46565d82d8bee7cff7d09a6f9065e250e7b6dd16858fb724d5fda9f21e7c3b27-done.png" />
but i am facing issue while creating a pull request.
<img alt="Issue_png.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/b5e6221d3be63ed43b3d71816bca2162589ff286b31dc689fdcf8fc283f1f59a-Issue_png.png" />
after searching stackoverflow an answer suggested to contact the code keeper of the repository.
https://unix.stackexchange.com/questions/106113/git-push-fails-with-remote-error-hook-declined-to-update-refs-heads-master
@chetanshinde911 , you are trying to create a pull request for our own project right.
In that case, a simple git push origin master should suffice to push the changes.
git push origin master
Then, you can go to your pagure.io fork https://pagure.io/fork/<yourname>/fedora-commops/fedora-happiness-packets and from there , you can click on 'Open PR' button to make a pull request
https://pagure.io/fork/<yourname>/fedora-commops/fedora-happiness-packets
@chetanshinde911 , you are trying to create a pull request for our own project right. In that case, a simple git push origin master should suffice to push the changes. Then, you can go to your pagure.io fork https://pagure.io/fork/<yourname>/fedora-commops/fedora-happiness-packets and from there , you can click on 'Open PR' button to make a pull request
Cool, Thanks! @phoenixabhishek . The issue occured because i had used hypen while naming the branch which was not getting accepted on the remote site. :)
@chetanshinde911 I think the issue was the long branch name or a forbidden character. I see you opened #152 successfully, so looks like you figured it out. :confetti_ball:
@jflory7 how to remove the emoticon, i accidently sent the confuse emoticon. appologies
Cool, Thanks! @phoenixabhishek . The issue occured because i had used hypen while naming the branch which was not getting accepted on the remote site. :) @chetanshinde911 I think the issue was the long branch name or a forbidden character. I see you opened #152 successfully, so looks like you figured it out. 🎊
@chetanshinde911 I think the issue was the long branch name or a forbidden character. I see you opened #152 successfully, so looks like you figured it out. 🎊
Thanks! @jflory7 !
Looks like a Pagure bug. I can't remove emoji reactions to comments either. No worries though, it's alright. :smiley:
Hey! @jflory7 , Thanks, Can you assign me a new issue after this issue gets merge, really excited to work.
@chetanshinde911 I suggest looking at #103 as a next task. Additionally, if you have ideas about what to work as it aligns to our project goals, feel free to file a new issue for this. :thumbsup:
<img alt="active-issue-console.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/9cc97216da4f45530118892a2191cb45f1e3c42d99135767f0ef61c22d378d0a-active-issue-console.png" />
#154 completes the work specified by this ticket. However, I would like to see a new PR to give feedback to the user about what page they are currently on. I think this is being planned in #139. For now, I am closing this ticket as complete. :clapper:
Metadata Update from @jflory7: - Issue close_status updated to: complete - Issue status updated to: Closed (was: Open)
Metadata Update from @jflory7: - Issue set to the milestone: Summer Coding 2019: community bonding
Login to comment on this ticket.