Merge branch 'dev_daiao' of https://bdgit.trustie.net/hushasha/bigdata into dev_daiao

This commit is contained in:
daiao 2017-09-30 19:24:20 +08:00
commit cb13f6d360
6 changed files with 100 additions and 94 deletions

View File

@ -7,7 +7,9 @@
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><span class="ispublic-label"><%= l(:field_is_public) %>:</span>
<label class="panel-form-label fl">&nbsp;</label>
<i class="fa fa-folder mr5 color-light-grey" aria-hidden="true"></i>
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly',:style=>'border:none; max-width:980px;white-space: nowrap; text-overflow:ellipsis;font-family: Consolas;') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><span class="ispublic-label"><%= l(:field_is_public) %>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
<%= if attachment.id.nil?
#待补充代码
@ -16,7 +18,7 @@
end
%>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= link_to('<i class="fa fa-trash-o mr5"></i>'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<div class="cl"></div>
@ -48,13 +50,6 @@
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'AnnexBtn fl mt3' %>
<%#= button_tag "上传附件", :id => "upload_attachments", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
<label class="panel-form-label fl">&nbsp;</label>
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
<i class="fa fa-upload mr5"></i>
<span>上传附件</span>
</a>
<!--<a href="javascript:void(0);" onclick="_file.click();" class="AnnexBtn fl mr15">上传附件</a>-->
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
@ -81,7 +76,11 @@
<%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>
<!--)-->
<!--</span>-->
<label class="panel-form-label fl">&nbsp;</label>
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
<i class="fa fa-upload mr5"></i>
<span>上传附件</span>
</a>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>

View File

@ -1,23 +1,23 @@
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="<%= user_path(@user) %>"><%= @user.show_name %></a> &gt;
<a href="<%= user_path(@user) %>"><%= @user.show_name %></a> &gt; 论
</p>
<div class="edu-class-top clearfix mb30 pr user_bg_shadow bor-grey-e">
<div class="clearfix">
<div class="fl with60 mt5">
<a href="javascript:void(0)" class="fl">
<a href="<%= user_path(@user.show_name) %>" class="fl">
<%= image_tag(url_to_avatar(User.current), :width => 60, :height => 60,:alt=>'贴吧图像', :class=>"bor-radius-all" ) %>
</a>
<div class="fl ml15">
<li class="font-16"><%= @user.show_name %></li>
<li class="font-16"><a href="<%= user_path(@user.show_name) %>" class="color-grey3"><%= @user.show_name %></a></li>
<li class="mt5 color-grey"><%= @user.login %></li>
</div>
</div>
<ul class="task-index-head-info fr with30" style="padding: 10px 0px;">
<li><span class="color-orange font-bd" id="all_syllabuses"><%= @memos_praise_count %></span><br><span>被赞</span></li>
<li><span class="color-orange font-bd" id="all_syllabuses"><%= @my_memos_count %></span><br><span>回复/评论</span></li>
<li><span class="color-orange font-bd" id="all_syllabuses"><%= @my_forums_count %></span><br><span>主题</span></li>
<ul class="fr" style="padding: 10px 0px;text-align:right">
<li class="fl" style="text-align:center"><span class="color-orange font-bd" id="all_syllabuses"><%= @memos_praise_count %></span><br><span>被赞</span></li>
<li class="fl" style="text-align:center;margin-left: 60px;"><span class="color-orange font-bd" id="all_syllabuses"><%= @my_memos_count %></span><br><span>回复/评论</span></li>
<li class="fl" style="text-align:center;margin-left: 60px;"><span class="color-orange font-bd" id="all_syllabuses"><%= @my_forums_count %></span><br><span>主题</span></li>
</ul>
</div>
</div>
@ -29,27 +29,32 @@
<div id="forum_list" class="forum_table mh650">
<% @memos.each_with_index do |memo, index| %>
<div class="forum_table_item">
<a class="fr mr15">
<a href="<%= user_path(memo.author_id) %>" class="fr mr15">
<%= image_tag(url_to_avatar(memo.author), :width => 50, :height => 50,:alt=>'用户头像', :class=>"bor-radius-all mt3" ) %>
</a>
<div class="fl color-grey pr" style="flex: 1;">
<a href="<%= user_path(memo.author_id) %>" ><%= User.find(memo.author_id).try(:show_name) %></a>
<p class="font-16">
<a href="<%= forum_memo_path(memo.forum, memo) %>" class="clearfix item_name" target="_blank">
<p class="font-16 clearfix">
<a href="<%= forum_memo_path(memo.forum, memo) %>" class="clearfix item_name fl" target="_blank">
<%= memo.subject %>
<% if memo.sticky %>
<span class="btn-top btn-cir-red mt5 ml5">顶</span>
<% end %>
</a>
<% if memo.sticky %>
<span class="btn-top btn-cir-red mt7 ml5 fl">顶</span>
<% end %>
</p>
<p style="width: 1103px;" class="overellipsis"><%= memo.content %></p>
<p class="clearfix font-12 mt5">
<span class="mr20 fl" style="cursor: pointer;"><i class="fa fa-eye mr5"></i><%= memo.viewed_count %></span>
<span class="mr20 fl" style="cursor: pointer;"><i class="fa fa-thumbs-o-up mr5"></i><%= get_praise_num(memo) %></span>
<span class="mr50 fl" style="cursor: pointer;"><i class="fa fa-comments-o mr5"></i><%= Memo.where(:root_id => memo.id).count %></span>
<!--<span class="fl">类别:分享</span>-->
<span class="fr mr5">最后更新:<%= time_from_now memo.updated_at %></span>
</p>
<p style="width: 1091px;" class="overellipsis color-dark-grey mb10"><%= memo.content %></p>
<div class="clearfix">
<a href="<%= user_path(memo.author_id) %>" class="fl"><%= User.find(memo.author_id).try(:show_name) %></a>
<span class="fl ml30"><%= time_from_now memo.updated_at %></span>
<!--<span class="fl ml50">最后回复:</span>-->
<p class="font-12 mt5 fr">
<span class="mr20 fl" style="cursor: default;" data-tip-down="浏览数"><i class="fa fa-eye mr5"></i><%= memo.viewed_count %></span>
<span class="mr20 fl" style="cursor: default;" data-tip-down="点赞数"><i class="fa fa-thumbs-o-up mr5"></i><%= get_praise_num(memo) %></span>
<span class="mr10 fl" style="cursor: default;" data-tip-down="回复数"><i class="fa fa-comments-o mr5"></i><%= Memo.where(:root_id => memo.id).count %></span>
<!--<span class="fl">类别:分享</span>-->
</p>
</div>
<% if @user.admin? || @user == memo.author %>
<div class="edu-position-hidebox" style="position: absolute;right: 10px;top:0px;">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
@ -70,13 +75,13 @@
</div>
<% end %>
</div>
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
<div class="mt10 fl" style="width: 600px">
<div class="fl" style="width: 600px">
<% for attachment in attachments %>
<!--<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">-->
<!--<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">-->
@ -20,8 +20,11 @@
<div class="cl"></div>
<% else %>
<span class="pic_files fl "></span>
<%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 45 -%>
<a href="javascript:void(0);" class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a>
<i class="fa fa-folder mr5 color-orange03 mt8 fl" aria-hidden="true"></i>
<%= link_to_short_attachment attachment, :class => 'fl FilesName02 color-orange03', :download => true, :length => 45 -%>
<span class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</span>
<a href="<%= user_path(attachment.author) %>" class="fl color-orange05"><%= attachment.author %></a>
<span class="fl color-grey">,<%= format_time attachment.created_on %></span>
<% if options[:deletable] %>
<a href="<%=attachment_path(attachment) %>" onclick="confirm(<%=l(:text_are_you_sure) %>)" data-method="delete"> <span class="pic_del fl "></span> </a>
<% end %>

View File

@ -61,37 +61,37 @@
<!--onmouseover="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').show();" onmouseout="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').hide();"-->
<div class="comment_content clearfix" >
<div class="color-grey3"><%= comment.content_detail.html_safe %></div>
<div class="J_Comment_Info clearfix">
<div class="t_info fl">
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area fl"><%= time_from_now(comment.created_at) %></span>
</div>
<p class="fr mr10 orig_reply">
<% if comment.creator_user == User.current %>
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%= memo.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= forum_memo_path(comment.forum, comment, :user_activity_id => memo.id) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="ml5 mr5 color-grey">|</span>
<%= link_to(
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => memo.class.to_s, :user_activity_id => memo.id},
:remote => true,
:method => 'get',
:title => l(:button_reply),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
<div class="">
<div class="cl"></div>
<div id="reply_message_<%= comment.id%>" class="reply_to_message"></div>
</div>
</div>
<!--回复end-->
</div>
</div>
<div class="J_Comment_Info clearfix">
<div class="t_info fl">
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area fl"><%= time_from_now(comment.created_at) %></span>
</div>
<p class="fr mr10 orig_reply">
<% if comment.creator_user == User.current %>
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%= memo.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= forum_memo_path(comment.forum, comment, :user_activity_id => memo.id) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="ml5 mr5 color-grey">|</span>
<%= link_to(
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => memo.class.to_s, :user_activity_id => memo.id},
:remote => true,
:method => 'get',
:title => l(:button_reply),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
</div>
<div class="cl"></div>
</div>

View File

@ -5,7 +5,7 @@
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)"><%= @user.show_name %></a> &gt; <a href="<%= forums_path %>">讨论 </a>
<a href="<%= user_path(@user.show_name)%>"><%= @user.show_name %></a> &gt; <a href="<%= forums_path %>">讨论 </a>
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<p class="ml15 color-grey3 fl">
@ -16,11 +16,11 @@
<div class="edu-tab clearfix mb20 user_bg_shadow bor-grey-e">
<div class="panel-inner-fourm nobg">
<div class="clearfix pr">
<a href="/users/innov" class="fl">
<a href="<%= user_path(@memo.author) %>" class="fl">
<%= image_tag(url_to_avatar(@memo.author), :width => 60, :height => 60, :alt=>'用户头像', :class=>"panel-list-img mr15" ) %>
</a>
<div class="panel-list-infobox fl" style="margin:0;margin-left: 9px">
<div class="clearfix mb20">
<div class="panel-list-infobox fl" style="margin:0;margin-left: 6px">
<div class="clearfix mb5">
<p class="color-grey3 fl" style="font-size: 16px;">
<%= h @memo.subject %>
<% if @memo.sticky %>
@ -29,7 +29,7 @@
</p>
<!-- <p class="color-grey fr font-12 mr15 mt5"><a href="javascript:void(0)">返回</a></p>-->
</div>
<p><a href="<%= user_path(@memo.author) %>" class="font-14 mr15 color-grey" target="_blank"><%= @memo.author.show_name %></a><span class="font-14 mr15 color-grey">发表于<%= time_from_now @memo.updated_at %></span></p>
<p class="mb10"><a href="<%= user_path(@memo.author) %>" class="font-14 mr15 color-grey" target="_blank"><%= @memo.author.show_name %></a><span class="font-14 mr15 color-grey">发表于<%= time_from_now @memo.updated_at %></span></p>
<!--<p class="color-grey panel-lightgrey fl mt3">-->
<!--<span class="fl mr10 mt2">类别:分享</span>-->
<!-- </p>-->
@ -55,7 +55,7 @@
<!--帖子内容-->
<%= @memo.content.html_safe %>
</div>
<ul class="panel-inner-info mt10 clearfix">
<ul class="panel-inner-info clearfix">
<!--上传的文件内容-->
<% if @memo.attachments.any?%>
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>

View File

@ -73,6 +73,28 @@
<!--onmouseover="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').show();" onmouseout="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').hide();"-->
<div class="comment_content clearfix" >
<div class="color-grey3"><%= comment.content_detail.html_safe %></div>
<div class="J_Comment_Info clearfix">
<div class="t_info fl">
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area fl"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
</div>
<p class="fr mr10 orig_reply">
<% if is_teacher || comment.creator_user == User.current%>
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%=activity.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= delete_board_message_path(:id => comment, :user_activity_id => activity.id, :activity_id => activity.id) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="ml5 mr5 color-grey">|</span>
<%= link_to(
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id},
:remote => true,
:method => 'get',
:title => l(:button_reply),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
<div class="">
<div class="cl"></div>
<div id="reply_message_<%= comment.id%>" class="reply_to_message"></div>
@ -81,29 +103,6 @@
<!--回复end-->
</div>
</div>
<div class="J_Comment_Info clearfix">
<div class="t_info fl">
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area fl"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
</div>
<p class="fr mr10 orig_reply">
<% if is_teacher || comment.creator_user == User.current%>
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%=activity.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= delete_board_message_path(:id => comment, :user_activity_id => activity.id, :activity_id => activity.id) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="ml5 mr5 color-grey">|</span>
<%= link_to(
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id},
:remote => true,
:method => 'get',
:title => l(:button_reply),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
</div>
<div class="cl"></div>
</div>