From 0ab17f1e909fdeeda766ddcdbc368317bd93c10a Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 21 May 2014 09:45:16 +0800 Subject: [PATCH] contest image show --- app/views/softapplications/show.html.erb | 213 +++++++++++------------ public/stylesheets/nyan.css | 52 +++++- 2 files changed, 154 insertions(+), 111 deletions(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index c077bc822..36167880c 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -1,146 +1,139 @@ -<%=render :partial => 'layouts/base_softapplication_top_content'%> - - +<%= render :partial => 'layouts/base_softapplication_top_content' %>

<%= notice %>

- - - - - - - - - - - - <% contest = @softapplication.contests.first %> - - - - - - - - + + - + + + + + + + + + +
<%= @softapplication.name %> - <%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: { confirm: '您确定要删除吗?' } if @softapplication.destroyable_by? User.current %>  - <%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %> -
所属类别:<%= @softapplication.app_type_name %>所属竞赛:<%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛'%>
发布人员:<%= @softapplication.user.name %>系统支持:<%= @softapplication.android_min_version_available %>
- 作品下载: +
+ + + + + + + + + <% contest = @softapplication.contests.first %> + + + + + + + + + - - - - - - - - - - - -
<%= @softapplication.name %> + <%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: {confirm: '您确定要删除吗?'} if @softapplication.destroyable_by? User.current %>  + <%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %> +
所属类别:<%= @softapplication.app_type_name %>所属竞赛:<%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %>
发布人员:<%= @softapplication.user.name %>系统支持:<%= @softapplication.android_min_version_available %>
+ 作品下载: - <% options = {:author => true, :deletable => @softapplication.user.eql?(User.current) } %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %> + <% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %> - 开发人员:<%= @softapplication.application_developers %>
平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>发布时间:<%=format_time @softapplication.created_at %>
- <% unless @softapplication.deposit_project_url.nil? %> - <%= textilizable ("托管项目网址: " + @softapplication.deposit_project_url) %> - <% end %> -
-
开发人员:<%= @softapplication.application_developers %>
平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>发布时间:<%= format_time @softapplication.created_at %>
+ <% unless @softapplication.deposit_project_url.nil? %> + <%= textilizable ("托管项目网址: " + @softapplication.deposit_project_url) %> + <% end %> +
+ +
-
作品简介:
-
<%= @softapplication.description %>
+ +
作品简介:
+
+ +
<%= @softapplication.description %>
-
作品得分:
- -
-
-
得分比例
-
- <% 100.step(20,-20) do |star| %> -
-
-
-
-
-
- <%= @stars_status_map["star#{(star/20).to_s}".to_sym] %> -
- <% end %> -
-
-
-
最终得分
-
<%=@softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分
-
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
-
-
-
打分总人数
-
<%= @softapplication.raters(:quality).count%>
-
-
+
作品得分:
+ +
+
+
得分比例
+
+ <% 100.step(20, -20) do |star| %> +
+
+
+
+
+
+ <%= @stars_status_map["star#{(star/20).to_s}".to_sym] %> +
+ <% end %> +
+
+
+
最终得分
+
<%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %> + 分 +
+
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
+
+
+
打分总人数
+
+ <%= @softapplication.raters(:quality).count %>
+
+
-
作品截图:
-
- <% @image_results.take(4).each do |attachment| %> - <%= link_to_attachment_img attachment, :class => "soft-application", :download => "true" %> - <% end %> -
-
+ +
作品截图:
+
+ +
+
    + <% @image_results.take(4).each do |attachment| %> +
  • + + <%= link_to_attachment_img attachment, :class => "soft-application", :download => "true"%> +
  • + <% end %> +
+
+
- +
-
作品评论:
-
评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %>(您可以重新打分,打分结果以最后一次打分为主!)
- +
作品评论:
+
评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %> + (您可以重新打分,打分结果以最后一次打分为主!)
+
- <%= render :partial => 'message_history', :locals => { :contest => @softapplication, :journals => @jour, :state => false} %> + <%= render :partial => 'message_history', :locals => {:contest => @softapplication, :journals => @jour, :state => false} %>
-<%#= link_to '返回竞赛页面', show_softapplication_contest_path(@softapplication.contest) %>
diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index e1088c8c0..0135b1e46 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -218,7 +218,6 @@ body { border-style: solid; border-width: 1px; color: #222222; - font-family: "Helvetica Neue"; font-size: 1.2em; outline: medium none; padding: 8px; @@ -1140,3 +1139,54 @@ div.pagination { .all_browse_div table td{ vertical-align: middle; } + +/* softapplication show +*******************************************************************************/ +.softapplication-img { + margin: 0; + padding: 0; +} +.softapplication-img { + margin: 5px auto; + width: 860px; + max-height: 640px; + overflow: hidden; + box-shadow: 5px 5px 20px 5px #ccc; + border-radius: 5px; +} +.soft-application { + width: 326px; + height: 580px; +} +.softapplication-img .title{ + width: 326px; + position: absolute; + left: 0; + bottom: 0; +} +.softapplication-img .title a{ + display: block; + text-decoration: none; + color: #fff; + font-size: 20px; + padding: 20px; + background: rgba(0,0,0,0.5); +} +.softapplication-img li{ + list-style-type: none; + position: relative; + float: left; + width: 205px; + -webkit-transition: all 0.5s; + -moz-transition: all 0.5s; + -ms-transition: all 0.5s; + -o-transition: all 0.5s; + transition: all 0.5s; + box-shadow: -1px 0 3px 1px rgba(0,0,0,0.3); +} +.softapplication-img ul:hover li{ + width: 160px; +} +.softapplication-img ul li:hover{ + width: 326px; +}