导出样式

This commit is contained in:
huang 2016-03-02 18:41:20 +08:00
parent 21244a5657
commit a0ef85f4da
2 changed files with 274 additions and 5 deletions

View File

@ -0,0 +1,271 @@
<%#= javascript_include_tag 'bootstrap'%>
<%#= stylesheet_link_tag 'project' %>
<%#= stylesheet_link_tag 'leftside' %>
<%#= javascript_include_tag 'attachments'%>
<div class="resource-wrapper">
<ul class="resource-banner">
<li class="fl resource-switch">
<a href="<%= user_resource_user_path(User.current, :type => '6') %>" class="resource-tab resource-tab-active" data-remote="true">公共资源</a>
</li>
<li class="fl resource-switch">
<a href="<%= user_resource_user_path(User.current, :type => '1') %>" class="resource-tab" data-remote="true">我的资源</a>
</li>
<li class="fl w770 border-bottom h34">&nbsp;</li>
<div class="cl"></div>
</ul>
<div class="cl"></div>
<div id="users_setting">
<div id="search_div">
<%= form_tag( url_for(:controller => 'users', :action => 'resource_search', :id => User.current.id),
:remote => true , :method => 'get', :class => 'resourcesSearchloadBox mt10', :id => 'resource_search_form') do %>
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="searchResource" />
<%= hidden_field_tag(:type,type.nil? ? 1 : type) %>
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :style => 'border-style:none' %>
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
<% end %>
</div>
</div>
<div class="cl"></div>
<ul class="resource-list-tab mt10">
<li class="resource-list-checkbox fl"> </li>
<li class="resource-list-name fl">资源名称</li>
<li class="resource-list-time fr">上传时间</li>
<li class="resource-list-uploader fr">上传者</li>
<li class="resource-list-type fr">类别</li>
<li class="resource-list-size fr">大小</li>
<li class="resource-list-from fr">资源来源</li>
</ul>
<div class="cl"></div>
<form id="resources_list_form">
<div id="resources_list">
<% @attachments.each do |attach| %>
<ul class="resource-list" onmouseover="if($('#contextMenu').css('display') != 'block')$(this).children().css('background-color', '#e1e1e1')" onmouseout=" if($('#contextMenu').css('display') == 'none')$(this).children().css('background-color', 'white')">
<li class="resource-list-checkbox fl">
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
<!--<input name="checkbox2" type="checkbox" value="" class="resourcesCheckbox" />-->
</li>
<li class="resource-list-name fl hidden">
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack' %>
</li>
<li class="resource-list-time fr"><%= format_date(attach.created_on) %></li>
<li style="display: none"><%= attach.id %></li>
<li class="resource-list-uploader fr hidden"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
<li style="display: none"><%= attach.author_id %></li>
<li class="resource-list-type fr"><%= get_resource_type(attach.container_type)%></li>
<li style="display: none"><%= attach.id %></li>
<li class="resource-list-size fr"><%= number_to_human_size(attach.filesize) %></li>
<li style="display: none"><%= attach.id %></li>
<li class="resource-list-from fr hidden" title="<%= get_resource_origin(attach) %>"><%= get_resource_origin(attach) %></li>
<li style="display: none"><%= attach.id %></li>
</ul>
<div class="cl"></div>
<% end %>
</div>
<div class="cl"></div>
<div class="resource-list-option fl">
<div class="resource-check-all">
<input id="checkboxAll" type="checkbox" value="" onclick="all_select();" class="resourcesCheckbox" />
</div>
<a href="javascript:void(0);" class="replyGrey1 mr15" onclick="all_select();">全选</a>
<a href="javascript:void(0);" class="replyGrey" onclick="batch_delete();">删除</a>
<div class="resourcesSelectSend">
<div class="fl">选择&nbsp;<span class="c_red" id="res_count">0</span>&nbsp;个资源</div>
<div class="resourcesSelectSendButton" onclick="batch_send();">
<a href="javascript:void(0);" class="sendButtonBlue db" data-remote="true" >发送</a>
</div>
</div>
</div>
</form>
<div class="cl"></div>
<div>
<ul class="wlist" id="pages" style="margin-top: 5px;">
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
</ul>
</div>
<div class="cl"></div>
<!--<div id="upload_box" style="display: none">-->
<!--<%#= render :partial => 'upload_resource' ,:locals => {:user=>@user}%>-->
<!--</div>-->
</div>
<div class="cl"></div>
<div class="popupWrap w615"> <a href="javascript:void(0);" class="popupClose"></a>
<div class="f16 fb fontBlue mb10">选用资源库中的资源</div>
<div class="subjectList fl mr10">
<a href="<%= user_resource_user_path(User.current, :type => '6') %>" class="subjectChoose chooseActive fl" data-remote="true">公共资源</a>
<a href="<%= user_resource_user_path(User.current, :type => '1') %>" class="subjectChoose fl" data-remote="true">我的资源</a>
<%= form_tag( url_for(:controller => 'users', :action => 'resource_search', :id => User.current.id),
:remote => true , :method => 'get', :class => 'resourcesSearchloadBox mt10', :id => 'resource_search_form') do %>
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="searchResource" />
<%= hidden_field_tag(:type,type.nil? ? 1 : type) %>
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :style => 'border-style:none' %>
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
<% end %>
<div class="cl"></div>
<div style="height:441px; min-height:441px; max-height:441px;">
<ul class="subjectBanner mt10">
<li class="subjectName fl hidden"><span style="padding-left:15px;">资源名称</span></li>
<li class="subjectType fl">类别</li>
<li class="subjectCount fl">大小</li>
<li class="subjectPublisher fl">上传者</li>
<li class="fl subjectDate">上传时间</li>
</ul>
<% @attachments.each do |attach| %>
<ul class="subjectRow" onmouseover="if($('#contextMenu').css('display') != 'block')$(this).children().css('background-color', '#e1e1e1')" onmouseout=" if($('#contextMenu').css('display') == 'none')$(this).children().css('background-color', 'white')">
<li class="resource-list-checkbox fl">
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="subjectName fl hidden" />
<!--<input name="checkbox2" type="checkbox" value="" class="resourcesCheckbox" />-->
</li>
<li class="resource-list-name fl hidden">
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack' %>
</li>
<li class="resource-list-uploader fr hidden"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
<li class="resource-list-type fr"><%= get_resource_type(attach.container_type)%></li>
<li class="resource-list-size fr"><%= number_to_human_size(attach.filesize) %></li>
<li class="resource-list-from fr hidden" title="<%= get_resource_origin(attach) %>"><%= get_resource_origin(attach) %></li>
<li class="fl subjectDate"><%= format_date(attach.created_on) %></li>
</ul>
<div class="cl"></div>
<% end %>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">项目资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">附件</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<input type="checkbox" name="subjectName" class="mr5" style="vertical-align:middle;" />
<span>123456.jpg</span></label>
</li>
<li class="subjectType fl">课程资源</li>
<li class="subjectCount fl">123.0KB</li>
<li class="subjectPublisher fl">尹刚</li>
<li class="fl subjectDate">2016-01-21</li>
</ul>
</div>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText">选用</a></div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText">取消</a></div>
<div class="pageRoll mt0">
<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">上一页</a></div>
<div class="pageCell pageCellActive"><a href="javascript:void(0);" class="c_white">1</a></div>
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">2</a></div>
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">3</a></div>
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">...</a></div>
<div class="pageCell"><a href="javascript:void(0);" class="fontBlue">14</a></div>
<div class="pageCell"><a href="javascript:void(0);" class="linkBlue">下一页</a></div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>

View File

@ -1,10 +1,8 @@
$('#ajax-modal').html('<%= escape_javascript( render :partial => 'users/resource_search_form', :locals => {:user => User.current, :type => 1} ) %>');
$('#ajax-modal').html('<%= escape_javascript( render :partial => 'users/resources_list' , :locals => { :attachments => @attachments}) %>');
$('#ajax-modal').html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').html('<%= escape_javascript( render :partial => 'users/import_resource_info', :locals => {:user => User.current, :type => 1} ) %>');
showModal('ajax-modal', '615px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().css("top","10%").css("left","36%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("popbox_polls");