Merge branch 'szzh' into dev_hjq
This commit is contained in:
commit
75c8d6f422
|
@ -79,9 +79,7 @@ class AttachmentsController < ApplicationController
|
|||
if candown || User.current.admin? || User.current.id == @attachment.author_id
|
||||
@attachment.increment_download
|
||||
if stale?(:etag => @attachment.digest)
|
||||
if params[:force] == 'true'
|
||||
direct_download
|
||||
else
|
||||
if params[:preview] == 'true'
|
||||
convered_file = @attachment.diskfile
|
||||
#如果本身不是pdf文件,则先寻找是不是已转换化,如果没有则转化
|
||||
unless pdf?(convered_file)
|
||||
|
@ -96,6 +94,8 @@ class AttachmentsController < ApplicationController
|
|||
else
|
||||
direct_download
|
||||
end
|
||||
else
|
||||
direct_download
|
||||
end
|
||||
end
|
||||
else
|
||||
|
|
|
@ -94,6 +94,9 @@ class CoursesController < ApplicationController
|
|||
|
||||
def new_join
|
||||
@course = Course.find(params[:object_id])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 课程搜索
|
||||
|
|
|
@ -464,7 +464,7 @@ class PollController < ApplicationController
|
|||
sheet1[count_row + 1,0] = l(:label_poll_subtotal)
|
||||
sheet1[count_row + 2,0] = l(:label_poll_proportion)
|
||||
poll_question.poll_answers.each_with_index do |poll_answer,i|
|
||||
sheet1[count_row, i + 1] = poll_answer.answer_text
|
||||
sheet1[count_row, i + 1] = poll_answer.answer_text.gsub(/<\/?.*?>/,"").gsub(/ /," ")
|
||||
sheet1[count_row + 1, i + 1] = poll_answer.poll_votes.count
|
||||
sheet1[count_row + 2, i + 1] = statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)).to_s + "%"
|
||||
end
|
||||
|
@ -477,7 +477,7 @@ class PollController < ApplicationController
|
|||
sheet1[count_row,1] = poll_question.question_title
|
||||
count_row += 1
|
||||
poll_question.poll_votes.each do |poll_vote|
|
||||
sheet1[count_row,0] = poll_vote.vote_text
|
||||
sheet1[count_row,0] = poll_vote.vote_text.gsub(/<\/?.*?>/,"").gsub(/ /," ")
|
||||
count_row += 1
|
||||
end
|
||||
count_row += 1
|
||||
|
|
|
@ -24,7 +24,7 @@ class TestController < ApplicationController
|
|||
end
|
||||
@paths = homeworks_attach_path
|
||||
zipfile = ziping homeworks_attach_path
|
||||
send_file zipfile, :filename => bid.name,
|
||||
send_file zipfile, :filename => filename_for_content_disposition(bid.name),
|
||||
:type => detect_content_type(zipfile)
|
||||
rescue Errno::ENOENT => e
|
||||
logger.error "[Errno::ENOENT] ===> #{e}"
|
||||
|
|
|
@ -11,7 +11,7 @@ class ZipdownController < ApplicationController
|
|||
def download
|
||||
if User.current.logged?
|
||||
begin
|
||||
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file])
|
||||
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file])
|
||||
rescue => e
|
||||
render file: 'public/no_file_found.html'
|
||||
end
|
||||
|
@ -59,9 +59,10 @@ class ZipdownController < ApplicationController
|
|||
if homework != nil
|
||||
unless homework.attachments.empty?
|
||||
zipfile = zip_homework_by_user homework
|
||||
send_file zipfile.file_path, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
|
||||
"_" + homework.user.show_name +
|
||||
"_" + homework.name + ".zip", :type => detect_content_type(zipfile.file_path) if(zipfile)
|
||||
filename = ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
|
||||
"_" + homework.user.show_name +
|
||||
"_" + homework.name + ".zip"
|
||||
send_file zipfile.file_path, :filename => filename_for_content_disposition(filename), :type => detect_content_type(zipfile.file_path) if(zipfile)
|
||||
else
|
||||
render file: 'public/no_file_found.html'
|
||||
end
|
||||
|
|
|
@ -10,158 +10,158 @@ homework_type == 1 文件提交
|
|||
homework_type == 2 Project提交
|
||||
=end
|
||||
class Bid < ActiveRecord::Base
|
||||
Enterprise = 1
|
||||
Contest = 2
|
||||
Homework = 3
|
||||
HomeworkFile = 1
|
||||
HomeworkProject = 2
|
||||
attr_accessible :author_id, :budget, :deadline, :name, :description, :homework_type, :password
|
||||
include Redmine::SafeAttributes
|
||||
include ApplicationHelper
|
||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
belongs_to :author, :class_name => 'User', :foreign_key => :author_id
|
||||
belongs_to :course
|
||||
has_many :biding_projects, :dependent => :destroy
|
||||
has_many :projects, :through => :biding_projects
|
||||
has_many :courses_member, :class_name => 'User', :through => :courses
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
|
||||
has_many :homework_for_courses, :dependent => :destroy
|
||||
has_many :courses, :through => :homework_for_courses, :source => :course
|
||||
has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy
|
||||
has_many :homework_evaluations, :through => :homeworks
|
||||
has_many :join_in_contests, :dependent => :destroy
|
||||
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
|
||||
# has_many :fork_homework, :class_name => 'Bid', :conditions => "#{Bid.table_name}.parent_id = #{id}"
|
||||
acts_as_attachable
|
||||
|
||||
NAME_LENGTH_LIMIT = 60
|
||||
DESCRIPTION_LENGTH_LIMIT = 3000
|
||||
validates :name, length: {maximum: NAME_LENGTH_LIMIT}, presence: true
|
||||
validates :description, length: {maximum: DESCRIPTION_LENGTH_LIMIT}
|
||||
validates :author_id, presence: true
|
||||
validates :deadline, presence: true, format: {:with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/}
|
||||
validates :name, length: {maximum: NAME_LENGTH_LIMIT}
|
||||
validates :budget, format: { with: ->(p) { if p.reward_type == 1 then /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/
|
||||
elsif p.reward_type == 3 then /^(\d+)$|^(\d+).([0-9]{1})$/ end } }
|
||||
|
||||
validate :validate_user
|
||||
validate :validate_reward_type
|
||||
after_create :act_as_activity
|
||||
after_destroy :delete_kindeditor_assets
|
||||
scope :visible, lambda {|*args|
|
||||
nil
|
||||
}
|
||||
|
||||
scope :like, lambda {|arg|
|
||||
if arg.blank?
|
||||
where(nil)
|
||||
else
|
||||
pattern = "%#{arg.to_s.strip.downcase}%"
|
||||
where("LOWER(id) LIKE :p OR LOWER(name) LIKE :p OR LOWER(description) LIKE :p", :p => pattern)
|
||||
end
|
||||
}
|
||||
|
||||
scope :course_visible, lambda {|*args|
|
||||
includes(:courses).where(Course.allowed_to_condition(args.shift || User.current, :view_homeworks, *args))
|
||||
}
|
||||
|
||||
acts_as_watchable
|
||||
acts_as_taggable
|
||||
|
||||
acts_as_event :title => Proc.new {|o| "#{l(:label_course_homework)} ##{o.id}: #{o.name}" },
|
||||
:description => :description,
|
||||
:author => :author,
|
||||
:url => Proc.new {|o| {:controller => 'bids', :action => 'show', :id => o.id}}
|
||||
|
||||
acts_as_activity_provider :type => 'homeworks',
|
||||
:author_key => :author_id
|
||||
|
||||
acts_as_activity_provider :find_options => {:include => [:projects, :author]},
|
||||
:author_key => :author_id
|
||||
|
||||
safe_attributes 'name',
|
||||
'description',
|
||||
'budget',
|
||||
'deadline',
|
||||
'homework_type',
|
||||
'reward_type',
|
||||
'password'
|
||||
|
||||
|
||||
# Enterprise = 1
|
||||
# Contest = 2
|
||||
# Homework = 3
|
||||
# HomeworkFile = 1
|
||||
# HomeworkProject = 2
|
||||
# attr_accessible :author_id, :budget, :deadline, :name, :description, :homework_type, :password
|
||||
# include Redmine::SafeAttributes
|
||||
# include ApplicationHelper
|
||||
# has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
# belongs_to :author, :class_name => 'User', :foreign_key => :author_id
|
||||
# belongs_to :course
|
||||
# has_many :biding_projects, :dependent => :destroy
|
||||
# has_many :projects, :through => :biding_projects
|
||||
# has_many :courses_member, :class_name => 'User', :through => :courses
|
||||
# has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
# has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
|
||||
# has_many :homework_for_courses, :dependent => :destroy
|
||||
# has_many :courses, :through => :homework_for_courses, :source => :course
|
||||
# has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy
|
||||
# has_many :homework_evaluations, :through => :homeworks
|
||||
# has_many :join_in_contests, :dependent => :destroy
|
||||
# has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
|
||||
# # has_many :fork_homework, :class_name => 'Bid', :conditions => "#{Bid.table_name}.parent_id = #{id}"
|
||||
# acts_as_attachable
|
||||
#
|
||||
# NAME_LENGTH_LIMIT = 60
|
||||
# DESCRIPTION_LENGTH_LIMIT = 3000
|
||||
# validates :name, length: {maximum: NAME_LENGTH_LIMIT}, presence: true
|
||||
# validates :description, length: {maximum: DESCRIPTION_LENGTH_LIMIT}
|
||||
# validates :author_id, presence: true
|
||||
# validates :deadline, presence: true, format: {:with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/}
|
||||
# validates :name, length: {maximum: NAME_LENGTH_LIMIT}
|
||||
# validates :budget, format: { with: ->(p) { if p.reward_type == 1 then /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/
|
||||
# elsif p.reward_type == 3 then /^(\d+)$|^(\d+).([0-9]{1})$/ end } }
|
||||
#
|
||||
# validate :validate_user
|
||||
# validate :validate_reward_type
|
||||
# after_create :act_as_activity
|
||||
# after_destroy :delete_kindeditor_assets
|
||||
# scope :visible, lambda {|*args|
|
||||
# nil
|
||||
# }
|
||||
#
|
||||
# scope :like, lambda {|arg|
|
||||
# if arg.blank?
|
||||
# where(nil)
|
||||
# else
|
||||
# pattern = "%#{arg.to_s.strip.downcase}%"
|
||||
# where("LOWER(id) LIKE :p OR LOWER(name) LIKE :p OR LOWER(description) LIKE :p", :p => pattern)
|
||||
# end
|
||||
# }
|
||||
#
|
||||
# scope :course_visible, lambda {|*args|
|
||||
# includes(:courses).where(Course.allowed_to_condition(args.shift || User.current, :view_homeworks, *args))
|
||||
# }
|
||||
#
|
||||
# acts_as_watchable
|
||||
# acts_as_taggable
|
||||
#
|
||||
# acts_as_event :title => Proc.new {|o| "#{l(:label_course_homework)} ##{o.id}: #{o.name}" },
|
||||
# :description => :description,
|
||||
# :author => :author,
|
||||
# :url => Proc.new {|o| {:controller => 'bids', :action => 'show', :id => o.id}}
|
||||
#
|
||||
# acts_as_activity_provider :type => 'homeworks',
|
||||
# :author_key => :author_id
|
||||
#
|
||||
# acts_as_activity_provider :find_options => {:include => [:projects, :author]},
|
||||
# :author_key => :author_id
|
||||
#
|
||||
# safe_attributes 'name',
|
||||
# 'description',
|
||||
# 'deadline'
|
||||
def add_jour(user, notes, reference_user_id = 0, options = {})
|
||||
if options.count == 0
|
||||
jfm = JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
|
||||
self.journals_for_messages << jfm
|
||||
jfm
|
||||
else
|
||||
jfm = self.journals_for_messages.build(options)
|
||||
jfm.save
|
||||
jfm
|
||||
end
|
||||
end
|
||||
|
||||
def self.creat_bids(budget, deadline, name, description=nil, reward_type)
|
||||
self.create(:author_id => User.current.id, :budget => budget,
|
||||
:deadline => deadline, :name => name, :description => description, :commit => 0, :reward_type => reward_type)
|
||||
# self.acts << Activity.new(:user_id => self.author_id)
|
||||
end
|
||||
|
||||
def update_bids(budget, deadline, name, description=nil)
|
||||
if(User.current.id == self.author_id)
|
||||
self.name = name
|
||||
self.budget = budget
|
||||
self.deadline = deadline
|
||||
self.description = description
|
||||
self.save
|
||||
end
|
||||
end
|
||||
|
||||
def delete_bids
|
||||
unless self.nil?
|
||||
if User.current.id == self.author_id
|
||||
self.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def set_commit(commit)
|
||||
self.update_attribute(:commit, commit)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def validate_user
|
||||
errors.add :author_id, :invalid if author.nil? || !author.active?
|
||||
end
|
||||
|
||||
def validate_reward_type
|
||||
errors.add :reward_type, :invalid if self.reward_type == 0
|
||||
end
|
||||
|
||||
def act_as_activity
|
||||
self.acts << Activity.new(:user_id => self.author_id)
|
||||
end
|
||||
|
||||
# used to validate weather the user is the creater of the bid
|
||||
# added by william
|
||||
def validate_bid_manager(user_id)
|
||||
unless user_id.nil?
|
||||
if self.author_id == user_id
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Time 2015-04-01 14:19:06
|
||||
# Author lizanle
|
||||
# Description 删除对应课程通知的图片资源
|
||||
def delete_kindeditor_assets
|
||||
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::BID
|
||||
end
|
||||
# 'description',
|
||||
# 'budget',
|
||||
# 'deadline',
|
||||
# 'homework_type',
|
||||
# 'reward_type',
|
||||
# 'password'
|
||||
#
|
||||
#
|
||||
# # safe_attributes 'name',
|
||||
# # 'description',
|
||||
# # 'deadline'
|
||||
# def add_jour(user, notes, reference_user_id = 0, options = {})
|
||||
# if options.count == 0
|
||||
# jfm = JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id)
|
||||
# self.journals_for_messages << jfm
|
||||
# jfm
|
||||
# else
|
||||
# jfm = self.journals_for_messages.build(options)
|
||||
# jfm.save
|
||||
# jfm
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def self.creat_bids(budget, deadline, name, description=nil, reward_type)
|
||||
# self.create(:author_id => User.current.id, :budget => budget,
|
||||
# :deadline => deadline, :name => name, :description => description, :commit => 0, :reward_type => reward_type)
|
||||
# # self.acts << Activity.new(:user_id => self.author_id)
|
||||
# end
|
||||
#
|
||||
# def update_bids(budget, deadline, name, description=nil)
|
||||
# if(User.current.id == self.author_id)
|
||||
# self.name = name
|
||||
# self.budget = budget
|
||||
# self.deadline = deadline
|
||||
# self.description = description
|
||||
# self.save
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def delete_bids
|
||||
# unless self.nil?
|
||||
# if User.current.id == self.author_id
|
||||
# self.destroy
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def set_commit(commit)
|
||||
# self.update_attribute(:commit, commit)
|
||||
# end
|
||||
#
|
||||
# private
|
||||
#
|
||||
# def validate_user
|
||||
# errors.add :author_id, :invalid if author.nil? || !author.active?
|
||||
# end
|
||||
#
|
||||
# def validate_reward_type
|
||||
# errors.add :reward_type, :invalid if self.reward_type == 0
|
||||
# end
|
||||
#
|
||||
# def act_as_activity
|
||||
# self.acts << Activity.new(:user_id => self.author_id)
|
||||
# end
|
||||
#
|
||||
# # used to validate weather the user is the creater of the bid
|
||||
# # added by william
|
||||
# def validate_bid_manager(user_id)
|
||||
# unless user_id.nil?
|
||||
# if self.author_id == user_id
|
||||
# return true
|
||||
# else
|
||||
# return false
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# # Time 2015-04-01 14:19:06
|
||||
# # Author lizanle
|
||||
# # Description 删除对应课程通知的图片资源
|
||||
# def delete_kindeditor_assets
|
||||
# delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::BID
|
||||
# end
|
||||
end
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
// @status: 0 该项目不存在;1 不重复加入;2 成功加入; 3 已是项目成员;其它 加入失败
|
||||
<% if @status == 0%>
|
||||
alert("<%= l('project.join.tips.notexist') %>");
|
||||
<% elsif @status == 1%>
|
||||
alert("<%= l('project.join.tips.repeat') %>");
|
||||
<% elsif @status == 2%>
|
||||
alert("<%= l('project.join.tips.success') %>");
|
||||
hideModal($("#popbox"));
|
||||
<% elsif @status == 3%>
|
||||
alert("<%= l('project.join.tips.has') %>");
|
||||
<%else%>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<% is_float ||= false %>
|
||||
<% for attachment in attachments %>
|
||||
<div style="float:left;">
|
||||
<p style="height:14px;line-height:10px;width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<p style="height:14px;line-height:12px;width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%if is_float%>
|
||||
<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
|
||||
<% end%>
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<!-- fq --> <!-- modified by bai -->
|
||||
<%= error_messages_for 'bid' %>
|
||||
<!--[form:project]-->
|
||||
<p><%= l(:label_fork_form_new_description) %></p>
|
||||
|
||||
<!-- modified by bai -->
|
||||
<p style="margin-left:-68px;padding-right: 20px;"><strong><%= l(:label_choose_course) %><span class="required"> * </span></strong><%= select_tag 'course', course_options_for_select(@courses) %></p>
|
||||
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :value => @bid.name %></p>
|
||||
<!-- end -->
|
||||
|
||||
<p style="margin-left:-10px;padding-right: 20px;">
|
||||
<%= f.text_area :description, :rows => 8, :value => @bid.description, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
|
||||
<!-- <p><%#= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
|
||||
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
|
||||
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
|
||||
</p> -->
|
||||
<p><%= f.text_field :deadline, :value => nil,:required => true, :size => 60, :style => "width:150px;" , :readonly => true %><%= calendar_for('bid_deadline')%>
|
||||
<!--
|
||||
<p><%#= f.select :homework_type, homework_type_option %>
|
||||
</p>
|
||||
-->
|
||||
<p><%= f.select :is_evaluation, is_evaluation_option %>
|
||||
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
|
||||
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
|
||||
</fieldset>
|
|
@ -1,36 +0,0 @@
|
|||
<!-- huang -->
|
||||
<script type="text/javascript" language="javascript">
|
||||
function show(id, id_t, label_reward, label_money, label_credit, label_content) {
|
||||
var text = $('#' + id);
|
||||
var text_t = $('#' + id_t);
|
||||
if (text.val() == 0) {
|
||||
text_t.attr("placeholder", label_reward);
|
||||
}
|
||||
if (text.val() == 1) {
|
||||
text_t.attr("placeholder", label_money);
|
||||
}
|
||||
if (text.val() == 3) {
|
||||
text_t.attr("placeholder", label_credit);
|
||||
}
|
||||
if (text.val() == 2) {
|
||||
text_t.attr("placeholder", label_content);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
</script>
|
||||
<%= error_messages_for 'bid' %>
|
||||
<!--[form:project]-->
|
||||
<p style="width:500px;"><%= l(:label_bids_form_contest_new_description) %></p>
|
||||
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_name)}" %></p>
|
||||
|
||||
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_description)}" %></p>
|
||||
|
||||
<p style="margin-left:-10px;"><%= f.text_field :password, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
|
||||
|
||||
<p>
|
||||
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
|
||||
|
||||
<!-- 设置奖项设置的打开 关闭开关-->
|
||||
</p>
|
||||
<!-- <em class="info" style="margin-left:95px;"><%= l(:text_contest_reward) %></em> -->
|
||||
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :placeholder => "#{l(:label_deadline)}" %><%= calendar_for('bid_deadline')%></p>
|
|
@ -1,30 +0,0 @@
|
|||
<div class="inf_user_image">
|
||||
<% for user in @bid.watcher_users %>
|
||||
<ul class="list_watch"><li>
|
||||
<table width="660px" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(user), :class => "avatar") %></td>
|
||||
<td><table width="580px" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to_user(user), :class => "project_avatar_name" %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" ><p class="font_description">
|
||||
<% unless user.memberships.empty? %>
|
||||
<%= l(:label_x_contribute_to, :count => user.memberships.count) %>
|
||||
<% for member in user.memberships %>
|
||||
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" align="right" class="font_lighter"><%= l(:label_user_joinin) %><%= format_date(user.created_on) %>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></li></ul>
|
||||
<% end %>
|
||||
</div>
|
|
@ -12,7 +12,7 @@
|
|||
div.recall_con .reply_btn{margin-left:555px;margin-top:5px;}
|
||||
</style>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<div class="msg_box" id='leave-message' nhname="new_message">
|
||||
<div class="msg_box fl" id='leave-message' nhname="new_message">
|
||||
<%# reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
<h4><%= l(:label_leave_message) %></h4>
|
||||
|
||||
|
@ -30,15 +30,20 @@
|
|||
:placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250}%>
|
||||
<textarea cols="40" nhname="new_message_textarea" maxlength="250" name="new_form[course_message]" placeholder="请在此留下你的意见和建议!" rows="20" style="display: none;"></textarea>
|
||||
<p nhname="contentmsg"></p>
|
||||
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
|
||||
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10" nhname="cancel_btn">取 消</a>
|
||||
<a href="javascript:void(0)" onclick='$("#leave_message_form").submit();' class="blue_btn fr mt10">
|
||||
<%= l(:button_leave_meassge)%>
|
||||
</a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
|
||||
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10" nhname="cancel_btn">取 消</a>
|
||||
<a href="javascript:void(0)" onclick='$("#leave_message_form").submit();' class="blue_btn fr mt10">
|
||||
<%= l(:button_leave_meassge)%>
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="history">
|
||||
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
|
||||
</div>
|
||||
|
@ -49,6 +54,7 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
function init_editor(params){
|
||||
var editor = params.kindutil.create(params.textarea, {
|
||||
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
|
||||
|
@ -155,8 +161,8 @@
|
|||
params.div_form = $(">.respond-form",params.container);
|
||||
params.form = $("form",params.div_form);
|
||||
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.editor = init_editor(params);
|
||||
|
@ -166,6 +172,7 @@
|
|||
});
|
||||
}
|
||||
params.cancel_btn.click();
|
||||
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||
setTimeout(function(){
|
||||
if(!params.div_form.is(':hidden')){
|
||||
params.textarea.show();
|
||||
|
@ -187,8 +194,8 @@
|
|||
return;
|
||||
}
|
||||
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.editor = init_editor(params);
|
||||
init_form(params);
|
||||
|
|
|
@ -29,8 +29,9 @@
|
|||
:class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%= link_to l(:label_bid_respond_quote),'',
|
||||
<%#= link_to l(:label_bid_respond_quote),'',
|
||||
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||
<%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>"reply_btn"} %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<script type="text/javascript">
|
||||
function submit_form(obj)
|
||||
{
|
||||
hideModal(obj);
|
||||
$("#new-watcher-form").submit();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<% if @state %>
|
||||
<% if @state == 0 %>
|
||||
alert("加入成功");
|
||||
hideModal("#popbox02");
|
||||
hideModal($("#popbox"));
|
||||
<% elsif @state == 1 %>
|
||||
alert("密码错误");
|
||||
<% elsif @state == 2 %>
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
<br />
|
||||
<p class="mt5 break_word"><%= e.event_description.html_safe %>
|
||||
<br />
|
||||
<div class="cl"></div>
|
||||
<%= l :label_activity_time %> : <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %>
|
||||
</p>
|
||||
<%= link_to_attachments_course(e) if e.class.to_s == "News" %>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<% if file.is_public? || User.current.member_of_course?(course) %>
|
||||
<div class="re_con_box" id="container_files_<%= file.id %>">
|
||||
<div class="">
|
||||
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename, preview: true),:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
||||
<% if User.current.logged? %>
|
||||
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<% else %>
|
||||
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
||||
<% end %>
|
||||
<%= link_to '下载',download_named_attachment_path(file.id, file.filename, force: true),class: 'f_l re_open' %>
|
||||
<%= link_to_attachment file, text: '下载', class: 'f_l re_open' %>
|
||||
<% else %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<% project_attachments.each do |file| %>
|
||||
<div class="re_con_box">
|
||||
<div class="">
|
||||
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename, preview: true),:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
||||
<% if User.current.logged? %>
|
||||
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
|
||||
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<% else %>
|
||||
<%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
||||
<% end %>
|
||||
<%= link_to '下载',download_named_attachment_path(file.id, file.filename, force: true),class: 'f_l re_open' %>
|
||||
<%= link_to_attachment file, text: '下载', class: 'f_l re_open' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -4,19 +4,21 @@
|
|||
<span class="c_red">*</span>
|
||||
<%= l(:field_name)%>:
|
||||
</label>
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="<%= Bid::NAME_LENGTH_LIMIT%>" onkeyup="regex_homework_name();" value="<%= homework.name%>" >
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>" >
|
||||
<p id="homework_name_span" class="c_red ml110"></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li >
|
||||
<label class="label02 "> <%= l(:field_quote)%>: </label>
|
||||
<!--<textarea name="" placeholder="请在此填入作业的要求及评分依据" class=" w548 h150 mb10 fl" ></textarea>-->
|
||||
<% if edit_mode %>
|
||||
<%= f.kindeditor :description,:width=>'83%',:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
|
||||
<% else %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= f.kindeditor :description,:width=>'83%',:editor_id => 'homework_description_editor' %>
|
||||
<% end %>
|
||||
<div style="width: 83%;float: left;">
|
||||
<% if edit_mode %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
|
||||
<% else %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor' %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="mt10">
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</div>
|
||||
<div class="search fl">
|
||||
<%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get, :class => "search_form") do %>
|
||||
<%= text_field_tag 'name', params[:name], :placeholder => l(:label_course_name), :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %>
|
||||
<input class="search_text fl" id="name" name="name" onkeyup="regexName('搜索条件不能为空');" placeholder="课程名称" type="text">
|
||||
<a href="javascript:void(0)" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
|
||||
<%= l(:label_search)%>
|
||||
</a>
|
||||
|
|
|
@ -107,7 +107,9 @@
|
|||
<!--邀请加入-->
|
||||
<div class="subNavBox">
|
||||
<% if User.current.member_of?(@project) %>
|
||||
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit"><%= l(:label_invite)%></div>
|
||||
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit" data-val="expand">
|
||||
<%= l(:label_invite)%>
|
||||
</div>
|
||||
<ul class="navContent " style="display:block" id="navContent_invit">
|
||||
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
|
||||
<% if User.current.allowed_to?(:manage_members, @project) %>
|
||||
|
|
|
@ -8,11 +8,15 @@
|
|||
<% if is_new %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||
<%= f.kindeditor :description,:width=>'91%',:editor_id=>'news_description_editor' %>
|
||||
<div class="fl" style="width: 91%">
|
||||
<%= f.kindeditor :description,:editor_id=>'news_description_editor' %>
|
||||
</div>
|
||||
<p id="description_notice_span" class="ml55"></p>
|
||||
<% else %>
|
||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||
<%= f.kindeditor :description,:width=>'91%',:editor_id=>'news_description_editor',:owner_id => @news.id,:owner_type => OwnerTypeHelper::NEWS %>
|
||||
<div class="fl" style="width: 91%">
|
||||
<%= f.kindeditor :description,:editor_id=>'news_description_editor',:owner_id => @news.id,:owner_type => OwnerTypeHelper::NEWS %>
|
||||
</div>
|
||||
<p id="description_notice_span" class="ml55"></p>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
|
||||
<% if @news.commentable? %>
|
||||
<div class="msg_box">
|
||||
<div class="msg_box fl">
|
||||
<h4><%= l(:label_comment_add) %></h4>
|
||||
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
|
||||
<div class="box" id="news_comment">
|
||||
|
@ -43,7 +43,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% comments = @comments.reverse %>
|
||||
<% comments.each do |comment| %>
|
||||
<% next if comment.new_record? %>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
|
||||
<%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
|
||||
<% else %>
|
||||
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
|
||||
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white'%>
|
||||
<%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -1,69 +1,11 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_news) %></h2>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function regexTitle()
|
||||
{
|
||||
var name = $("#news_title").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#title_notice_span").text("<%= l(:label_title_blank)%>");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else if(name.length <= 60)
|
||||
{
|
||||
$("#title_notice_span").text("<%= l(:label_field_correct)%>");
|
||||
$("#title_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#title_notice_span").text("<%= l(:label_title_long)%>");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function submitComment()
|
||||
{
|
||||
$("#add_comment_form").submit();
|
||||
}
|
||||
|
||||
function regexDescription()
|
||||
{
|
||||
var name = $("#news_description").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#description_notice_span").text("<%= l(:label_descripition_blank)%>");
|
||||
$("#description_notice_span").css('color','#ff0000');
|
||||
$("#description_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#description_notice_span").text("<%= l(:label_field_correct)%>");
|
||||
$("#description_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submitNews()
|
||||
{
|
||||
if(regexTitle() && regexDescription())
|
||||
{
|
||||
$("#news-form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<% if authorize_for('news', 'edit') %>
|
||||
<div id="edit-news" style="display:none;">
|
||||
<%= labelled_form_for :news, @news, :url => news_path(@news),
|
||||
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
|
||||
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
|
||||
<%= render :partial => 'project_form', :locals => { :f => f, :is_new => false } %>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
<span><%= link_to journal.user, user_path(journal.user), :class => 'c_blue fb fl mb10', :target => "_blank" %>
|
||||
</span><span class="c_grey fr"><%= format_time(journal.created_on) %></span>
|
||||
<div class="cl"></div>
|
||||
<p><%= textilizable journal.notes%></p>
|
||||
<!--<p><%#= textilizable journal.notes%></p>-->
|
||||
<p><%=journal.notes.html_safe%>
|
||||
</div>
|
||||
<div class="ping_disfoot">
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
|
@ -20,8 +21,9 @@
|
|||
:class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%= link_to l(:label_bid_respond_quote),'',
|
||||
<%#= link_to l(:label_bid_respond_quote),'',
|
||||
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||
<%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %>
|
||||
|
||||
<% end %>
|
||||
</span>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
.C_form{ margin:20px 0 0 60px;}
|
||||
.C_form ul li{ font-size:14px; color:#3f3a39; line-height:30px; padding-left: 60px;}
|
||||
.C_form ul li input{ margin-left:20px; border:0px; border:1px solid #e1e1e1; color:#898989; padding-left:5px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; padding: 0 !important; }
|
||||
.C_form ul li.mB5{ color:#898989; font-size:12px; padding-left:150px;}
|
||||
.C_form ul li.mB5{ color:#898989; font-size:12px; padding-left:140px;}
|
||||
.width190{ width:190px; height:26px; border-color:#e1e1e1;}
|
||||
.C_form a{ font-size:12px; color:#15bccf; float:left; display:block; height:40px; width:200px; margin-top:25px;}
|
||||
.C_form a:hover{ text-decoration:underline;}
|
||||
|
@ -31,7 +31,6 @@
|
|||
<script type="text/javascript">
|
||||
function submit_form(obj)
|
||||
{
|
||||
hideModal(obj);
|
||||
$("#new-watcher-form").submit();
|
||||
// alert("申请成功");
|
||||
}
|
||||
|
@ -52,25 +51,25 @@
|
|||
</div>
|
||||
<div class="C_form">
|
||||
<%= form_tag({:controller => 'applied_project',
|
||||
:action => 'applied_join_project'},
|
||||
:remote => true,
|
||||
:method => :post,
|
||||
:id => 'new-watcher-form') do %>
|
||||
:action => 'applied_join_project'},
|
||||
:remote => true,
|
||||
:method => :post,
|
||||
:id => 'new-watcher-form') do %>
|
||||
<ul>
|
||||
<li style="padding-top: 15px;">
|
||||
<span class="tips"><%= l('project.join.id.label')%></span>
|
||||
<input type="hidden" name="project_join" value="1">
|
||||
<input type="hidden" name="user_id" value="<%= User.current.id%>">
|
||||
<input type="hidden" name="user_id" value="<%= User.current.id %>">
|
||||
<input class=" width190" name="project_id" id="project_id" type="text" value="" >
|
||||
<input type="text" style="display: none"/>
|
||||
</li>
|
||||
<li class="mB5" style="width: 260px"><%= l('project.join.id.tips')%></li>
|
||||
<li>
|
||||
<a href="#" class="btn" style="margin-left: 50px;" onclick="submit_form(this);">
|
||||
<%= l(:label_apply_project) %>
|
||||
<%= l(:label_apply_project) %>
|
||||
</a>
|
||||
<a href="#" class="btn" style="margin-left: 20px;" onclick="hideModal(this);">
|
||||
<%= l(:button_cancel)%>
|
||||
<%= l(:button_cancel) %>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
function init_editor(params){
|
||||
var editor = params.kindutil.create(params.textarea, {
|
||||
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
|
||||
|
@ -149,7 +150,7 @@
|
|||
params.div_form = $(">.respond-form",params.container);
|
||||
params.form = $("form",params.div_form);
|
||||
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined){
|
||||
|
@ -160,6 +161,7 @@
|
|||
});
|
||||
}
|
||||
params.cancel_btn.click();
|
||||
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||
setTimeout(function(){
|
||||
if(!params.div_form.is(':hidden')){
|
||||
params.textarea.show();
|
||||
|
@ -181,8 +183,8 @@
|
|||
return;
|
||||
}
|
||||
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.editor = init_editor(params);
|
||||
init_form(params);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div class="invi_search">
|
||||
<input hidden="hidden" value="true" name="flag">
|
||||
<input id="principal_search" class="invi_search_input fl" type="text" placeholder=<%= l(:label_invite_trustie_user_tips) %>>
|
||||
<a class="invi_search_btn fl" onclick="observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')">搜索</a>
|
||||
<a class="invi_search_btn fl" onclick="observeSearchfield('principal_search', null, '<%= escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true)%> ')">搜索</a>
|
||||
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')" %>
|
||||
<div class="cl"></div>
|
||||
<div id="principals_for_new_member">
|
||||
|
@ -48,7 +48,7 @@
|
|||
<% end %>
|
||||
</ul>
|
||||
<div class="cl mb10"></div>
|
||||
<a href="#" class="btn_free" onclick="$('#new_membership').submit();">
|
||||
<a href="javascript:void(0)" class="btn_free" onclick="submit_invite_members()">
|
||||
<%= l(:label_invite_members)%>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -67,37 +67,39 @@
|
|||
var text=$(label).text();
|
||||
$(label).attr("title",text);
|
||||
}
|
||||
|
||||
function nh_show_err_message(msg){
|
||||
$("#RSide>.flash").remove();
|
||||
$("#RSide").prepend('<div class="flash error" id="flash_error">'+msg+'</div>');
|
||||
}
|
||||
$('#new_membership').submit(function(){
|
||||
var user_ischeck=false;
|
||||
$("input[name='membership[user_ids][]']").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
user_ischeck=true;
|
||||
}
|
||||
});
|
||||
var role_ischeck=false;
|
||||
$("input[name='membership[role_ids][]']").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
role_ischeck=true;
|
||||
}
|
||||
});
|
||||
if(user_ischeck==false && role_ischeck==false){
|
||||
nh_show_err_message('请选择用户和角色!');
|
||||
return false;
|
||||
}
|
||||
if(user_ischeck==false){
|
||||
nh_show_err_message('请选择用户!');
|
||||
return false;
|
||||
}
|
||||
if(role_ischeck==false){
|
||||
nh_show_err_message('请选择角色!');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
function nh_show_err_message(msg){
|
||||
$("#RSide>.flash").remove();
|
||||
$("#RSide").prepend('<div class="flash error" id="flash_error">'+msg+'</div>');
|
||||
}
|
||||
|
||||
function submit_invite_members()
|
||||
{
|
||||
var user_ischeck=false;
|
||||
$("input[name='membership[user_ids][]']").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
user_ischeck=true;
|
||||
}
|
||||
});
|
||||
var role_ischeck=false;
|
||||
$("input[name='membership[role_ids][]']").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
role_ischeck=true;
|
||||
}
|
||||
});
|
||||
if(user_ischeck==false && role_ischeck==false){
|
||||
nh_show_err_message('请选择用户和角色!');
|
||||
return false;
|
||||
}
|
||||
if(user_ischeck==false){
|
||||
nh_show_err_message('请选择用户!');
|
||||
return false;
|
||||
}
|
||||
if(role_ischeck==false){
|
||||
nh_show_err_message('请选择角色!');
|
||||
return false;
|
||||
}
|
||||
$('#new_membership').submit();
|
||||
}
|
||||
</script>
|
|
@ -70,6 +70,7 @@
|
|||
:class => "problem_tit fl fb " %>
|
||||
<br />
|
||||
<p class="mt5 break_word"><%= textAreailizable act,:content %><br />
|
||||
<div class="cl"></div>
|
||||
<%= l :label_create_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -1,54 +1,53 @@
|
|||
<% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
|
||||
<%= if show_revision_graph && revisions && revisions.any?
|
||||
indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid|
|
||||
url_for(
|
||||
:controller => 'repositories',
|
||||
:action => 'revision',
|
||||
:id => project,
|
||||
:repository_id => @repository.identifier_param,
|
||||
:rev => scmid)
|
||||
end
|
||||
render :partial => 'revision_graph',
|
||||
:locals => {
|
||||
:commits => indexed_commits,
|
||||
:space => graph_space
|
||||
}
|
||||
end %>
|
||||
indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid|
|
||||
url_for(
|
||||
:controller => 'repositories',
|
||||
:action => 'revision',
|
||||
:id => project,
|
||||
:repository_id => @repository.identifier_param,
|
||||
:rev => scmid)
|
||||
end
|
||||
render :partial => 'revision_graph',
|
||||
:locals => {
|
||||
:commits => indexed_commits,
|
||||
:space => graph_space
|
||||
}
|
||||
end %>
|
||||
<%= form_tag(
|
||||
{:controller => 'repositories', :action => 'diff', :id => project,
|
||||
:repository_id => @repository.identifier_param, :path => to_path_param(path)},
|
||||
:method => :get
|
||||
) do %>
|
||||
<table class="list changesets">
|
||||
<thead><tr>
|
||||
<th>#</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><%= l(:label_date) %></th>
|
||||
<th><%= l(:field_author) %></th>
|
||||
<th><%= l(:field_comments) %></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% show_diff = revisions.size > 1 %>
|
||||
<% line_num = 1 %>
|
||||
<% revisions.each do |changeset| %>
|
||||
<tr class="changeset <%= cycle 'odd', 'even' %>">
|
||||
<% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %>
|
||||
<%= content_tag(:td, :class => 'id', :style => id_style) do %>
|
||||
<%= link_to_revision(changeset, @repository) %>
|
||||
<% end %>
|
||||
<td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %></td>
|
||||
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %></td>
|
||||
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
|
||||
<td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td>
|
||||
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<p style="padding-top: 10px;">
|
||||
{:controller => 'repositories', :action => 'diff', :id => project,
|
||||
:repository_id => @repository.identifier_param, :path => to_path_param(path)},
|
||||
:method => :get
|
||||
) do %>
|
||||
<table class="list changesets">
|
||||
<thead><tr>
|
||||
<th>#</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><%= l(:label_date) %></th>
|
||||
<th><%= l(:field_author) %></th>
|
||||
<th><%= l(:field_comments) %></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% show_diff = revisions.size > 1 %>
|
||||
<% line_num = 1 %>
|
||||
<% revisions.each do |changeset| %>
|
||||
<tr class="changeset <%= cycle 'odd', 'even' %>">
|
||||
<% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %>
|
||||
<%= content_tag(:td, :class => 'id', :style => id_style) do %>
|
||||
<%= link_to_revision(changeset, @repository) %>
|
||||
<% end %>
|
||||
<td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %></td>
|
||||
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %></td>
|
||||
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
|
||||
<td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td>
|
||||
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<p style="padding-top: 10px;">
|
||||
<%= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
|
||||
</p>
|
||||
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
<div class="repository_con" style="line-height:1.9;">
|
||||
<div class="repositorytitle" style="float:left;">
|
||||
<%= render :partial => 'breadcrumbs',
|
||||
:locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
|
||||
:locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
|
||||
<%= render :partial => 'navigation' %>
|
||||
|
||||
</div>
|
||||
<!--contextual end-->
|
||||
<div class="cl"></div>
|
||||
|
@ -25,18 +24,18 @@
|
|||
link_to h(repo.name),
|
||||
{:controller => 'repositories', :action => 'show',
|
||||
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
|
||||
:class => 'repository' + (repo == @repository ? ' selected' : ''),
|
||||
:class => "mb10 break_word c_orange" }.join(' | ').html_safe %>)
|
||||
:class => 'repository' + (repo == @repository ? ' selected' : ''),
|
||||
:class => "mb10 break_word c_orange" }.join(' | ').html_safe %>)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="repos_more"><a id="showgithelp" value="show_help" onclick ="showhelpAndScrollTo('repos_git_more'); " class="c_dblue lh23">展开Git操作指南</a></div>
|
||||
<div class="repos_more"><a href="#" id="showgithelp" value="show_help" onclick ="showhelpAndScrollTo('repos_git_more'); " class="c_dblue lh23">展开Git操作指南</a></div>
|
||||
<div id="repos_git_more">
|
||||
<br>
|
||||
<div class=" c_dark f14">
|
||||
<p>项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码。</p>
|
||||
<p>通过cmd命令提示符进入代码对应文件夹的根目录,假设当前用户的登录名为user,版本库名称为demo,需要操作的版本库分支为branch。
|
||||
如果是首次提交代码,执行如下命令:</p>
|
||||
如果是首次提交代码,执行如下命令:</p>
|
||||
</div>
|
||||
<div class="repos_explain">
|
||||
<p>git init</p>
|
||||
|
@ -53,7 +52,7 @@
|
|||
|
||||
<p>git push -u origin branch:branch</p>
|
||||
</div>
|
||||
<!--repos_explain end-->
|
||||
<!--repos_explain end-->
|
||||
<div class="c_dark f14">
|
||||
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
|
||||
</div>
|
||||
|
@ -68,7 +67,7 @@
|
|||
|
||||
<p>git push -u origin branch:branch</p>
|
||||
</div>
|
||||
<!--repos_explain end-->
|
||||
<!--repos_explain end-->
|
||||
<div class="c_dark f14">
|
||||
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
|
||||
</div>
|
||||
|
@ -81,7 +80,7 @@
|
|||
|
||||
<p>git push origin branch_name</p>
|
||||
</div>
|
||||
<!--repos_explain end-->
|
||||
<!--repos_explain end-->
|
||||
<div class="c_dark f14">
|
||||
<p>从网上获取别人的开源版本库,转交到trustie网站上,打开命令行执行如下:</p>
|
||||
</div>
|
||||
|
@ -101,56 +100,59 @@
|
|||
<p><a href="/users/646" class="c_orange">李海</a>提供</p>
|
||||
</div>
|
||||
</div>
|
||||
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
|
||||
<%= render :partial => 'dir_list' %>
|
||||
<% end %>
|
||||
<!-- 代码库显示 -->
|
||||
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
|
||||
<%= render :partial => 'dir_list' %>
|
||||
<% end %>
|
||||
<%= render_properties(@properties) %>
|
||||
|
||||
<%= render_properties(@properties) %>
|
||||
<% if authorize_for('repositories', 'revisions') %>
|
||||
<% if @changesets && !@changesets.empty? %>
|
||||
<h3>
|
||||
<%= l(:label_latest_revision_plural) %>
|
||||
</h3>
|
||||
<%= render :partial => 'revisions',
|
||||
:locals => {:project => @project, :path => @path,
|
||||
:revisions => @changesets, :entry => nil} %>
|
||||
<!-- 代码修订 -->
|
||||
<% if authorize_for('repositories', 'revisions') %>
|
||||
<%# if @changesets && !@changesets.empty? %>
|
||||
<h3>
|
||||
<%= l(:label_latest_revision_plural) %>
|
||||
</h3>
|
||||
<%= render :partial => 'revisions',
|
||||
:locals => {:project => @project, :path => @path,
|
||||
:revisions => @changesets, :entry => nil} %>
|
||||
<%# end %>
|
||||
|
||||
<p style="padding-top: 10px;">
|
||||
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
|
||||
sep = '' %>
|
||||
<% if @repository.supports_all_revisions? && @path.blank? %>
|
||||
<%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project,
|
||||
:repository_id => @repository.identifier_param},
|
||||
:class => "orange_u_btn" %>
|
||||
<% sep = '|' %>
|
||||
<% end %>
|
||||
<p style="padding-top: 10px;">
|
||||
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
|
||||
sep = '' %>
|
||||
<% if @repository.supports_all_revisions? && @path.blank? %>
|
||||
<%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project,
|
||||
:repository_id => @repository.identifier_param},
|
||||
:class => "orange_u_btn" %>
|
||||
<% sep = '|' %>
|
||||
<% end %>
|
||||
<% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
|
||||
<%= sep %>
|
||||
<%= link_to l(:label_view_revisions),
|
||||
{:action => 'changes',
|
||||
:path => to_path_param(@path),
|
||||
:id => @project,
|
||||
:repository_id => @repository.identifier_param,
|
||||
:rev => @rev},
|
||||
:class => "orange_u_btn" %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% if @repository.supports_all_revisions? %>
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(
|
||||
:atom, params.merge(
|
||||
{:format => 'atom', :action => 'revisions',
|
||||
:id => @project, :page => nil, :key => User.current.rss_key})) %>
|
||||
<% end %>
|
||||
<% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
|
||||
<%= sep %>
|
||||
<%= link_to l(:label_view_revisions),
|
||||
{:action => 'changes',
|
||||
:path => to_path_param(@path),
|
||||
:id => @project,
|
||||
:repository_id => @repository.identifier_param,
|
||||
:rev => @rev},
|
||||
:class => "orange_u_btn" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% if @repository.supports_all_revisions? %>
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(
|
||||
:atom, params.merge(
|
||||
{:format => 'atom', :action => 'revisions',
|
||||
:id => @project, :page => nil, :key => User.current.rss_key})) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<!-- added by bai -->
|
||||
<p class="fb c_dark mt10">查看如何提交代码:
|
||||
<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %>
|
||||
<%= link_to('English', en_usage_path, :class => "c_blue") %>
|
||||
<!-- added by bai -->
|
||||
<p class="fb c_dark mt10">查看如何提交代码:
|
||||
<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %>
|
||||
<%= link_to('English', en_usage_path, :class => "c_blue") %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag "scm" %>
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
</ul>
|
||||
|
||||
<div class="ping_box mt10" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%@work.student_works_scores.order("created_at desc").each do |score|%>
|
||||
<%@work.student_works_scores.order("updated_at desc").each do |score|%>
|
||||
<div id="work_score_<%= score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => score}%>
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<a href="javascript:void(0);" class="c_orange fl" ><%= score.score%>分</a>
|
||||
<a href="javascript:void(0);" class="fr c_purple mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a>
|
||||
<span class=" fr c_grey mr20">
|
||||
<%=format_time score.created_at %>
|
||||
<%=format_time score.updated_at %>
|
||||
</span>
|
||||
<div class="cl mb5"></div>
|
||||
<p class="break_word">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<li class="hwork_num ">
|
||||
<a href="javascript:void(0);" class=" f14 f_b c_dark fl" >学号</a>
|
||||
<span class="c_dark f14 fb fl">学号</span>
|
||||
</li>
|
||||
<li class=" hwork_name f14 fb c_dark">
|
||||
学生姓名
|
||||
|
|
|
@ -2,7 +2,7 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti
|
|||
$('#score_<%= @work.id%>').peSlider({range: 'min'});
|
||||
|
||||
<% if @is_new%>
|
||||
$("#score_list_<%= @work.id%>").prepend("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>");
|
||||
$("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %></div>");
|
||||
<% else %>
|
||||
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>");
|
||||
<% end%>
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
|
||||
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span>
|
||||
<div class="cl"></div>
|
||||
<p><%= textilizable journal.notes%></p>
|
||||
<!--<p><%#= textilizable journal.notes%></p>-->
|
||||
<p><%=journal.notes.html_safe%></p>
|
||||
</div>
|
||||
<div class="ping_disfoot">
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
|
@ -23,8 +24,9 @@
|
|||
:class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%= link_to l(:label_bid_respond_quote),'',
|
||||
<%#= link_to l(:label_bid_respond_quote),'',
|
||||
{:focus => 'project_respond',:nhname=>'reply_btn', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||
<%= link_to l(:label_bid_respond_quote),'javascript:;',{:nhname=>'reply_btn'} %>
|
||||
|
||||
<% end %>
|
||||
</span>
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
function init_editor(params){
|
||||
var editor = params.kindutil.create(params.textarea, {
|
||||
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
|
||||
|
@ -177,8 +178,8 @@
|
|||
params.div_form = $(">.respond-form",params.container);
|
||||
params.form = $("form",params.div_form);
|
||||
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.editor = init_editor(params);
|
||||
|
@ -188,6 +189,7 @@
|
|||
});
|
||||
}
|
||||
params.cancel_btn.click();
|
||||
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||
setTimeout(function(){
|
||||
if(!params.div_form.is(':hidden')){
|
||||
params.textarea.show();
|
||||
|
@ -209,11 +211,15 @@
|
|||
return;
|
||||
}
|
||||
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.cancel_btn = $("#new_message_cancel_btn");
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.editor = init_editor(params);
|
||||
init_form(params);
|
||||
params.cancel_btn.click(function(){
|
||||
nh_reset_form(params);
|
||||
});
|
||||
// $("a[nhname='cancel_btn']",params.div_form).click(function(){
|
||||
// nh_reset_form(params);
|
||||
// });
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<%# memberships = user.memberships.all(:conditions => cond) %>
|
||||
<% user_courses = user_courses_list(user) %>
|
||||
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
|
||||
<%= ":" unless user_courses.empty? %>
|
||||
<%#= ":" unless user_courses.empty? %>
|
||||
<% for course in user_courses %>
|
||||
<%# if course.name != nil %>
|
||||
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.host_course} %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<% end %>
|
||||
|
||||
<p>
|
||||
<%= reply.notes %>
|
||||
<%= reply.notes.html_safe %>
|
||||
</p>
|
||||
<span class="c_grey fl">
|
||||
<%= format_time reply.created_on %>
|
||||
|
@ -33,8 +33,9 @@
|
|||
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% if reply_allow %>
|
||||
<%= link_to l(:button_reply),'',
|
||||
<%#= link_to l(:button_reply),'',
|
||||
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
|
||||
<%= link_to l(:button_reply),'javascript:;',{:nhname=>"reply_btn"} %>
|
||||
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
<p nhname="contentmsg"></p>
|
||||
<div style="padding-top:5px;float:left;" nhname="toolbar_container"></div>
|
||||
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-top: 5px;"%>
|
||||
<a href="javascript:;" id="new_message_cancel_btn" style="display:none;"></a>
|
||||
<%else %>
|
||||
<div style="font-size: 14px;margin:10px;">
|
||||
<%= l(:label_user_login_tips) %>
|
||||
|
|
|
@ -3,4 +3,7 @@ $('#history').html('<%= escape_javascript(render(:partial => 'users/history',:lo
|
|||
$('#jour_count').html('<%= @obj_count%>')
|
||||
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
|
||||
$('#new_form_user_message').val("");
|
||||
if($('#new_message_cancel_btn') != undefined && $('#new_message_cancel_btn').length!=0){
|
||||
$('#new_message_cancel_btn').click();
|
||||
}
|
||||
$('#new_form_reference_user_id').val("");
|
|
@ -421,6 +421,7 @@
|
|||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
/* toolbar */
|
||||
.ke-toolbar {
|
||||
|
|
|
@ -5621,7 +5621,7 @@ _plugin('core', function(K) {
|
|||
if (data.error === 0) {
|
||||
var url = K.formatUrl(data.url, 'absolute');
|
||||
//self.exec('insertimage', url, 'image','','','1','left');
|
||||
self.insertHtml('<img src="'+url+'"/>');
|
||||
self.insertHtml('<img src="'+url+'"/>');
|
||||
var asset_id = data.asset_id;
|
||||
if ( asset_id != "" && parent.document.getElementById('asset_id') != null ) {
|
||||
parent.document.getElementById('asset_id').value += asset_id.toString();
|
||||
|
|
|
@ -432,6 +432,7 @@
|
|||
}
|
||||
/* container */
|
||||
.ke-container {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
border: 1px solid #CCCCCC;
|
||||
background-color: #FFF;
|
||||
|
|
|
@ -265,6 +265,11 @@ function submitFocus(obj) {
|
|||
$(obj).focus();
|
||||
}
|
||||
|
||||
function submitComment()
|
||||
{
|
||||
$("#add_comment_form").submit();
|
||||
}
|
||||
|
||||
//当项目描述长度小于112px时,不显示更多按钮
|
||||
$(function () {
|
||||
// alert($("#course_description_content").height());
|
||||
|
@ -485,4 +490,4 @@ function judgeprojectname(){
|
|||
name:{required : "请填写项目名称!",remote:'您已新建过同名项目,请修改项目名称!'}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ a:hover.work_edit{color: #fff; background: #64bdd9;}
|
|||
.wzan a{ display: block;}
|
||||
a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;}
|
||||
a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
|
||||
.msg_box{ width:670px; height:225px; border-bottom:1px dashed #CCC; padding-top:10px;}
|
||||
.msg_box{ width:670px; border-bottom:1px dashed #CCC; padding-top:10px;}
|
||||
.msg_box h4{ }
|
||||
.msg_box textarea{width:658px;height:90px;padding:5px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 0px; color:#666; font-size:12px; }
|
||||
|
||||
|
|
|
@ -440,3 +440,4 @@ img{max-width: 100%;}
|
|||
.attachments {clear: both;}
|
||||
.is_public_checkbox{margin-left: 15px;margin-right: 10px;}
|
||||
.author_name{color: #3ca5c6 !important;}
|
||||
.ke-container-default{max-width: 100%;}
|
||||
|
|
Loading…
Reference in New Issue