This commit is contained in:
nwb 2014-08-29 15:28:45 +08:00
commit dec77da33c
38 changed files with 337 additions and 101 deletions

View File

@ -45,11 +45,45 @@ class FilesController < ApplicationController
'filename' => "#{Attachment.table_name}.filename",
'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads"
sort = ""
if params[:project_id]
@isproject = true
@containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort
if params[:sort]
params[:sort].split(",").each do |sort_type|
order_by = sort_type.split(":")
case order_by[0]
when "filename"
attribute = "filename"
when "size"
attribute = "filesize"
when "attach_type"
attribute = "attachtype"
when "content_type"
attribute = "created_on"
when "field_file_dense"
attribute = "is_public"
when "downloads"
attribute = "downloads"
when "created_on"
attribute = "created_on"
end
if order_by.count == 1
sort += "#{Attachment.table_name}.#{attribute} desc "
elsif order_by.count == 2
sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} "
end
if sort_type != params[:sort].split(",").last
sort += ","
end
end
end
@containers = [ Project.includes(:attachments).reorder(sort).find(@project.id)]
@containers += @project.versions.includes(:attachments).reorder(sort).all.sort
show_attachments @containers
@ -57,7 +91,6 @@ class FilesController < ApplicationController
elsif params[:course_id]
@isproject = false
sort = ""
if params[:sort]
params[:sort].split(",").each do |sort_type|
order_by = sort_type.split(":")

View File

@ -737,7 +737,7 @@ module ApplicationHelper
text = text.dup
macros = catch_macros(text)
text = Redmine::WikiFormatting.to_html("CKEditor", text, :object => obj, :attribute => attr)
#text = Redmine::WikiFormatting.to_html("CKEditor", text, :object => obj, :attribute => attr)
@parsed_headings = []
@heading_anchors = {}
@ -1555,6 +1555,25 @@ module ApplicationHelper
date = time.strftime("%Y年%m月%d日")
end
#当TAG数量过多时更多链接
#1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 9代表课程
def more_tags id,object_flag
a= 1
case object_flag
when "1"
s = link_to l(:label_more_tags),:controller => "users", :action => "show", :id => id
when "2"
s = link_to l(:label_more_tags),:controller => "projects", :action => "show", :id => id
when "3"
s = link_to l(:label_more_tags),:controller => "issues", :action => "show", :id => id
when "4"
s = link_to l(:label_more_tags),:controller => "bids", :action => "show", :id => id
when "9"
s = link_to l(:label_more_tags),:controller => "courses", :action => "show", :id => id
end
s
end
private
def wiki_helper

View File

@ -240,11 +240,14 @@ class Issue < ActiveRecord::Base
self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h}
self.status = issue.status
self.author = User.current
unless options[:attachments] == false
self.attachments = issue.attachments.map do |attachement|
attachement.copy(:container => self)
end
end
#赞不提供附件复制功能
#unless options[:attachments] == false
#self.attachments = issue.attachments.map do |attachement|
# a = attachement.copy(:container => self)
# #a.save
# a
#end
#end
@copied_from = issue
@copy_options = options
self

View File

@ -4,7 +4,11 @@
<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;") +
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %>
if attachment.id.nil?
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end
%>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>

View File

@ -4,5 +4,5 @@ $('#relation_file').html('<%=render_attachments_for_new_project(@project, nil)%>
<% elsif @course%>
$('#relation_file').html('<%=render_attachments_for_new_course(@course, nil)%>');
<% end%>
$('#attachments').children().css("width","100%").css("word-break","break-all");
$('#attachments').children().css("width","100%").css("word-break","break-all").css("word-wrap", "break-word");

View File

@ -6,8 +6,9 @@
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp
<span class="size">
<% if @attachment!=nil&&@attachment.container_type == 'Document'&&User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, @attachment.project) %>
<%= link = link_to(l(:button_add), {:controller => 'code_review',
<!-- &&(@attachment.container_type == 'Document' || @attachment.container_type == 'WikiPage') -->
<% if @attachment!=nil&&User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, @attachment.project) %>
<%= l(:review_assignments)+":" %><%= link = link_to(l(:button_add), {:controller => 'code_review',
:action => 'assign', :action_type => 'attachment',
:id=>@attachment.project,
:change_id => '', :attachment_id => @attachment.id,

View File

@ -53,7 +53,7 @@
</span>
<% end %>
</div>
<div style="width: 100%;word-break: break-all;">
<div style="width: 100%;word-break: break-all;word-wrap: break-word;">
<% if @topics.any? %>
<!-- <table class="list messages">
<thead><tr>

View File

@ -6,7 +6,7 @@
<p>
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= @contest.budget%></span></strong>
</p>
<div class="bid_description" style="width: 100%;word-break:break-all;">
<div class="bid_description" style="width: 100%;word-break:break-all;word-wrap: break-word;">
<%= @contest.description %>
<!-- <%# if @contest.attachments.any?%>
<%# options = {:author => true} %>

View File

@ -22,15 +22,22 @@
<%= error_messages_for 'bid' %>
<p><%= l(:label_homeworks_form_new_description) %></p>
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %></p>
<p>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
</p>
<p><span id="bid_name_span"></span></p>
<p><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
<!-- <p><%#= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> -->
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>
<p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}",:readonly => "readonly") %><%= calendar_for('bid_deadline')%>
<p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();") %><%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span">
</span>
</p>
<p><%= f.select :is_evaluation, is_evaluation_option %>
</p>

View File

@ -1,9 +1,60 @@
<script type="text/javascript">
function regexName()
{
var name = $("#bid_name").val();
if(name=="")
{
$("#bid_name_span").text("名称不能为空");
$("#bid_name_span").css('color','#ff0000');
return false;
}
else
{
$("#bid_name_span").text("填写正确");
$("#bid_name_span").css('color','#008000');
return true;
}
}
function regexDeadLine()
{
var deadline = $("#bid_deadline").val();
var regex = /^\d{4}-\d{2}-\d{2}$/;
if(deadline=="")
{
$("#bid_deadline_span").text("截止日期不能为空");
$("#bid_deadline_span").css('color','#ff0000');
return false;
}
else if(regex.test(deadline))
{
$("#bid_deadline_span").text("填写正确");
$("#bid_deadline_span").css('color','#008000');
return true;
}
else
{
$("#bid_deadline_span").text("截止日期格式错误");
$("#bid_deadline_span").css('color','#ff0000');
return false;
}
}
function submitHomework()
{
if(regexDeadLine()&&regexName())
{
$("#new_bid").submit();
}
}
</script>
<h3><%=l(:label_course_new_homework)%></h3>
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
<div class="box tabular">
<%= render :partial => 'homework_form', :locals => { :f => f } %>
<%= submit_tag l(:button_create), :class => "enterprise" %>
<input type="button" onclick="submitHomework();" value="<%= l(:button_create)%>" class="enterprise">
<%= javascript_tag "$('#bid_name').focus();" %>
<% end %>
</div>

View File

@ -29,7 +29,7 @@
<%= 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) : e.event_url,:style => "word-break:break-all;" %>
<%= 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_url,:style => "word-break:break-all;word-wrap: break-word;" %>
</td>
</tr>
<tr>

View File

@ -37,11 +37,8 @@
</ul>
<% end -%>
<ul class="list-group-item-meta">
<div class="issue-list-description">
<div class="wiki" style="width: 100%;word-break: break-all;">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable issue, :description %>
</div>
<!-- <#%= l(:field_description)%>:&nbsp;<#%= issue.short_description %> -->
</div>
</ul>
<ul class="list-group-item-meta">

View File

@ -11,8 +11,9 @@
<% if @copy_from && @copy_from.attachments.any? %>
<p>
<label for="copy_attachments"><%= l(:label_copy_attachments) %></label>
<%= check_box_tag 'copy_attachments', '1', @copy_attachments %>
<!-- 去除附件复制功能 -->
<!-- <label for="copy_attachments"><#%= l(:label_copy_attachments) %></label>
<#%= check_box_tag 'copy_attachments', '1', @copy_attachments %> -->
</p>
<% end %>
<% if @copy_from && !@copy_from.leaf? %>

View File

@ -1,7 +1,7 @@
<h3><%=h @issue.tracker %> #<%= @issue.id %></h3>
<p><%= authoring @journal.created_on, @journal.user, :label => :label_updated_time_by %></p>
<div class="text-diff" style="word-break: break-all;width: 100%;">
<div class="text-diff" style="word-break: break-all;width: 100%;word-wrap: break-word;">
<%= simple_format_without_paragraph @diff.to_html %>
</div>

View File

@ -191,7 +191,7 @@
<div style="padding-bottom: 8px">
<% if @course.description && @course.description.size>0 %>
<div class="font_lighter_sidebar" style="word-break:break-all; word-wrap:break-all;">
<div class="font_lighter_sidebar" style="word-break:break-all; word-wrap:break-word;">
<%= textilizable @course.description %>
</div>

View File

@ -112,7 +112,7 @@
</div>
<div style="padding-bottom: 8px">
<div class="font_lighter_sidebar" style="word-break:break-all">
<div class="font_lighter_sidebar" style="word-break:break-all;word-wrap: break-word;">
<%= textilizable @project.description %>
</div>
<div class="created_on_project">

View File

@ -116,7 +116,7 @@
</p>
<% end %>
<% unless @user.user_extensions.nil? %>
<p style="width: 100%;word-break: break-all">
<p style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= @user.user_extensions.brief_introduction %>
</p>
<% end %>

View File

@ -46,7 +46,7 @@
</div>
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>" style="word-break: break-all;"><%= label_tag l(:field_subject) %>: <%=h @memo.subject %></div>
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>" style="word-break: break-all;word-wrap: break-word;"><%= label_tag l(:field_subject) %>: <%=h @memo.subject %></div>
<div class="memo-content">
<%= textAreailizable(@memo,:content) %>
<p>

View File

@ -156,7 +156,7 @@
<tr>
<td class="comments">
<div class="wiki" style="width: 100%;word-break: break-all;">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %>
</div>

View File

@ -27,14 +27,15 @@
<p><label><%= l(:label_board) %></label><br />
<%# modify by nwb%>
<% if @message.project %>
<%= f.select :board_id, boards_options_for_select(@message.project.boards) %></p>
<%= f.select :board_id, boards_options_for_select(@message.project.boards) %>
<% elsif @message.course %>
<%= f.select :board_id, boards_options_for_select(@message.course.boards) %></p>
<%= f.select :board_id, boards_options_for_select(@message.course.boards) %>
<% end %>
</p>
<% end %>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all"></div>
<p><label for="message_subject"><%= l(:field_description) %><span class="required"> *&nbsp;&nbsp;</span></label>
<%= text_area :quote,:quote,:style => 'display:none' %>
</p>
<p>
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %>
<%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content' %></p>

View File

@ -37,6 +37,7 @@
background-color: #F6F6F6;
white-space: normal;
word-break: break-all;
word-wrap: break-word;
/*word-wrap: break-word;*/
}
.memo-timestamp {
@ -94,7 +95,7 @@
<%= link_to @topic.author, user_path(@topic.author) %>
</p>
</div>
<div class="memo-section" style="width: 100%;word-break: break-all;">
<div class="memo-section" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 83%;word-break: break-all;">
<% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %>
@ -161,7 +162,7 @@
</tr>
<tr>
<td class="comments">
<div class="wiki" style="width: 100%;word-break: break-all;">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable message,:content,:attachments => message.attachments %>
<%#= message.content.html_safe %>
</div>

View File

@ -4,7 +4,7 @@
<%= course_board_breadcrumb(@message) %>
<% end %>
<h3><%= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;"><%=h @topic.subject %></span></h3>
<h3><%= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%=h @topic.subject %></span></h3>
<%= form_for @message, {
:as => :message,

View File

@ -3,9 +3,11 @@
<%= @project ? l(:label_news_new) : l(:bale_news_notice) %>
</div>
<div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p>
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;", :onblur => "regexTitle();" %></p>
<P><span id="title_notice_span">(60个字符以内)</span></P>
<!-- <p style="margin-left:-10px;"><%#= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> -->
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p>
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;", :onblur => "regexDescription();" %></p>
<P><span id="description_notice_span"></span></P>
<p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p>
</div>

View File

@ -1,3 +1,56 @@
<script type="text/javascript">
function regexTitle()
{
var name = $("#news_title").val();
if(name.length ==0)
{
$("#title_notice_span").text("标题不能为空");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
else if(name.length <= 60)
{
$("#title_notice_span").text("填写正确");
$("#title_notice_span").css('color','#008000');
return true;
}
else
{
$("#title_notice_span").text("标题超过60个字符");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
}
function regexDescription()
{
var name = $("#news_description").val();
if(name.length ==0)
{
$("#description_notice_span").text("描述不能为空");
$("#description_notice_span").css('color','#ff0000');
$("#description_notice_span").focus();
return false;
}
else
{
$("#description_notice_span").text("填写正确");
$("#description_notice_span").css('color','#008000');
return true;
}
}
function submitNews()
{
if(regexTitle() && regexDescription())
{
$("#news-form").submit();
}
}
</script>
<%
if @project.project_type == Project::ProjectType_course
btn_tips = l(:label_news_notice)
@ -22,7 +75,9 @@
<%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/form', :locals => {:f => f} %>
<%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit --> |
<%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit -->
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :class => 'whiteButton m3p10' %>
|
<%= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %>

View File

@ -1,3 +1,55 @@
<script type="text/javascript">
function regexTitle()
{
var name = $("#news_title").val();
if(name.length ==0)
{
$("#title_notice_span").text("标题不能为空");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
else if(name.length <= 60)
{
$("#title_notice_span").text("填写正确");
$("#title_notice_span").css('color','#008000');
return true;
}
else
{
$("#title_notice_span").text("标题超过60个字符");
$("#title_notice_span").css('color','#ff0000');
$("#title_notice_span").focus();
return false;
}
}
function regexDescription()
{
var name = $("#news_description").val();
if(name.length ==0)
{
$("#description_notice_span").text("描述不能为空");
$("#description_notice_span").css('color','#ff0000');
$("#description_notice_span").focus();
return false;
}
else
{
$("#description_notice_span").text("填写正确");
$("#description_notice_span").css('color','#008000');
return true;
}
}
function submitNews()
{
if(regexTitle() && regexDescription())
{
$("#news-form").submit();
}
}
</script>
<div class="contextual">
<%= watcher_link(@news, User.current) %>
<%= link_to(l(:button_edit),
@ -15,9 +67,10 @@
<%= labelled_form_for :news, @news, :url => news_path(@news),
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => ''} %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
<%#= submit_tag l(:button_save) %>
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:class => 'whiteButton m3p10' %>
<%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %>
<% end %>
<div id="preview" class="wiki"></div>
</div>

View File

@ -7,7 +7,7 @@
<% @events_by_day.keys.sort.reverse.each do |day| %>
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-break: break-all;">
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
</div>
@ -24,7 +24,7 @@
</span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;">
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable e,:event_description %>
<%#= h(truncate(strip_tags(e.event_description).gsub(/&nbsp;/, ' '), length: 30, omission: '...')) %>
</div>

View File

@ -22,7 +22,7 @@
<% i += 1 %>
<% end %>
<%= link_to l(:label_more_tags),:controller => "tags", :action => "show", :id => obj.id %>
<%= more_tags(obj.id,object_flag)%>
<% else %>

View File

@ -30,7 +30,7 @@
</span></td>
</tr>
<tr>
<td colspan="2" width="580" style="word-break:break-all">
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
<p class="font_description">
<%= textilizable membership.course.short_description %>
</p>

View File

@ -20,27 +20,18 @@
<tr>
<!-- added by bai 区分了个人列表里的项目与课程 -->
<td colspan="2" width="580px"><p class="font_description">
<% unless user.memberships.empty? %>
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
<% memberships = user.memberships.all(:conditions => cond) %>
<%= l(:label_x_contribute_to, :count => memberships.count) %>
<% for member in memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% else %>
<%= l(:label_x_contribute_to, :count => 0) %>
<% end %>
<p class="font_description">
<% unless user.memberships.empty? %>
<% cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
<% memberships = user.memberships.all(:conditions => cond) %>
<%= l(:label_x_course_contribute_to, :count => memberships.count) %>
<% for member in memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% else %>
<%= l(:label_x_course_contribute_to, :count => 0) %>
<% user_courses = user_courses_list(user) %>
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
<% for course in user_courses %>
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %><%= (user_courses.last == course) ? '' : '' %>
<% end %>
</p>
</td>

View File

@ -28,7 +28,7 @@
<span class="font_lighter"> <%= l(:label_peoject_take_in) %></span> <%= link_to_project(membership.project) %></td>
</tr>
<tr>
<td colspan="2" width="580" style="word-break:break-all">
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
<p class="font_description">
<%= membership.project.short_description%>
</p></td>

View File

@ -7,29 +7,30 @@
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :title => "#{user.name}" %></td>
<td><table width="580px" border="0">
<tr> <!-- modified by bai 增加了关注人的名字全称-->
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to(user.name,user_path(user)), :class => "project_avatar_name" %>
<td colspan="2" valign="top"><strong><%= content_tag "div", link_to(user.name,user_path(user)), :class => "project_avatar_name" %></strong>
</td>
</tr>
<tr> <!-- modified by bai 区别了“关注”里个人参与的项目与课程-->
<td colspan="2" width="580px" ><p class="font_description">
<% unless user.memberships.empty? %>
<%# unless user.memberships.empty? %>
<% cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" %>
<% memberships = user.memberships.all(:conditions => cond) %>
<%= l(:label_x_contribute_to, :count => memberships.count) %>
<% for member in memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<% end %>
<%# end %>
</p>
<p class="font_description">
<% unless user.memberships.empty? %>
<% cond = Project.visible_condition(User.current) + " AND projects.project_type = 1" %>
<% memberships = user.memberships.all(:conditions => cond) %>
<%= l(:label_x_course_contribute_to, :count => memberships.count) %>
<% for member in memberships %>
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : '' %>
<% end %>
<%# unless user.memberships.empty? %>
<% user_courses = user_courses_list(user) %>
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
<% for course in user_courses %>
<%# if course.name != nil %>
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %><%= (user_courses.last == course) ? '' : '' %>
<%# end %>
<% end %>
<%# end %>
</p>
</td>
</tr>

View File

@ -158,7 +158,7 @@
<div class="d-p-projectlist">
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
<li style="overflow:auto;word-break:break-all;height:100%;" class='<%= cycle("odd", "even") %>'>
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4" style="float: left; margin-top: 7px">
<%= image_tag('/images/contest1.png')%>
</div>
@ -197,7 +197,7 @@
<span style="margin-top: -20px;float: right; display: block;"><%#= link_to l(:label_more_information), forums_path %></span>
<div style="height: 167px; padding-top:6px;">
<fieldset style="padding-left: 36px; margin-left: 13px; height: 150px; width:380px; border-radius:10px;">
<div style="font-size:14px; color: #1166AD;text-align:center;word-break: break-all; "><strong style="margin:auto;"><%= @contestNotification.title %></strong></div>
<div style="font-size:14px; color: #1166AD;text-align:center;word-break: break-all;word-wrap: break-word; "><strong style="margin:auto;"><%= @contestNotification.title %></strong></div>
<div class="underline-contests_four"></div>
<div id="up_zzjs">
<div id="marqueebox">

View File

@ -66,7 +66,7 @@
<% #projects = find_miracle_project(10, 3) %>
<% @projects.map do |project| %>
<!--<%# cache cache_key_for_project(project) do %> -->
<li style="overflow:auto;word-break:break-all;height:100%;" class='<%= cycle("odd", "even") %>'>
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
<div style="float: left;">
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
</div>

View File

@ -22,6 +22,6 @@
%>, <%= format_time(@diff.content_to.updated_on) %>)</em>
</p>
<div class="text-diff" style=" width: 100%;word-break: break-all;">
<div class="text-diff" style=" width: 100%;word-break: break-all;word-wrap: break-word;">
<%= simple_format_without_paragraph @diff.to_html %>
</div>

View File

@ -1809,3 +1809,4 @@ en:
notice_account_invalid_creditentials_new: You have not to the mailbox activation
lable_unknow_type: Unknow type
lable_score_less_than_zero: Score less than 0, revised to 0
review_assignments: review assignments

View File

@ -276,6 +276,7 @@ zh:
field_is_default: 默认值
field_tracker: 跟踪
field_subject: 主题
field_quote: 描述
field_due_date: 计划完成日期
field_assigned_to: 指派给
field_priority: 优先级
@ -2116,4 +2117,5 @@ zh:
lable_forums_max_length: 贴吧描述最大长度为65535个字符
lable_unknow_type: 未知类型
lable_score_less_than_zero: 得分小于0修正为0
review_assignments: 评审任务

View File

@ -441,10 +441,10 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.datetime "updated_at", :null => false
t.string "page_type"
t.integer "sort_type"
t.integer "image_width", :default => 107
t.integer "image_height", :default => 63
t.integer "show_course", :default => 1
t.integer "show_contest", :default => 1
t.integer "image_width", :default => 107
t.integer "image_height", :default => 63
end
create_table "forums", :force => true do |t|
@ -899,7 +899,7 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
t.integer "osp_id"
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false
t.text "content", :limit => 16777215, :null => false
t.integer "author_id"
t.integer "replies_count", :default => 0
t.integer "last_reply_id"
@ -933,6 +933,19 @@ ActiveRecord::Schema.define(:version => 20140826072838) do
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
create_table "rich_rich_files", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "rich_file_file_name"
t.string "rich_file_content_type"
t.integer "rich_file_file_size"
t.datetime "rich_file_updated_at"
t.string "owner_type"
t.integer "owner_id"
t.text "uri_cache"
t.string "simplified_type", :default => "file"
end
create_table "roles", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false
t.integer "position", :default => 1

View File

@ -97,7 +97,7 @@ table.annotate td.author {
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_D { background: #f88 }