Merge branch 'competition' into develop
Conflicts: Gemfile.lock app/views/layouts/_base_footer.html.erb
This commit is contained in:
commit
9af6c03547
|
@ -0,0 +1,115 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actionmailer (3.2.13)
|
||||
actionpack (= 3.2.13)
|
||||
mail (~> 2.5.3)
|
||||
actionpack (3.2.13)
|
||||
activemodel (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
builder (~> 3.0.0)
|
||||
erubis (~> 2.7.0)
|
||||
journey (~> 1.0.4)
|
||||
rack (~> 1.4.5)
|
||||
rack-cache (~> 1.2)
|
||||
rack-test (~> 0.6.1)
|
||||
sprockets (~> 2.2.1)
|
||||
activemodel (3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
builder (~> 3.0.0)
|
||||
activerecord (3.2.13)
|
||||
activemodel (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
arel (~> 3.0.2)
|
||||
tzinfo (~> 0.3.29)
|
||||
activeresource (3.2.13)
|
||||
activemodel (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
activesupport (3.2.13)
|
||||
i18n (= 0.6.1)
|
||||
multi_json (~> 1.0)
|
||||
acts-as-taggable-on (2.4.1)
|
||||
rails (>= 3, < 5)
|
||||
arel (3.0.2)
|
||||
builder (3.0.0)
|
||||
coderay (1.0.9)
|
||||
erubis (2.7.0)
|
||||
fastercsv (1.5.0)
|
||||
hike (1.2.3)
|
||||
i18n (0.6.1)
|
||||
journey (1.0.4)
|
||||
jquery-rails (2.0.3)
|
||||
railties (>= 3.1.0, < 5.0)
|
||||
thor (~> 0.14)
|
||||
json (1.8.0)
|
||||
mail (2.5.4)
|
||||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
mime-types (1.23)
|
||||
multi_json (1.7.6)
|
||||
mysql2 (0.3.11-x86-mingw32)
|
||||
net-ldap (0.3.1)
|
||||
polyglot (0.3.3)
|
||||
rack (1.4.5)
|
||||
rack-cache (1.2)
|
||||
rack (>= 0.4)
|
||||
rack-openid (1.3.1)
|
||||
rack (>= 1.1.0)
|
||||
ruby-openid (>= 2.1.8)
|
||||
rack-ssl (1.3.3)
|
||||
rack
|
||||
rack-test (0.6.2)
|
||||
rack (>= 1.0)
|
||||
rails (3.2.13)
|
||||
actionmailer (= 3.2.13)
|
||||
actionpack (= 3.2.13)
|
||||
activerecord (= 3.2.13)
|
||||
activeresource (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
bundler (~> 1.0)
|
||||
railties (= 3.2.13)
|
||||
railties (3.2.13)
|
||||
actionpack (= 3.2.13)
|
||||
activesupport (= 3.2.13)
|
||||
rack-ssl (~> 1.3.2)
|
||||
rake (>= 0.8.7)
|
||||
rdoc (~> 3.4)
|
||||
thor (>= 0.14.6, < 2.0)
|
||||
rake (10.0.4)
|
||||
rdoc (3.12.2)
|
||||
json (~> 1.4)
|
||||
ruby-openid (2.1.8)
|
||||
seems_rateable (1.0.13)
|
||||
jquery-rails
|
||||
rails
|
||||
sprockets (2.2.2)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
thor (0.18.1)
|
||||
tilt (1.4.1)
|
||||
treetop (1.4.14)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
tzinfo (0.3.37)
|
||||
|
||||
PLATFORMS
|
||||
x86-mingw32
|
||||
|
||||
DEPENDENCIES
|
||||
activerecord-jdbc-adapter (= 1.2.5)
|
||||
activerecord-jdbcmysql-adapter
|
||||
acts-as-taggable-on
|
||||
builder (= 3.0.0)
|
||||
coderay (~> 1.0.6)
|
||||
fastercsv (~> 1.5.0)
|
||||
i18n (~> 0.6.0)
|
||||
jquery-rails (~> 2.0.2)
|
||||
mysql2 (~> 0.3.11)
|
||||
net-ldap (~> 0.3.1)
|
||||
rack-openid
|
||||
rails (= 3.2.13)
|
||||
rdoc (>= 2.4.2)
|
||||
ruby-openid (~> 2.1.4)
|
||||
seems_rateable
|
|
@ -1,4 +1,8 @@
|
|||
class SoftapplicationsController < ApplicationController
|
||||
before_filter :find_softapplication, only: [:edit, :update, :destroy]
|
||||
before_filter :editable, only: [:edit, :update]
|
||||
before_filter :destroyable, only: :destroy
|
||||
|
||||
# GET /softapplications
|
||||
# GET /softapplications.json
|
||||
def index
|
||||
|
@ -71,8 +75,9 @@ class SoftapplicationsController < ApplicationController
|
|||
# PUT /softapplications/1
|
||||
# PUT /softapplications/1.json
|
||||
def update
|
||||
@softapplication = Softapplication.find(params[:id])
|
||||
|
||||
# @softapplication = Softapplication.find(params[:id])
|
||||
@softapplication.attachments.map{|attach| attach.destroy }
|
||||
@softapplication.save_attachments(params[:attachments])
|
||||
respond_to do |format|
|
||||
if @softapplication.update_attributes(params[:softapplication])
|
||||
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully updated.' }
|
||||
|
@ -92,11 +97,11 @@ class SoftapplicationsController < ApplicationController
|
|||
# DELETE /softapplications/1
|
||||
# DELETE /softapplications/1.json
|
||||
def destroy
|
||||
@softapplication = Softapplication.find(params[:id])
|
||||
# @softapplication = Softapplication.find(params[:id])
|
||||
@softapplication.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to softapplications_url }
|
||||
format.html { redirect_to home_path }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
@ -192,4 +197,24 @@ class SoftapplicationsController < ApplicationController
|
|||
#format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def find_softapplication
|
||||
@softapplication = Softapplication.find_by_id(params[:id])
|
||||
end
|
||||
|
||||
def editable
|
||||
unless @softapplication.editable_by? User.current
|
||||
render_403
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
def destroyable
|
||||
unless @softapplication.destroyable_by? User.current
|
||||
render_403
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -181,7 +181,7 @@ class Attachment < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def pack?
|
||||
!!(self.filename =~ /\.(zip|rar|tar|gz)$/i)
|
||||
!!(self.filename =~ /\.(zip|rar|tar|gz|exe|jar|7z|iso)$/i)
|
||||
end
|
||||
|
||||
def thumbnailable?
|
||||
|
|
|
@ -7,7 +7,7 @@ class Softapplication < ActiveRecord::Base
|
|||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
has_many :contesting_softapplications, :dependent => :destroy
|
||||
belongs_to :user
|
||||
belongs_to :contest
|
||||
has_many :contests, :through => :contesting_softapplications
|
||||
|
||||
def add_jour(user, notes, reference_user_id = 0, options = {})
|
||||
if options.count == 0
|
||||
|
@ -21,6 +21,13 @@ class Softapplication < ActiveRecord::Base
|
|||
def set_commit(commit)
|
||||
self.update_attribute(:commit, commit)
|
||||
end
|
||||
|
||||
|
||||
def editable_by? usr
|
||||
usr.admin? || self.user == usr
|
||||
end
|
||||
|
||||
def destroyable_by? usr
|
||||
self.user == usr || usr.admin?
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<tr>
|
||||
<td><strong>应用软件:</strong></td>
|
||||
<td>
|
||||
<%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication)) %>
|
||||
<%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %>
|
||||
</td>
|
||||
</tr></br>
|
||||
</div>
|
||||
|
|
|
@ -27,3 +27,18 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="debug">
|
||||
<%= debug(params) if Rails.env.development? %>
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-46523987-1', 'trustie.net');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<div class="top-content">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
|
||||
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||
<td rowspan="2" width="250px"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %></td>
|
||||
<td ><%=link_to l(:field_homepage), home_path %> >
|
||||
<%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
|
||||
<span>
|
||||
<% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
|
||||
</span>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
|
@ -26,23 +26,23 @@
|
|||
<div class="top-content">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
|
||||
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||
<td rowspan="2" width="250px">
|
||||
<div class="project-search">
|
||||
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20 %>
|
||||
<%= hidden_field_tag 'reward_type', @bid.reward_type %>
|
||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
|
||||
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||
<td rowspan="2" width="250px">
|
||||
<div class="project-search">
|
||||
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20 %>
|
||||
<%= hidden_field_tag 'reward_type', @bid.reward_type %>
|
||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %></td>
|
||||
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> >
|
||||
<span><%= link_to @bid.name, bid_path %></span></td>
|
||||
<td style="padding-left: 8px"><%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %></td>
|
||||
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> >
|
||||
<span><%= link_to @bid.name, bid_path %></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -27,24 +27,24 @@
|
|||
<div class="top-content">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
|
||||
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||
<td rowspan="2" width="250px">
|
||||
<div class="project-search">
|
||||
<%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20 %>
|
||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
|
||||
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
|
||||
<td rowspan="2" width="250px">
|
||||
<div class="project-search">
|
||||
<%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
|
||||
<%= text_field_tag 'name', params[:name], :size => 20 %>
|
||||
<%= hidden_field_tag 'project_type', params[:project_type] %>
|
||||
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %></td>
|
||||
<td ><%=link_to l(:field_homepage), home_path %> >
|
||||
<%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
|
||||
<span><%= link_to @contest.name, show_contest_contest_path %></span>
|
||||
</td>
|
||||
<td style="padding-left: 8px"><%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %></td>
|
||||
<td ><%=link_to l(:field_homepage), home_path %> >
|
||||
<%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
|
||||
<span><%= link_to @contest.name, show_contest_contest_path %></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -1,64 +1,70 @@
|
|||
<%= 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)%> :<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)%> :</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">1、<%=l(:label_upload_softapplication_packets_mustpacketed)%><br>2、<%=l(:label_upload_softapplication_photo_condition)%></p>
|
||||
<p style="font-size: 10px; color: red"><%=l(:label_updated_caution)%></p>
|
||||
|
||||
</fieldset>
|
||||
</fieldset></br>
|
||||
<div class="align-center"><%= submit_tag l(:button_create), :onclick => "return true" %></div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h1>Listing softapplications</h1>
|
||||
<h1>参赛应用</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
|
|
@ -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>
|
|
@ -1,3 +1,4 @@
|
|||
<%=render :partial => 'layouts/base_softapplication_top_content'%>
|
||||
<style>
|
||||
.softapplication-img .soft-application {
|
||||
float: left;
|
||||
|
@ -10,7 +11,7 @@
|
|||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<!-- <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> -->
|
||||
<div style="height: 130px">
|
||||
<div style="height: auto; padding-bottom: 10px">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="320" >
|
||||
</td>
|
||||
|
@ -18,10 +19,15 @@
|
|||
<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 %>
|
||||
<%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>所属类别:<%= @softapplication.app_type_name %></td>
|
||||
<td>发布时间:<%=format_time @softapplication.created_at %></td>
|
||||
<% contest = @softapplication.contests.first %>
|
||||
<td>所属竞赛:<%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>发布人员:<%= @softapplication.user.name %></td>
|
||||
|
@ -38,7 +44,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
|
||||
<td></td>
|
||||
<td>发布时间:<%=format_time @softapplication.created_at %></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
@ -48,9 +54,9 @@
|
|||
</div>
|
||||
<div class="underline-contests_one"></div>
|
||||
|
||||
<div style="height: 60px">
|
||||
<div style="height: auto; padding-bottom: 10px">
|
||||
<strong><div style="font-size: 15px">应用简介:</div></strong>
|
||||
<div><%= @softapplication.description %></div>
|
||||
<div><%= @softapplication.description.truncate(150, omission: '...') %></div>
|
||||
</div>
|
||||
<div class="underline-contests_one"></div>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -1837,7 +1837,9 @@ zh:
|
|||
label_release_softapplication: 发布应用
|
||||
label_upload_softapplication_packets: 上传应用软件包
|
||||
label_upload_softapplication_photo: 上传产品截图
|
||||
label_upload_softapplication_photo_condition: 截图至少上传2张,至多4张;格式为gif/jpg/png, 尺寸480*800, 每张小于2M
|
||||
label_upload_softapplication_packets_mustpacketed: 应用软件作品必须打包后以压缩包的形式上传,便于上传和下载 ;
|
||||
label_upload_softapplication_photo_condition: 应用软件截图需上传4张;格式为gif/jpg/png, 尺寸480*800, 每张小于2M
|
||||
label_updated_caution: 注意:若修改应用,则之前上传的软件包和截图都将被删除,请重新上传!
|
||||
label_softapplication_name: 应用名称
|
||||
label_softapplication_description: 应用简介
|
||||
label_softapplication_type: 应用分类
|
||||
|
@ -1855,6 +1857,7 @@ zh:
|
|||
label_release_add_contest_succeed: 该应用发布并添加成功.
|
||||
label_add_contest_succeed_fail: 添加失败,该应用已参赛.
|
||||
label_no_ftapplication: 暂无应用
|
||||
label_edit_softapplication: 修改应用
|
||||
|
||||
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
Loading…
Reference in New Issue