|
|
@ -1,5 +1,5 @@
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
<% if @is_in_course == 1 || @course_activity == 1 %>
|
|
|
|
<% if @is_in_course.to_i == 1 || @course_activity == 1 %>
|
|
|
|
$(function(){
|
|
|
|
$(function(){
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
@ -19,13 +19,17 @@
|
|
|
|
$("#homework_editor").toggle();
|
|
|
|
$("#homework_editor").toggle();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function cancel_edit(){
|
|
|
|
function cancel_edit(){
|
|
|
|
<% if @is_in_course == 1 %>
|
|
|
|
<% if @is_manage.to_i == 1 %>
|
|
|
|
|
|
|
|
window.location.href='<%=manage_or_receive_homeworks_user_path(User.current.id) %>';
|
|
|
|
|
|
|
|
<% elsif @is_manage.to_i == 2 %>
|
|
|
|
|
|
|
|
window.location.href='<%=my_homeworks_user_path(User.current.id) %>';
|
|
|
|
|
|
|
|
<% elsif @is_in_course.to_i == 1 %>
|
|
|
|
window.location.href='<%=homework_common_index_path(:course => @course.id) %>';
|
|
|
|
window.location.href='<%=homework_common_index_path(:course => @course.id) %>';
|
|
|
|
<% elsif @is_in_course == 0 %>
|
|
|
|
<% elsif @is_in_course.to_i == 0 %>
|
|
|
|
window.location.href='<%=user_homeworks_user_path(User.current.id) %>';
|
|
|
|
window.location.href='<%=user_homeworks_user_path(User.current.id) %>';
|
|
|
|
<% elsif @is_in_course == -1 && @course_activity == 0 %>
|
|
|
|
<% elsif @is_in_course.to_i == -1 && @course_activity == 0 %>
|
|
|
|
window.location.href='<%=user_path(User.current.id) %>';
|
|
|
|
window.location.href='<%=user_path(User.current.id) %>';
|
|
|
|
<% elsif @is_in_course == -1 && @course_activity == 1 %>
|
|
|
|
<% elsif @is_in_course.to_i == -1 && @course_activity == 1 %>
|
|
|
|
window.location.href='<%=course_path(@course.id) %>';
|
|
|
|
window.location.href='<%=course_path(@course.id) %>';
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -40,6 +44,7 @@
|
|
|
|
<%= form_for @homework do |f| %>
|
|
|
|
<%= form_for @homework do |f| %>
|
|
|
|
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
|
|
|
|
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
|
|
|
|
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>
|
|
|
|
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>
|
|
|
|
|
|
|
|
<input type="text" name="is_manage" class="none" value="<%= @is_manage%>"/>
|
|
|
|
<div id="HomeWorkCon">
|
|
|
|
<div id="HomeWorkCon">
|
|
|
|
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>
|
|
|
|
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|