-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render LMS main navigation (tabs) with template, override templates f…
…or a specific list item
- Loading branch information
1 parent
57af11c
commit d532f8d
Showing
4 changed files
with
88 additions
and
25 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
common/test/test_microsites/test_microsite/templates/courseware/tabs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## mako | ||
<%namespace name='static' file='/static_content.html'/> | ||
<%! | ||
from django.utils.translation import ugettext as _ | ||
from django.core.urlresolvers import reverse | ||
%> | ||
<%page args="tab_list, active_page, default_tab, tab_image" /> | ||
|
||
<% | ||
def url_class(is_active): | ||
if is_active: | ||
return "active" | ||
return "" | ||
%> | ||
% for tab in tab_list: | ||
<% | ||
tab_is_active = tab.tab_id in (active_page, default_tab) | ||
tab_class = url_class(tab_is_active) | ||
%> | ||
<li> | ||
<a href="${tab.link_func(course, reverse) | h}" class="${tab_class}"> | ||
Test Microsite Tab: ${_(tab.name) | h} | ||
% if tab_is_active: | ||
<span class="sr">, current location</span> | ||
%endif | ||
% if tab_image: | ||
## Translators: 'needs attention' is an alternative string for the | ||
## notification image that indicates the tab "needs attention". | ||
<img src="${tab_image}" alt="${_('needs attention')}" /> | ||
%endif | ||
</a> | ||
</li> | ||
% endfor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## mako | ||
<%namespace name='static' file='/static_content.html'/> | ||
<%! | ||
from django.utils.translation import ugettext as _ | ||
from django.core.urlresolvers import reverse | ||
%> | ||
<%page args="tab_list, active_page, default_tab, tab_image" /> | ||
|
||
<% | ||
def url_class(is_active): | ||
if is_active: | ||
return "active" | ||
return "" | ||
%> | ||
% for tab in tab_list: | ||
<% | ||
tab_is_active = tab.tab_id in (active_page, default_tab) | ||
tab_class = url_class(tab_is_active) | ||
%> | ||
<li> | ||
<a href="${tab.link_func(course, reverse) | h}" class="${tab_class}"> | ||
${_(tab.name) | h} | ||
% if tab_is_active: | ||
<span class="sr">, current location</span> | ||
%endif | ||
% if tab_image: | ||
## Translators: 'needs attention' is an alternative string for the | ||
## notification image that indicates the tab "needs attention". | ||
<img src="${tab_image}" alt="${_('needs attention')}" /> | ||
%endif | ||
</a> | ||
</li> | ||
% endfor |