}
.itemadd a { color: navy; }
+.itemtree li .mainline { margin-left: 24; }
/* specialized display of items in tree, by type */
.itemtree li.item_HEADING {
list-style-image: url(tango/folder.png);
- margin-top: 4;
+ margin: 9 0;
}
.itemtree li.item_HEADING > a {
color: navy;
}
-li.item_HEADING > a.mainlink {
+li.item_HEADING > .mainline {
+ margin-bottom: 12;
+}
+
+li.item_HEADING > div.mainline a.mainlink {
border-bottom: #aaa 1px solid;
}
-li.item_HEADING > a.mainlink:hover {
+li.item_HEADING > .mainline a.mainlink:hover {
border-bottom: none;
}
font-size: 80%; color: navy;
}
-.menublockopener { margin-left: 0.25em; color: #aaa !important; font-weight: normal !important; }
+.menublockopener { margin-left: 0.25em; color: #bbb !important; font-weight: normal !important; }
.menublock { background-color: #f0f0e0; font-size: 95%; padding: 1 4; }
#coursebanner { background-color: #f2e4cc; margin: -12 -12 0 -12; padding: 8; }
allowed = user.is_superuser
if not allowed:
course = models.Course.objects.get(pk=course_id)
- allowed = ((user.is_anonymous and course.access=='ANON') or \
- (user.is_authenticated and course.access=='LOGIN'))
+ allowed = ((user.is_anonymous() and course.access=='ANON') or \
+ (user.is_authenticated() and course.access=='LOGIN'))
if not allowed:
allowed = _fast_user_membership_query(user.id, course_id)
if allowed:
return handler(request, course_id, *args, **kwargs)
else:
- return _access_denied(_('Only course members are allowed here.'))
+ if course.access=='LOGIN':
+ msg = _('Please log in, so that you can enter this site.')
+ else:
+ msg = _('Only course members are allowed here.')
+ return _access_denied(msg)
return hdlr
# decorator
class="itemtree">
<li py:for="item, subs in tree" class="item_${item.item_type} an_item"
id="item_${item.id}">
- <a href="${item.item_url()}" class="mainlink">${item}</a>
- <span class="menublock">
+ <div class="mainline">
+ <a href="${item.item_url()}" class="mainlink">${item}</a>
+ <span class="menublock" py:if="not (item.item_type=='HEADING' and not edit)">
<span py:if="item.needs_meta_link()">
<a href="${item.item_url('meta')}">about</a> </span>
<span py:if="edit">
• <a href="${item.item_url('relocate/')}">put under heading</a>
</span>
</span>
+ </div>
<!-- !to show a full tree, uncomment the following: -->
${show_tree(subs, edit)}
</li>
</div>
<div py:def="item_resequence_panel()" py:strip="True">
- <div id="showtree_panel" class="little_action_panel">
- <a href="javascript:doToggleItemTree();">Show/hide tree</a>
- </div>
<div id="resequence_panel" class="little_action_panel">
<a href="javascript:doResequence();">Resequence items</a>
</div>
<p py:if="not item_tree">
There are no items associated with this course yet.
</p>
- <div py:if="instructs(request.user, course)" id="edit_course" class="little_action_panel">
+ <div py:if="is_editor" id="edit_course" class="little_action_panel">
<a href="${course.course_url()}edit/">Edit course details</a>
</div>
- ${item_resequence_panel()}
+ <div id="showtree_panel" class="little_action_panel">
+ <a href="javascript:doToggleItemTree();">Show/hide tree</a>
+ </div>
+ <div py:if="is_editor">${item_resequence_panel()}</div>
${show_tree(item_tree, edit=is_editor)}
<div py:if="is_editor">${add_subs()}</div>