Merge branch 'szzh' into develop

This commit is contained in:
sw 2014-10-24 09:56:31 +08:00
commit 725c9559a6
15 changed files with 88 additions and 54 deletions

View File

@ -56,6 +56,8 @@ class AttachmentsController < ApplicationController
}
format.api
end
rescue Encoding::InvalidByteSequenceError => e
render :action => 'file'
end
def download

View File

@ -42,6 +42,7 @@ class ContestsController < ApplicationController
@offset, @limit = api_offset_and_limit(:limit => 10)
#@contests = Contest.visible
#@contests = @contests.like(params[:name]) if params[:name].present?
@is_search = params[:name] ? true:false
@contests = Contest.visible.where("name like '%#{params[:name]}%'")
if params[:contests_search]
(redirect_to contests_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?

View File

@ -1,9 +1,7 @@
<h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3>
<p class="subtitle">
<%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
</p>
</p>
<div id="activity">
<% @events_by_day.keys.sort.reverse.each do |day| %>
<h3></h3>
@ -13,7 +11,8 @@
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" >
<img src="/images/new/user.jpg" width="40" height="40"/>
<!--img src="/images/new/user.jpg" width="40" height="40"/-->
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
</td>
<td>
<table width="580px" border="0">
@ -63,16 +62,6 @@
</div>
<%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %>
<div style="float:left;">
<%= link_to_content_update("\xc2\xab " + l(:label_previous),
params.merge(:from => @date_to - @days - 1),
:title => l(:label_date_from_to, :start => format_date(@date_to - 2*@days), :end => format_date(@date_to - @days - 1))) %>
</div>
<div style="float:right;">
<%= link_to_content_update(l(:label_next) + " \xc2\xbb",
params.merge(:from => @date_to + @days - 1),
:title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1))) unless @date_to >= Date.today %>
</div>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => params.merge(:from => nil, :key => User.current.rss_key) %>
<% end %>

View File

@ -28,6 +28,7 @@
<% end if @contest %>
<div id="preview" class="wiki"></div>
</div>
<br/>
<% end %>
<div>

View File

@ -38,11 +38,16 @@
</div>
<% if @contests.size > 0%>
<%= sort_contest(@s_state)%>
<div id="bid-show">
<div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div>
<% else %>
<% elsif @is_search%>
<%= render :partial => "layouts/no_content"%>
<% else %>
<%= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div>
<% end %>
<% html_title l(:label_contest_list)%>

View File

@ -36,7 +36,7 @@
</div>
<%= sort_course(@s_type, @school_id)%>
<div id="courses-index">
<div id="courses-index" class="projects-index">
<%if @courses%>
<%= render_course_hierarchy(@courses)%>
<%end%>

View File

@ -51,7 +51,7 @@
style="word-break: break-all;word-wrap: break-word;">
<%= label_tag l(:field_subject) %>: <%=h @memo.subject %>
</div>
<div class="memo-content">
<div class="memo-content" id="memo-content_div">
<%= textAreailizable(@memo,:content) %>
<p>
<% if @memo.attachments.any?%>
@ -149,8 +149,17 @@
<script type="text/javascript">
jQuery(document).ready(function($) {
transpotUrl('.lz');
transpotUrl('.replies');
});
jQuery(document).ready(function($) {
transpotUrl('.lz');
transpotUrl('.replies');
});
window.onready = function() {
var maxwidth = $("#memo-content_div").width();
$("#memo-content_div").children().each(function(){
if($(this).width()>maxwidth)
{
$(this).width(maxwidth);
}
});
};
</script>

View File

@ -31,7 +31,7 @@
<% end %>
</div>
<%= sort_project(@s_type, @project_type) %>
<div id="projects-index">
<div id="projects-index" class="projects-index">
<%= render_project_hierarchy(@projects)%>
</div>

View File

@ -93,7 +93,7 @@
</div>
<div style="clear: both"></div>
<div>
<div class="school-index">
<ul id="schoollist" style="line-height: 25px">
</ul>

View File

@ -1,20 +1,26 @@
<%= form_tag({:action => 'edit', :tab => 'projects'}) do %>
<div class="box tabular settings">
<p>
<%= setting_check_box :default_projects_public %>
</p>
<div class="box tabular settings">
<p><%= setting_check_box :default_projects_public %></p>
<p>
<%= setting_multiselect(:default_projects_modules,
Redmine::AccessControl.available_project_modules.collect {|m| [l_or_humanize(m, :prefix => "project_module_"), m.to_s]}) %>
</p>
<p><%= setting_multiselect(:default_projects_modules,
Redmine::AccessControl.available_project_modules.collect {|m| [l_or_humanize(m, :prefix => "project_module_"), m.to_s]}) %></p>
<p>
<%= setting_multiselect(:default_projects_tracker_ids, Tracker.sorted.all.collect {|t| [t.name, t.id.to_s]}) %>
</p>
<p><%= setting_multiselect(:default_projects_tracker_ids,
Tracker.sorted.all.collect {|t| [t.name, t.id.to_s]}) %></p>
<p>
<%= setting_check_box :sequential_project_identifiers %>
</p>
<p><%= setting_check_box :sequential_project_identifiers %></p>
<p style="display: none;"><%= setting_select :new_project_user_role_id, Role.find_all_givable.collect {|r| [r.name, r.id.to_s]},
:blank => "--- #{l(:actionview_instancetag_blank_option)} ---" %>
</p>
</div>
<p><%= setting_select :new_project_user_role_id,
Role.find_all_givable.collect {|r| [r.name, r.id.to_s]},
:blank => "--- #{l(:actionview_instancetag_blank_option)} ---" %></p>
</div>
<%= submit_tag l(:button_save) %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,4 +1,4 @@
<div class="wiki wiki-page">
<div class="wiki wiki-page" id="wiki_content_div">
<%= textAreailizable content, :text, :attachments => content.page.attachments,
:edit_section_links => (@sections_editable && {:controller => 'wiki', :action => 'edit', :project_id => @page.project, :id => @page.title}) %>
<%#= content.text.html_safe %>

View File

@ -1,27 +1,33 @@
<div class="contextual">
<%= link_to(l(:label_history), {:action => 'history', :id => @page.title},
:class => 'icon icon-history') %>
<%= link_to(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
</div>
<%= wiki_page_breadcrumb(@page) %>
<h3><%= h(@page.pretty_title) %></h3>
<h3>
<%= h(@page.pretty_title) %>
</h3>
<p>
<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %>
<em>(<%= @diff.content_from.author ?
@diff.content_from.author.name : l(:label_user_anonymous)
%>, <%= format_time(@diff.content_from.updated_on) %>)</em>
<%= l(:label_version) %>
<%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %>
<em>
(<%= @diff.content_from.author ? @diff.content_from.author.name : l(:label_user_anonymous)%>,
<%= format_time(@diff.content_from.updated_on) %>)
</em>
&#8594;
<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show',
:id => @page.title, :project_id => @page.project,
:version => @diff.content_to.version
%>/<%= @page.content.version %>
<em>(<%= @diff.content_to.author ?
link_to_user(@diff.content_to.author.name) : l(:label_user_anonymous)
%>, <%= format_time(@diff.content_to.updated_on) %>)</em>
<%= l(:label_version) %>
<%= link_to @diff.content_to.version, :action => 'show',
:id => @page.title, :project_id => @page.project,
:version => @diff.content_to.version %>
/
<%= @page.content.version %>
<em>
(<%= @diff.content_to.author ? link_to_user(@diff.content_to.author.name) : l(:label_user_anonymous)%>,
<%= format_time(@diff.content_to.updated_on) %>)
</em>
</p>
<div class="text-diff" style=" width: 100%;word-break: break-all;word-wrap: break-word;">
<%= simple_format_without_paragraph @diff.to_html %>
<%= simple_format_without_paragraph @diff.to_html %>
</div>

View File

@ -68,3 +68,15 @@
<%= render :partial => 'sidebar' %>
<% end %>
<% html_title @page.pretty_title %>
<script type="text/javascript">
window.onready = function() {
var maxwidth = $("#wiki_content_div").width();
$("#wiki_content_div").children().each(function(){
if($(this).width()>maxwidth)
{
$(this).width(maxwidth);
}
});
};
</script>

View File

@ -2832,3 +2832,6 @@ div.repos_explain{
}
.list .tableth{background-color:#EEEEEE; padding: 4px; white-space:pre;}
.projects-index{min-height: 350px}
.school-index{min-height: 400px}

View File

@ -864,7 +864,7 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
min-height: 200px;
min-height: 180px;
}