替换竞赛模块首页中竞赛和应用的图标并调整相应的格式

This commit is contained in:
wanglinchun 2014-04-22 19:27:31 +08:00
parent bc068eb12b
commit 05c0d2a5ac
10 changed files with 72 additions and 132 deletions

View File

@ -100,7 +100,7 @@ class SoftapplicationsController < ApplicationController
@softapplication.destroy
respond_to do |format|
format.html { redirect_to :back }
format.html { redirect_to home_path }
format.json { head :no_content }
end
end

View File

@ -8,7 +8,6 @@
<td>
<%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication)) %>
</td>
<td><%= link_to '删除', c_softapplication.softapplication, method: :delete, data: { confirm: '您确定要删除吗?' } %></td>
</tr></br>
</div>
<div style="padding-left: 68px">

View File

@ -1,64 +1,69 @@
<%= form_for(@softapplication) do |f| %>
<%= form_for(softapplication) do |f| %>
<% if @softapplication.errors.any? %>
<% if softapplication.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@softapplication.errors.count, "error") %> prohibited this softapplication from being saved:</h2>
<h2><%= pluralize(softapplication.errors.count, "error") %> prohibited this softapplication from being saved:</h2>
<ul>
<% @softapplication.errors.full_messages.each do |msg| %>
<% softapplication.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<tr style="width:700px; margin-left: -10px">
<td><%= l(:label_softapplication_name) %></td>
<td style="require, color: #bb0000"> * </td>:
<td ><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
<td><%= l(:label_softapplication_name_condition)%></td>
</tr></ br><br /><br />
<fieldset class="contes-new-box">
<tr style="width:700px; margin-left: -10px">
<span><%= l(:label_softapplication_name) %></span>
<span class="contest-star"> * </span>: <td ><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
<span><%= l(:label_softapplication_name_condition)%></span>
</tr></ br>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_version_available) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
<tr style="width:800px;">
<td><%= l(:label_softapplication_version_available) %></td>
<td style="require, color: #bb0000"> * </td>:
<td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr></ br>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_type) %></span>
</tr></ br><br /><br />
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td>
<tr style="width:800px;">
<td><%= l(:label_softapplication_type) %></td>
<td style="require, color: #bb0000"> * </td>:
<td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr></ br>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_description) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr></ br><br /><br />
</tr></ br>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_developers) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td>
<tr style="width:800px;">
<td><%= l(:label_softapplication_description) %></td>
<td style="require, color: #bb0000"> * </td>:
<td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr></ br><br /><br />
<fieldset style="width: 600px">
<div>
<%=l(:label_upload_softapplication_packets)%>&nbsp;:<br />
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
</div>
</fieldset></tr></ br></ br></ br></ br></ br>
<fieldset style="width: 600px">
<div>
<span><%=l(:label_upload_softapplication_photo)%>&nbsp;:</span>(<span style="font-size: 3px"><%=l(:label_upload_softapplication_photo_condition)%></span>)<br />
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
</div>
</fieldset>
</tr></ br>
<br />
<br />
<fieldset style="width: 500px">
<legend>上传应用软件包和应用截图</legend>
<%= render_flash_messages %>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
<p style="font-size: 10px">(<%=l(:label_upload_softapplication_photo_condition)%>)</p>
</fieldset>
</fieldset></br>
<div class="align-center"><%= submit_tag l(:button_create), :onclick => "return true" %></div>
<% end %>

View File

@ -1,6 +1,8 @@
<h1>Editing softapplication</h1>
<h3 style="font-size: 18px"><%= l(:label_edit_softapplication)%></h3>
<%= render partial: 'form', locals:{softapplication: @softapplication} %>
<!-- <%= link_to 'Show', @softapplication %>
<%= link_to 'Back', softapplications_path %> -->
<%= render 'form' %>
<%= link_to 'Show', @softapplication %> |
<%= link_to 'Back', softapplications_path %>

View File

@ -1,76 +1,5 @@
<h3 style="font-size: 18px"><%= l(:label_release_softapplication)%></h3>
<%= render partial: 'form', locals:{softapplication: @softapplication} %>
<div >
<%= form_for Softapplication.new, :url => {:controller => 'softapplications', :action => 'create'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true, :id => 'add_homework_form'} do |f| %>
<fieldset class="contes-new-box">
<!-- <legend>
<%= l(:label_attachment_plural) %>
</legend> -->
<tr style="width:700px; margin-left: -10px">
<span><%= l(:label_softapplication_name) %></span>
<span class="contest-star"> * </span>: <td ><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
<span><%= l(:label_softapplication_name_condition)%></span>
</tr></ br>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_version_available) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr></ br>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_type) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr></ br>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_description) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr></ br>
<br />
<br />
<tr style="width:800px;">
<span><%= l(:label_softapplication_developers) %></span>
<span class="contest-star"> * </span>: <td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td>
</tr></ br>
<br />
<br />
<fieldset style="width: 500px">
<legend>上传应用软件包和应用截图</legend>
<%= render_flash_messages %>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
<p style="font-size: 10px">(<%=l(:label_upload_softapplication_photo_condition)%>)</p>
</fieldset>
</fieldset></br>
<div class="align-center"><%= submit_tag l(:button_create), :onclick => "return true" %></div>
<script type="text/javascript">
function j_submit () {
alert('start')
var submit_homework = function(){
$('#add_homework_form').clone().attr('action', '<%= url_for({:controller => "softapplications", :action => "create"})+".js" %>').ajaxSubmit()
};
alert('stop')
$.globalEval(submit_homework());
return false;
}
</script>
</div>
<% end %>
</div>

View File

@ -18,6 +18,10 @@
<table width="100%" border="0">
<tr style="font-size: 18px">
<td colspan="2" valign="top"><strong><%= @softapplication.name %></strong></td>
<td style="font-size: 15px">
<%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: { confirm: '您确定要删除吗?' } if @softapplication.destroyable_by? User.current %>&nbsp;
<%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %>
</td>
</tr>
<tr>
<td>所属类别:<%= @softapplication.app_type_name %></td>

View File

@ -142,18 +142,18 @@
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4"; style="float: left; margin-top: 7px">
<%= image_tag('/images/039.gif')%>
<%= image_tag('/images/contest1.png')%>
</div>
<div style="float: left; margin-left: -8px; margin-top: 5px; width: 380px;">
<div style="float: left; margin-left: 12px; margin-top: 10px; margin-bottom: -4px; width: 380px;">
<%= link_to(contest.name, contest.event_url, :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
</div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: -8px; width: 380px;">
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;">
<span class='font_lighter' title =<%=contest.description.to_s%>><%=contest.description.truncate(50, omission: '...')%></span>
</div><br />
<div style="padding-left: 36px; clear: left;">
<div style="padding-left: 57px; clear: left;">
<span class="font_lighter">发布时间:<%=format_time contest.created_on %></span>
</div>
@ -204,18 +204,18 @@
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4"; style="float: left; margin-top: 7px">
<%= image_tag('/images/009.gif')%>
<%= image_tag('/images/app1.png')%>
</div>
<div style="float: left; margin-left: -8px; margin-top: 5px; width: 380px;">
<div style="float: left; margin-left: 10px; margin-top: 7px;margin-bottom: -2px; width: 380px;">
<%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
</div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: -8px; width: 380px;">
<div class='text_nowrap' style="float: left;margin:5px; margin-left: 10px; margin-bottom:1px; width: 380px;">
<span class='font_lighter' title =<%=softapplication.description.to_s%>><%=softapplication.description.truncate(50, omission: '...')%></span>
</div><br />
<div style="padding-left: 36px; clear: left;">
<div style="padding-left: 55px; clear: left;">
<span class="font_lighter">发布时间:<%=format_time softapplication.created_at %></span>
</div>

View File

@ -1855,6 +1855,7 @@ zh:
label_release_add_contest_succeed: 该应用发布并添加成功.
label_add_contest_succeed_fail: 添加失败,该应用已参赛.
label_no_ftapplication: 暂无应用
label_edit_softapplication: 修改应用

BIN
public/images/app1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
public/images/contest1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB