Skip to content

Commit

Permalink
(metacademy#59) setting lighter color for links of already known conc…
Browse files Browse the repository at this point in the history
…epts while browsing
  • Loading branch information
sygi committed Mar 6, 2015
1 parent c92bcf9 commit fef3c84
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions server/static/css/standard.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ a.sidr-class-ac-li-a {
}


.internal-link.known-concept{
color: #BB9CB0;
text-decoration: none;
}
.internal-link.known-concept:hover{
text-decoration:underline;
color:#B25291;
}
.internal-link, .focus-link{
color: #A01F70;
text-decoration: none;
Expand Down
2 changes: 1 addition & 1 deletion server/static/html/browsing.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h3>Concepts</h3>
<ul>
{% for concept in uncat_concepts %}
{% if concept.is_finished %}
<li> <a class="internal-link" href="{% url 'graphs:concepts' concept.tag %}"> {{concept.title}} </a> </li>
<li> <a class="internal-link{% if concept in known_concepts %} known-concept{% endif %}" href="{% url 'graphs:concepts' concept.tag %}"> {{concept.title}} </a> </li>
{% endif %}
{% endfor %}
</ul>
Expand Down
10 changes: 8 additions & 2 deletions server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from apps.graph.models import Concept, Tag
from apps.roadmaps.models import Roadmap
from apps.user_management.models import Profile
from forms import ContactForm


Expand Down Expand Up @@ -44,6 +45,7 @@ def get_browsing_view(request):
"""
Return the list of concepts and roadmaps, sorted by category
"""
print "browsing"
tags = Tag.objects.exclude(title='Meta').extra(select={'lower_title': 'lower(title)'}).order_by("lower_title").all()
tags = list(Tag.objects.filter(title='Meta').all()) + list(tags) # Meta tag should appear first

Expand All @@ -57,10 +59,14 @@ def get_browsing_view(request):
uncat_course_guides = Roadmap.objects.filter(tags=None, roadmapsettings__doc_type='Course Guide') \
.extra(select={'lower_title': 'lower(title)'}).order_by("lower_title").all()
uncat_course_guides = filter(Roadmap.is_listed_in_main, uncat_course_guides)


learned = None
if request.user.is_authenticated():
uprof, _ = Profile.objects.get_or_create(pk=request.user.pk)
learned = [concept for cs in uprof.learned.all() for concept in Concept.objects.filter(id=cs.id).all()]

return render(request, "browsing.html", {'tags': tags, 'uncat_concepts': uncat_concepts, 'uncat_roadmaps': uncat_roadmaps,
'uncat_course_guides': uncat_course_guides})
'uncat_course_guides': uncat_course_guides, 'known_concepts': learned})



Expand Down

0 comments on commit fef3c84

Please sign in to comment.