Merge remote-tracking branch 'origin/szzh' into szzh

memcached_alan^2
lizanle 10 years ago
commit d2bf8a16de

@ -1,2 +1,2 @@
--format documentation
--color --color
--require spec_helper

@ -28,28 +28,21 @@ gem "rmagick", ">= 2.0.0"
group :development do group :development do
gem 'grape-swagger' gem 'grape-swagger'
#gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git' gem 'better_errors', '~> 1.1.0'
gem 'puma' if RbConfig::CONFIG['host_os'] =~ /linux/ gem 'rack-mini-profiler', '~> 0.9.3'
end
group :development, :test do
unless RUBY_PLATFORM =~ /w32/
gem 'pry-rails' gem 'pry-rails'
if RUBY_VERSION >= '2.0.0' if RUBY_VERSION >= '2.0.0'
gem 'pry-byebug' gem 'pry-byebug'
else
# gem 'pry-debugger'
end end
gem 'pry-stack_explorer' gem 'pry-stack_explorer'
gem 'better_errors', '~> 1.1.0' end
gem 'rack-mini-profiler', '~> 0.9.3'
end
group :test do
gem "shoulda", "~> 3.5.0"
gem "mocha", "~> 1.1.0"
gem 'capybara', '~> 2.4.1'
gem 'nokogiri', '~> 1.6.3'
gem 'factory_girl', '~> 4.4.0'
gem 'selenium-webdriver', '~> 2.42.0'
gem "faker" gem 'rspec-rails', '~> 3.0'
gem 'factory_girl_rails'
end end
# Gems used only for assets and not required # Gems used only for assets and not required

@ -8,10 +8,11 @@ class AvatarController < ApplicationController
# Make sure that API users get used to set this content type # Make sure that API users get used to set this content type
# as it won't trigger Rails' automatic parsing of the request body for parameters # as it won't trigger Rails' automatic parsing of the request body for parameters
unless request.content_type == 'application/octet-stream' unless request.content_type == 'application/octet-stream'
render :nothing => true, :status => 406 @source_type = params[:source_type]
return @source_id = params[:source_id]
end @temp_file = params[:avatar][:image]
@image_file = @temp_file.original_filename
else
unless request.raw_post.nil? unless request.raw_post.nil?
@source_type = params[:source_type] @source_type = params[:source_type]
@source_id = params[:source_id] @source_id = params[:source_id]
@ -25,6 +26,8 @@ class AvatarController < ApplicationController
end end
end end
end end
end
if @temp_file && (@temp_file.size > 0) if @temp_file && (@temp_file.size > 0)
diskfile=disk_filename(@source_type,@source_id) diskfile=disk_filename(@source_type,@source_id)
@urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file)) @urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file))
@ -61,6 +64,10 @@ class AvatarController < ApplicationController
image.compress(300) image.compress(300)
respond_to do |format| respond_to do |format|
format.json{
render :inline => "#{@urlfile.to_s}?#{Time.now.to_i}",:content_type => 'text/html'
return
}
format.js format.js
format.api { format.api {
if saved if saved

@ -80,7 +80,7 @@ class BoardsController < ApplicationController
includes(:last_reply). includes(:last_reply).
limit(@topic_pages.per_page). limit(@topic_pages.per_page).
offset(@topic_pages.offset). offset(@topic_pages.offset).
order(sort_clause). order("last_replies_messages.created_on desc").
preload(:author, {:last_reply => :author}). preload(:author, {:last_reply => :author}).
all all
elsif @course elsif @course
@ -88,7 +88,7 @@ class BoardsController < ApplicationController
includes(:last_reply). includes(:last_reply).
# limit(@topic_pages.per_page). # limit(@topic_pages.per_page).
# offset(@topic_pages.offset). # offset(@topic_pages.offset).
order(sort_clause). order("last_replies_messages.created_on desc").
preload(:author, {:last_reply => :author}). preload(:author, {:last_reply => :author}).
all : [] all : []
@topics = paginateHelper board_topics,10 @topics = paginateHelper board_topics,10

@ -5,6 +5,7 @@ class CoursesController < ApplicationController
helper :activities helper :activities
helper :members helper :members
helper :words helper :words
helper :attachments
before_filter :auth_login1, :only => [:show, :feedback] before_filter :auth_login1, :only => [:show, :feedback]
menu_item :overview menu_item :overview

@ -58,7 +58,7 @@ class IssuesController < ApplicationController
def index def index
retrieve_query retrieve_query
sort_init(@query.sort_criteria.empty? ? [['updated_on', 'desc']] : @query.sort_criteria) sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns) sort_update(@query.sortable_columns)
@query.sort_criteria = sort_criteria.to_a @query.sort_criteria = sort_criteria.to_a
@ -387,7 +387,7 @@ class IssuesController < ApplicationController
def retrieve_previous_and_next_issue_ids def retrieve_previous_and_next_issue_ids
retrieve_query_from_session retrieve_query_from_session
if @query if @query
sort_init(@query.sort_criteria.empty? ? [['updated_on', 'desc']] : @query.sort_criteria) sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns, 'issues_index_sort') sort_update(@query.sortable_columns, 'issues_index_sort')
limit = 500 limit = 500
issue_ids = @query.issue_ids(:order => sort_clause, :limit => (limit + 1), :include => [:assigned_to, :tracker, :priority, :category, :fixed_version]) issue_ids = @query.issue_ids(:order => sort_clause, :limit => (limit + 1), :include => [:assigned_to, :tracker, :priority, :category, :fixed_version])

@ -194,6 +194,13 @@ class MessagesController < ApplicationController
redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id))
end end
elsif request.get? elsif request.get?
if params[:is_board]
if @project
redirect_to project_boards_path(@project)
elsif @course
redirect_to course_boards_path(@course)
end
else
respond_to do |format| respond_to do |format|
format.html { format.html {
layout_file = @project ? 'base_projects' : 'base_courses' layout_file = @project ? 'base_projects' : 'base_courses'
@ -202,6 +209,7 @@ class MessagesController < ApplicationController
end end
end end
end end
end
# Delete a messages # Delete a messages
def destroy def destroy

@ -244,12 +244,12 @@ update
def show def show
## TODO: the below will move to filter, done. ## TODO: the below will move to filter, done.
# if !User.current.member_of?(@project) if !User.current.member_of?(@project)
# if @project.hidden_repo if @project.hidden_repo
# render_403 render_403
# return -1 return -1
# end end
# end end
#if( !User.current.member_of?(@project) || @project.hidden_repo) #if( !User.current.member_of?(@project) || @project.hidden_repo)
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?

@ -593,6 +593,17 @@ module ApplicationHelper
Project.project_tree(projects, &block) Project.project_tree(projects, &block)
end end
# 判断当前用户是否为项目管理员
def is_project_manager?(user_id,project_id)
@result = false
mem = Member.where("user_id = ? and project_id = ?",user_id, project_id)
unless mem.blank?
mem.first.roles.to_s.include?("Manager")
@result = false
end
return @result
end
def principals_check_box_tags(name, principals) def principals_check_box_tags(name, principals)
s = '' s = ''
principals.each do |principal| principals.each do |principal|
@ -1770,8 +1781,7 @@ module ApplicationHelper
def get_memo def get_memo
@new_memo = Memo.new @new_memo = Memo.new
#@new_memo.subject = "有什么想说的,尽管来咆哮吧~~" @public_forum = Forum.find(1) rescue ActiveRecord::RecordNotFound
@public_forum = Forum.find(1)
end end
#获取用户未过期的课程 #获取用户未过期的课程

@ -232,6 +232,18 @@ module RepositoriesHelper
:label => l(:label_git_report_last_commit) :label => l(:label_git_report_last_commit)
)) ))
end end
# 判断项目是否有主版本库
def judge_main_repository(pro)
if pro.repositories.blank?
return false
else
pro.repositories.sort.each do |rep|
rep.is_default?
return true
end
end
end
# def cvs_field_tags(form, repository) # def cvs_field_tags(form, repository)
# content_tag('p', form.text_field( # content_tag('p', form.text_field(
# :root_url, # :root_url,

@ -32,6 +32,8 @@ class Token < ActiveRecord::Base
token = Token.get_token_from_user(user, 'autologin') token = Token.get_token_from_user(user, 'autologin')
unless token unless token
token = Token.create(:user => user, :action => 'autologin') token = Token.create(:user => user, :action => 'autologin')
else
token.update_attribute(:created_on, Time.now)
end end
token token
end end

@ -17,6 +17,7 @@
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span> </span>
<div class="cl"></div>
<% end %> <% end %>
<% container.saved_attachments.each_with_index do |attachment, i| %> <% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment"> <span id="attachments_p<%= i %>" class="attachment">
@ -34,10 +35,12 @@
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span> </span>
<div class="cl"></div>
<% end %> <% end %>
<% end %> <% end %>
</span> </span>
<% project = project %> <% project = project %>
<div class="cl"></div>
<span class="add_attachment" style="font-weight:normal;"> <span class="add_attachment" style="font-weight:normal;">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%--> <!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->

@ -56,7 +56,7 @@
:file_count => l(:label_file_count), :file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all) :delete_all_files => l(:text_are_you_sure_all)
} %> } %>
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span> <span id="upload_file_count<%= container.id %>" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span> </span>

@ -1,4 +1,72 @@
<% if defined?(container) %>
<span id="attachments_fields<%= container.id %>" class="attachments_fields" xmlns="http://www.w3.org/1999/html"> <span id="attachments_fields<%= container.id %>" class="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="sub_btn">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% else %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
<% end %>
</span>
<script type='text/javascript'>
// function CompatibleSend()
// {
// var obj=document.getElementById("_file");
// var file= $(obj).clone();
// file.click();
// }
</script>
<span class="add_attachment">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "文件浏览", :type=>"button", :onclick=>"_file#{container.id}.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => "_file#{container.id}",
:class => 'file_selector',
:multiple => true,
:onchange => "addInputFiles_board(this, '#{container.id}');",
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count<%=container.id %>" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% else %>
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %> <% if defined?(container) && container && container.saved_attachments %>
<% if isReply %> <% if isReply %>
<% container.saved_attachments.each_with_index do |attachment, i| %> <% container.saved_attachments.each_with_index do |attachment, i| %>
@ -27,23 +95,23 @@
<% end %> <% end %>
<% end %> <% end %>
</span> </span>
<script type='text/javascript'> <script type='text/javascript'>
// function CompatibleSend() // function CompatibleSend()
// { // {
// var obj=document.getElementById("_file"); // var obj=document.getElementById("_file");
// var file= $(obj).clone(); // var file= $(obj).clone();
// file.click(); // file.click();
// } // }
</script> </script>
<span class="add_attachment"> <span class="add_attachment">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%--> <!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "文件浏览", :type=>"button", :onclick=>"file#{container.id}.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %> <%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]', <%= file_field_tag 'attachments[dummy][file]',
:id => "file#{container.id}", :id => '_file',
:class => 'file_selector', :class => 'file_selector',
:multiple => true, :multiple => true,
:onchange => "addInputFiles_board(this, '#{container.id}');", :onchange => 'addInputFiles(this);',
:style => 'display:none', :style => 'display:none',
:data => { :data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size => Setting.attachment_max_size.to_i.kilobytes,
@ -60,6 +128,7 @@
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span> </span>
<% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %> <%= javascript_include_tag 'attachments' %>
<% end %> <% end %>

@ -13,6 +13,6 @@
:target => "_blank"%> :target => "_blank"%>
</div> </div>
<% end %> <% end %>
<br> <div class="cl"></div>
<% end %> <% end %>
</div> </div>

@ -3,7 +3,6 @@ var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
fileSpan.hide(); fileSpan.hide();
alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>"); alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>");
<% else %> <% else %>
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
fileSpan.find('a.remove-upload') fileSpan.find('a.remove-upload')
.attr({ .attr({
"data-remote": true, "data-remote": true,
@ -11,6 +10,8 @@ fileSpan.find('a.remove-upload')
"href": '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>' "href": '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>'
}) })
.off('click'); .off('click');
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
//var divattach = fileSpan.find('div.div_attachments'); //var divattach = fileSpan.find('div.div_attachments');
//divattach.html('<%= j(render :partial => 'tags/tagEx', :locals => {:obj => @attachment, :object_flag => "6"})%>'); //divattach.html('<%= j(render :partial => 'tags/tagEx', :locals => {:obj => @attachment, :object_flag => "6"})%>');
<% end %> <% end %>

@ -7,8 +7,7 @@
:id => nil, :id => nil,
:class => 'upload_file', :class => 'upload_file',
:size => "1", :size => "1",
:multiple => false, :multiple => true,
:onchange => 'addInputAvatar(this);',
:data => { :data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
@ -22,6 +21,6 @@
} %> } %>
<!--</span>--> <!--</span>-->
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= javascript_include_tag 'avatars' %> <%= javascript_include_tag 'jq-upload/jquery.ui.widget', 'jq-upload/jquery.iframe-transport', 'jq-upload/jquery.fileupload', 'jq-upload/upload' %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>

@ -1,4 +1,4 @@
var imgSpan = $('#avatar_image'); var imgSpan = jQuery('#avatar_image');
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'}); imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});

@ -3,7 +3,7 @@
<%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %> <%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
<li> <li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="#" onclick="$('#message-form').submit();" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="#" onclick="submitProjectsBoard('<%= @message.id %>')" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>

@ -32,7 +32,7 @@
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p> <p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;"> <div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;" id="topic<%= topic.id %>">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %> <% author = topic.author.to_s + "" %>
@ -40,12 +40,10 @@
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p> <p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.course_editable_by?(User.current) %> <% if topic.course_editable_by?(User.current) %>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: left; <a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
margin-left: 20px;"><%= l(:button_edit) %></a> margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %> <% end %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'},
@ -55,21 +53,28 @@
:style => ' margin-right: 10px;' :style => ' margin-right: 10px;'
) if topic.destroyable_by?(User.current) %> ) if topic.destroyable_by?(User.current) %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %>
<div class="cl"></div> <div class="cl"></div>
<p id="contentmessage<%=topic.id %>" class="project_board_content break_word"> <script>
<%= topic.content %> $(function(){if($("#contentmessage<%=topic.id %>").height()>55){$("#project_show_<%= topic.id%>").show();}});
</p> </script>
<% if topic.content.size > 300 %> <div class="project_board_content break_word" id="content_<%=topic.id%>">
<p> <div id="contentmessage<%=topic.id %>" class="upload_img">
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#contentmessage<%=topic.id %>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label> <%= topic.content.html_safe %>
</div>
</div>
<p style="display: none" id="project_show_<%= topic.id%>">
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<span class="g-arr-down"> <span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" /> <img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span> </span>
</p> </p>
<% end %>
<%= link_to_attachments_course topic, :author => false %> <%= link_to_attachments_course topic, :author => false %>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %> <%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
@ -95,7 +100,8 @@
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %> <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="talk_btn fr c_white" style=""><%= l(:label_memo_create)%></a> <%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

@ -12,7 +12,7 @@
} do |f| %> } do |f| %>
<%= render :partial => 'form_project', <%= render :partial => 'form_project',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="#" onclick="$('#message-form<%= topic.id%>').submit();" class="blue_btn fl c_white" ><%= l(:button_submit)%></a> <a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');" class="blue_btn fl c_white" ><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a>
<%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %> <%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %>
</ul> </ul>
@ -31,8 +31,8 @@
} do |f| %> } do |f| %>
<%= render :partial => 'form_course', <%= render :partial => 'form_course',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="javascript:void(0)" onclick="$('#message-form<%= topic.id%>').submit();"class="blue_btn fl c_white"><%= l(:button_submit)%></a> <a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<%= link_to l(:button_cancel), board_message_url(topic.board,topic.root, :r => (topic.parent_id &&topic.id)), :class => "blue_btn grey_btn fl c_white" %> <a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a>
<% end %> <% end %>
</ul> </ul>

@ -8,16 +8,16 @@
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span" class="ml55"></p> <p id="subject_span<%= topic.id%>" class="ml55"></p>
</li> </li>
<% else %> <% else %>
<li> <li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<% end %> <% end %>
<li class="ml60 mb5"> <li class="ml60 mb5">
@ -40,12 +40,12 @@
<% end %> <% end %>
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none' %>
<% if replying%> <% if replying%>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
<% else %> <% else %>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span" class="ml55"></p> <p id="message_content_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li> <li>

@ -5,19 +5,19 @@
<li style="display: none"> <li style="display: none">
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<% else %> <% else %>
<li> <li>
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %>
<p id="subject_span" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<% end %> <% end %>
<li class="ml60 mb5"> <li class="ml60 mb5">
@ -40,12 +40,12 @@
<% end %> <% end %>
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none' %>
<% if replying%> <% if replying%>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
<% else %> <% else %>
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span" class="ml55"></p> <p id="message_content_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li> <li>

@ -4,7 +4,7 @@
<li> <li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="#" onclick="$('#message-form').submit();" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="#" onclick="submitProjectsBoard('<%= @message.id %>')" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>

@ -32,7 +32,8 @@
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p> <p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;">
<div class="talkmain_box" id="topic<%= topic.id %>" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %> <% author = topic.author.to_s + "" %>
@ -40,12 +41,10 @@
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p> <p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.editable_by?(User.current) %> <% if topic.editable_by?(User.current) %>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: left; <a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
margin-left: 20px;"><%= l(:button_edit) %></a> margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %> <% end %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'},
@ -55,21 +54,28 @@
:style => ' margin-right: 10px;' :style => ' margin-right: 10px;'
) if topic.destroyable_by?(User.current) %> ) if topic.destroyable_by?(User.current) %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %>
<div class="cl"></div> <div class="cl"></div>
<script>
<p id="contentmessage<%=topic.id %>" class="project_board_content break_word"> $(function(){if($("#contentmessage<%=topic.id %>").height()>55){$("#project_show_<%= topic.id%>").show();}});
</script>
<div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img">
<%= topic.content %> <%= topic.content %>
</p> </div>
<% if topic.content.size > 300 %> </div>
<p>
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#contentmessage<%=topic.id %>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<p style="display: none" id="project_show_<%= topic.id%>">
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<span class="g-arr-down"> <span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" /> <img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span> </span>
</p> </p>
<% end %>
<%= link_to_attachments_course topic, :author => false %> <%= link_to_attachments_course topic, :author => false %>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %> <%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
@ -96,7 +102,10 @@
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %> <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="talk_btn fr c_white" style=""><%= l(:label_memo_create)%></a> <%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
<a href="#" onclick="$('#message_form<%= topic.id%>').submit();" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
@ -174,6 +183,7 @@
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
<% else %> <% else %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
@ -205,20 +215,5 @@
$("#message_form").submit(); $("#message_form").submit();
} }
} }
function regexContent()
{
var content = $.trim($("#message_content").val());
if(content.length ==0)
{
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
$("#message_content_span").css('color','#ff0000');
flag = false;
}
else
{
$("#message_content_span").text("<%= l(:label_field_correct) %>");
$("#message_content_span").css('color','#008000');
flag = true;
}
}
</script> </script>

@ -24,7 +24,29 @@
<script type="text/javascript">//侧导航 <script type="text/javascript">//侧导航
window.onload = function () {
var topic_id = getParam('topic_id');
document.getElementById(topic_id).focus();
}
var getParam = function(name){
var search = document.location.search;
var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
var matcher = pattern.exec(search);
var items = null;
if(null != matcher){
try{
items = decodeURIComponent(decodeURIComponent(matcher[1]));
}catch(e){
try{
items = decodeURIComponent(matcher[1]);
}catch(e){
items = matcher[1];
}
}
}
return items;
};
function show_newtalk() function show_newtalk()
{ {
@ -35,6 +57,9 @@ function show_newtalk1(id)
{ {
$(id).toggle(); $(id).toggle();
} }
</script> </script>
<% if @project %> <% if @project %>
<%= render :partial => 'project_show', locals: {project: @project} %> <%= render :partial => 'project_show', locals: {project: @project} %>

@ -56,7 +56,7 @@
</p> </p>
<p class="stats"> <p class="stats">
<%= content_tag('span', "#{garble @course.members.count}", :class => "info") %> <%= content_tag('span', "#{garble @course.members.count}", :class => "info") %>
<%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %> <%= content_tag('span', l(:label_x_member, :count => @course.members.count)) %>
</p> </p>
<!--gcm--> <!--gcm-->

@ -15,12 +15,13 @@
<span class="fl"> &nbsp;</span> <span class="fl"> &nbsp;</span>
<span class="fl"> <%= l(:label_new_activity) %></span> <span class="fl"> <%= l(:label_new_activity) %></span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @course)} "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : <%= link_to "#{eventToLanguageCourse(e.event_type, @course)} "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) :
(e.event_type.eql?("bid") ? homework_course_path(@course) : e.event_url),:class => "problem_tit c_dblue fl fb"%> (e.event_type.eql?("bid") ? homework_course_path(@course) : (e.event_type.eql?("message") || e.event_type.eql?("reply") ? course_boards_path(@course,:topic_id => e.id) : e.event_url)),:class => "problem_tit c_dblue fl fb"%>
<br /> <br />
<p class="mt5 break_word"><%= e.event_description.html_safe %> <p class="mt5 break_word"><%= e.event_description.html_safe %>
<br /> <br />
<%= l :label_activity_time %> <%= format_activity_day(day) %>&nbsp;<%= format_time(e.event_datetime, false) %> <%= l :label_activity_time %> <%= format_activity_day(day) %>&nbsp;<%= format_time(e.event_datetime, false) %>
</p> </p>
<%= link_to_attachments_course(e) if e.is_a?(News) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--课程动态 end--> </div><!--课程动态 end-->

@ -20,17 +20,15 @@
<div class=""> <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_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" %>
<% if User.current.logged? %> <% if User.current.logged? %>
<!--私有项目资源部能引用,不能设置公开私有--> <%#--私有项目资源不能引用,不能设置公开私有--%>
<!--公开项目资源可以应用,管理员和资源上传者拥有设置公开私有权限--> <%#--公开项目资源可以应用,管理员和资源上传者拥有设置公开私有权限--%>
<% if project.is_public? %>
<%= 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) %> <%= 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) %>
<% if (Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") || file.author_id == User.current.id) && project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project" %> <% if (is_project_manager?(User.current.id, @project.id) || file.author_id == User.current.id) && project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project" %>
<span id="is_public_<%= file.id %>"> <span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
</span> </span>
<% end %> <% end %>
<% end %> <% end %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class=""> <div class="">

@ -49,7 +49,7 @@
</div> </div>
</div> </div>
<% end %> <% end %>
<div class="pagination"> <div class="pagination" style="margin-top: 10px;">
<%= pagination_links_full @forums_pages, @forums_count %> <%= pagination_links_full @forums_pages, @forums_count %>
</div> </div>
<% else %> <% else %>

@ -59,7 +59,7 @@
<strong style="float: left;"> <strong style="float: left;">
文件: 文件:
</strong> </strong>
<div id="homework_attach_jour_attachment"> <div id="homework_attach_jour_attachment" style="padding-left: 40px;">
<%= render :partial => 'attachments/form' %> <%= render :partial => 'attachments/form' %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

@ -12,13 +12,13 @@
$("#stars_value").val(num); $("#stars_value").val(num);
} }
function ChoseZero() // function ChoseZero()
{ // {
if(confirm('是否确定评分为0分?')) // if(confirm('是否确定评分为0分?'))
{ // {
ChoseStars(0); // ChoseStars(0);
} // }
} // }
</script> </script>
<div id="popbox"> <div id="popbox">
<div class="ping_con"> <div class="ping_con">

@ -1,4 +1,4 @@
<a style="float: right;padding-left: 10px;font-weight: normal;cursor: pointer;color: red;" onclick="ChoseZero();">零分</a> <a style="float: right;padding-left: 10px;font-weight: normal;cursor: pointer;color: red;" onclick="ChoseStars(0);">零分</a>
<span><a href="javascript:" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span> <span><a href="javascript:" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="javascript:" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span> <span><a href="javascript:" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="javascript:" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span> <span><a href="javascript:" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>

@ -75,16 +75,32 @@
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620", <%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
:maxlength => 3000, :placeholder => "最多3000个汉字" %> :maxlength => 3000, :placeholder => "最多3000个汉字" %>
</p> </p>
<p> <!--<div class="cl"></div>-->
<label style="float: left;"> <!--<p>-->
<!--<label style="float: left;">-->
<!--&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;-->
<!--</label>-->
<!--<div style="float: left;padding-bottom: 15px;">-->
<!--<%#= render :partial => 'attachments/form', :locals => {:container => @homework}%>-->
<!--</div>-->
<!--</p>-->
<!--<div class="cl"></div>-->
<div class="cl"></div>
<label style="float: left;padding-left: 15px;">
&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;
</label> </label>
<div style="float: left;padding-bottom: 15px;"> <!--<div style="float: left;margin-left: 5px;">-->
<%= render :partial => 'attachments/form', :locals => {:container => @homework}%> <!--<%#= render :partial => 'attachments/form',locals: {:container => @homework}%>-->
<!--</div>-->
<div style="float: left;">
<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
</div> </div>
</p>
<div class="cl"></div> <div class="cl"></div>
<p>
<p style="padding-top: 10px;">
<label>&nbsp;&nbsp;&nbsp;开发项目 <label>&nbsp;&nbsp;&nbsp;开发项目
<img src="/images/bid/pic_question.png" width="16" height="16" <img src="/images/bid/pic_question.png" width="16" height="16"
title="项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。 title="项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。
@ -101,7 +117,7 @@
<span style="float: left;"> <span style="float: left;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span> </span>
<a href="javascript:" class="tijiao" onclick="submit_homework_form();"> <a href="javascript:void(0)" class="tijiao" onclick="submit_homework_form();">
<%= l(:label_button_ok) %> <%= l(:label_button_ok) %>
</a> </a>
<a href="javascript:history.back()" class="tijiao">取&nbsp;&nbsp;消</a> <a href="javascript:history.back()" class="tijiao">取&nbsp;&nbsp;消</a>

@ -34,17 +34,26 @@
<a class="subnav_num">(<%= attaments_num %>)</a> <a class="subnav_num">(<%= attaments_num %>)</a>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> <%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %> <% end %>
</div> </div>
<% end%> <% end %>
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %> <% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %>
<% if @project.hidden_repo || !@project.is_public? %>
<% if User.current.member_of?(@project) %>
<div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a>
</div>
<% end %>
<% else %>
<div class="subNav"> <div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %> <%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a> <a class="subnav_num">(<%= @project.repositories.count %>)</a>
</div> </div>
<% end %><!--meny end --> <% end %>
<% end %>
<!-- more --> <!-- more -->
<div class="subNav subNav_jiantou" onclick="$('#navContent').toggle(500);" id="expand_tools_expand"><%= l(:label_project_more) %></div> <div class="subNav subNav_jiantou" onclick="$('#navContent').toggle(500);" id="expand_tools_expand"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContent"> <ul class="navContent" id="navContent">

@ -169,6 +169,7 @@ function cookieget(n)
<div class="side_center"> <div class="side_center">
<div class="custom_service"> <div class="custom_service">
<% get_memo %> <% get_memo %>
<% if @public_forum %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %> <%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
@ -176,6 +177,7 @@ function cookieget(n)
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label> <label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a> <a href="javascript:void(0);" class="opnionButton" style=" color:#fff;" id="" onclick="f_submit();"><%= l(:label_submit)%></a>
<% end %> <% end %>
<% end %>
</div> </div>
<div class="msgserver"> <div class="msgserver">
<a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白&nbsp;&nbsp;&nbsp;羽</a> <a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白&nbsp;&nbsp;&nbsp;羽</a>

@ -23,7 +23,7 @@
<a class="subnav_num">(<%= attaments_num %>)</a> <a class="subnav_num">(<%= attaments_num %>)</a>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> <%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

@ -34,7 +34,7 @@
<a class="subnav_num">(<%= attaments_num %>)</a> <a class="subnav_num">(<%= attaments_num %>)</a>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> <%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %> <% end %>
</div> </div>
<% end%> <% end%>

@ -3,7 +3,6 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>升级浏览器</title> <title>升级浏览器</title>
<script src="jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
<style type="text/css"> <style type="text/css">
body{ font-size:12px; font-family:"微软雅黑","宋体"; background: #F2F2F2; font-style:normal;} body{ font-size:12px; font-family:"微软雅黑","宋体"; background: #F2F2F2; font-style:normal;}
.update{ border-bottom:1px solid #d7d7d7; color:#fea254; text-align:center; width:100%; font-size:10px; height:30px; background:#fdffd9; padding:2px 0;z-index:1000;} .update{ border-bottom:1px solid #d7d7d7; color:#fea254; text-align:center; width:100%; font-size:10px; height:30px; background:#fdffd9; padding:2px 0;z-index:1000;}

@ -2,15 +2,15 @@
<div class="actions" style="max-width:680px;"> <div class="actions" style="max-width:680px;">
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<p><%= f.text_field :subject, :required => true, :size => 95 %></p> <p><%= f.text_field :subject, :required => true, :size => 95, :style => 'width:98%' %></p>
<p style="max-width:680px"><%= f.kindeditor :content,:width=>'99%', :required => true %></p> <p style="max-width:680px"><%= f.kindeditor :content,:width=>'99%', :required => true %></p>
<!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> --> <!--<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> -->
<br/> <div class="cl"></div>
<p style="margin-right: 10px;" class="fl"> <label class="fl" style="margin-left: -80px;margin-top: 10px;"><%= l(:label_attachment_plural) %></label>
<%= l(:label_attachment_plural) %><br /> <div style="margin-left: 110px;margin-top: 10px;margin-bottom: 10px;" class="fl">
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %> <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p> </div>
<%= f.submit :value => l(:label_memo_create), :style => "margin-left: 100px;"%> <%= link_to l(:button_back), forum_path(@forum) %> <%= f.submit :value => l(:label_memo_create), :style => "margin-left: 100px;"%> <%= link_to l(:button_back), forum_path(@forum) %>
</div> </div>
<% end %> <% end %>

@ -29,7 +29,7 @@
<%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %> <%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
<% else %> <% 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), "javascript:void(0)", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %> <%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</li> </li>

@ -44,6 +44,7 @@
<span class="g-arr-down"></span> <span class="g-arr-down"></span>
</div> </div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span> <span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
<%= link_to_attachments_course news %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--problem_main end--> </div><!--problem_main end-->

@ -72,20 +72,22 @@
<span class="c_grey"><%= l(:text_scm_command_not_available) %></span> <span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
<% end %> <% end %>
</li> </li>
<li > <% unless judge_main_repository(@project) %>
<li>
<label class="label02"><%=l(:field_repository_is_default)%></label> <label class="label02"><%=l(:field_repository_is_default)%></label>
<%= f.check_box :is_default, :label => "" %></p> <%= f.check_box :is_default, :label => "", :no_label => true %></p>
</li> </li>
<% end %>
<li > <li >
<label class="label02"><span class="c_red">*</span><%=l(:label_repository_name)%></label> <label class="label02"><span class="c_red">*</span><%=l(:label_repository_name)%></label>
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>""%> <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
<% unless @repository.identifier_frozen? %> <% unless @repository.identifier_frozen? %>
<span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info)%></span> <span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
<% end %> <% end %>
</li> </li>
<li > <li >
<label class="label02"><span class="c_red">*</span><%=l(:label_password)%></label> <label class="label02"><span class="c_red">*</span><%=l(:label_password)%></label>
<%= f.password_field :upassword, :label=> "" %> <%= f.password_field :upassword, :label=> "", :no_label => true %>
<span class="c_grey"><%= l(:label_upassword_info)%></span> <span class="c_grey"><%= l(:label_upassword_info)%></span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>

@ -40,7 +40,7 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<!--jou留言--> <!--缺陷 jou留言 -->
<% elsif e.forge_act_type == "Journal" %> <% elsif e.forge_act_type == "Journal" %>
<div class="problem_main"> <div class="problem_main">
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a> <a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
@ -66,9 +66,7 @@
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> </span> <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages', project_boards_path(@project,:topic_id => act.id),
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}),
:class => "problem_tit fl fb " %> :class => "problem_tit fl fb " %>
<br /> <br />
<p class="mt5 break_word"><%= textAreailizable act,:content %><br /> <p class="mt5 break_word"><%= textAreailizable act,:content %><br />

@ -44,12 +44,7 @@
<% for tracker in @trackers %> <% for tracker in @trackers %>
<li><%= link_to h(tracker.name), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>: <li><%= link_to h(tracker.name), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>:
<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i, <%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
:total => @total_issues_by_tracker[tr :total => @total_issues_by_tracker[tracker].to_i) %>
<li><%= l(:default_tracker_bug) %></li>
<% end %>
<% if tracker.[4]%>
<li><%= l(:default_tracker_mission) %></li>
<% end %>
</li> </li>
<% end %> <% end %>
</ul> </ul>
@ -95,7 +90,7 @@
<% end %> <% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %> <%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
<% end %> <% end %>
<% html_title(l(:label_overview)) -%> <% html_title(l(:label_overview)) -%>

@ -152,9 +152,6 @@
<div class="cl"></div> <div class="cl"></div>
</div>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %> <%= stylesheet_link_tag "scm" %>
<% end %> <% end %>

@ -323,9 +323,8 @@
</span> </span>
&nbsp; &nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages', act.board.project ? project_boards_path(act.board.project,:topic_id => act.id) : course_boards_path(act.board.course,:topic_id => act.id),
:action => 'show', :class => "problem_tit fl fb " %>
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
</td> </td>
<% else %> <% else %>
<td colspan="2" valign="top"> <td colspan="2" valign="top">

@ -28,7 +28,13 @@
<td colspan="2" valign="top" width="50" ><img src="/images/new/news.png" width="40" height="40"/></td> <td colspan="2" valign="top" width="50" ><img src="/images/new/news.png" width="40" height="40"/></td>
<td><table width="580" border="0"> <td><table width="580" border="0">
<tr> <tr>
<td colspan="2" valign="top"><strong> <%= content_tag('span', h(e.project), :class => 'project') %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title(e.event_title), e.event_url %></td> <td colspan="2" valign="top"><strong> <%= content_tag('span', h(e.project), :class => 'project') %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span>
<% if e.event_type.eql?("message") || e.event_type.eql?("reply") %>
<%= link_to format_activity_title(e.event_title), e.board.project ? project_boards_path(e.board.project,:topic_id => e.id):course_boards_path(e.board.course,:topic_id => e.id) %>
<%else %>
<%= link_to format_activity_title(e.event_title), e.event_url %>
<%end%>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580" ><p class="font_description"><%= format_activity_description(e.event_description) %></p></td> <td colspan="2" width="580" ><p class="font_description"><%= format_activity_description(e.event_description) %></p></td>

@ -124,6 +124,7 @@ zh:
# #
lable_file_sharingarea: 资源共享区 lable_file_sharingarea: 资源共享区
label_upload_source: 上传资源
label_upload_files: 上传文件 label_upload_files: 上传文件
label_slected_to_other_project: 选入我的其他项目 label_slected_to_other_project: 选入我的其他项目
label_slected_to_project: 选入我的项目 label_slected_to_project: 选入我的项目

@ -0,0 +1,9 @@
class ChangeAutologinFromSettings < ActiveRecord::Migration
def up
Setting.where(name: 'autologin').update_all(value: 60)
end
def down
Setting.where(name: 'autologin').update_all(value: 7)
end
end

@ -6,7 +6,7 @@ module RailsKindeditor
input_html = { :id => id }.merge(options.delete(:input_html) || {}) input_html = { :id => id }.merge(options.delete(:input_html) || {})
output = ActiveSupport::SafeBuffer.new output = ActiveSupport::SafeBuffer.new
output << text_area_tag(name, content, input_html) output << text_area_tag(name, content, input_html)
output << javascript_tag(js_replace(id, options)) output << javascript_tag(js_replace(id, options.merge(window_onload: 'true')))
end end
def kindeditor(name, method, options = {}) def kindeditor(name, method, options = {})
@ -14,7 +14,7 @@ module RailsKindeditor
input_html = (options.delete(:input_html) || {}).stringify_keys input_html = (options.delete(:input_html) || {}).stringify_keys
output_buffer = ActiveSupport::SafeBuffer.new output_buffer = ActiveSupport::SafeBuffer.new
output_buffer << build_text_area_tag(name, method, self, options, input_html) output_buffer << build_text_area_tag(name, method, self, options, input_html)
output_buffer << javascript_tag(js_replace(input_html['id'], options)) output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true')))
end end
def kindeditor_upload_json_path(*args) def kindeditor_upload_json_path(*args)
@ -50,7 +50,7 @@ module RailsKindeditor
"var old_onload_#{random_name}; "var old_onload_#{random_name};
if(typeof window.onload == 'function') old_onload_#{random_name} = window.onload; if(typeof window.onload == 'function') old_onload_#{random_name} = window.onload;
window.onload = function() { window.onload = function() {
#{editor_id}KindEditor.create('##{dom_id}', #{get_options(options).to_json}); #{editor_id}KindEditor.create('##{dom_id}', #{get_options(options).to_json}).loadPlugin('paste');
if(old_onload_#{random_name}) old_onload_#{random_name}(); if(old_onload_#{random_name}) old_onload_#{random_name}();
}" }"
else else

@ -22,7 +22,7 @@ module Trustie
end end
end end
rescue Exception => e rescue Exception => e
logger.error "[Error] compress : ===> #{e}" Rails.logger.error "[Error] compress : ===> #{e}"
end end
end end

@ -1,7 +1,348 @@
// Generated by CoffeeScript 1.9.0
/*
paste.js is an interface to read data ( text / image ) from clipboard in different browsers. It also contains several hacks.
https://github.com/layerssss/paste.js
*/
(function() {
var $, Paste, createHiddenEditable, dataURLtoBlob;
$ = window.jQuery;
$.paste = function(pasteContainer) {
var pm;
if (typeof console !== "undefined" && console !== null) {
console.log("DEPRECATED: This method is deprecated. Please use $.fn.pastableNonInputable() instead.");
}
pm = Paste.mountNonInputable(pasteContainer);
return pm._container;
};
$.fn.pastableNonInputable = function() {
var el, _i, _len;
for (_i = 0, _len = this.length; _i < _len; _i++) {
el = this[_i];
Paste.mountNonInputable(el);
}
return this;
};
$.fn.pastableTextarea = function() {
var el, _i, _len;
for (_i = 0, _len = this.length; _i < _len; _i++) {
el = this[_i];
Paste.mountTextarea(el);
}
return this;
};
$.fn.pastableContenteditable = function() {
var el, _i, _len;
for (_i = 0, _len = this.length; _i < _len; _i++) {
el = this[_i];
Paste.mountContenteditable(el);
}
return this;
};
dataURLtoBlob = function(dataURL, sliceSize) {
var b64Data, byteArray, byteArrays, byteCharacters, byteNumbers, contentType, i, m, offset, slice, _ref;
if (sliceSize == null) {
sliceSize = 512;
}
if (!(m = dataURL.match(/^data\:([^\;]+)\;base64\,(.+)$/))) {
return null;
}
_ref = m, m = _ref[0], contentType = _ref[1], b64Data = _ref[2];
byteCharacters = atob(b64Data);
byteArrays = [];
offset = 0;
while (offset < byteCharacters.length) {
slice = byteCharacters.slice(offset, offset + sliceSize);
byteNumbers = new Array(slice.length);
i = 0;
while (i < slice.length) {
byteNumbers[i] = slice.charCodeAt(i);
i++;
}
byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
offset += sliceSize;
}
return new Blob(byteArrays, {
type: contentType
});
};
createHiddenEditable = function() {
return $(document.createElement('div')).attr('contenteditable', true).css({
width: 1,
height: 1,
position: 'fixed',
left: -100,
overflow: 'hidden'
});
};
Paste = (function() {
Paste.prototype._target = null;
Paste.prototype._container = null;
Paste.mountNonInputable = function(nonInputable) {
var paste;
paste = new Paste(createHiddenEditable().appendTo(nonInputable), nonInputable);
$(nonInputable).on('click', (function(_this) {
return function() {
return paste._container.focus();
};
})(this));
paste._container.on('focus', (function(_this) {
return function() {
return $(nonInputable).addClass('pastable-focus');
};
})(this));
return paste._container.on('blur', (function(_this) {
return function() {
return $(nonInputable).removeClass('pastable-focus');
};
})(this));
};
Paste.mountTextarea = function(textarea) {
var ctlDown, paste;
if (-1 !== navigator.userAgent.toLowerCase().indexOf('chrome')) {
return this.mountContenteditable(textarea);
}
paste = new Paste(createHiddenEditable().insertBefore(textarea), textarea);
ctlDown = false;
$(textarea).on('keyup', function(ev) {
var _ref;
if ((_ref = ev.keyCode) === 17 || _ref === 224) {
return ctlDown = false;
}
});
$(textarea).on('keydown', function(ev) {
var _ref;
if ((_ref = ev.keyCode) === 17 || _ref === 224) {
ctlDown = true;
}
if (ctlDown && ev.keyCode === 86) {
return paste._container.focus();
}
});
$(paste._target).on('pasteImage', (function(_this) {
return function() {
return $(textarea).focus();
};
})(this));
$(paste._target).on('pasteText', (function(_this) {
return function() {
return $(textarea).focus();
};
})(this));
$(textarea).on('focus', (function(_this) {
return function() {
return $(textarea).addClass('pastable-focus');
};
})(this));
return $(textarea).on('blur', (function(_this) {
return function() {
return $(textarea).removeClass('pastable-focus');
};
})(this));
};
Paste.mountContenteditable = function(contenteditable) {
var paste;
paste = new Paste(contenteditable, contenteditable);
$(contenteditable).on('focus', (function(_this) {
return function() {
return $(contenteditable).addClass('pastable-focus');
};
})(this));
return $(contenteditable).on('blur', (function(_this) {
return function() {
return $(contenteditable).removeClass('pastable-focus');
};
})(this));
};
function Paste(_at__container, _at__target) {
this._container = _at__container;
this._target = _at__target;
this._container = $(this._container);
this._target = $(this._target).addClass('pastable');
this._container.on('paste', (function(_this) {
return function(ev) {
var clipboardData, file, item, reader, text, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _results;
if (((_ref = ev.originalEvent) != null ? _ref.clipboardData : void 0) != null) {
clipboardData = ev.originalEvent.clipboardData;
if (clipboardData.items) {
_ref1 = clipboardData.items;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
item = _ref1[_i];
if (item.type.match(/^image\//)) {
reader = new FileReader();
reader.onload = function(event) {
return _this._handleImage(event.target.result);
};
reader.readAsDataURL(item.getAsFile());
}
if (item.type === 'text/plain') {
item.getAsString(function(string) {
return _this._target.trigger('pasteText', {
text: string
});
});
}
}
} else {
if (-1 !== Array.prototype.indexOf.call(clipboardData.types, 'text/plain')) {
text = clipboardData.getData('Text');
_this._target.trigger('pasteText', {
text: text
});
}
_this._checkImagesInContainer(function(src) {
return _this._handleImage(src);
});
}
}
if (clipboardData = window.clipboardData) {
if ((_ref2 = (text = clipboardData.getData('Text'))) != null ? _ref2.length : void 0) {
return _this._target.trigger('pasteText', {
text: text
});
} else {
_ref3 = clipboardData.files;
_results = [];
for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
file = _ref3[_j];
_this._handleImage(URL.createObjectURL(file));
_results.push(_this._checkImagesInContainer(function() {}));
}
return _results;
}
}
};
})(this));
}
Paste.prototype._handleImage = function(src) {
var loader;
loader = new Image();
loader.onload = (function(_this) {
return function() {
var blob, canvas, ctx, dataURL;
canvas = document.createElement('canvas');
canvas.width = loader.width;
canvas.height = loader.height;
ctx = canvas.getContext('2d');
ctx.drawImage(loader, 0, 0, canvas.width, canvas.height);
dataURL = null;
try {
dataURL = canvas.toDataURL('image/png');
blob = dataURLtoBlob(dataURL);
} catch (_error) {}
if (dataURL) {
return _this._target.trigger('pasteImage', {
blob: blob,
dataURL: dataURL,
width: loader.width,
height: loader.height
});
}
};
})(this);
return loader.src = src;
};
Paste.prototype._checkImagesInContainer = function(cb) {
var img, timespan, _i, _len, _ref;
timespan = Math.floor(1000 * Math.random());
_ref = this._container.find('img');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
img = _ref[_i];
img["_paste_marked_" + timespan] = true;
}
return setTimeout((function(_this) {
return function() {
var _j, _len1, _ref1, _results;
_ref1 = _this._container.find('img');
_results = [];
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
img = _ref1[_j];
if (!img["_paste_marked_" + timespan]) {
cb(img.src);
}
_results.push($(img).remove());
}
return _results;
};
})(this), 1);
};
return Paste;
})();
}).call(this);
KindEditor.plugin('paste', function(K) { KindEditor.plugin('paste', function(K) {
var editor = this, var editor = this,
name = 'paste'; name = 'paste';
var contentWindow = document.getElementsByTagName('iframe')[0].contentWindow; var contentWindow = document.getElementsByTagName('iframe')[0].contentWindow;
var nodeBody = contentWindow.document.getElementsByTagName('body')[0];
console.log(nodeBody);
$(nodeBody).pastableContenteditable();
dataURItoBlob = function(dataURI) {
// convert base64/URLEncoded data component to raw binary data held in a string
var byteString;
if (dataURI.split(',')[0].indexOf('base64') >= 0)
byteString = atob(dataURI.split(',')[1]);
else
byteString = unescape(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
// write the bytes of the string to a typed array
var ia = new Uint8Array(byteString.length);
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return new Blob([ia], {type:mimeString});
};
$(nodeBody).on('pasteImage', function(ev, data) {
console.log('pasteImage');
console.log("dataURL: " + data.dataURL);
console.log("width: " + data.width);
console.log("height: " + data.height);
console.log(data.blob);
var blob = dataURItoBlob(data.dataURL);
if (data.blob !== null) {
var data = new FormData();
data.append("imgFile",blob, "imageFilename.png");
console.log(data);
$.ajax({
url: '/kindeditor/upload?dir=image',
contentType: false,
type: 'POST',
data: data,
processData: false,
success: function(data) {
editor.exec('insertimage', JSON.parse(data).url);
}
});
}
});
return;
contentWindow.document.getElementsByTagName('body')[0].onpaste = function(event) { contentWindow.document.getElementsByTagName('body')[0].onpaste = function(event) {
// use event.originalEvent.clipboard for newer chrome versions // use event.originalEvent.clipboard for newer chrome versions
var items = (event.clipboardData || event.originalEvent.clipboardData).items; var items = (event.clipboardData || event.originalEvent.clipboardData).items;
@ -20,6 +361,7 @@ KindEditor.plugin('paste', function(K) {
console.log(event.target.result); // data url! console.log(event.target.result); // data url!
var data = new FormData(); var data = new FormData();
data.append("imgFile", blob, "imageFilename.png"); data.append("imgFile", blob, "imageFilename.png");
console.log(blob);
$.ajax({ $.ajax({
url: '/kindeditor/upload?dir=image', url: '/kindeditor/upload?dir=image',
contentType: false, contentType: false,

@ -578,7 +578,7 @@ function setupHeartBeat(){
function setupAjaxIndicator() { function setupAjaxIndicator() {
$('#ajax-indicator').bind('ajaxSend', function(event, xhr, settings) { $('#ajax-indicator').bind('ajaxSend', function(event, xhr, settings) {
if(settings && settings.url && settings.url.endsWith('account/heartbeat')){ if(settings && settings.url && settings.url.match(/account\/heartbeat$/)){
return; return;
} }
if ($('.ajax-loading').length === 0 && settings.contentType != 'application/octet-stream') { if ($('.ajax-loading').length === 0 && settings.contentType != 'application/octet-stream') {

@ -52,13 +52,14 @@ function ajaxUpload(file, fileSpan, inputEl) {
fileSpan.removeClass('ajax-loading'); fileSpan.removeClass('ajax-loading');
var form = fileSpan.parents('form'); var form = fileSpan.parents('form');
if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) { // if (form.queue('upload').length == 0 && ajaxUpload.uploading == 0) {
$('input:submit', form).removeAttr('disabled'); // $('input:submit', form).removeAttr('disabled');
} // }
form.dequeue('upload'); // form.dequeue('upload');
}); });
} }
var progressSpan = $('#upload_progressbar'); var progressSpan = $('#upload_progressbar');
progressSpan.progressbar(); progressSpan.progressbar();
fileSpan.addClass('ajax-waiting'); fileSpan.addClass('ajax-waiting');

@ -151,45 +151,48 @@ function submit_edit_course(id)
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////课程讨论区 //////////////////////////////////////////////////////////////课程讨论区
function regexSubject() function regexSubject(id) {
{ var subjectid = "#message_subject" + id ;
var content = $.trim($("#message_subject").val()); var content = $.trim($(subjectid).val());
if(content.length ==0) var message = "#subject_span" + id;
{ if (content.length == 0) {
$("#subject_span").text("主题不能为空"); $(message).text("主题不能为空");
$("#subject_span").css('color','#ff0000'); $(message).css('color', '#ff0000');
return false; return false;
} }
else else {
{ $(message).text("填写正确");
$("#subject_span").text("填写正确"); $(message).css('color', '#008000');
$("#subject_span").css('color','#008000');
return true; return true;
} }
return false; return false;
} }
function regexContent() function regexContent(id) {
{ var contentid = "#message_content" + id;
var content = message_content_editor.html(); var message = "#message_content_span"+ id;
if(content.length ==0) var content = $.trim($(contentid).val());
{ if (content.length == 0) {
$("#message_content_span").text("描述不能为空"); $(message).text("描述不能为空");
$("#message_content_span").css('color','#ff0000'); $(message).css('color', '#ff0000');
return false; return false;
} }
else else {
{ $(message).text("填写正确");
$("#message_content_span").text("填写正确"); $(message).css('color', '#008000');
$("#message_content_span").css('color','#008000');
return true; return true;
} }
return false; return false;
} }
function submitCoursesBoard()
{ // 项目讨论区编辑和提交
message_content_editor.sync(); function submitProjectsBoard(id) {
if(regexSubject()&&regexContent()){$("#message-form").submit();} var formid = "#message-form" + id;
if (regexSubject(id) && regexContent(id)) {
$(formid).submit();
}
} }
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////// 课程通知 /////////////////////////////////////////////////////////////// 课程通知
function regexTitle() function regexTitle()

File diff suppressed because it is too large Load Diff

@ -0,0 +1,217 @@
/*
* jQuery Iframe Transport Plugin 1.8.3
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, require, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
// Helper variable to create unique names for the transport iframes:
var counter = 0;
// The iframe transport accepts four additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
// overrides the name property of the file input field(s),
// can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
// options.initialIframeSrc: the URL of the initial iframe src,
// by default set to "javascript:false;"
$.ajaxTransport('iframe', function (options) {
if (options.async) {
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6:
/*jshint scripturl: true */
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
/*jshint scripturl: false */
form,
iframe,
addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar = /\?/.test(options.url) ? '&' : '?';
// XDomainRequest only supports GET and POST:
if (options.type === 'DELETE') {
options.url = options.url + addParamChar + '_method=DELETE';
options.type = 'POST';
} else if (options.type === 'PUT') {
options.url = options.url + addParamChar + '_method=PUT';
options.type = 'POST';
} else if (options.type === 'PATCH') {
options.url = options.url + addParamChar + '_method=PATCH';
options.type = 'POST';
}
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
counter += 1;
iframe = $(
'<iframe src="' + initialIframeSrc +
'" name="iframe-transport-' + counter + '"></iframe>'
).bind('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
try {
response = iframe.contents();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length || !response[0].firstChild) {
throw new Error();
}
} catch (e) {
response = undefined;
}
// The complete callback returns the
// iframe content document as response object:
completeCallback(
200,
'success',
{'iframe': response}
);
// Fix for IE endless progress bar activity bug
// (happens on form submits to iframe targets):
$('<iframe src="' + initialIframeSrc + '"></iframe>')
.appendTo(form);
window.setTimeout(function () {
// Removing the form in a setTimeout call
// allows Chrome's developer tools to display
// the response result
form.remove();
}, 0);
});
form
.prop('target', iframe.prop('name'))
.prop('action', options.url)
.prop('method', options.type);
if (options.formData) {
$.each(options.formData, function (index, field) {
$('<input type="hidden"/>')
.prop('name', field.name)
.val(field.value)
.appendTo(form);
});
}
if (options.fileInput && options.fileInput.length &&
options.type === 'POST') {
fileInputClones = options.fileInput.clone();
// Insert a clone for each file input field:
options.fileInput.after(function (index) {
return fileInputClones[index];
});
if (options.paramName) {
options.fileInput.each(function (index) {
$(this).prop(
'name',
paramNames[index] || options.paramName
);
});
}
// Appending the file input fields to the hidden form
// removes them from their original location:
form
.append(options.fileInput)
.prop('enctype', 'multipart/form-data')
// enctype must be set as encoding for IE:
.prop('encoding', 'multipart/form-data');
// Remove the HTML5 form attribute from the input(s):
options.fileInput.removeAttr('form');
}
form.submit();
// Insert the file input fields at their original location
// by replacing the clones with the originals:
if (fileInputClones && fileInputClones.length) {
options.fileInput.each(function (index, input) {
var clone = $(fileInputClones[index]);
// Restore the original name and form properties:
$(input)
.prop('name', clone.prop('name'))
.attr('form', clone.attr('form'));
clone.replaceWith(input);
});
}
});
form.append(iframe).appendTo(document.body);
},
abort: function () {
if (iframe) {
// javascript:false as iframe src aborts the request
// and prevents warning popups on HTTPS in IE6.
// concat is used to avoid the "Script URL" JSLint error:
iframe
.unbind('load')
.prop('src', initialIframeSrc);
}
if (form) {
form.remove();
}
}
};
}
});
// The iframe transport returns the iframe content document as response.
// The following adds converters from iframe to text, json, html, xml
// and script.
// Please note that the Content-Type for JSON responses has to be text/plain
// or text/html, if the browser doesn't include application/json in the
// Accept header, else IE will show a download dialog.
// The Content-Type for XML responses on the other hand has to be always
// application/xml or text/xml, so IE properly parses the XML response.
// See also
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
$.ajaxSetup({
converters: {
'iframe text': function (iframe) {
return iframe && $(iframe[0].body).text();
},
'iframe json': function (iframe) {
return iframe && $.parseJSON($(iframe[0].body).text());
},
'iframe html': function (iframe) {
return iframe && $(iframe[0].body).html();
},
'iframe xml': function (iframe) {
var xmlDoc = iframe && iframe[0];
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
$(xmlDoc.body).html());
},
'iframe script': function (iframe) {
return iframe && $.globalEval($(iframe[0].body).text());
}
}
});
}));

@ -0,0 +1,563 @@
/*! jQuery UI - v1.11.1+CommonJS - 2014-09-17
* http://jqueryui.com
* Includes: widget.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([ "jquery" ], factory );
} else if (typeof exports === "object") {
// Node/CommonJS:
factory(require("jquery"));
} else {
// Browser globals
factory( jQuery );
}
}(function( $ ) {
/*!
* jQuery UI Widget 1.11.1
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/
var widget_uuid = 0,
widget_slice = Array.prototype.slice;
$.cleanData = (function( orig ) {
return function( elems ) {
var events, elem, i;
for ( i = 0; (elem = elems[i]) != null; i++ ) {
try {
// Only trigger remove when necessary to save time
events = $._data( elem, "events" );
if ( events && events.remove ) {
$( elem ).triggerHandler( "remove" );
}
// http://bugs.jquery.com/ticket/8235
} catch( e ) {}
}
orig( elems );
};
})( $.cleanData );
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// proxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
namespace = name.split( "." )[ 0 ];
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
$[ namespace ] = $[ namespace ] || {};
existingConstructor = $[ namespace ][ name ];
constructor = $[ namespace ][ name ] = function( options, element ) {
// allow instantiation without "new" keyword
if ( !this._createWidget ) {
return new constructor( options, element );
}
// allow instantiation without initializing for simple inheritance
// must use "new" keyword (the code above always passes args)
if ( arguments.length ) {
this._createWidget( options, element );
}
};
// extend with the existing constructor to carry over any static properties
$.extend( constructor, existingConstructor, {
version: prototype.version,
// copy the object used to create the prototype in case we need to
// redefine the widget later
_proto: $.extend( {}, prototype ),
// track widgets that inherit from this widget in case this widget is
// redefined after a widget inherits from it
_childConstructors: []
});
basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
basePrototype.options = $.widget.extend( {}, basePrototype.options );
$.each( prototype, function( prop, value ) {
if ( !$.isFunction( value ) ) {
proxiedPrototype[ prop ] = value;
return;
}
proxiedPrototype[ prop ] = (function() {
var _super = function() {
return base.prototype[ prop ].apply( this, arguments );
},
_superApply = function( args ) {
return base.prototype[ prop ].apply( this, args );
};
return function() {
var __super = this._super,
__superApply = this._superApply,
returnValue;
this._super = _super;
this._superApply = _superApply;
returnValue = value.apply( this, arguments );
this._super = __super;
this._superApply = __superApply;
return returnValue;
};
})();
});
constructor.prototype = $.widget.extend( basePrototype, {
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,
widgetName: name,
widgetFullName: fullName
});
// If this widget is being redefined then we need to find all widgets that
// are inheriting from it and redefine all of them so that they inherit from
// the new version of this widget. We're essentially trying to replace one
// level in the prototype chain.
if ( existingConstructor ) {
$.each( existingConstructor._childConstructors, function( i, child ) {
var childPrototype = child.prototype;
// redefine the child widget using the same prototype that was
// originally used, but inherit from the new version of the base
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
});
// remove the list of existing child constructors from the old constructor
// so the old child constructors can be garbage collected
delete existingConstructor._childConstructors;
} else {
base._childConstructors.push( constructor );
}
$.widget.bridge( name, constructor );
return constructor;
};
$.widget.extend = function( target ) {
var input = widget_slice.call( arguments, 1 ),
inputIndex = 0,
inputLength = input.length,
key,
value;
for ( ; inputIndex < inputLength; inputIndex++ ) {
for ( key in input[ inputIndex ] ) {
value = input[ inputIndex ][ key ];
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
// Clone objects
if ( $.isPlainObject( value ) ) {
target[ key ] = $.isPlainObject( target[ key ] ) ?
$.widget.extend( {}, target[ key ], value ) :
// Don't extend strings, arrays, etc. with objects
$.widget.extend( {}, value );
// Copy everything else by reference
} else {
target[ key ] = value;
}
}
}
}
return target;
};
$.widget.bridge = function( name, object ) {
var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = widget_slice.call( arguments, 1 ),
returnValue = this;
// allow multiple hashes to be passed on init
options = !isMethodCall && args.length ?
$.widget.extend.apply( null, [ options ].concat(args) ) :
options;
if ( isMethodCall ) {
this.each(function() {
var methodValue,
instance = $.data( this, fullName );
if ( options === "instance" ) {
returnValue = instance;
return false;
}
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
}
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
}
methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue && methodValue.jquery ?
returnValue.pushStack( methodValue.get() ) :
methodValue;
return false;
}
});
} else {
this.each(function() {
var instance = $.data( this, fullName );
if ( instance ) {
instance.option( options || {} );
if ( instance._init ) {
instance._init();
}
} else {
$.data( this, fullName, new object( options, this ) );
}
});
}
return returnValue;
};
};
$.Widget = function( /* options, element */ ) {};
$.Widget._childConstructors = [];
$.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: false,
// callbacks
create: null
},
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widget_uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
this.options = $.widget.extend( {},
this.options,
this._getCreateOptions(),
options );
this.bindings = $();
this.hoverable = $();
this.focusable = $();
if ( element !== this ) {
$.data( element, this.widgetFullName, this );
this._on( true, this.element, {
remove: function( event ) {
if ( event.target === element ) {
this.destroy();
}
}
});
this.document = $( element.style ?
// element within the document
element.ownerDocument :
// element is window or document
element.document || element );
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
}
this._create();
this._trigger( "create", null, this._getCreateEventData() );
this._init();
},
_getCreateOptions: $.noop,
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,
destroy: function() {
this._destroy();
// we can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
.unbind( this.eventNamespace )
.removeData( this.widgetFullName )
// support: jquery <1.6.3
// http://bugs.jquery.com/ticket/9413
.removeData( $.camelCase( this.widgetFullName ) );
this.widget()
.unbind( this.eventNamespace )
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetFullName + "-disabled " +
"ui-state-disabled" );
// clean up events and states
this.bindings.unbind( this.eventNamespace );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
},
_destroy: $.noop,
widget: function() {
return this.element;
},
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
if ( arguments.length === 0 ) {
// don't return a reference to the internal hash
return $.widget.extend( {}, this.options );
}
if ( typeof key === "string" ) {
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
options = {};
parts = key.split( "." );
key = parts.shift();
if ( parts.length ) {
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
for ( i = 0; i < parts.length - 1; i++ ) {
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
curOption = curOption[ parts[ i ] ];
}
key = parts.pop();
if ( arguments.length === 1 ) {
return curOption[ key ] === undefined ? null : curOption[ key ];
}
curOption[ key ] = value;
} else {
if ( arguments.length === 1 ) {
return this.options[ key ] === undefined ? null : this.options[ key ];
}
options[ key ] = value;
}
}
this._setOptions( options );
return this;
},
_setOptions: function( options ) {
var key;
for ( key in options ) {
this._setOption( key, options[ key ] );
}
return this;
},
_setOption: function( key, value ) {
this.options[ key ] = value;
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled", !!value );
// If the widget is becoming disabled, then nothing is interactive
if ( value ) {
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}
}
return this;
},
enable: function() {
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOptions({ disabled: true });
},
_on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
// no suppressDisabledCheck flag, shuffle arguments
if ( typeof suppressDisabledCheck !== "boolean" ) {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
}
// no element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
element = this.element;
delegateElement = this.widget();
} else {
element = delegateElement = $( element );
this.bindings = this.bindings.add( element );
}
$.each( handlers, function( event, handler ) {
function handlerProxy() {
// allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - disabled class as method for disabling individual parts
if ( !suppressDisabledCheck &&
( instance.options.disabled === true ||
$( this ).hasClass( "ui-state-disabled" ) ) ) {
return;
}
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
// copy the guid so direct unbinding works
if ( typeof handler !== "string" ) {
handlerProxy.guid = handler.guid =
handler.guid || handlerProxy.guid || $.guid++;
}
var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
eventName = match[1] + instance.eventNamespace,
selector = match[2];
if ( selector ) {
delegateElement.delegate( selector, eventName, handlerProxy );
} else {
element.bind( eventName, handlerProxy );
}
});
},
_off: function( element, eventName ) {
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
element.unbind( eventName ).undelegate( eventName );
},
_delay: function( handler, delay ) {
function handlerProxy() {
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
var instance = this;
return setTimeout( handlerProxy, delay || 0 );
},
_hoverable: function( element ) {
this.hoverable = this.hoverable.add( element );
this._on( element, {
mouseenter: function( event ) {
$( event.currentTarget ).addClass( "ui-state-hover" );
},
mouseleave: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-hover" );
}
});
},
_focusable: function( element ) {
this.focusable = this.focusable.add( element );
this._on( element, {
focusin: function( event ) {
$( event.currentTarget ).addClass( "ui-state-focus" );
},
focusout: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-focus" );
}
});
},
_trigger: function( type, event, data ) {
var prop, orig,
callback = this.options[ type ];
data = data || {};
event = $.Event( event );
event.type = ( type === this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type ).toLowerCase();
// the original event may come from any element
// so we need to reset the target on the new event
event.target = this.element[ 0 ];
// copy original event properties over to the new event
orig = event.originalEvent;
if ( orig ) {
for ( prop in orig ) {
if ( !( prop in event ) ) {
event[ prop ] = orig[ prop ];
}
}
}
this.element.trigger( event, data );
return !( $.isFunction( callback ) &&
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
event.isDefaultPrevented() );
}
};
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
if ( typeof options === "string" ) {
options = { effect: options };
}
var hasOptions,
effectName = !options ?
method :
options === true || typeof options === "number" ?
defaultEffect :
options.effect || defaultEffect;
options = options || {};
if ( typeof options === "number" ) {
options = { duration: options };
}
hasOptions = !$.isEmptyObject( options );
options.complete = callback;
if ( options.delay ) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
element[ method ]( options );
} else if ( effectName !== method && element[ effectName ] ) {
element[ effectName ]( options.duration, options.easing, callback );
} else {
element.queue(function( next ) {
$( this )[ method ]();
if ( callback ) {
callback.call( element[ 0 ] );
}
next();
});
}
};
});
var widget = $.widget;
}));

@ -0,0 +1,23 @@
$(function() {
var $upload_file = $('.upload_file');
$('.upload_file').fileupload({
url: '/upload_avatar.json?source_type=' + $('.upload_file').attr('data-source-type') +
'&source_id=' + $('.upload_file').attr('data-source-id'),
formData: function(form) {
var data = form.serializeArray();
var auth = null;
for(var key in data){
if(data[key].name == "authenticity_token"){
auth = data[key];break;
}
}
return [auth];
},
done: function(e, data) {
var imgSpan = jQuery('#avatar_image');
imgSpan.attr({
"src": data.result.text ? data.result.text() : data.result
});
}
});
});

@ -144,42 +144,51 @@ $(function(){
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////项目讨论区 //////////////////////////////////////////////////////////////项目讨论区
function regexSubject() { function regexSubject(id) {
var content = $.trim($("#message_subject").val());
var subjectid = "#message_subject" + id ;
var content = $.trim($(subjectid).val());
var message = "#subject_span" + id;
if (content.length == 0) { if (content.length == 0) {
$("#subject_span").text("主题不能为空"); $(message).text("主题不能为空");
$("#subject_span").css('color', '#ff0000'); $(message).css('color', '#ff0000');
return false; return false;
} }
else { else {
$("#subject_span").text("填写正确"); $(message).text("填写正确");
$("#subject_span").css('color', '#008000'); $(message).css('color', '#008000');
return true; return true;
} }
return false; return false;
} }
function regexContent() { function regexContent(id) {
var content = $.trim($("#message_content").val());
var contentid = "#message_content" + id;
var message = "#message_content_span"+ id;
var content = $.trim($(contentid).val());
if (content.length == 0) { if (content.length == 0) {
$("#message_content_span").text("描述不能为空");
$("#message_content_span").css('color', '#ff0000'); $(message).text("描述不能为空");
$(message).css('color', '#ff0000');
return false; return false;
} }
else { else {
$("#message_content_span").text("填写正确");
$("#message_content_span").css('color', '#008000'); $(message).text("填写正确");
$(message).css('color', '#008000');
return true; return true;
} }
return false; return false;
} }
// 项目讨论区编辑和提交 // 项目讨论区编辑和提交
function submitProjectsBoard() { function submitProjectsBoard(id) {
if (regexSubject() && regexContent()) { var formid = "#message-form" + id;
$("#message-form").submit();
if (regexSubject(id) && regexContent(id)) {
$(formid).submit();
} }
} }
// 提交新闻 // 提交新闻
function regexTitle() { function regexTitle() {
var name = $("#news_title").val(); var name = $("#news_title").val();

@ -7,263 +7,8 @@ h2, .wiki h1 {font-size: 20px;}
h3, .wiki h2 {font-size: 15px; padding-left: 5px} h3, .wiki h2 {font-size: 15px; padding-left: 5px}
h4, .wiki h3 {font-size: 13px;} h4, .wiki h3 {font-size: 13px;}
h4 {border-bottom: 1px dotted #bbb;} h4 {border-bottom: 1px dotted #bbb;}
/*huang*/
/*上传图片处理*/
.upload_img img{max-width: 100%;}
.link_file{ background:url(../images/pic_file.png) 0 0px no-repeat !important; padding-left:20px !important; color:#64bdd9 !important; }
/****翻页***/
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}
ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3px;}
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
/*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}*/
.wlist_select a{background-color: #64bdd9;cursor: default;color:#fff;}
/*a.c_white{ color:#fff; !important;}*/
/*20150203项目界面优化样式 By: huangjignquan*/
.project_new{font-size: 15px; padding: 5px;}
.project_new .description{font-size: 12px; color: #ff7450; margin-bottom: 2px;}
/*20150205新的项目界面 By: huangjingquan*/
ol,ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; }
.ml10{ margin-left:10px;}
.ml20{ margin-left:20px;}
.ml25{ margin-left:25px;}
.ml30{ margin-left:30px;}
.mr10{ margin-right:10px;}
.mb5{ margin-bottom:5px;}
.mb10{ margin-bottom:10px;}
.f12{font-size:12px; font-weight:normal;}
.c_orange{color:#ff5722;}
.fl{ float: left;}
.fr{ float:right;}
.project_h4{ font-size:14px; color:#3b3b3b;}
.project_watch_new{color: #fff !important;font-size:12px; display:block !important; padding: 0px 4px !important; margin-right: 10px !important; height: 20px !important; line-height: 21px !important;padding-top:1px !important; background: none repeat scroll 0% 0% #64BDD9 !important;}
.project_content{ width:940px; margin:10px auto;}
.project_left{ float:left;}
.project_right{ width:670px; float:left;background:#fff; padding:10px;}
/*项目信息*/
.project_info{ background:#fff; padding:10px 8px 0px 10px; width:222px;}
.pr_info_id{ width:137px; color:#5a5a5a; font-size:14px;}
.pr_info_join{}
.pr_info_join a{ color:#fff; display:block; padding:0 5px; margin-right:10px; float:left; height:22px; background:#64bdd9; text-align:center; }
.pr_info_join a:hover{ background:#41a8c8;}
.pr_info_name{ color:#3e4040; font-size:14px; line-height:1.5;}
.pr_info_name a:hover{ color:#3ca5c6;}
.pr_info_score{ font-size:14px; color:#3e4040; }
.pr_info_score a{ color:#ff7143;}
.pr_info_score a:hover{ color:#64bdd9;}
.img_private{ background:url(../images/new_project/img_project.png) 0 0 no-repeat; width:32px; height:16px; color:#fff; font-size:12px; padding-left:7px; }
a.info_foot_num{ font-weight: bold; color:#3ca5c6; }
.pr_info_foot{ color:#7f7f7f; margin-top:5px; font-size:12px }
a:hover.info_foot_num{ color:#2390b2;}
/*左侧导航*/
.subNavBox{width:222px; background:#fff;margin:10px 10px 0 0;}
.subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6;line-height:28px;padding-left:10px;background-color:#fff;}
.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
.subNav_jiantou:hover{color:#0781b4; }
.currentDd{color:#0781b4; }
.currentDt{background-color:#fff; }
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:20px; padding:0px 5px; text-align:center; margin-top:5px; margin-left:82px;}
a.ml95{ margin-left:97px; float: right;}
a.ml105{ margin-left:120px;}
a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:5px 0px 10px 10px; background:#fff; color:#6d6d6d;}
.course_description{max-height: 103px;overflow:hidden;}
.course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;}
.lg-foot:hover{ color:#787b7e;}
/****标签(和资源库的tag样式一致)***/
.project_Label{ width:220px; padding-left:10px !important; padding-right:10px; background:#fff; margin-top:10px;}
a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; }
.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;}
.re_tag{ width: auto; padding-left:4px;padding-right: 4px; height:22px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px;font-size:12px; }
.re_tag a{ color:#0d90c3;}
.tag_h span,.tag_h a{ margin-top:5px;}
/*右侧内容--动态*/
/*右侧内容--动态*/
.project_r_h{height:40px; background:#eaeaea; margin-bottom:10px;}
.project_h2{ background:#64bdd9; color:#fff; height:29px; width:90px; text-align:center; font-weight:normal; padding-top:10px; font-size:16px;padding-left:10px;}
.project_r_box{ border:1px solid #e2e1e1; width:670px; margin-top:10px;}
.project_h3 { color:#646464; font-size:14px; padding:0 10px; border-bottom:1px solid #e2e1e1;}
a.more{ float:right; font-size:12px; font-weight:normal; color:#a9a9a9; margin-top:3px;}
a:hover.more{ color:#64bdd9;}
.project_box_ul{ padding:0 10px;}
.project_box_list{ padding:10px 0; border-bottom:1px dashed #e2e1e1; padding-left:30px; color:#6f6c6c;}
.img_problem{ background:url(../images/new_project/img_project.png) 0 -20px no-repeat;}
.img_talk{ background:url(../images/new_project/img_project.png) 0 -62px no-repeat;}
.img_ziyuan{ background:url(../images/new_project/img_project.png) 0 -115px no-repeat;}
.img_edition{ background:url(../images/new_project/img_project.png) 0 -167px no-repeat;}
.project_name{ color:#058c42;}
.project_name:hover{ color:#016f33;}
.project_txt{ color:#0781b4; width:445px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.project_txt:hover{ color:#066e9a;}
.noline{ border-bottom:none;}
/*弹框*/
.floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;}
.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;}
.box_close:hover{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
/*邮件邀请*/
.box_main{ width:345px; margin:0 auto;}
.box_main02{ width:390px; margin:15px auto;}
.box_h3{ color:#15bccf; text-align:center; font-size:16px;}
.box_p{ color:#404040; margin-bottom:5px;}
.fb_item{ color:#919191; border:1px solid #919191; height:25px; margin-bottom:10px; padding-left:5px; width:290px;}
.icon_addm{ background:url(../images/img_floatbox.png) 0 -33px no-repeat; width:16px; height:16px; display:block; margin:5px 0 0 5px;}
.icon_addm:hover{background:url(../images/img_floatbox.png) 0 -61px no-repeat; }
.icon_removem{ background:url(../images/img_floatbox.png) -22px -33px no-repeat;width:16px; height:16px; display:block; margin:5px 0 0 5px}
.icon_removem:hover{background:url(../images/img_floatbox.png) -22px -61px no-repeat;}
.btn_free{ background:#ff5722; display:block; width:80px; text-align:center; color:#fff !important; height:25px; padding-top:5px; margin-bottom:10px;}
.btn_free:hover{ background:#d63502;text-decoration:none;}
/*成员邀请*/
.invi_search{ margin-left:25px;}
.invi_search_input{ border:1px solid #15bccf; width:180px; height:24px; color:#9b9b9b; padding-left:5px;}
.invi_search_btn{ background:#15bccf; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #15bccf; padding-top:2px; cursor:pointer;}
.invi_search_btn:hover{ background:#0da1b2; border:1px solid #0da1b2;}
.rolebox{ margin:10px 0;margin-left:-38px;}
/*问题跟踪*/
.problem_top{ margin:10px 0 ;}
.problem_search_input{ border:1px solid #64bdd9; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:10px;}
.problem_search_btn{ background:#64bdd9; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #64bdd9; padding-top:2px; cursor:pointer;}
.problem_search_btn:hover{ background:#3da1c1; border:1px solid #3da1c1;}
.problem_new_btn{ margin-left:10px; border:1px solid #ff7143; color:#ff7143 !important; width:60px; height:19px; font-size:12px; text-align:center; padding-top:4px;margin-top:-2px;}
.problem_new_btn:hover{ background:#ff7143; color:#fff !important;}
.problem_p{ color:#535252; margin-top:5px;padding-right:15px;}
.problem_p span{ color:#ff3e00;}
.problem_pic{ display:block; width:42px; height:42px; padding:3px; border:1px solid #e3e3e3; margin-top:5px;}
.problem_pic:hover{border:1px solid #64bdd9;}
.problem_txt{ width:610px; margin-left:10px; color:#777777;}
.problem_name{ color:#ff5722 !important;}
.problem_line{margin-top:5px;float:left;}
.problem_name:hover{ color:#d33503;}
.problem_tit{ color:#0781b4 !important; width:430px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.problem_tit:hover{ color:#09658c !important; }
.problem_main{ border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;}
/****翻页***/
.wlist{}
.wlist a{ float:right; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;}
.wlist_l a{ float:left; margin-right:3px; margin-left:0px;}
.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;}
.wlist_select a { background-color:#48aac9; color:#fff;}
/****讨论区***/
.talk_top{ margin:10px 0; font-size:14px; color:#4c4c4c;}
.talk_top span{ color:#ff7143;}
.talk_txt{ width:460px; margin-left:10px; color:#676868;}
.talk_up{ color:#f63c00;}
.talk_pic{width:32px; height:32px; padding:2px;}
.talk_btn{ background:#64bdd9; width:50px; height:22px; color:#fff; text-align:center; margin-top:9px; padding-top:2px;}
.talk_btn:hover{ background:#2a9dc1;}
/****讨论区内页***/
.mt0{ margin-top:0px;}
.talk_info{ color:#7d7d7d; margin-left:50px; margin-top:10px;}
.talk_edit{ color:#426e9a; margin-right:5px;}
.talk_edit:hover{ color:#ff5722;}
.talk_reply { background:#eeeeee; padding:10px; margin-bottom:10px;}
.talkpage_text{ border:1px solid #64bdd9; width:600px; color:#7d7d7d; padding:5px; margin:10px 0 10px 50px;}
/****新建讨论***/
.talk_new{ padding-left:15px; color:#4c4c4c;}
.c_red{ color:#F00;}
.talk_input{ border:1px solid #64bdd9; height:22px; width:595px; margin-bottom:10px;}
.talk_text{ border:1px solid #64bdd9; height:100px;width:595px; margin-bottom:10px;}
.talk_new ul li{ }
.view_span{font-weight:normal; color:#999;}
.sb{width:70px; height:26px; color:#606060;}
.ml60{ margin-left:60px;}
.blue_btn{ background:#64bdd9; display:block; font-size:14px;color:#fff; height:28px; width:50px; text-align:center; margin-left:10px; margin-top:10px;}
.blue_btn:hover{ background:#329cbd;}
.grey_btn{ background:#d9d9d9; color:#656565;}
.grey_btn:hover{ background:#717171; color:#fff;}
/****资源库***/
.f_l{ float:left;}
.f_r{ float:right;}
.resource a{ text-align:center;}
.b_lblue{ background:#64bdd9;}
.b_dblue{ background:#55a1b9; cursor:pointer;}
.f_b{ font-weight: bold;}
.c_blue{ color:#64bdd9;}
a.c_dblue{ color: #3ca5c6;}
a:hover.c_dblue{ color: #0781b4;}
.c_grey{ color:#999999;}
.c_grey02{ color:#666666;}
.f_14{ font-size:14px;}
.c_dblue{ color:#3e6d8e;}
.w90{width:90px;}
.ml10{margin-left:10px;}
.resource{ width:670px;}
.re_top{width:660px; height:40px; background:#eaeaea; padding:5px;}
.re_top input{ float:left;}
.re_search{ margin-top:7px; margin-left:5px;}
.re_schbox{ width:240px; height:24px; border:1px solid #64bdd9; color:#666666;}
.re_schbtn{ width:60px; height:26px; color:#fff; margin-right:5px; border:none; margin-left:0px; }
a.re_fabu { display:block; width:90px; height:35px; font-size:14px; color:#fff; text-align:center; padding-top:5px; }
a:hover.re_fabu{background:#55a1b9;}
.re_con{ margin:5px; width:665px;}
.re_con_top{color:#494949; }
.re_con_top span{ color:#999999; font-weight:bold;}
a.re_select{ display:block; width:88px; height:22px; border:1px solid #ff9900; color:#ff9900; margin-left:10px;}
a:hover.re_select{ background:#ff9900; color:#fff; text-decoration:none;}
.re_open{display:block; width:46px; height:22px; border:1px solid #64bdd9; color:#64bdd9; margin-left:10px;}
a:hover.re_open{ background:#64bdd9; color:#fff; text-decoration:none;}
a.re_de{ color:#6883b6; margin-left:15px;}
.re_con_box{ border-bottom:1px dashed #dadada; padding-bottom:10px; margin-bottom:10px;}
.upload_con { }
.upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;}
.upload_box{ width:430px; height:80px;}
a.upload_btn02{ display:block; float:left; margin-top:15px; width:80px; height:30px; text-align: center; color:#fff; font-size:14px; background:#15bccf; margin-right:15px;}
a:hover.upload_btn02{ background:#55a1b9;}
a.upload_btn_grey{background:#a3a3a3;}
a:hover.upload_btn_grey{background:#8a8a8a;}
.upload_btn{width:80px; height:26px;}
.upload_check{ margin-top:4px;}
/****其他未更新页面***/
.setting{ /*background:url(../images/setting.jpg) 0 0 no-repeat;*/ width:670px; height:443px;}
.newproblem{}
/*企业版样式*/
.content_syqy{ width:940px; height:400px; border:1px;}
.content_syqy .list{ font-size:14px; font-weight:normal; margin-left:10px; font-weight:bold; padding-top:10px}
.syqy_box{ margin-left:-30px; margin-top:5px;}
.syqy_box ul li{ float:left; margin-right:10px; border:1px solid #e3e3e3; width:215px; height:30px; padding:5px; padding-right:0px; margin-bottom:10px; overflow:hidden; text-overflow:ellipsis;font-size:14px; color:#464646;white-space: nowrap; }
.syqy_box ul li img{ float:left; margin-right:3px; }
.syqy_box ul li a { float:left;font-size:14px; color:#464646; height:30px; padding-top:4px; width: 175px; overflow:hidden; text-overflow:ellipsis;}
.syqy_box ul li a:hover{color:#15bccf;}
a.syqy_wenzi{ padding-bottom:10px; border:1px solid red;}
/*current position*/ /*current position*/
.enterprise_all{
padding-left: 20px;
}
.course_ad{
position:absolute;
visibility:visible;
background:#ffffff;
width:14%;
}
.ad_title{
color: #FFFFFF;
font-weight: bold;
}
.ad_content{
text-indent: 2em;
}
.contest_count{ .contest_count{
width: 20%; width: 20%;
height: 60px; height: 60px;
@ -278,7 +23,7 @@ a.syqy_wenzi{ padding-bottom:10px; border:1px solid red;}
width: 940px; width: 940px;
line-height: 1.2em; line-height: 1.2em;
padding-top: 6px; padding-top: 6px;
margin-bottom: 10px;
} }
div.position-f{ div.position-f{
@ -533,7 +278,6 @@ span.forums-avatar-right{
margin-bottom: 10px; margin-bottom: 10px;
border-bottom: 1px dashed rgb(204, 204, 204); border-bottom: 1px dashed rgb(204, 204, 204);
width: 680px; width: 680px;
table-layout: fixed;
} }
.borad-message{ .borad-message{
@ -564,7 +308,6 @@ span.forums-avatar-right{
padding-top: 10px; padding-top: 10px;
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
clear: left;
} }
.borad-topic-count-message{ .borad-topic-count-message{
@ -618,7 +361,7 @@ span.forums-avatar-right{
} }
.content-text-list{ .content-text-list{
margin-bottom: 10px; margin-bottom: 10px;
border-bottom: 1px dashed rgb(204, 204, 204); /*border-bottom: 1px dashed rgb(204, 204, 204);*/
width: 580px; width: 580px;
} }
@ -645,7 +388,8 @@ span.forums-avatar-right{
/*added by bai*/ /*added by bai*/
.user_underlinescore{ .user_underlinescore{
margin: 1px; margin:1;
padding:1;
width:700px; width:700px;
height:1px; height:1px;
background-color:#15bccf; background-color:#15bccf;
@ -893,7 +637,7 @@ ul.tool li{list-style-type:none;
font-size: 16px; font-size: 16px;
color: #5c5c5c; color: #5c5c5c;
text-align: justify; text-align: justify;
/*text-justify: inter-ideograph; */ text-justify: inter-ideograph;
} }
.inf_user_image{ .inf_user_image{
@ -919,7 +663,7 @@ ul.tool li{list-style-type:none;
font-size: 20px; font-size: 20px;
color: #FF0000; color: #FF0000;
text-align: justify; text-align: justify;
/*text-justify: inter-ideograph; */ text-justify: inter-ideograph;
} }
@ -952,6 +696,7 @@ ul.user_course_sort li{list-style-type:none;
height:auto;} height:auto;}
.info-break{ .info-break{
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
@ -997,6 +742,7 @@ ul.user_course_sort li{list-style-type:none;
font-size:13px; font-size:13px;
padding-left: 12px; padding-left: 12px;
padding-right: 8px; padding-right: 8px;
line-height: 1.5em;
} }
.created_on_project{ .created_on_project{
padding-left: 12px; padding-left: 12px;
@ -1005,14 +751,8 @@ ul.user_course_sort li{list-style-type:none;
.font_description{ .font_description{
font-size:14px; font-size:14px;
line-height: 1.5em; line-height: 1.5em;
word-break:break-all;
word-wrap: break-word;
}
.font_description img{
max-width: 90%;
max-height: 90%; /* 设置最大宽度和高度 */
}
}
.font_description2{ .font_description2{
font-size:13px; font-size:13px;
line-height: 1.5em; line-height: 1.5em;
@ -1076,7 +816,10 @@ ul.user_course_sort li{list-style-type:none;
} }
.user_tags{ .user_tags{
padding:0px; padding-top: 5px;
padding-bottom: 5px;
padding-left: 12px;
padding-right: 12px;
} }
.tool{ .tool{
@ -1109,7 +852,8 @@ ul.user_course_sort li{list-style-type:none;
background-color:#adb6c5; background-color:#adb6c5;
} }
.user_underline{ .user_underline{
margin:1px; margin:1;
padding:1;
width:240px; width:240px;
height:1px; height:1px;
background-color:#15bccf; background-color:#15bccf;
@ -1119,8 +863,8 @@ ul.user_course_sort li{list-style-type:none;
.user_enterprise_underline{ .user_enterprise_underline{
margin:1px; margin:1;
padding:1px; padding:1;
width:240px; width:240px;
height:1px; height:1px;
background-color:#ac344f; background-color:#ac344f;
@ -1128,14 +872,16 @@ ul.user_course_sort li{list-style-type:none;
} }
.user_underline2{ .user_underline2{
margin:1px; margin:1;
padding:1;
width:240px; width:240px;
height:1px; height:1px;
background-color:#c6e9fe; background-color:#c6e9fe;
overflow:hidden overflow:hidden
} }
.user_underline3{ .user_underline3{
margin: 1px; margin:1;
padding:1;
width:120px; width:120px;
height:1px; height:1px;
background-color:#c6e9fe; background-color:#c6e9fe;
@ -1143,7 +889,8 @@ ul.user_course_sort li{list-style-type:none;
margin-top: 10px; margin-top: 10px;
} }
.homepage_underline{ .homepage_underline{
margin:1px; margin:1;
padding:1;
width:240px; width:240px;
height:1px; height:1px;
background-color:#c6e9fe; background-color:#c6e9fe;
@ -1508,8 +1255,8 @@ input#openid_url { background: url(../images/openid-bg.gif) no-repeat; backgroun
.clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clear:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden; }
/***** Links *****/ /***** Links *****/
a, a:link, a:visited{ color: #0781B4 ; text-decoration: none; } a, a:link, a:visited{ color: #169; text-decoration: none; }
a:hover, a:active{ color: #09658c;} a:hover, a:active{ color: #c61a1a; text-decoration: underline;}
a img{ border: 0; } a img{ border: 0; }
a.issue.closed, a.issue.closed:link, a.issue.closed:visited { color: #999; text-decoration: line-through; } a.issue.closed, a.issue.closed:link, a.issue.closed:visited { color: #999; text-decoration: line-through; }
@ -1518,14 +1265,6 @@ a.user.locked, a.user.locked:link, a.user.locked:visited {color: #999;}
#sidebar a.selected {line-height:1.7em; padding:1px 3px 2px 2px; margin-left:-2px; background-color:#9DB9D5; color:#fff; border-radius:2px;} #sidebar a.selected {line-height:1.7em; padding:1px 3px 2px 2px; margin-left:-2px; background-color:#9DB9D5; color:#fff; border-radius:2px;}
#sidebar a.selected:hover {text-decoration:none;} #sidebar a.selected:hover {text-decoration:none;}
#sidebar #attachment_ a {
background-position: 0% 50%;
background-repeat: no-repeat;
font-family: '微软雅黑'; /*modify by men*/
padding-left: 20px !important;
padding-top: 2px !important;
padding-bottom: 3px !important;
}
#admin-menu a {line-height:1.7em;} #admin-menu a {line-height:1.7em;}
#admin-menu a.selected {padding-left: 20px !important; background-position: 2px 40%;} #admin-menu a.selected {padding-left: 20px !important; background-position: 2px 40%;}
@ -1535,7 +1274,7 @@ a.collapsible.collapsed {background: url(../images/arrow_collapsed.png) no-repea
a#toggle-completed-versions {color:#999;} a#toggle-completed-versions {color:#999;}
/***** Tables *****/ /***** Tables *****/
table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; } table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; }
table.list th { background-color:#EEEEEE; padding: 4px; white-space:pre-line; } table.list th { background-color:#EEEEEE; padding: 4px; white-space:nowrap; }
table.list td { vertical-align: top; padding-right:10px; } table.list td { vertical-align: top; padding-right:10px; }
table.list td.id { width: 2%; text-align: center;} table.list td.id { width: 2%; text-align: center;}
table.list td.checkbox { width: 15px; padding: 2px 0 0 0; } table.list td.checkbox { width: 15px; padding: 2px 0 0 0; }
@ -1611,8 +1350,7 @@ tr.message.locked td.subject { background: url(../images/locked.png) no-repeat 0
tr.message.sticky td.subject { background: url(../images/bullet_go.png) no-repeat 0 1px; font-weight: bold; } tr.message.sticky td.subject { background: url(../images/bullet_go.png) no-repeat 0 1px; font-weight: bold; }
tr.version.closed, tr.version.closed a { color: #999; } tr.version.closed, tr.version.closed a { color: #999; }
tr.version td.name { padding-left: 20px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; } tr.version td.name { padding-left: 20px; }
tr.version td.description{word-break: break-all}
tr.version.shared td.name { background: url(../images/link.png) no-repeat 0% 70%; } tr.version.shared td.name { background: url(../images/link.png) no-repeat 0% 70%; }
tr.version td.date, tr.version td.status, tr.version td.sharing { text-align: center; white-space:nowrap; } tr.version td.date, tr.version td.status, tr.version td.sharing { text-align: center; white-space:nowrap; }
@ -1742,7 +1480,7 @@ margin-left:-10px;
.table_font{font-size:20px;color:#DD0000} .table_font{font-size:20px;color:#DD0000}
.registerd_box{padding-left: 600px;} .registerd_box{padding-left: 600px;}
.project_table{margin:0;margin-bottom:10px;background-color:#0ee;height:50px;} .project_table{margin:0,0,0,0;margin-bottom:10px;background-color:#0ee;height:50px;}
.project_header_tag{float:right; color:#000000;} .project_header_tag{float:right; color:#000000;}
.project_right_tag{margin-top:44%;} .project_right_tag{margin-top:44%;}
@ -1811,15 +1549,13 @@ form {display: inline;}
/*added by bai*/ /*added by bai*/
input[type="submit"].bid_btn { input[type="submit"].bid_btn {
padding-bottom: 5px; padding-bottom: 5px;
width: auto; width: 55px;
height: 25px; height: 25px;
text-align: center;
font-family: '微软雅黑', Arial, Helvetica, sans-serif; font-family: '微软雅黑', Arial, Helvetica, sans-serif;
font-size: 12px; font-size: 12px;
color: #fff; color: #fff;
padding: 8px; padding: 0px;
background: #15bccf; background: #15bccf;
text-align: center;
border-radius: 4px; border-radius: 4px;
border: 1px solid #15bccf; border: 1px solid #15bccf;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset; box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
@ -1827,26 +1563,6 @@ input[type="submit"].bid_btn {
cursor: pointer; cursor: pointer;
} }
input[type="submit"].ButtonAddTags {
color: #fffbff ;
padding-bottom:5px ;
width:auto ;
height: 25px ;
font-family: '微软雅黑',Arial,Helvetica,sans-serif ;
font-size: 15px ;
font-weight: normal;
text-align: center ;
margin:0 auto;
border-radius: 0px !important;
background: #15bccf ;
border: 0px solid #15bccf !important;
position: relative;
top:3px;
}
input[type="button"].bid_btn { input[type="button"].bid_btn {
/*padding-bottom: 5px;*/ /*padding-bottom: 5px;*/
width: 55px; width: 55px;
@ -1856,7 +1572,6 @@ input[type="button"].bid_btn {
color: #fff; color: #fff;
padding: 0px; padding: 0px;
background: #15bccf; background: #15bccf;
text-align: center;
border-radius: 4px; border-radius: 4px;
border: 1px solid #15bccf; border: 1px solid #15bccf;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset; box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
@ -1903,15 +1618,13 @@ div.issue .next-prev-links {color:#999;}
div.issue table.attributes th {width:22%;} div.issue table.attributes th {width:22%;}
div.issue table.attributes td {width:28%;} div.issue table.attributes td {width:28%;}
.private_project { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;}
#issue_tree table.issues, #relations table.issues { border: 0; } #issue_tree table.issues, #relations table.issues { border: 0; }
#issue_tree td.checkbox, #relations td.checkbox {display:none;} #issue_tree td.checkbox, #relations td.checkbox {display:none;}
#relations td.buttons {padding:0;} #relations td.buttons {padding:0;}
fieldset.collapsible { border-width: 1px 0 0 0; font-size: 0.9em; margin-top: 5px; } fieldset.collapsible { border-width: 1px 0 0 0; font-size: 0.9em; }
fieldset.collapsible>legend { padding-left: 16px; background:url(../images/arrow_collapsed.png) no-repeat 0% 40%; cursor:pointer; } fieldset.collapsible>legend { padding-left: 16px; background: url(../images/arrow_expanded.png) no-repeat 0% 40%; cursor:pointer; }
fieldset.collapsible.collapsed>legend { background-image: url(../images/arrow_expanded.png); } fieldset.collapsible.collapsed>legend { background-image: url(../images/arrow_collapsed.png); }
fieldset#date-range p { margin: 2px 0 2px 0; } fieldset#date-range p { margin: 2px 0 2px 0; }
fieldset#filters table { border-collapse: collapse; } fieldset#filters table { border-collapse: collapse; }
@ -1921,7 +1634,7 @@ fieldset#filters td.field { width:230px; }
fieldset#filters td.operator { width:180px; } fieldset#filters td.operator { width:180px; }
fieldset#filters td.operator select {max-width:170px;} fieldset#filters td.operator select {max-width:170px;}
fieldset#filters td.values { white-space:nowrap; } fieldset#filters td.values { white-space:nowrap; }
fieldset#filters td.values select {min-width:130px;max-width: 100px;} fieldset#filters td.values select {min-width:130px;}
fieldset#filters td.values input {height:1em;} fieldset#filters td.values input {height:1em;}
fieldset#filters td.add-filter { text-align: right; vertical-align: top; } fieldset#filters td.add-filter { text-align: right; vertical-align: top; }
@ -2012,8 +1725,8 @@ ul.projects li {list-style-type:none;
#projects-index ul.projects div.root a.project {font-family:'微软雅黑', "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 14px; margin: 0 0 10px 0; } #projects-index ul.projects div.root a.project {font-family:'微软雅黑', "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 14px; margin: 0 0 10px 0; }
.my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; } .my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; }
#notified-projects ul{max-height:250px; overflow-y:auto;} #notified-projects ul, #tracker_project_ids ul {max-height:250px; overflow-y:auto;}
#tracker_project_ids ul {max-height:250px; /*overflow-y:auto;*/}
#related-issues li img {vertical-align:middle;} #related-issues li img {vertical-align:middle;}
ul.properties {padding:0; font-size: 0.9em; color: #777;} ul.properties {padding:0; font-size: 0.9em; color: #777;}
@ -2052,22 +1765,6 @@ input#content_comments {width: 99%}
p.pagination {margin-top:8px; font-size: 90%} p.pagination {margin-top:8px; font-size: 90%}
ul.courses {margin:0px; padding-left:0em;}
ul.courses ul {padding-left:1.6em;}
ul.courses.root {margin:0; padding:0;}
ul.courses li {list-style-type:none;}
ul.courses li {list-style-type:none;}
#courses-index ul.courses ul.courses { border-left: 3px solid #e0e0e0; padding-left:1em;}
#courses-index ul.courses li.root {margin-bottom: 1em;}
#courses-index ul.courses li.child {margin-top: 1em;}
#courses-index ul.courses div.root a.course {font-family:'微软雅黑', "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 14px; margin: 0 0 10px 0; }
.my-course { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; }
/***** Tabular forms ******/ /***** Tabular forms ******/
.tabular p{ .tabular p{
margin: 0; margin: 0;
@ -2098,17 +1795,6 @@ html>body .tabular p {overflow:hidden;}
font-size: 12px; font-size: 12px;
} }
.role label{
font-weight: bold;
float: left;
text-align: right;
/* width of left column */
margin-left: -60px;
/* width of labels. Should be smaller than left column to create some right margin */
width: 175px;
font-size: 12px;
}
.tabular label.floating{ .tabular label.floating{
font-weight: normal; font-weight: normal;
margin-left: 0px; margin-left: 0px;
@ -2145,7 +1831,7 @@ input#time_entry_comments { width: 90%;}
.tabular.settings p{ padding-left: 300px; } .tabular.settings p{ padding-left: 300px; }
.tabular.settings label{ margin-left: -300px; width: 295px; } .tabular.settings label{ margin-left: -300px; width: 295px; }
.tabular.settings textarea { width: 85%; } .tabular.settings textarea { width: 99%; }
.settings.enabled_scm table {width:100%} .settings.enabled_scm table {width:100%}
.settings.enabled_scm td.scm_name{ font-weight: bold; } .settings.enabled_scm td.scm_name{ font-weight: bold; }
@ -2153,12 +1839,10 @@ input#time_entry_comments { width: 90%;}
fieldset.settings label { display: block; } fieldset.settings label { display: block; }
fieldset#notified_events .parent { padding-left: 20px; } fieldset#notified_events .parent { padding-left: 20px; }
span.required {color: #bb0000; margin-right: 2px;} span.required {color: #bb0000;}
.summary {font-style: italic;} .summary {font-style: italic;}
#attachments_fields input.description {margin-left:4px; width:100px; } #attachments_fields input.description {margin-left:4px; width:100px; }
#attachments_fields span {display:block; white-space:nowrap;}
#attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} #attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';}
#attachments_fields input.filename {border:0; height:1.8em; width:150px; color:#555; background-color:inherit; background:url(../images/attachment.png) no-repeat 1px 50%; padding-left:18px;}/*Modified by young*/ #attachments_fields input.filename {border:0; height:1.8em; width:150px; color:#555; background-color:inherit; background:url(../images/attachment.png) no-repeat 1px 50%; padding-left:18px;}/*Modified by young*/
#attachments_fields .ajax-waiting input.filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} #attachments_fields .ajax-waiting input.filename {background:url(../images/hourglass.png) no-repeat 0px 50%;}
@ -2166,8 +1850,6 @@ span.required {color: #bb0000; margin-right: 2px;}
#attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } #attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; }
a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block; padding-left:16px;} a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block; padding-left:16px;}
a.remove-upload:hover {text-decoration:none !important;} a.remove-upload:hover {text-decoration:none !important;}
#attachments_fields input.is_public_checkbox {width:20px;}
#attachments_fields span.ispublic-label {display:inline-block;width:30px;margin-left:10px; }
/*gcm upload file count and deleteall*/ /*gcm upload file count and deleteall*/
#upload_file_count #count {color:red; font-size:1.5em;} #upload_file_count #count {color:red; font-size:1.5em;}
@ -2275,7 +1957,7 @@ width:20%;
font-weight:bold; font-weight:bold;
text-align:center; text-align:center;
padding:0.6em; padding:0.6em;
z-index:100000; z-index:100;
opacity: 0.5; opacity: 0.5;
} }
@ -2322,9 +2004,15 @@ color:#505050;
} }
img.ui-datepicker-trigger { img.ui-datepicker-trigger {
display: block;
background: url(../images/public_icon.png) -31px 0 no-repeat;
cursor: pointer; cursor: pointer;
vertical-align: middle; vertical-align: middle;
margin-left: 4px; margin-left: 5px;
margin-top: 5px;
width: 16px;
height: 15px;
float: left;
} }
/***** Progress bar *****/ /***** Progress bar *****/
@ -2347,7 +2035,7 @@ p.progress-info {clear: left; font-size: 80%; margin-top:-4px; color:#777;}
#roadmap table.progress td { height: 1.2em; } #roadmap table.progress td { height: 1.2em; }
/***** Tabs *****/ /***** Tabs *****/
#content .tabs {height: 2.6em; margin-bottom:1.2em; position:relative; overflow:hidden;} #content .tabs {height: 2.6em; margin-bottom:1.2em; position:relative; overflow:hidden;}
#content .tabs ul {margin:0; position:absolute; bottom:0; padding-left:0.5em; width:2000px; border-bottom: 1px solid #15BCCF;} #content .tabs ul {margin:0; position:absolute; bottom:0; padding-left:0.5em; font-family: 14px; width:2000px; border-bottom: 1px solid #15BCCF;}
#content .tabs ul li { #content .tabs ul li {
float:left; float:left;
list-style-type:none; list-style-type:none;
@ -2434,7 +2122,7 @@ button.tab-right {
padding-bottom: 2px; padding-bottom: 2px;
text-align: center; text-align: center;
border: 1px solid #15BCCF; border: 1px solid #15BCCF;
border-bottom: 1px solid #15BCCF; /*border-bottom: 0px solid #15BCCF;*/
color:#606060; color:#606060;
font-weight:bold; font-weight:bold;
@ -2451,7 +2139,7 @@ button.tab-right {
} }
#content .tabs_new ul li a.selected { #content .tabs_new ul li a.selected {
background-color: #1C9EC7; background-color: rgba(28, 158, 199, 0.68);
border: 1px solid #15BCCF; border: 1px solid #15BCCF;
border-bottom: 1px solid #fff; border-bottom: 1px solid #fff;
color:#FFF; color:#FFF;
@ -2649,8 +2337,6 @@ button.tabs_new_enterprise-right {
background-color:#f6f6f6; background-color:#f6f6f6;
color:#505050; color:#505050;
border: 1px solid #e4e4e4; border: 1px solid #e4e4e4;
word-break: break-all;
word-wrap: break-word;
} }
/***** Wiki *****/ /***** Wiki *****/
@ -2807,14 +2493,6 @@ a.close-icon:hover {background-image:url('../images/close_hl.png');}
padding-top: 2px; padding-top: 2px;
padding-bottom: 3px; padding-bottom: 3px;
} }
#sidebar #attachemnt_.icon {
background-position: 0% 50%;
background-repeat: no-repeat;
font-family: '微软雅黑'; /*modify by men*/
padding-left: 20px;
padding-top: 2px;
padding-bottom: 3px;
}
.icon_enterprise { .icon_enterprise {
background-position: 0% 50%; background-position: 0% 50%;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -2839,7 +2517,7 @@ a.close-icon:hover {background-image:url('../images/close_hl.png');}
.icon-user { background-image: url(../images/user.png); } .icon-user { background-image: url(../images/user.png); }
.icon-projects { background-image: url(../images/projects.png); } .icon-projects { background-image: url(../images/projects.png); }
.icon-help { background-image: url(../images/help.png); } .icon-help { background-image: url(../images/help.png); }
.icon-attachment { background-image: url(../images/attachment.png); } .icon-attachment { background-image: url(../images/attachment.png);padding-left: 20px !important; }
.icon-history { background-image: url(../images/history.png); } .icon-history { background-image: url(../images/history.png); }
.icon-time { background-image: url(../images/time.png); } .icon-time { background-image: url(../images/time.png); }
.icon-time-add { background-image: url(../images/time_add.png); } .icon-time-add { background-image: url(../images/time_add.png); }
@ -3062,7 +2740,8 @@ div.repos_explain{
/* new linchun compitition */ /* new linchun compitition */
.contest_underline{ .contest_underline{
margin:1px; margin:1;
padding:1;
width:900px; width:900px;
height:0.5px; height:0.5px;
background-color:#aaa; background-color:#aaa;
@ -3100,100 +2779,4 @@ div.repos_explain{
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
} }
.upload_img img{max-width: 580px;}
.button-canel{
padding-bottom: 5px;
width: auto;
height: 25px;
font-family: '微软雅黑',Arial,Helvetica,sans-serif;
font-size: 12px;
color: #ffffff;
padding: 3px 9px;
background: #15bccf;
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
cursor: pointer;
}
.list .tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;}
.projects-index{min-height: 350px}
.school-index{min-height: 400px}
#membership_project_id option
{
width: 190px;
}
input[class~='ButtonClolr'],.ButtonColor{
color: #fffbff !important;
/*padding: 5px;*/
width: auto;
height: 24px ;
font-family: '微软雅黑',Arial,Helvetica,sans-serif;
font-size: 15px;
text-align: center;
background: #15bccf !important;
border: 0px solid #15bccf ;
display:inline-block
}
input[class~='m3p10'], .m3p10 {
margin-top: 5px;
padding: 5px 10px;
height: 20px;
display: inline-block;
color: #ffffff;
cursor:pointer;
}
/*pre标签换行*/
.break_word{word-break: break-all;word-wrap: break-word;}
.break_word_firefox{white-space: pre-wrap;word-break: break-all;}
/*日历选择图*/
img.ui-datepicker-trigger {
display:block;
background:url(/images/public_icon.png) -31px 0 no-repeat;
cursor: pointer;
vertical-align: middle;
margin-left: 5px;
margin-top: 5px;
width:16px;
height:15px;
float:left;
}
/*lizanle 日誌搜索結果樣式*/
.search_results {
color: red;
}
/*lizanle
.pagination ul li a, .pagination ul li span{
background-color: #FFFFFF;
border-color: #DDDDDD;
border-image: none;
border-style: solid;
border-width: 1px 1px 1px 1px;
float: left;
line-height: 20px;
padding: 4px 12px;
text-decoration: none;
}
.pagination ul a {
color: #9B9B9B;
}
.pagination ul li a:hover, .pagination ul li a:focus, .pagination ul .active a, .pagination ul .active span{
background-color: #ffc02f;
border: 1px solid #ffc02f;
}
.pagination ul li{
float: left;
margin-right: 3px;
list-style: none outside none;
}
*/

@ -86,7 +86,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
.ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; } .ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; }
.ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;} .ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
.ping_con p span a{ color:#777777;} .ping_con p span a{ color:#777777;}
.ping_star{ width:185px; color:#333; font-weight:bold; margin-bottom:5px;} .ping_star{ width:195px; color:#333; font-weight:bold; margin-bottom:5px;}
.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;} .ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;}
.ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;} a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;}

@ -1,9 +1,8 @@
.jstEditor { .jstEditor {
padding-left: 0px; padding-left: 0px;
} }
.jstEditor textarea, .jstEditor iframe { .jstEditor textarea, .jstEditor iframe {
margin: 0 ; margin: 0;
margin-left: 80px; margin-left: 80px;
} }
@ -15,7 +14,7 @@
} }
.jstElements { .jstElements {
padding: 3px 3px 3px 0px;/*by young*/ padding: 3px 3px 3px 10px;/*by young*/
} }
.jstElements button { .jstElements button {

@ -45,6 +45,7 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/ /*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;} .project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;} .course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.project_board_content{overflow: hidden;max-height: 55px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;} .course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;} .lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;} .lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}

@ -1190,7 +1190,8 @@ div.pagination {
text-align: left; text-align: left;
font-size: 13px; font-size: 13px;
} }
.pagination li a{margin-top: 10px;}
.pagination li span{margin-top: 10px;}
.m5p5 { .m5p5 {
display: inline-block; display: inline-block;
height: auto; height: auto;

@ -738,6 +738,6 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
.Replybox{ float:left; width:495px; margin-left:5px;} .Replybox{ float:left; width:495px; margin-left:5px;}
.talk_nextpage{ border:none; width:410px; margin:0 auto;} .talk_nextpage{ border:none; width:410px; margin:0 auto;}
.newtalk { margin-top:8px; margin-right:8px;} .newtalk { margin-top:8px; margin-right:8px;}
.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}
#about_newtalk{ display:none;} #about_newtalk{ display:none;}

@ -422,3 +422,5 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
/*文本左对齐*/ /*文本左对齐*/
.tl{text-align: left;} .tl{text-align: left;}
img{max-width: 100%;}
.attachments {clear: both;}

@ -97,9 +97,7 @@ table.annotate td.author {
background: inherit; background: inherit;
} }
table.annotate td.line-code { background-color: #fafafa; }
table.annotate td.line-code { background-color: #fafafa; word-break: break-all;}
div.action_M { background: #fd8 } div.action_M { background: #fd8 }
div.action_D { background: #f88 } div.action_D { background: #f88 }

@ -1,12 +0,0 @@
require 'spec_helper'
describe EnterprisesController do
describe "GET 'index'" do
it "returns http success" do
get 'index'
response.should be_success
end
end
end

@ -1,4 +1,3 @@
require 'faker'
FactoryGirl.define do FactoryGirl.define do
factory :user do factory :user do

@ -0,0 +1,46 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require 'spec_helper'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!
# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
# run as spec files by default. This means that files in spec/support that end
# in _spec.rb will both be required and run as specs, causing the specs to be
# run twice. It is recommended that you do not name files matching this glob to
# end with _spec.rb. You can configure this pattern with the --pattern
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
#
# The following line is provided for convenience purposes. It has the downside
# of increasing the boot-up time by auto-requiring all files in the support
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
#
# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
# RSpec Rails can automatically mix in different behaviours to your tests
# based on their file location, for example enabling you to call `get` and
# `post` in specs under `spec/controllers`.
#
# You can disable this behaviour by removing the line below, and instead
# explicitly tag your specs with their type, e.g.:
#
# RSpec.describe UsersController, :type => :controller do
# # ...
# end
#
# The different available types are documented in the features, such as in
# https://relishapp.com/rspec/rspec-rails/docs
config.infer_spec_type_from_file_location!
end

@ -0,0 +1,71 @@
require 'rails_helper'
RSpec.describe "Account request", :type => :request do
describe "用户登录" do
let(:user){FactoryGirl.create(:user)}
it "未登录访问需要登录页面会自动跳入登录页" do
get 'my/page'
expect(response).to redirect_to(signin_path)
end
context "正常登录" do
before{post signin_path, username: user.login, password: user.password}
it "登录成功,正常跳转" do
expect(response).to redirect_to(my_account_url)
end
it "登录成功session正确" do
expect(user.id).to eq(session[:user_id])
end
it "正常登录后可以访问需要认证的页面" do
get 'my/account'
expect(response).to have_http_status(:success)
expect(response.body).to include(user.login)
end
end
context "登录失败" do
before{post signin_path, username: user.login, password: 'wrong password'}
it {expect(response).to render_template('account/login')}
it "跳加登录页面" do
get 'my/page'
expect(response).to redirect_to(signin_path)
end
end
context "自动登录" do
before{
post signin_path, username: user.login, password: user.password, autologin: 1
}
it "登录成功跳转到个人首页" do
expect(response).to redirect_to(my_account_url)
end
it "验证token" do
token = Token.first
expect(token).not_to be_nil
expect(user.id).to eq(token.user.id)
expect(token.action).to eq('autologin')
expect(user.id).to eq(session[:user_id])
expect(token.value).to eq(cookies['autologin'])
end
it 'session 失效后可以用token自动重新登录' do
token = Token.first
reset!
User.current = nil
get my_account_url
expect(response).to redirect_to(signin_url)
cookies[:autologin] = token.value
get my_account_url
expect(response).to have_http_status(:success)
expect(response.body).to include(user.login)
end
end
end
end

@ -1,38 +1,91 @@
# This file is copied to spec/ when you run 'rails generate rspec:install' require 'rubygems'
ENV["RAILS_ENV"] ||= 'test' require 'rspec/core'
require File.expand_path("../../config/environment", __FILE__) # require_relative 'support/spork_patch'
require 'rspec/rails'
require 'rspec/autorun'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# files.
#
# Given that it is always loaded, you are encouraged to keep this file as
# light-weight as possible. Requiring heavyweight dependencies from this file
# will add to the boot time of your test suite on EVERY test run, even for an
# individual file that may not need all of that loaded. Instead, consider making
# a separate helper file that requires the additional dependencies and performs
# the additional setup, and require it from the spec files that actually need
# it.
#
# The `.rspec` file also contains a few flags that are not defaults but that
# users commonly want.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config| RSpec.configure do |config|
# ## Mock Framework # rspec-expectations config goes here. You can use an alternate
# # assertion/expectation library such as wrong or the stdlib/minitest
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: # assertions if you prefer.
# config.expect_with :rspec do |expectations|
# config.mock_with :mocha # This option will default to `true` in RSpec 4. It makes the `description`
# config.mock_with :flexmock # and `failure_message` of custom matchers include text for helper methods
# config.mock_with :rr # defined using `chain`, e.g.:
# be_bigger_than(2).and_smaller_than(4).description
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures # # => "be bigger than 2 and smaller than 4"
config.fixture_path = "#{::Rails.root}/spec/fixtures" # ...rather than:
# # => "be bigger than 2"
# If you're not using ActiveRecord, or you'd prefer not to run each of your expectations.include_chain_clauses_in_custom_matcher_descriptions = true
# examples within a transaction, remove the following line or assign false end
# instead of true.
config.use_transactional_fixtures = true # rspec-mocks config goes here. You can use an alternate test double
# library (such as bogus or mocha) by changing the `mock_with` option here.
# If true, the base class of anonymous controllers will be inferred config.mock_with :rspec do |mocks|
# automatically. This will be the default behavior in future versions of # Prevents you from mocking or stubbing a method that does not exist on
# rspec-rails. # a real object. This is generally recommended, and will default to
config.infer_base_class_for_anonymous_controllers = false # `true` in RSpec 4.
mocks.verify_partial_doubles = true
end
# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
=begin
# These two settings work together to allow you to limit a spec run
# to individual examples or groups you care about by tagging them with
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
# get run.
config.filter_run :focus
config.run_all_when_everything_filtered = true
# Limits the available syntax to the non-monkey patched syntax that is
# recommended. For more details, see:
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
config.disable_monkey_patching!
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an
# individual spec file.
if config.files_to_run.one?
# Use the documentation formatter for detailed output,
# unless a formatter has already been configured
# (e.g. via a command-line flag).
config.default_formatter = 'doc'
end
# Print the 10 slowest examples and example groups at the
# end of the spec run, to help surface which specs are running
# particularly slow.
config.profile_examples = 10
# Run specs in random order to surface order dependencies. If you find an # Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing # order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run. # the seed, which is printed after each run.
# --seed 1234 # --seed 1234
config.order = "random" config.order = :random
# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed
=end
end end

@ -0,0 +1,22 @@
# https://stackoverflow.com/questions/24030907/spork-0-9-2-and-rspec-3-0-0-uninitialized-constant-rspeccorecommandline-n/24085168#24085168
# https://github.com/manafire/spork/commit/38c79dcedb246daacbadb9f18d09f50cc837de51#diff-937afaa19ccfee172d722a05112a7c6fL6
class Spork::TestFramework::RSpec
def run_tests(argv, stderr, stdout)
if rspec1?
::Spec::Runner::CommandLine.run(
::Spec::Runner::OptionParser.parse(argv, stderr, stdout)
)
elsif rspec3?
options = ::RSpec::Core::ConfigurationOptions.new(argv)
::RSpec::Core::Runner.new(options).run(stderr, stdout)
else
::RSpec::Core::CommandLine.new(argv).run(stderr, stdout)
end
end
def rspec3?
return false if !defined?(::RSpec::Core::Version::STRING)
::RSpec::Core::Version::STRING =~ /^3\./
end
end

@ -1,7 +1,6 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
one: one:
act_id: act_id:
act_type: MyString act_type: MyString
user_id: user_id:
@ -10,14 +9,3 @@ two:
act_id: act_id:
act_type: MyString act_type: MyString
user_id: user_id:
id: 1
act_id: 1
act_type: JournalsForMessage
user_id: 5
two:
act_id: 2
act_type: JournalsForMessage
user_id: 5

@ -1,6 +1,5 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
<<<<<<< HEAD
one: one:
typeId: 1 typeId: 1
typeName: MyString typeName: MyString
@ -8,18 +7,3 @@ one:
two: two:
typeId: 1 typeId: 1
typeName: MyString typeName: MyString
=======
courses_001_infos:
id: 1
course_id: 1
user_id: 20
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
courses_002_infos:
id: 2
course_id: 2
user_id: 20
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0

@ -1,16 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
<<<<<<< HEAD
one: one:
=======
courses_001_statuses:
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0
changesets_count: 1 changesets_count: 1
watchers_count: 1 watchers_count: 1
course_id: 1 course_id: 1
grade: 1.5 grade: 1.5
course_ac_para: 1 course_ac_para: 1
<<<<<<< HEAD
two: two:
changesets_count: 1 changesets_count: 1
@ -18,16 +13,3 @@ two:
course_id: 1 course_id: 1
grade: 1.5 grade: 1.5
course_ac_para: 1 course_ac_para: 1
=======
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
courses_002_statuses:
changesets_count: 1
watchers_count: 1
course_id: 2
grade: 1.5
course_ac_para: 1
created_at: 2013-09-30 15:36:00
updated_at: 2014-04-19 01:50:41
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0

@ -1,6 +1,5 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
<<<<<<< HEAD
one: one:
name: name:
province: MyString province: MyString
@ -8,16 +7,3 @@ one:
two: two:
name: name:
province: MyString province: MyString
=======
school_117:
id: 117
name: 国防科学技术大学
province: 湖南省
logo_link:
school_001:
id: 1
name: 摧毁地球人学校
province: 火星
logo_link:
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0

@ -1,4 +1,3 @@
<<<<<<< HEAD
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
person_one_extra: person_one_extra:
@ -38,62 +37,3 @@ person_mao_extra:
teacher_realname: nil teacher_realname: nil
student_realname: nil student_realname: nil
location_city: nil location_city: nil
=======
user_extension_006:
id: 6
user_id: 6
birthday:
brief_introduction:
gender: 0
location:
occupation:
work_experience:
zip_code:
created_at: 2014-07-29 02:54:09
updated_at: 2014-07-29 02:54:09
technical_title:
identity: 0
student_id:
teacher_realname:
student_realname:
location_city:
school_id:
user_extension_020:
id: 20
user_id: 20
birthday:
brief_introduction: 哈尔
gender: 0
location: 黑龙江
occupation: kylinos-cloud
work_experience:
zip_code:
created_at: 2014-07-29 02:54:09
updated_at: 2014-07-29 02:54:09
technical_title: 助教
identity: 0
student_id:
teacher_realname:
student_realname:
location_city: 哈尔滨
school_id:
user_extension_025:
id: 25
user_id: 25
birthday:
brief_introduction: 哈尔
gender: 0
location: 黑龙江
occupation: kylinos-cloud
work_experience:
zip_code:
created_at: 2014-07-29 02:54:09
updated_at: 2014-07-29 02:54:09
technical_title: 助教
identity: 1 #student
student_id: 10060342
teacher_realname:
student_realname: 'ue_realname'
location_city: 哈尔滨
school_id: 117
>>>>>>> a09a3dc378c45f43f5c4b090479fa292a846f4f0

@ -1,6 +1,6 @@
require 'test_helper' require 'test_helper'
class SystemLogControllerTest < ActionController::TestCase class UserScoreControllerTest < ActionController::TestCase
# test "the truth" do # test "the truth" do
# assert true # assert true
# end # end

@ -0,0 +1,7 @@
require 'test_helper'
class ZipdownControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

@ -29,7 +29,7 @@ class AccountTest < ActionController::IntegrationTest
# Replace this with your real tests. # Replace this with your real tests.
def test_login def test_login
get "my/page" get "my/page"
assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fmy%2Fpage" assert_redirected_to "/login"
log_user('jsmith', 'jsmith') log_user('jsmith', 'jsmith')
get "my/account" get "my/account"
@ -44,7 +44,7 @@ class AccountTest < ActionController::IntegrationTest
# User logs in with 'autologin' checked # User logs in with 'autologin' checked
post '/login', :username => user.login, :password => 'admin', :autologin => 1 post '/login', :username => user.login, :password => 'admin', :autologin => 1
assert_redirected_to '/my/page' assert_redirected_to '/users/1'
token = Token.first token = Token.first
assert_not_nil token assert_not_nil token
assert_equal user, token.user assert_equal user, token.user
@ -73,6 +73,7 @@ class AccountTest < ActionController::IntegrationTest
Redmine::Configuration.stubs(:[]).with('autologin_cookie_name').returns('custom_autologin') Redmine::Configuration.stubs(:[]).with('autologin_cookie_name').returns('custom_autologin')
Redmine::Configuration.stubs(:[]).with('autologin_cookie_path').returns('/') Redmine::Configuration.stubs(:[]).with('autologin_cookie_path').returns('/')
Redmine::Configuration.stubs(:[]).with('autologin_cookie_secure').returns(false) Redmine::Configuration.stubs(:[]).with('autologin_cookie_secure').returns(false)
Redmine::Configuration.stubs(:[]).with('max_concurrent_ajax_uploads').returns(2)
with_settings :autologin => '7' do with_settings :autologin => '7' do
assert_difference 'Token.count' do assert_difference 'Token.count' do
@ -85,12 +86,10 @@ class AccountTest < ActionController::IntegrationTest
# Session is cleared # Session is cleared
reset! reset!
cookies['custom_autologin'] = token cookies['custom_autologin'] = token
get '/my/page' get '/my/account'
assert_response :success assert_response :success
assert_difference 'Token.count', -1 do
post '/logout' post '/logout'
end
assert cookies['custom_autologin'].blank? assert cookies['custom_autologin'].blank?
end end
end end

@ -1,22 +1,22 @@
require 'rubygems' require 'rubygems'
require 'spork' # require 'spork'
#uncomment the following line to use spork with the debugger #uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug' #require 'spork/ext/ruby-debug'
Spork.prefork do # Spork.prefork do
# Loading more in this block will cause your tests to run faster. However, # # Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll # # if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect. # # need to restart spork for it take effect.
ENV["RAILS_ENV"] = "test" # ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__) # require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help' # require 'rails/test_help'
#
end # end
#
Spork.each_run do # Spork.each_run do
# This code will be run each time you run your specs. # # This code will be run each time you run your specs.
#
end # end
# --- Instructions --- # --- Instructions ---
# Sort the contents of this file into a Spork.prefork and a Spork.each_run # Sort the contents of this file into a Spork.prefork and a Spork.each_run
@ -86,6 +86,7 @@ class ActiveSupport::TestCase
User.anonymous User.anonymous
get "/login" get "/login"
assert_equal nil, session[:user_id] assert_equal nil, session[:user_id]
puts response.response_code()
assert_response :success assert_response :success
assert_template "account/login" assert_template "account/login"
post "/login", :username => login, :password => password post "/login", :username => login, :password => password

@ -1,6 +1,6 @@
require 'test_helper' require 'test_helper'
class PollAnswersTest < ActiveSupport::TestCase class ApplyProjectMasterTest < ActiveSupport::TestCase
# test "the truth" do # test "the truth" do
# assert true # assert true
# end # end

@ -1,6 +1,6 @@
require 'test_helper' require 'test_helper'
class PollQuestionsTest < ActiveSupport::TestCase class AppliedProjectTest < ActiveSupport::TestCase
# test "the truth" do # test "the truth" do
# assert true # assert true
# end # end

@ -1,6 +1,6 @@
require 'test_helper' require 'test_helper'
class PollUserTest < ActiveSupport::TestCase class BugToOspTest < ActiveSupport::TestCase
# test "the truth" do # test "the truth" do
# assert true # assert true
# end # end

@ -1,6 +1,6 @@
require 'test_helper' require 'test_helper'
class PollsTest < ActiveSupport::TestCase class SchoolControllerTest < ActionController::TestCase
# test "the truth" do # test "the truth" do
# assert true # assert true
# end # end

@ -0,0 +1,7 @@
require 'test_helper'
class RelativeMemoToOpenSourceProjectTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

@ -0,0 +1 @@
Put your Redmine plugins here.
Loading…
Cancel
Save