banner类型

This commit is contained in:
huang 2016-04-26 16:23:08 +08:00
parent 32d7927eb9
commit 17b2e82963
4 changed files with 289 additions and 56 deletions

View File

@ -135,61 +135,7 @@
<div class="sn-content-left fl sn-mt15">
<% @subfield_content.each do |field| %>
<% if field.status.to_i == 1 %>
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
<!-- 代码 开始 -->
<div id="fsD1" class="focus">
<div id="D1pic1" class="fPic">
<div class="fcon" style="display: none;">
<a target="_blank" href="javascript:void(0);"><img src="/images/banner/banner01.jpg" alt="" style="opacity: 1; "></a>
<span class="shadow"><a target="_blank" href="javascript:void(0);">国内首个全球卫星导航系统仿真软件平台DBSim测试版上线</a></span>
</div>
<div class="fcon" style="display: none;">
<a target="_blank" href="javascript:void(0);"><img src="/images/banner/banner02.jpg" alt="" style="opacity: 1; "></a>
<span class="shadow"><a target="_blank" href="javascript:void(0);">国内首个全球卫星导航系统仿真软件平台DBSim测试版上线</a></span>
</div>
<div class="fcon" style="display: none;">
<a target="_blank" href="javascript:void(0);"><img src="/images/banner/banner01.jpg" alt="" style="opacity: 1; "></a>
<span class="shadow"><a target="_blank" href="javascript:void(0);">国内首个全球卫星导航系统仿真软件平台DBSim测试版上线</a></span>
</div>
<div class="fcon" style="display: none;">
<a target="_blank" href="javascript:void(0);"><img src="/images/banner/banner02.jpg" alt="" style="opacity: 1; "></a>
<span class="shadow"><a target="_blank" href="javascript:void(0);">国内首个全球卫星导航系统仿真软件平台DBSim测试版上线</a></span>
</div>
</div>
<div class="fbg">
<div class="D1fBt" id="D1fBt">
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
</div>
</div>
<span class="prev"></span>
<span class="next"></span>
</div>
<script type="text/javascript">
Qfast.add('widgets', { path: "/javascripts/terminator2.2.min.js", type: "js", requires: ['fx'] });
Qfast(false, 'widgets', function () {
K.tabs({
id: 'fsD1', //焦点图包裹id
conId: "D1pic1", //** 大图域包裹id
tabId:"D1fBt",
tabTn:"a",
conCn: '.fcon', //** 大图域配置class
auto: 1, //自动播放 1或0
effect: 'fade', //效果配置
eType: 'click', //** 鼠标事件
pageBt:true, //是否有按钮切换页码
bns: ['.prev', '.next'],//** 前后按钮配置class
interval: 3000 //** 停顿时间
})
})
</script>
<!-- 代码 结束 -->
</div>
<%= render :partial => 'organizations/org_subfield_leftT', :locals => {:field => field} %>
<% elsif field.status.to_i == 2 %>
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title">业界动态<a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>

View File

@ -0,0 +1,276 @@
<% if is_default_field?(field) %>
<% case field.name %>
<% when 'course' %>
<% if @course_acts.blank? %>
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
<% else %>
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
<!-- 代码 开始 -->
<div id="fsD1" class="focus">
<div id="D1pic1" class="fPic">
<% @course_acts.first(4).each do |act| %>
<% if act.org_act_type == "HomeworkCommon" %>
<% activity = HomeworkCommon.find(act.org_act_id) %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), student_work_index_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), student_work_index_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow"><%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank' %></span>
</div>
<% elsif act.org_act_type == "Message" %>
<% activity = Message.find(act.org_act_id) %>
<% iamge_path = get_image_path_from_content(activity.content) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
<% else %>
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
<% end %>
</span>
</div>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow">
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
</span>
</div>
<% elsif act.org_act_type == "Poll" %>
<% activity = Poll.find(act.org_act_id) %>
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
<% if ( activity.polls_status==2) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow">
<% if has_commit %>
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank' %>
<% else %>
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s, :target => '_blank' %>
<% end %>
</span>
</div>
<% end %>
<% end %>
<% end %>
</div>
<div class="fbg">
<div class="D1fBt" id="D1fBt">
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
</div>
</div>
<span class="prev"></span>
<span class="next"></span>
</div>
</div>
<% end %>
<% when 'project' %>
<% if @project_acts.blank? %>
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
<% else %>
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
<!-- 代码 开始 -->
<div id="fsD1" class="focus">
<div id="D1pic1" class="fPic">
<% @project_acts.first(4).each do |act| %>
<% if act.org_act_type == "Issue" %>
<% activity = Issue.find(act.org_act_id) %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), issue_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), issue_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow"><%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank' %></span>
</div>
<% elsif act.org_act_type == "Message" %>
<% activity = Message.find(act.org_act_id) %>
<% iamge_path = get_image_path_from_content(activity.content) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
<% else %>
<%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
<% end %>
</span>
</div>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_url_in_org(activity.id), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow">
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
</span>
</div>
<% end %>
<% end %>
</div>
<div class="fbg">
<div class="D1fBt" id="D1fBt">
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
</div>
</div>
<span class="prev"></span>
<span class="next"></span>
</div>
</div>
<% end %>
<% end %>
<% else %>
<% if field.field_type == "Post" %>
<% org_acts = get_subfield_acts field %>
<% if org_acts.blank? %>
<%= render :partial => 'organizations/org_subfield_leftT_default', :locals => {:field => field} %>
<% else %>
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
<!-- 代码 开始 -->
<div id="fsD1" class="focus">
<div id="D1pic1" class="fPic">
<% org_acts.first(4).each do |activity| %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
<% document = activity.org_act %>
<% org_subfield_id = params[:org_subfield_id] %>
<% flag = 2 %>
<% iamge_path = get_image_path_from_content(document.content) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank' %></span>
</div>
<% elsif activity.container_type == 'OrgSubfield' %>
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
<% message = Message.find(activity.org_act_id) %>
<% if message.board.org_subfield_id %>
<% if message.parent_id.nil? %>
<% content = message.content%>
<% else %>
<% content = message.parent.content%>
<% end %>
<% iamge_path = get_image_path_from_content(content) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow">
<% if message.parent_id.nil? %>
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank' %>
<% else %>
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank'%>
<% end %>
</span>
</div>
<% else %>
<% if message.parent_id.nil? %>
<% content = message.content%>
<% else %>
<% content = message.parent.content%>
<% end %>
<% iamge_path = get_image_path_from_content(content) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), board_message_path(message.board,activity), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), board_message_path(message.board,activity), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow">
<% if message.parent_id.nil? %>
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :class=> "postGrey" %>
<% else %>
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :class=> "postGrey" %>
<% end %>
</span>
</div>
<% end %>
<% end %>
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
<% news = News.find(activity.org_act_id) %>
<% iamge_path = get_image_path_from_content(news.description) %>
<div class="fcon" style="display: none;">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/banner-default.jpg", :width => "820", :height => "435"), news_path(news), :target => "_blank", :style =>"opacity: 1; " %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "820", :height => "435"), news_path(news), :target => "_blank", :style =>"opacity: 1; " %>
<% end %>
<span class="shadow"><%= link_to news.title.to_s, news_path(news), :target => '_blank' %></span>
</div>
<% end %>
<% end %>
<% end %>
</div>
<div class="fbg">
<div class="D1fBt" id="D1fBt">
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class="current"></a>
<a href="javascript:void(0)" hidefocus="true" target="_self" class=""></a>
</div>
</div>
<span class="prev"></span>
<span class="next"></span>
</div>
</div>
<% end %>
<% end %>
<% end %>
<script type="text/javascript">
Qfast.add('widgets', { path: "/javascripts/terminator2.2.min.js", type: "js", requires: ['fx'] });
Qfast(false, 'widgets', function () {
K.tabs({
id: 'fsD1', //焦点图包裹id
conId: "D1pic1", //** 大图域包裹id
tabId:"D1fBt",
tabTn:"a",
conCn: '.fcon', //** 大图域配置class
auto: 1, //自动播放 1或0
effect: 'fade', //效果配置
eType: 'click', //** 鼠标事件
pageBt:true, //是否有按钮切换页码
bns: ['.prev', '.next'],//** 前后按钮配置class
interval: 3000 //** 停顿时间
})
})
</script>

View File

@ -0,0 +1,10 @@
<div class="sn-index-banner" style="display:<%= field.hide == 0?'block':'none' %>;">
<!-- 代码 开始 -->
<div id="fsD1" class="focus">
<div class="fPic">
<div class="fcon-default">
<a target="_blank" href="javascript:void(0);"><img src="/images/default_blank/banner-default.jpg" alt="" ></a>
</div>
</div>
</div>
</div>

View File

@ -98,6 +98,7 @@ a.sn-search-button {width:53px; height:40px; border:1px solid #ccc; border-left:
filter:progid:DXImageTransform.Microsoft.gradient( GradientType = 0,startColorstr = '#80000000',endColorstr = '#80000000')\9; display:block; text-align:left; }
.focus .shadow a{ text-decoration:none; color:#fff; font-size:20px; overflow:hidden; margin-left:10px; }
.focus .fcon{ position:relative; width:100%; float:left; display:none; background:#000 }
.focus .fcon-default{ position:relative; width:100%; float:left; background:#fff }
.focus .fcon img{ display:block; }
.focus .fbg{bottom:25px; right:40px; position:absolute; height:21px; text-align:center; z-index: 200; }
.focus .fbg div{margin:4px auto 0;overflow:hidden;zoom:1;height:14px}