From 7758e9bbf11fde265df0f1b0198e7cc2a5eddb02 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 21 Apr 2014 21:03:18 +0800 Subject: [PATCH 01/13] df --- app/views/softapplications/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 76483c7c0..c0234831a 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -68,7 +68,7 @@
软件评论:
-
评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %>
+
评分: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %>
From cc5b55ec9c2eba00d8535c627aa8bd5983726baf Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Tue, 22 Apr 2014 08:49:08 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=AD=E7=AE=80=E4=BB=8B=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E8=BE=B9=E8=B7=9D=E4=BB=A5=E5=8F=8A=E7=AE=80?= =?UTF-8?q?=E4=BB=8B=E9=99=90=E5=AE=9A=E5=AD=97=E6=95=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/show.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index c0234831a..a5c3fb596 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -10,7 +10,7 @@

<%= notice %>

-
+
@@ -48,9 +48,9 @@
-
+
应用简介:
-
<%= @softapplication.description %>
+
<%= @softapplication.description.truncate(150, omission: '...') %>
From bc068eb12b5016e24f8de398c9a60f2e37cceac1 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Tue, 22 Apr 2014 10:59:50 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E8=B5=9B?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E7=9A=84=E5=88=A0=E9=99=A4=E5=92=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8A=9F=E8=83=BD=E4=BB=A5=E5=8F=8A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E7=9A=84=E5=88=A0=E9=99=A4=E5=92=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 2 +- .../softapplications_controller.rb | 30 ++++++++- app/models/attachment.rb | 2 +- app/models/softapplication.rb | 11 +++- .../contests/_list_softapplications.html.erb | 1 + app/views/layouts/_base_footer.html.erb | 63 ++++++++++++------- app/views/softapplications/index.html.erb | 2 +- 7 files changed, 79 insertions(+), 32 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 40caae261..42cb62272 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,7 +75,7 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.1.0) + rake (10.0.4) rdoc (3.12.2) json (~> 1.4) ruby-openid (2.1.8) diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index 9f14aa118..9163f5473 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -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,7 +75,7 @@ class SoftapplicationsController < ApplicationController # PUT /softapplications/1 # PUT /softapplications/1.json def update - @softapplication = Softapplication.find(params[:id]) + # @softapplication = Softapplication.find(params[:id]) respond_to do |format| if @softapplication.update_attributes(params[:softapplication]) @@ -92,11 +96,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 :back } format.json { head :no_content } end end @@ -192,4 +196,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 diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 919760ee3..3ce64d695 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -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)$/i) end def thumbnailable? diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb index 205ede48b..6782b2436 100644 --- a/app/models/softapplication.rb +++ b/app/models/softapplication.rb @@ -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 diff --git a/app/views/contests/_list_softapplications.html.erb b/app/views/contests/_list_softapplications.html.erb index 29c985b7e..5646f5d12 100644 --- a/app/views/contests/_list_softapplications.html.erb +++ b/app/views/contests/_list_softapplications.html.erb @@ -8,6 +8,7 @@ <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication)) %> + <%= link_to '删除', c_softapplication.softapplication, method: :delete, data: { confirm: '您确定要删除吗?' } %>
diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index bba5b2166..a941a7d1f 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -1,28 +1,43 @@
+
+ <%= debug(params) if Rails.env.development? %> + +
diff --git a/app/views/softapplications/index.html.erb b/app/views/softapplications/index.html.erb index be9245876..16a206508 100644 --- a/app/views/softapplications/index.html.erb +++ b/app/views/softapplications/index.html.erb @@ -1,4 +1,4 @@ -

Listing softapplications

+

参赛应用

From 05c0d2a5ac576c3fc84997eca557985f824cda30 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Tue, 22 Apr 2014 19:27:31 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=A6=96=E9=A1=B5=E4=B8=AD=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E5=92=8C=E5=BA=94=E7=94=A8=E7=9A=84=E5=9B=BE=E6=A0=87=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=B8=E5=BA=94=E7=9A=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../softapplications_controller.rb | 2 +- .../contests/_list_softapplications.html.erb | 1 - app/views/softapplications/_form.html.erb | 97 +++++++++--------- app/views/softapplications/edit.html.erb | 10 +- app/views/softapplications/new.html.erb | 73 +------------ app/views/softapplications/show.html.erb | 4 + app/views/welcome/contest.html.erb | 16 +-- config/locales/zh.yml | 1 + public/images/app1.png | Bin 0 -> 4441 bytes public/images/contest1.png | Bin 0 -> 4794 bytes 10 files changed, 72 insertions(+), 132 deletions(-) create mode 100644 public/images/app1.png create mode 100644 public/images/contest1.png diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index 9163f5473..5153a01d4 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -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 diff --git a/app/views/contests/_list_softapplications.html.erb b/app/views/contests/_list_softapplications.html.erb index 5646f5d12..29c985b7e 100644 --- a/app/views/contests/_list_softapplications.html.erb +++ b/app/views/contests/_list_softapplications.html.erb @@ -8,7 +8,6 @@ -
diff --git a/app/views/softapplications/_form.html.erb b/app/views/softapplications/_form.html.erb index 5a046801f..f45125ea2 100644 --- a/app/views/softapplications/_form.html.erb +++ b/app/views/softapplications/_form.html.erb @@ -1,64 +1,69 @@ -<%= form_for(@softapplication) do |f| %> +<%= form_for(softapplication) do |f| %> - <% if @softapplication.errors.any? %> + <% if softapplication.errors.any? %>
-

<%= pluralize(@softapplication.errors.count, "error") %> prohibited this softapplication from being saved:

+

<%= pluralize(softapplication.errors.count, "error") %> prohibited this softapplication from being saved:

    - <% @softapplication.errors.full_messages.each do |msg| %> + <% softapplication.errors.full_messages.each do |msg| %>
  • <%= msg %>
  • <% end %>
<% end %> - -
- - : - - -

+
+ +
+ <%= l(:label_softapplication_name) %> + * : + <%= l(:label_softapplication_name_condition)%> + +
+
+ + + <%= l(:label_softapplication_version_available) %> + * : - - - : - + +
+
+ + + <%= l(:label_softapplication_type) %> -

+ * : - - - : - + +
+
+ + + <%= l(:label_softapplication_description) %> + * : -

+ +
+
+ + <%= l(:label_softapplication_developers) %> + * : - - - : - - -

- - -
-
- <%=l(:label_upload_softapplication_packets)%> :
-

- <%= render :partial => 'attachments/form' %> -

-
-
- -
-
- <%=l(:label_upload_softapplication_photo)%> :(<%=l(:label_upload_softapplication_photo_condition)%>)
-

- <%= render :partial => 'attachments/form' %> -

-
-
+ +
+
+
+ 上传应用软件包和应用截图 + <%= render_flash_messages %> +

+ <%= render :partial => 'attachments/form' %> +

+

(<%=l(:label_upload_softapplication_photo_condition)%>)

+ +
+
+
<%= submit_tag l(:button_create), :onclick => "return true" %>
<% end %> diff --git a/app/views/softapplications/edit.html.erb b/app/views/softapplications/edit.html.erb index f93e091d2..c9e0c6f66 100644 --- a/app/views/softapplications/edit.html.erb +++ b/app/views/softapplications/edit.html.erb @@ -1,6 +1,8 @@ -

Editing softapplication

+

<%= l(:label_edit_softapplication)%>

+ +<%= render partial: 'form', locals:{softapplication: @softapplication} %> + + -<%= render 'form' %> -<%= link_to 'Show', @softapplication %> | -<%= link_to 'Back', softapplications_path %> diff --git a/app/views/softapplications/new.html.erb b/app/views/softapplications/new.html.erb index d5ff2c9c2..1112fcfa4 100644 --- a/app/views/softapplications/new.html.erb +++ b/app/views/softapplications/new.html.erb @@ -1,76 +1,5 @@

<%= l(:label_release_softapplication)%>

- +<%= render partial: 'form', locals:{softapplication: @softapplication} %> -
- <%= 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| %> -
- -
- <%= l(:label_softapplication_name) %> - * : - <%= l(:label_softapplication_name_condition)%> - -
-
- - - <%= l(:label_softapplication_version_available) %> - * : - - -
-
- - - <%= l(:label_softapplication_type) %> - - * : - - -
-
- - - <%= l(:label_softapplication_description) %> - * : - - -
-
- - - <%= l(:label_softapplication_developers) %> - * : - - -
-
-
- 上传应用软件包和应用截图 - <%= render_flash_messages %> -

- <%= render :partial => 'attachments/form' %> -

-

(<%=l(:label_upload_softapplication_photo_condition)%>)

- -
-
-
<%= submit_tag l(:button_create), :onclick => "return true" %>
- - - <% end %> - \ No newline at end of file diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index a5c3fb596..d5681c4ea 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -18,6 +18,10 @@
<%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication)) %> <%= link_to '删除', c_softapplication.softapplication, method: :delete, data: { confirm: '您确定要删除吗?' } %>
<%= l(:label_softapplication_name) %> * <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %><%= l(:label_softapplication_name_condition)%>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %>
<%= l(:label_softapplication_version_available) %> * <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
<%= l(:label_softapplication_type) %> * <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %>
<%= l(:label_softapplication_description) %> * <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %>
<%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %>
+ diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index f283bd759..6ef2b4796 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -142,18 +142,18 @@
  • - <%= image_tag('/images/039.gif')%> + <%= image_tag('/images/contest1.png')%>
    -
    +
    <%= link_to(contest.name, contest.event_url, :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
    -
    +
    ><%=contest.description.truncate(50, omission: '...')%>

    -
    +
    发布时间:<%=format_time contest.created_on %>
    @@ -204,18 +204,18 @@
  • - <%= image_tag('/images/009.gif')%> + <%= image_tag('/images/app1.png')%>
    -
    +
    <%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
    -
    +
    ><%=softapplication.description.truncate(50, omission: '...')%>

    -
    +
    发布时间:<%=format_time softapplication.created_at %>
    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 079ad450d..c32c62c05 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1855,6 +1855,7 @@ zh: label_release_add_contest_succeed: 该应用发布并添加成功. label_add_contest_succeed_fail: 添加失败,该应用已参赛. label_no_ftapplication: 暂无应用 + label_edit_softapplication: 修改应用 \ No newline at end of file diff --git a/public/images/app1.png b/public/images/app1.png new file mode 100644 index 0000000000000000000000000000000000000000..3342781acd7be2b0a01a8b359d4a74d0ba775404 GIT binary patch literal 4441 zcmZveXHb)Cw1qziDxehUy$XlkMFHt5K@l+Y-a$$LA(T)9NKtwhDWY@;h*CuY96A!J zQl!@eq=X^~Amzs6owp$~?dHFu`^5)Uj)a3E@@p5+cZ~}n9nS6r) z({uup$|Avu##m!|?_;({1i;6SB=4s+drzAN*u9{oQ|pP2qcmnW-YC1n0-C z6bd!FsK1Ick2kWsyURUS)({$m+u8X&^}7|DhdmpHkI*1)(g~(w-n#(`km!4g)7;5= z;O+qwf|L=wM8-pl8SHeq(gOf{Ab4OHtXB1mEQQh_Bt zI_!0l6bR5SVc5?A^s@l926c{hp&@q@fl>K;ImZ3Rwlr7+3Z)t^hrPJf1h8?potuw_M zUtV@DKRp-=(iy%10Bk2?|6bfxO~GQ;mNCv)58SVw_ZRMaUVJLN`->N?38Z8It?meJ z#%6te66D=SQtQ|5USR>u7z581Ppo8TDGJRgM}tn{;djr}xC-9s_uu2>puB#4N5K9a z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GeDv zht;$M_Dlujqzn=pUCD}<=gFHndO5%61n}JPdd401*+w`e5iKFei7yi0#$ZXNNz(03 z=H{xBcc0iSAIg%a=M*R pcFNM^UH~-@J+h%%912{q0Y`G(d}Hg Date: Tue, 22 Apr 2014 20:23:15 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E5=BA=94=E7=94=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=80=E5=B1=9E=E7=AB=9E=E8=B5=9B=E5=8F=8A?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/show.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index d5681c4ea..51195dfcf 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -25,7 +25,8 @@
  • - + <% contest = @softapplication.contests.first %> + @@ -42,7 +43,7 @@ - + From b318166c15df004e4675c70c02a4257e77a4f673 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Wed, 23 Apr 2014 09:18:43 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E7=BB=99=E5=8F=82=E4=B8=8E=E7=AB=9E?= =?UTF-8?q?=E8=B5=9B=E7=9A=84=E5=BA=94=E7=94=A8=E9=A1=B5=E9=9D=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=BC=E8=88=AA=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._base_softapplication_top_content.html.erb | 20 ++++++++++++ app/views/layouts/base_contest.html.erb | 30 ++++++++--------- app/views/layouts/base_newcontest.html.erb | 32 +++++++++---------- app/views/softapplications/show.html.erb | 1 + 4 files changed, 52 insertions(+), 31 deletions(-) create mode 100644 app/views/layouts/_base_softapplication_top_content.html.erb diff --git a/app/views/layouts/_base_softapplication_top_content.html.erb b/app/views/layouts/_base_softapplication_top_content.html.erb new file mode 100644 index 000000000..064e84cf0 --- /dev/null +++ b/app/views/layouts/_base_softapplication_top_content.html.erb @@ -0,0 +1,20 @@ +
    +
    <%= @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 %>
    所属类别:<%= @softapplication.app_type_name %>发布时间:<%=format_time @softapplication.created_at %>所属竞赛:<%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
    发布人员:<%= @softapplication.user.name %>
    平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>发布时间:<%=format_time @softapplication.created_at %>
    + + + + + + + + + + +
    创新竞赛社区<%= l(:label_user_location) %> :
    <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %><%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > + + <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> + + +
    +
    \ No newline at end of file diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb index b4ba3dd4b..2bda701fe 100644 --- a/app/views/layouts/base_contest.html.erb +++ b/app/views/layouts/base_contest.html.erb @@ -26,23 +26,23 @@
    - - - + + + - - + +
    创新竞赛社区<%= l(:label_user_location) %> : - - 创新竞赛社区<%= l(:label_user_location) %> : + +
    <%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> > - <%= link_to @bid.name, bid_path %><%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> > + <%= link_to @bid.name, bid_path %>
    diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index ba78cefea..147df5245 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -27,24 +27,24 @@
    - - - + + + - - + +
    创新竞赛社区<%= l(:label_user_location) %> : - - 创新竞赛社区<%= l(:label_user_location) %> : + +
    <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %><%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > - <%= link_to @contest.name, show_contest_contest_path %> - <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %><%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > + <%= link_to @contest.name, show_contest_contest_path %> +
    diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 51195dfcf..b39ab6c61 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -1,3 +1,4 @@ +<%=render :partial => 'layouts/base_softapplication_top_content'%>