Merge branch 'wordh' into develop
This commit is contained in:
commit
1c374a4530
|
@ -18,6 +18,7 @@ class BidsController < ApplicationController
|
|||
helper :attachments
|
||||
include AttachmentsHelper
|
||||
helper :projects
|
||||
helper :words
|
||||
def index
|
||||
@project_type = params[:project_type]
|
||||
# Modified by nie
|
||||
|
@ -186,7 +187,7 @@ class BidsController < ApplicationController
|
|||
|
||||
def show
|
||||
@user = @bid.author
|
||||
@jours = @bid.journals_for_messages.reverse
|
||||
@jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
@limit = 10
|
||||
@feedback_count = @jours.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
|
@ -195,21 +196,19 @@ class BidsController < ApplicationController
|
|||
@state = false
|
||||
|
||||
respond_to do |format|
|
||||
if @bid.reward_type == 3
|
||||
format.html {
|
||||
render :layout => 'base_homework'
|
||||
}
|
||||
elsif @bid.reward_type == 1
|
||||
format.html {
|
||||
render :layout => 'base_bids'
|
||||
}
|
||||
layout_file = ''
|
||||
case @bid.reward_type
|
||||
when 3
|
||||
layout_file = 'base_homework'
|
||||
when 1
|
||||
layout_file = 'base_bids'
|
||||
else
|
||||
format.html {
|
||||
render :layout => 'base_contest'
|
||||
}
|
||||
layout_file = 'base_contest'
|
||||
end
|
||||
format.html {
|
||||
render :layout => layout_file
|
||||
}
|
||||
format.api
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -502,7 +501,7 @@ class BidsController < ApplicationController
|
|||
@bid.add_jour(User.current, message, refer_user_id)
|
||||
end
|
||||
@user = @bid.author
|
||||
@jours = @bid.journals_for_messages.reverse
|
||||
@jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
@limit = 10
|
||||
@feedback_count = @jours.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
|
|
|
@ -80,7 +80,7 @@ class ProjectsController < ApplicationController
|
|||
helper :documents
|
||||
helper :watchers
|
||||
# helper :watcherlist
|
||||
|
||||
helper :words
|
||||
### added by william
|
||||
include ActsAsTaggableOn::TagsHelper
|
||||
|
||||
|
@ -181,9 +181,7 @@ class ProjectsController < ApplicationController
|
|||
@s_type = 2
|
||||
end
|
||||
else
|
||||
logger.debug("-------------------------------------------------")
|
||||
@projects = Project.visible.where("project_type = ?", 1).order("created_on desc").offset(@project_pages.offset).limit(@limit).all
|
||||
logger.debug("-------------------------------------------------")
|
||||
@s_type = 0
|
||||
end
|
||||
respond_to do |format|
|
||||
|
@ -282,7 +280,7 @@ class ProjectsController < ApplicationController
|
|||
#Ended by young
|
||||
|
||||
def feedback
|
||||
@jours = @project.journals_for_messages.reverse
|
||||
@jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
@limit = 10
|
||||
@feedback_count = @jours.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
|
@ -297,39 +295,31 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def project_respond
|
||||
# will_reply = JournalsForMessage.find(params[:reference_id]) if params[:reference_id]
|
||||
project_id = request.headers["Referer"].match((%r|/([0-9]{1,})/|))[1]
|
||||
# @project = Project.find_by_id(project_id)
|
||||
parent_id = params[:reference_id]
|
||||
author_id = User.current.id
|
||||
reply_user_id = params[:reference_user_id]
|
||||
reply_id = params[:reference_message_id]
|
||||
content = params[:project_respond]
|
||||
options = {:user_id => author_id,
|
||||
:m_parent_id => parent_id,
|
||||
:m_reply_id => reply_id,
|
||||
:reply_id => reply_user_id,
|
||||
:notes => content,
|
||||
:is_readed => false}
|
||||
|
||||
if params[:project_respond].size>0
|
||||
jour = JournalsForMessage.find(params[:reference_id]) if params[:reference_id]
|
||||
if jour
|
||||
user = jour.user
|
||||
text = jour.notes
|
||||
else
|
||||
user = User.current
|
||||
text = []
|
||||
end
|
||||
# Replaces pre blocks with [...]
|
||||
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
|
||||
reference_content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> "
|
||||
reference_content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
||||
# reference_message = JournalForMessage.find(params[:reference_id])
|
||||
message = params[:project_respond] + "\n" + reference_content
|
||||
@jfm = Project.add_new_jour(nil, nil, project_id, options)
|
||||
@save_succ = @jfm.errors.empty?
|
||||
|
||||
|
||||
user.add_jour(User.current, message, user.id)
|
||||
flash[:notice]=l(:label_projects_feedback_respond_success)
|
||||
# if a_message.size > 5
|
||||
# @message = a_message[-5, 5]
|
||||
# else
|
||||
# @message = a_message
|
||||
# end
|
||||
# @message_count = a_message.count
|
||||
end
|
||||
# flash[:notice]=l(:label_projects_feedback_respond_success)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :back }
|
||||
# format.html { redirect_to :back }
|
||||
format.js
|
||||
#format.api { render_api_ok }
|
||||
end
|
||||
# redirect_to project_feedback_path(@project)
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -39,11 +39,10 @@ class WordsController < ApplicationController
|
|||
#format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def create_reply
|
||||
# deny api. api useless
|
||||
user_id = request.headers["Referer"].match((%r|/([0-9]{1,})/|))[1]
|
||||
@user = User.find(user_id)
|
||||
parent_id = params[:reference_id]
|
||||
author_id = User.current.id
|
||||
reply_user_id = params[:reference_user_id]
|
||||
|
@ -55,7 +54,7 @@ class WordsController < ApplicationController
|
|||
:reply_id => reply_user_id,
|
||||
:notes => content,
|
||||
:is_readed => false}
|
||||
@jfm = @user.add_jour(nil, nil, nil, options)
|
||||
@jfm = add_reply_adapter options
|
||||
|
||||
respond_to do |format|
|
||||
# format.html {
|
||||
|
@ -74,21 +73,8 @@ class WordsController < ApplicationController
|
|||
|
||||
def destroy
|
||||
@journal_destroyed = JournalsForMessage.delete_message(params[:object_id])
|
||||
@jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse
|
||||
@limit = 10
|
||||
@feedback_count = @jours.count
|
||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||
@offset ||= @feedback_pages.offset
|
||||
@jour = @jours[@offset, @limit]
|
||||
# if a_message.size > 5
|
||||
# @message = a_message[-5, 5]
|
||||
# else
|
||||
# @message = a_message
|
||||
# end
|
||||
# @message_count = a_message.count
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :back }
|
||||
format.js
|
||||
#format.api { render_api_ok }
|
||||
end
|
||||
|
@ -187,5 +173,32 @@ class WordsController < ApplicationController
|
|||
render_404
|
||||
end
|
||||
|
||||
def obj_distinguish_url_origin
|
||||
referer = request.headers["Referer"]
|
||||
obj_id = referer.match(%r(/([0-9]{1,})(/|$)))[1]
|
||||
if referer.match(/project/)
|
||||
obj = Project.find_by_id(obj_id)
|
||||
elsif referer.match(/user/)
|
||||
obj = User.find_by_id(obj_id)
|
||||
elsif ( referer.match(/bids/) || referer.match(/calls/) )
|
||||
obj = Bid.find_by_id(obj_id)
|
||||
else
|
||||
raise 'create reply obj unknow type.'
|
||||
end
|
||||
obj
|
||||
end
|
||||
|
||||
def add_reply_adapter options
|
||||
obj = obj_distinguish_url_origin
|
||||
if obj.kind_of? User
|
||||
obj.add_jour(nil, nil, nil, options)
|
||||
elsif obj.kind_of? Project
|
||||
Project.add_new_jour(nil, nil, obj.id, options)
|
||||
elsif obj.kind_of? Bid
|
||||
obj.add_jour(nil, nil, nil, options)
|
||||
else
|
||||
raise 'create reply obj unknow type.'
|
||||
end
|
||||
end
|
||||
#######end of message
|
||||
end
|
|
@ -82,7 +82,7 @@ module WelcomeHelper
|
|||
': '.html_safe <<
|
||||
link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url, :target => "_blank" )
|
||||
when 'attachment'
|
||||
str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container))
|
||||
str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container), :class => "attachments_list_color")
|
||||
else
|
||||
str << content_tag("span", "更新了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url, :target => "_blank" )
|
||||
end
|
||||
|
@ -110,16 +110,17 @@ module WelcomeHelper
|
|||
# activity.scope=['memos']
|
||||
# activity.events_welcome(nil, nil, {:limit => limit})
|
||||
|
||||
# resultSet = Memo.where('memos.parent_id IS NULL').includes(:last_reply).order('COALESCE (last_replies_memos.created_at, memos.created_at) DESC').limit(limit)
|
||||
resultSet = Memo.where('memos.parent_id IS NULL').includes(:last_reply).order('COALESCE (last_replies_memos.created_at, memos.created_at) DESC').limit(limit)
|
||||
# resultSet += Message.where('messages.parent_id IS NULL').includes(:last_reply).order('COALESCE (last_replies_messages.created_on, messages.created_on) DESC').limit(limit)
|
||||
resultSet = Memo.includes(:children).where('parent_id IS NULL').order('updated_at DESC').limit(limit)
|
||||
resultSet += Message.includes(:children).where('parent_id IS NULL').order('updated_on DESC').limit(limit)
|
||||
resultSet.sort! {|x,y| y.event_datetime <=> x.event_datetime}
|
||||
resultSet = resultSet.to_a
|
||||
for i in 0..(resultSet.size-1)
|
||||
resultSet[i] = resultSet[i].children.last if resultSet[i].children.count > 0
|
||||
end
|
||||
resultSet.take(limit)
|
||||
|
||||
# resultSet = Memo.includes(:children).where('parent_id IS NULL').order('updated_at DESC').limit(limit)
|
||||
# resultSet += Message.includes(:children).where('parent_id IS NULL').order('updated_on DESC').limit(limit)
|
||||
# resultSet.sort! {|x,y| y.event_datetime <=> x.event_datetime}
|
||||
# resultSet = resultSet.to_a
|
||||
# for i in 0..(resultSet.size-1)
|
||||
# resultSet[i] = resultSet[i].children.last if resultSet[i].children.count > 0
|
||||
# end
|
||||
# resultSet.take(limit)
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -149,7 +150,7 @@ module WelcomeHelper
|
|||
# }
|
||||
# user_objs = User.find_by_sql("SELECT * FROM users WHERE (users.id IN #{"(" << users.join(',') << ")"} )")
|
||||
activity = Redmine::Activity::Fetcher.new(nil)
|
||||
activity.scope_select{|t| ['changesets', 'documents'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
|
||||
activity.scope_select{|t| ['changesets', 'documents', 'memos', 'messages'].include?(t) ? nil : 'You may think you know what the following code does, may be. but why don"t you close this file and go play with something else, Now?' }
|
||||
activity.events_welcome(nil, nil, {:limit => limit, :types => 'welcome'})
|
||||
end
|
||||
|
||||
|
|
|
@ -77,8 +77,14 @@ class Bid < ActiveRecord::Base
|
|||
# safe_attributes 'name',
|
||||
# 'description',
|
||||
# 'deadline'
|
||||
def add_jour(user, notes, reference_user_id = 0)
|
||||
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
|
||||
def add_jour(user, notes, reference_user_id = 0, options = {})
|
||||
if options.count == 0
|
||||
self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
|
||||
else
|
||||
jfm = self.journals_for_messages.build(options)
|
||||
jfm.save
|
||||
jfm
|
||||
end
|
||||
end
|
||||
|
||||
def self.creat_bids(budget, deadline, name, description=nil, reward_type)
|
||||
|
|
|
@ -27,6 +27,16 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
after_destroy :reset_counters!
|
||||
|
||||
# default_scope { where('m_parent_id IS NULL') }
|
||||
|
||||
def remove_by_user? user
|
||||
if( self.user == user ||
|
||||
( self.jour.kind_of?(User) && self.jour== user )
|
||||
)
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def self.delete_message(message_id)
|
||||
self.find(message_id).destroy
|
||||
|
|
|
@ -166,10 +166,13 @@ class Project < ActiveRecord::Base
|
|||
pjfm
|
||||
end
|
||||
|
||||
def self.add_new_jour(user, notes, id)
|
||||
def self.add_new_jour(user, notes, id, options={})
|
||||
project = Project.find(id)
|
||||
# project.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => 0)
|
||||
pjfm = project.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0)
|
||||
if options.count == 0
|
||||
pjfm = project.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0)
|
||||
else
|
||||
pjfm = project.journals_for_messages.build(options)
|
||||
end
|
||||
pjfm.save
|
||||
pjfm
|
||||
end
|
||||
|
|
|
@ -1,69 +1,56 @@
|
|||
<!-- added by fq -->
|
||||
<!--
|
||||
modified by william 2012-8-30
|
||||
here used to end the bid;
|
||||
when the manager closed it or to the deadline.
|
||||
-->
|
||||
|
||||
<table width="660px" border="0" align="center" style="padding-left: 26px">
|
||||
<tr><td>
|
||||
<!-- modified by huang -->
|
||||
<% if @bid.reward_type ==3 %>
|
||||
<td class="font_lighter" style="font-size: 15px;"><%=l(:label_student_response)%></td>
|
||||
<% else %>
|
||||
<td class="font_lighter" style="font-size: 15px;"><%=l(:label_user_response)%></td>
|
||||
<% end %>
|
||||
</td>
|
||||
<!-- end -->
|
||||
</tr></table>
|
||||
|
||||
<% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %>
|
||||
<p class="font_lighter" style="font-size: 15px; padding-left: 85px; "><%=tip1%></p>
|
||||
|
||||
<div id='leave-message'>
|
||||
<%= render :partial => 'new', :locals => {:bid => @bid, :sta => @state} %>
|
||||
</div>
|
||||
<% label = '';
|
||||
case @bid.reward_type
|
||||
when 1
|
||||
label = l(:label_respond_requirement)
|
||||
when 2
|
||||
label = l(:label_contest_requirement)
|
||||
when 3
|
||||
label = l(:label_question_requirement)
|
||||
else
|
||||
end
|
||||
%>
|
||||
|
||||
|
||||
<% if journals.size >0 %>
|
||||
|
||||
<% for journal in journals%>
|
||||
<table width="660px" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></td>
|
||||
<td><table width="580px" border="0">
|
||||
<tr>
|
||||
<% label = '';
|
||||
case @bid.reward_type
|
||||
when 1
|
||||
label = l(:label_respond_requirement)
|
||||
when 2
|
||||
label = l(:label_contest_requirement)
|
||||
when 3
|
||||
label = l(:label_question_requirement)
|
||||
else
|
||||
|
||||
end
|
||||
%>
|
||||
<td colspan="2" valign="top"><strong> <%=link_to journal.user, user_path(journal.user)%></strong> <span class="font_lighter"><%= label %></span></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable journal.notes%></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><span class="font_lighter"><%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %></span></td>
|
||||
<% if @user==User.current|| User.current.admin? %>
|
||||
<td width="200" align="right" class="a"><%= link_to(l(:label_bid_respond_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
|
||||
:method => 'post', :title => l(:button_quote))%>
|
||||
<%= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
|
||||
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %></td>
|
||||
<% else %>
|
||||
<td width="200" align="right" class="a"><%= link_to(l(:label_bid_respond_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
|
||||
:method => 'post', :title => l(:button_quote))%>
|
||||
<% end %>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="line_under"></div>
|
||||
<ul class="message-for-user">
|
||||
<% for journal in journals%>
|
||||
<li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user">
|
||||
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
|
||||
<span class="body">
|
||||
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
|
||||
<span class="font_lighter"><%= label %></span>
|
||||
<div> <%= textilizable journal.notes%> </div>
|
||||
<span class="font_lighter"><%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %></span>
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<span>
|
||||
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
|
||||
:method => 'post', :title => l(:button_quote))%>
|
||||
<%= link_to l(:label_bid_respond_quote),'',
|
||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}
|
||||
%>
|
||||
<% if @user==User.current|| User.current.admin? %>
|
||||
<%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
|
||||
:remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
|
||||
<%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</span>
|
||||
</span>
|
||||
<div style="clear: both;"></div>
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
<div id='<%= ids %>' class="respond-form">
|
||||
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<div>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
|
||||
<table width="940px">
|
||||
<tr>
|
||||
<td class="info_font" style="width: 220px; color: #15bccf""><%= l(:label_contest_innovate) %></td>
|
||||
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_contest_innovate) %></td>
|
||||
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
|
||||
<td rowspan="2">
|
||||
<% if User.current.logged? %>
|
||||
|
@ -54,4 +54,4 @@
|
|||
<%= render :partial => "layouts/no_content"%>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% html_title l(:label_contest_list)%>
|
||||
|
|
|
@ -36,3 +36,5 @@
|
|||
<%= render :partial => "layouts/no_content"%>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% html_title l(:label_requirement_enterprise_list)%>
|
|
@ -1,49 +1,34 @@
|
|||
<!-- fq -->
|
||||
<table width="660px" border="0" align="center">
|
||||
<tr>
|
||||
<td width="50" valign="top"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></td>
|
||||
<td><table width="100%" border="0">
|
||||
<tr>
|
||||
<td><h3><%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%>:<%= @bid.name %></h3></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<div style="margin-left: 20px;">
|
||||
<span class="portrait"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></span>
|
||||
<span class="body">
|
||||
<h3><%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%>:<%= @bid.name %></h3>
|
||||
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
|
||||
|
||||
<td><strong><%= l(:label_bids_reward_method) %>
|
||||
<span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑">
|
||||
<%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= @bid.budget%>
|
||||
</span></strong></td>
|
||||
<p>
|
||||
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= l(:label_call_bonus) %>
|
||||
<%= l(:label_RMB_sign) %><%= @bid.budget %></span></strong>
|
||||
</p>
|
||||
<% elsif @bid.reward_type == 2%>
|
||||
|
||||
<td><strong><%= l(:label_bids_reward_method) %>
|
||||
<span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑">
|
||||
<%= @bid.budget%>
|
||||
</span></strong></td>
|
||||
<% else %>
|
||||
<!-- <td><strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑">
|
||||
<%= l(:label_bids_credit) %> <%= @bid.budget%> <%= l(:label_bids_credit_number) %></span></strong></td> -->
|
||||
<% end %>
|
||||
</tr>
|
||||
<!--modified by baiyu-->
|
||||
<tr><td style="font-size: 13px; color: rgb(0,0,0);"><%= @bid.description %>
|
||||
<% if @bid.attachments.any?%>
|
||||
<% options = {:author => true} %>
|
||||
<%= render :partial => 'attachments/links',
|
||||
:locals => {:attachments => @bid.attachments, :options => options} %>
|
||||
<p>
|
||||
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= @bid.budget%></span></strong>
|
||||
</p>
|
||||
<% else %>
|
||||
<% end %>
|
||||
</td></tr>
|
||||
</table></td>
|
||||
<td>
|
||||
<!-- 在这里添加赞和踩-->
|
||||
<span id="praise_tread" style="float: right">
|
||||
<%= render :partial => "/praise_tread/praise_tread",
|
||||
:locals => {:obj => @bid,:show_flag => true,:user_id =>User.current.id}%>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="bid_description">
|
||||
<%= @bid.description %>
|
||||
</p>
|
||||
<% if @bid.attachments.any?%>
|
||||
<% options = {:author => true} %>
|
||||
<%= render :partial => 'attachments/links',
|
||||
:locals => {:attachments => @bid.attachments, :options => options} %>
|
||||
<% end %>
|
||||
<span id="praise_tread" style="float: right">
|
||||
<%= render :partial => "/praise_tread/praise_tread",
|
||||
:locals => {:obj => @bid,:show_flag => true,:user_id =>User.current.id}%>
|
||||
</span>
|
||||
</span>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
||||
<!-- 这里是用户的反馈输入框 -->
|
||||
<div id="history">
|
||||
<%= render :partial => 'history', :locals => { :bid => @bid, :journals => @jour, :state => false} %>
|
||||
</div>
|
||||
|
@ -54,4 +39,3 @@
|
|||
<ul>
|
||||
</div>
|
||||
|
||||
<!-- end -->
|
||||
|
|
|
@ -29,3 +29,5 @@
|
|||
<% else %>
|
||||
<%= render :partial => "layouts/no_content" %>
|
||||
<% end %>
|
||||
|
||||
<%html_title l(:label_forum)%>
|
|
@ -1,5 +1,5 @@
|
|||
<!-- added by fq -->
|
||||
<div id="add-memo" style="display:none;">
|
||||
<div id="add-memo" class='lz' style="display: none; padding: 20px;">
|
||||
<h3><%=l(:label_memo_new)%></h3>
|
||||
<% if User.current.logged? %>
|
||||
<%= labelled_form_for(@memo, :url => forum_memos_path(@forum), :html => {:multipart => true} ) do |f| %>
|
||||
|
@ -15,7 +15,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<div class="actions" style="max-width:680px">
|
||||
<p><%= f.text_field :subject, :required => true, :size => 95 %></p>
|
||||
<p><%= f.text_field :subject, :required => true%></p>
|
||||
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor02' %></p>
|
||||
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>
|
||||
<br/>
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<%= form_tag({:controller => 'projects', :action => 'project_respond'}) do %>
|
||||
<%= form_tag({:controller => 'projects', :action => 'project_respond'}, :remote => true) do %>
|
||||
<%= text_area_tag 'project_respond', "",
|
||||
:class => 'noline', :required => true,
|
||||
:style => "resize: none;", :rows => 6,
|
||||
:style => "resize: none;", :rows => 3,
|
||||
:placeholder => l(:label_projects_feedback_respond_content),
|
||||
:maxlength => 250 %>
|
||||
|
||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
||||
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn"%>
|
||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
|
||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
|
||||
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "enterprise"%>
|
||||
|
||||
<%end%>
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
<div class="tools ">
|
||||
<ul><h3>项目交流</h3>
|
||||
<li><%= link_to l(:project_module_documents), project_documents_path(@project) %></li>
|
||||
<li><%= link_to l(:project_module_wiki), project_wiki_path(@project) %></li>
|
||||
<li><%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %></li>
|
||||
<li><%= link_to l(:project_module_files) ,project_files_path(@project) %></li>
|
||||
<li><%= link_to l(:project_module_wiki), project_wiki_path(@project) %></li>
|
||||
</ul>
|
||||
<ul><h3>进度跟踪</h3>
|
||||
<li><%= link_to l(:project_module_calendar),project_calendar_path(@project) %></li>
|
||||
|
@ -15,7 +15,7 @@
|
|||
</ul>
|
||||
<ul><h3>其他工具</h3>
|
||||
<li><%= link_to l(:label_module_share) ,share_show_path(@project) %></li>
|
||||
<li><%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %></li>
|
||||
<li><%= link_to l(:project_module_documents), project_documents_path(@project) %></li>
|
||||
<li></li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %>
|
||||
<table width="940px">
|
||||
<tr>
|
||||
<td class="info_font" style="width: 220px; color: #15bccf""><%= l(:label_course_practice) %></td>
|
||||
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_course_practice) %></td>
|
||||
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
|
||||
<td rowspan="2">
|
||||
<% if User.current.logged?%>
|
||||
|
@ -65,4 +65,4 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_project_plural)) -%>
|
||||
<% html_title(l(:label_new_course)) -%>
|
||||
|
|
|
@ -1,57 +1,84 @@
|
|||
<script>
|
||||
var W3CDOM = document.createElement && document.getElementsByTagName;
|
||||
|
||||
window.onload = setMaxLength;
|
||||
|
||||
function setMaxLength() {
|
||||
if (!W3CDOM) return;
|
||||
var textareas = document.getElementsByTagName('textarea');
|
||||
for (var i=0;i<textareas.length;i++) {
|
||||
var textarea = textareas[i];
|
||||
setMaxLengthItem(textareas[i]);
|
||||
}
|
||||
}
|
||||
function setMaxLengthItem(textarea){
|
||||
if (textarea.getAttribute('maxlength')) {
|
||||
var counter = document.createElement('div');
|
||||
counter.className = 'counter';
|
||||
var counterClone = counter.cloneNode(true);
|
||||
counterClone.innerHTML = '<span>0</span>/'+textarea.getAttribute('maxlength');
|
||||
textarea.parentNode.insertBefore(counterClone,textarea.nextSibling);
|
||||
textarea.relatedElement = counterClone.getElementsByTagName('span')[0];
|
||||
textarea.onkeyup = textarea.onchange = checkMaxLength;
|
||||
textarea.onkeyup();
|
||||
}
|
||||
}
|
||||
|
||||
function checkMaxLength() {
|
||||
var maxLength = this.getAttribute('maxlength');
|
||||
var currentLength = this.value.length;
|
||||
if (currentLength > maxLength)
|
||||
this.relatedElement.className = 'toomuch';
|
||||
else
|
||||
this.relatedElement.className = '';
|
||||
this.relatedElement.firstChild.nodeValue = currentLength;
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- fq -->
|
||||
<h3><%= l(:label_user_response) %></h3>
|
||||
|
||||
<div style="width: 80%; margin-left:10%;">
|
||||
<%= form_for('new_form', :method => :post,
|
||||
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
|
||||
|
||||
<table border="0" width="525px" align="center" >
|
||||
<tr>
|
||||
<td><%= f.text_area 'project_message', :rows => 3, :cols => 65, :placeholder => "#{l(:label_welcome_my_respond)}", :style => "resize: none;", :class => 'noline'%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" width="525px" align="center">
|
||||
<tr>
|
||||
<td align="right">
|
||||
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "bid_btn" %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
|
||||
:placeholder => "#{l(:label_welcome_my_respond)}",
|
||||
:style => "resize: none; width: 98%",
|
||||
:class => 'noline'%>
|
||||
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<% if @jour.size >0 %>
|
||||
|
||||
<% for journal in @jour%>
|
||||
<table width="660px" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></td>
|
||||
<td>
|
||||
<table width="580px" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong> <%= link_to journal.user, user_path(journal.user)%></strong><span class="font_lighter"><%= l(:label_projects_feedback) %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" >
|
||||
<div class="font_description">
|
||||
<%= textilizable journal.notes%>
|
||||
</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>: <%= format_time journal.created_on %></span></td>
|
||||
<td width="200" align="right" class="a">
|
||||
<% ids = 'project_respond_form_'+journal.id.to_s%>
|
||||
<%= toggle_link l(:label_projects_feedback_respond), ids, {:focus => 'project_respond'} %> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<div id=<%= ids%> style="display: none">
|
||||
<%= render :partial => 'new_respond', :locals => {:journal => journal} %>
|
||||
</div></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="line_under"></div>
|
||||
<% end %>
|
||||
<ul class="message-for-user">
|
||||
<% for journal in @jour%>
|
||||
<li id='word_li_<%=journal.id.to_s%>' class="outer-message-for-user">
|
||||
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
|
||||
<span class="body">
|
||||
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
|
||||
<span class="font_lighter"><%= l(:label_projects_feedback) %></span>
|
||||
<%= textilizable journal.notes%>
|
||||
<span class="font_lighter"> <%= l :label_update_time %>: <%= format_time journal.created_on %></span>
|
||||
<% id = 'project_respond_form_'+journal.id.to_s%>
|
||||
<span>
|
||||
<%= link_to l(:label_projects_feedback_respond),'',
|
||||
{:focus => 'project_respond',
|
||||
:onclick => "toggleAndSettingWordsVal($('##{id}'),
|
||||
$('##{id} textarea'),
|
||||
'#{l(:label_reply_plural)} #{journal.user.show_name}: ');
|
||||
return false;"} %>
|
||||
</span>
|
||||
</span>
|
||||
<div style="clear: both;"></div>
|
||||
<div id='<%= id %>' class="respond-form">
|
||||
<%= render :partial => 'new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<div>
|
||||
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<div class="pagination" style="float:left;">
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<% if @save_succ %>
|
||||
var pre_append = $('<%= j(
|
||||
render :partial => "words/journal_reply_items",
|
||||
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm}
|
||||
) %>').hide();
|
||||
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
|
||||
pre_append.fadeIn(600);
|
||||
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
|
||||
textarea.val('');
|
||||
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
|
||||
setMaxLengthItem(pre_append.find('textarea')[0]);
|
||||
<% else %>
|
||||
alert("<%= l(:label_feedback_fail) %>");
|
||||
<% end %>
|
|
@ -132,9 +132,10 @@
|
|||
<div class="inner-right" style="float: left; height: 100%; ">
|
||||
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
||||
</div>
|
||||
|
||||
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
|
||||
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %>
|
||||
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= time_tag_welcome event.event_datetime %>前</span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
||||
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= time_tag_welcome event.event_datetime %></span> <span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<% if @journal_destroyed.nil? %>
|
||||
alert('<%=l(:notice_failed_delete)%>');
|
||||
<% elsif (@journal_destroyed.jour_type == 'Principal')%>
|
||||
<% elsif (['Principal','Project', 'Bid'].include? @journal_destroyed.jour_type)%>
|
||||
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
|
||||
destroyedItem.fadeOut(600,function(){
|
||||
destroyedItem.remove();
|
||||
|
|
|
@ -1562,6 +1562,7 @@ en:
|
|||
label_noawards: No awards
|
||||
label_user_location: Location
|
||||
label_requirement_enterprise: Requirements
|
||||
label_requirement_enterprise_list: Requirements List
|
||||
label_contest_innovate: Competitions
|
||||
label_software_user: Users
|
||||
label_course_practice: Courses
|
||||
|
|
|
@ -445,7 +445,7 @@ zh:
|
|||
project_module_time_tracking: 时间跟踪
|
||||
project_module_news: 新闻
|
||||
project_module_documents: 文档
|
||||
project_module_files: 文件共享
|
||||
project_module_files: 版本下载
|
||||
project_module_wiki: Wiki
|
||||
project_module_repository: 版本库
|
||||
project_module_boards: 讨论区
|
||||
|
@ -515,6 +515,7 @@ zh:
|
|||
label_software_user: 软件创客
|
||||
label_contest_innovate: 创新竞赛
|
||||
label_requirement_enterprise: 软件众包
|
||||
label_requirement_enterprise_list: 众包列表
|
||||
label_new_homework: 作业
|
||||
label_new_contest: 竞赛
|
||||
label_requirement_focus: 关注需求
|
||||
|
|
|
@ -22,7 +22,7 @@ function showAndScrollTo(id, focus) {
|
|||
if (focus !== null) {
|
||||
$('#'+focus).focus();
|
||||
}
|
||||
$('html, body').animate({scrollTop: $('#'+id).offset().top}, 100);
|
||||
$('html, body').animate({scrollTop: $('#'+id).offset().top}, 400);
|
||||
}
|
||||
|
||||
function toggleRowGroup(el) {
|
||||
|
|
|
@ -201,6 +201,14 @@ input[class='nyan-clean-gray']:active, .nyan-clean-gray:active {
|
|||
-moz-box-sizing: border-box;
|
||||
-box-sizing: border-box;
|
||||
}*/
|
||||
div.actions input[type="text"]{
|
||||
padding: 3px;
|
||||
width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-box-sizing: border-box;
|
||||
|
||||
}
|
||||
.lz {
|
||||
position:relative;
|
||||
min-height: 200px;
|
||||
|
|
|
@ -308,3 +308,6 @@ div#tooltip::after {
|
|||
border-bottom: 1px solid #FFFFFF;
|
||||
border-right: 1px solid #FFFFFF;
|
||||
}
|
||||
a.attachments_list_color {
|
||||
color: green;
|
||||
}
|
||||
|
|
|
@ -2109,6 +2109,7 @@ span.body{
|
|||
|
||||
span.time{
|
||||
color: rgb(172,174,174);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.message-notes{
|
||||
|
@ -2154,4 +2155,16 @@ ul.messages-for-user-reply li {
|
|||
|
||||
.toomuch {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.bonus {
|
||||
color: #ed8924;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.bid_description {
|
||||
width: 90%;
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
Loading…
Reference in New Issue