Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

This commit is contained in:
yanxd 2014-04-21 20:01:00 +08:00
commit 0226052dd0
4 changed files with 68 additions and 52 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_ftapplication) %></p>
<% end %>
</div>
</div>

View File

@ -1854,6 +1854,7 @@ zh:
label_tags_contest_description: 竞赛描述
label_release_add_contest_succeed: 该应用发布并添加成功.
label_add_contest_succeed_fail: 添加失败,该应用已参赛.
label_no_ftapplication: 暂无应用