student user_course
This commit is contained in:
parent
c5a3a5bac3
commit
3e8decf1d1
|
@ -20,21 +20,3 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function() {
|
|
||||||
var $menu = $('.user_course_list .menu');
|
|
||||||
var $li_tags = $menu.find('[mode]');
|
|
||||||
var $dyn_list = $('.dyn_list_wrapper');
|
|
||||||
|
|
||||||
$menu.find('[mode]').each(function(index, el) {
|
|
||||||
$(el).click(function() {
|
|
||||||
mode = $(el).attr('mode');
|
|
||||||
$menu.find('[mode]').removeClass( "on" );
|
|
||||||
$( this ).addClass( "on" );
|
|
||||||
var wrapper = $('[mode='+mode+']')
|
|
||||||
$dyn_list.addClass( "hidden" );
|
|
||||||
wrapper.removeClass('hidden')
|
|
||||||
})
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -11,23 +11,27 @@
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p>
|
<div class="user_course_list">
|
||||||
<span><%=l(:label_course_doing)%>(<%=@memberships_doing.count%>)</span>
|
<div class="menu">
|
||||||
<%= link_to"#{l(:label_course_view_student)}",{:controller=>'projects',:action=>'course', :course => 1}, :class => 'icon icon-add' %>
|
<%= link_to"#{l(:label_course_view_student)}",course_path(course: 1), :class => 'icon icon-add' %>
|
||||||
</p>
|
<ul>
|
||||||
<div>
|
<li mode='doing' class="on">进行中</li>
|
||||||
<%= render :partial => 'course_form', :locals => {:memberships => @memberships_doing}%>
|
<li mode='end'>已完结</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="clear:both;"></div>
|
<div class="dyn_list_wrapper" mode='doing'>
|
||||||
|
<div class='created_course'>
|
||||||
<p>
|
<%= render :partial => 'course_form', :locals => {:memberships => @memberships_doing} %>
|
||||||
<%= link_to l(:label_course_done)+"("+@memberships_done.count.to_s+")", 'javascript:void(0);', :onclick => '$("#courses_history_block").slideToggle(400); ', style:"color:#666666" if User.current.logged? %>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div id="courses_history_block" class="courses_history hidden" >
|
|
||||||
<%= render :partial => 'course_form', :locals => {:memberships => @memberships_done}%>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dyn_list_wrapper hidden" mode='end'>
|
||||||
|
<div class="created_course ">
|
||||||
|
<%= render :partial => 'course_form', :locals => {:memberships => @memberships_done} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -12,3 +12,22 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
var $menu = $('.user_course_list .menu');
|
||||||
|
var $li_tags = $menu.find('[mode]');
|
||||||
|
var $dyn_list = $('.dyn_list_wrapper');
|
||||||
|
|
||||||
|
$menu.find('[mode]').each(function(index, el) {
|
||||||
|
$(el).click(function() {
|
||||||
|
mode = $(el).attr('mode');
|
||||||
|
$menu.find('[mode]').removeClass( "on" );
|
||||||
|
$( this ).addClass( "on" );
|
||||||
|
var wrapper = $('[mode='+mode+']')
|
||||||
|
$dyn_list.addClass( "hidden" );
|
||||||
|
wrapper.removeClass('hidden')
|
||||||
|
})
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in New Issue