commit
f9e03434c2
@ -1,8 +1,32 @@
|
|||||||
module Mobile
|
module Mobile
|
||||||
module Entities
|
module Entities
|
||||||
class Exercise < Grape::Entity
|
class Exercise < Grape::Entity
|
||||||
|
include Redmine::I18n
|
||||||
|
include ApplicationHelper
|
||||||
|
include ApiHelper
|
||||||
|
def self.exercise_expose(field)
|
||||||
|
expose field do |f,opt|
|
||||||
|
if f.is_a?(Hash) && f.key?(field)
|
||||||
|
if field == :created_on
|
||||||
|
format_time(f[field])
|
||||||
|
else
|
||||||
|
f[field]
|
||||||
|
end
|
||||||
|
elsif f.is_a?(::Exercise)
|
||||||
|
if f.respond_to?(field)
|
||||||
|
f.send(field)
|
||||||
|
else
|
||||||
|
case field
|
||||||
|
when :coursename
|
||||||
|
f.course.nil? ? "" : f.course.name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
expose :exercise_name
|
expose :exercise_name
|
||||||
expose :exercise_description
|
expose :exercise_description
|
||||||
|
exercise_expose :coursename #所属班级名
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
<span>
|
||||||
|
<a title="<%= syllabus.title %>" id="rename_syllabus_title_<%= syllabus.id %>" ondblclick="rename_syllabus_title($(this),'<%=syllabus.title %>','<%=syllabus.id %>');"><%= syllabus.title %></a>
|
||||||
|
</span>
|
@ -0,0 +1 @@
|
|||||||
|
$("#syllabus_title_<%=@syllabus.id %>").html("<%=escape_javascript(render :partial => 'admin/rename_syllabus_title', :locals => {:syllabus => @syllabus}) %>");
|
@ -0,0 +1,7 @@
|
|||||||
|
<% if @in_user_homepage %>
|
||||||
|
<% homepage = BlogComment.find(User.current.blog.homepage_id) %>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => @blog_comment, :user_activity_id => homepage.id}) %>");
|
||||||
|
<% else%>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @blog_comment,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% end %>
|
||||||
|
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity');
|
@ -1,5 +1,5 @@
|
|||||||
<span style="word-break: normal; word-wrap: break-word;"><%=@syllabus.title %></span>
|
<span style="word-break: normal; word-wrap: break-word;"><%=@syllabus.title %></span>
|
||||||
|
|
||||||
<% if User.current == syllabus.user %>
|
<% if User.current == syllabus.user || User.current.admin? %>
|
||||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :onclick => "show_edit_title();"%>
|
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :onclick => "show_edit_title('#{@syllabus.title}');"%>
|
||||||
<% end %>
|
<% end %>
|
@ -1,5 +1,8 @@
|
|||||||
//location.reload();
|
//location.reload();
|
||||||
<% if params[:detail_page] %>
|
<% if @act %>
|
||||||
|
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => 2, :act => @act}) %>");
|
||||||
|
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
|
||||||
|
<% elsif params[:detail_page] %>
|
||||||
window.location.href = '<%= organization_path(params[:organization_id],:org_subfield_id => @org_sub_id )%>';
|
window.location.href = '<%= organization_path(params[:organization_id],:org_subfield_id => @org_sub_id )%>';
|
||||||
<% else %>
|
<% else %>
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
@ -1 +1,4 @@
|
|||||||
//location.reload();
|
<% if @user_activity_id %>
|
||||||
|
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => 2, :act => @act}) %>");
|
||||||
|
<% end %>
|
||||||
|
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
$("#syllabus_title_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus} %>");
|
$("#syllabus_title_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus} %>");
|
||||||
|
$("#syllabus_title_edit").text("");
|
||||||
$("#syllabus_title_show").show();
|
$("#syllabus_title_show").show();
|
||||||
$("#syllabus_title_edit").hide();
|
$("#syllabus_title_edit").hide();
|
@ -0,0 +1,60 @@
|
|||||||
|
<ul>
|
||||||
|
<% comments.each do |comment| %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||||
|
<div class="homepagePostReplyPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyDes">
|
||||||
|
<div class="homepagePostReplyPublisher">
|
||||||
|
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||||
|
<%= time_from_now(comment.created_on) %>
|
||||||
|
</div>
|
||||||
|
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||||
|
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||||
|
<% end %>
|
||||||
|
<% if !comment.content_detail.blank? %>
|
||||||
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
<%= comment.content_detail.html_safe %>
|
||||||
|
</div>
|
||||||
|
<div class="orig_reply mb10 mt-10">
|
||||||
|
<div class="reply">
|
||||||
|
<span class="reply-right">
|
||||||
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
|
</span>
|
||||||
|
<span style="position: relative" class="fr mr20">
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_reply),
|
||||||
|
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage},
|
||||||
|
:remote => true,
|
||||||
|
:method => 'get',
|
||||||
|
:title => l(:button_reply)) if !comment.root.locked? %>
|
||||||
|
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||||
|
</span>
|
||||||
|
<% if comment.author == User.current %>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_delete),
|
||||||
|
{:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage},
|
||||||
|
:method => :delete,
|
||||||
|
:remote => true,
|
||||||
|
:class => 'fr mr20',
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:title => l(:button_delete)) %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p id="reply_message_<%= comment.id%>"></p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
@ -0,0 +1,60 @@
|
|||||||
|
<ul>
|
||||||
|
<% comments.each do |comment| %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||||
|
<div class="homepagePostReplyPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyDes">
|
||||||
|
<div class="homepagePostReplyPublisher">
|
||||||
|
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||||
|
<%= time_from_now(comment.created_at) %>
|
||||||
|
</div>
|
||||||
|
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||||
|
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||||
|
<% end %>
|
||||||
|
<% if !comment.content_detail.blank? %>
|
||||||
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
<%= comment.content_detail.html_safe %>
|
||||||
|
</div>
|
||||||
|
<div class="orig_reply mb10 mt-10">
|
||||||
|
<div class="reply">
|
||||||
|
<span class="reply-right">
|
||||||
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
|
</span>
|
||||||
|
<span style="position: relative" class="fr mr20">
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_reply),
|
||||||
|
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
|
||||||
|
:remote => true,
|
||||||
|
:method => 'get',
|
||||||
|
:title => l(:button_reply)) %>
|
||||||
|
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||||
|
</span>
|
||||||
|
<% if comment.creator_user == User.current %>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_delete),
|
||||||
|
{:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id},
|
||||||
|
:method => :delete,
|
||||||
|
:remote => true,
|
||||||
|
:class => 'fr mr20',
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:title => l(:button_delete)) %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p id="reply_message_<%= comment.id%>"></p>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 25 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue