#146 Active class is set to an element in sidebar for all pages .
Closed: complete 5 years ago by jflory7. Opened 5 years ago by phoenixabhishek.

Summary

Have active class only on the element that is associated with the current URL.

Background

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.

Details

On analysis, it was found that since the following code in happinesspackets\messaging\urls.py is true for all cases of url patterns,

.
.
.
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.

.
.
.
 {% 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>
.
.
.

Outcome

Only the element that is mapped with the current url should have an active class.


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.

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

5 years ago

@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?

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... :)

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

5 years ago

@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.

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]

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.

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:

@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

@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. :)

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. 🎊

Thanks! @jflory7 !

@jflory7 how to remove the emoticon, i accidently sent the confuse emoticon. appologies

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:

#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)

5 years ago

Metadata Update from @jflory7:
- Issue set to the milestone: Summer Coding 2019: community bonding

5 years ago

Login to comment on this ticket.

Metadata
Attachments 7
Attached 5 years ago View Comment
Attached 5 years ago View Comment
Attached 5 years ago View Comment
Attached 5 years ago View Comment
Attached 5 years ago View Comment
Attached 5 years ago View Comment