首页:当无应用时,提示暂无应用

This commit is contained in:
wanglinchun 2014-04-21 19:36:05 +08:00
parent 87fdecdabd
commit 94a7bacdd2
3 changed files with 66 additions and 51 deletions

View File

@ -84,7 +84,6 @@ class SoftapplicationsController < ApplicationController
end
end
def add_attach
@softapplication = Softapplication.find(params[:id])
@softapplication.save_attachments(params[:attachments])
@ -101,6 +100,7 @@ class SoftapplicationsController < ApplicationController
format.json { head :no_content }
end
end
#应用评价涉及到的方法
def new_message
@jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id]
@ -118,10 +118,10 @@ class SoftapplicationsController < ApplicationController
rescue ActiveRecord::RecordNotFound
render_404
end
#新建评价
def create_message
if params[:softapplication_message][:message].size>0
if params[:reference_content]
message = params[:softapplication_message][:message] + "\n" + params[:reference_content]
else
@ -131,7 +131,6 @@ class SoftapplicationsController < ApplicationController
@softapplication = Softapplication.find(params[:id])
@softapplication.add_jour(User.current, message, refer_user_id)
end
@user = @softapplication.user
@jours = @softapplication.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@ -167,6 +166,7 @@ class SoftapplicationsController < ApplicationController
format.js
end
end
#
def more
@jour = @softapplication.journals_for_messages
@ -179,6 +179,7 @@ class SoftapplicationsController < ApplicationController
#format.api { render_api_ok }
end
end
#
def back
@jour = @softapplication.journals_for_messages

View File

@ -1608,4 +1608,13 @@ module ApplicationHelper
User.current
end
# def hadcommittedforcontest(curu)
# message = JournalsForMessage.find_by_sql("select * from journals_for_messages where jour_type = 'Softapplication' ")
# message.each do |createmessage|
# if createmessage.user_id == curu
# return true
# end
# end
# end
end

View File

@ -198,6 +198,7 @@
<h3 style="margin-left: 5px; color: #e8770d;"><strong>最新参赛应用</strong></h3>
<div class="d-p-projectlist-box">
<% if Softapplication.count > 0%>
<div class="d-p-projectlist">
<% find_all_hot_softapplication.map do |softapplication| break if(softapplication == find_all_hot_softapplication[5]) %>
@ -222,6 +223,10 @@
<% end; reset_cycle %>
</div>
<% else %>
<p class="font_lighter"><%= l(:label_no_bid_project) %></p>
<% end %>
</div>
</div>