alan 11 years ago
commit 72ed73fb05

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

@ -460,6 +460,7 @@ module ApplicationHelper
project_tree(projects) do |project, level| project_tree(projects) do |project, level|
name_prefix = (level > 0 ? '&nbsp;' * 2 * level + '&#187; ' : '').html_safe name_prefix = (level > 0 ? '&nbsp;' * 2 * level + '&#187; ' : '').html_safe
tag_options = {:value => project.id} tag_options = {:value => project.id}
tag_options[:title] = project.name
if project == options[:selected] || (options[:selected].respond_to?(:include?) && options[:selected].include?(project)) if project == options[:selected] || (options[:selected].respond_to?(:include?) && options[:selected].include?(project))
tag_options[:selected] = 'selected' tag_options[:selected] = 'selected'
else else
@ -1836,11 +1837,8 @@ module ApplicationHelper
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'} bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"} forum_link = link_to l(:label_project_module_forums), {:controller => "forums", :action => "index"}
stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'} stores_link = link_to l(:label_stores_index), {:controller => 'stores', :action=> 'index'}
school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'} school_all_school_link = link_to l(:label_school_all), {:controller => 'school', :action => 'index'}
#@nav_dispaly_project_label #@nav_dispaly_project_label
nav_list = Array.new nav_list = Array.new
nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1 nav_list.push(school_all_school_link) if @nav_dispaly_course_all_label && @show_course == 1

@ -219,7 +219,7 @@ module CoursesHelper
def render_course_hierarchy(courses) def render_course_hierarchy(courses)
render_course_nested_lists(courses) do |course| render_course_nested_lists(courses) do |course|
s = link_to_course(course, {}, :class => "#{course.css_classes} #{User.current.member_of?(course) ? 'my-course' : nil}").html_safe s = link_to_course(course, {}, :class => "#{course.css_classes} #{User.current.member_of_course?(course) ? 'my-course' : nil}").html_safe
s s
end end
end end

@ -15,7 +15,7 @@
<%= l(:label_private) %> <%= l(:label_private) %>
</span> </span>
<% end %> <% end %>
<%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%> <%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info #{User.current.member_of_course?(@course) ? 'my-project' : nil}"))%>
</p> </p>
<p > <p >
<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%> <%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%>

@ -1,4 +1,3 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>');
showModal('ajax-modal', '510px'); showModal('ajax-modal', '510px');
$('#ajax-modal').addClass('new-watcher');
$('#ajax-modal').css('height','330px'); $('#ajax-modal').css('height','330px');

@ -54,7 +54,7 @@
if (textStatus == 'success') { if (textStatus == 'success') {
eval(xhr.responseText); eval(xhr.responseText);
} else if (textStatus == 'error') { } else if (textStatus == 'error') {
alert('error'); // alert('error');
} }
} }

@ -51,7 +51,7 @@
style="word-break: break-all;word-wrap: break-word;"> style="word-break: break-all;word-wrap: break-word;">
<%= label_tag l(:field_subject) %>: <%=h @memo.subject %> <%= label_tag l(:field_subject) %>: <%=h @memo.subject %>
</div> </div>
<div class="memo-content"> <div class="memo-content" id="memo-content_div">
<%= textAreailizable(@memo,:content) %> <%= textAreailizable(@memo,:content) %>
<p> <p>
<% if @memo.attachments.any?%> <% if @memo.attachments.any?%>
@ -153,4 +153,13 @@ jQuery(document).ready(function($) {
transpotUrl('.lz'); transpotUrl('.lz');
transpotUrl('.replies'); 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> </script>

@ -14,9 +14,14 @@
<script type="text/javascript"> <script type="text/javascript">
function get_options(value) { function get_options(value) {
var prefix = "";
if(location.href.indexOf('ros')>=0)
{
prefix = "/ros"
}
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: 'http://<%= Setting.host_name%>/school/get_options/' + encodeURIComponent(value), url: prefix + '/school/get_options/' + encodeURIComponent(value),
data: 'text', data: 'text',
success: function (data) { success: function (data) {
$("#province").val(value); $("#province").val(value);

@ -2,38 +2,39 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
var prefix = '';
if(location.href.indexOf('ros') >= 0)
{
prefix = '/ros'
}
$("#province").html("<option value='0' selected = true style='display: none;'></option>"); $("#province").html("<option value='0' selected = true style='display: none;'></option>");
$.ajax({ $.ajax({
type :"POST", type :"POST",
url :'/school/get_province', url :prefix + '/school/get_province',
data: "send", data: "send",
success: function(data, textStatus){ success: function(data, textStatus){
$("#province").append(data.text); $("#province").append(data.text);
$("#schoollist").html(data.text_s); $("#schoollist").html(data.text_s);
} }
}) })
}); });
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function get_school(value){ function get_school(value){
var prefix = '';
if(location.href.indexOf('ros') >= 0)
{
prefix = '/ros'
}
$.ajax({ $.ajax({
type :"POST", type :"POST",
url :'/school/get_schoollist/'+encodeURIComponent(value), url :prefix + '/school/get_schoollist/'+encodeURIComponent(value),
data :'text', data :'text',
success: function(data){ success: function(data){
$("#schoollist").html(data); $("#schoollist").html(data);
//$("#schoollist").html(data);
} }
})
}
)
} }
</script> </script>
@ -41,7 +42,6 @@
function test(id){ function test(id){
location.href = encodeURI('http://<%= Setting.host_course %>/?school_id='+id); location.href = encodeURI('http://<%= Setting.host_course %>/?school_id='+id);
} }
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function ssearch(){ function ssearch(){
@ -54,20 +54,20 @@
alert("<%= l(:label_search_conditions_not_null) %>"); alert("<%= l(:label_search_conditions_not_null) %>");
return; return;
} }
//alert(province); var prefix = '';
if(location.href.indexOf('ros') >= 0)
{
prefix = '/ros'
}
$.ajax({ $.ajax({
type :"POST", type :"POST",
url :'/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+province, url :prefix + '/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+province,
data :'text', data :'text',
success: function(data){ success: function(data){
$("#schoollist").html(data); $("#schoollist").html(data);
//$("#schoollist").html(data);
} }
}) })
} }
function word_keydown(e){ function word_keydown(e){
if(e&& e.keyCode==13){ if(e&& e.keyCode==13){
ssearch(); ssearch();
@ -77,25 +77,27 @@
<div> <div>
<p> <p>
<%= link_to l(:label_all_schol),school_index_path %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <%= link_to l(:label_all_schol),school_index_path %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% if User.current.logged? %> <% if User.current.logged? %>
<a href="http://<%= Setting.host_course %>"><%= l(:label_my_school) %></a> <a href="http://<%= Setting.host_course %>">
<%= l(:label_my_school) %>
</a>
<% end %> <% end %>
</p> </p>
<ul> <ul>
<li style="width: 40%; float: left"><%= l(:label_select_province) %>: <li style="width: 40%; float: left">
<%= l(:label_select_province) %>:
<select id="province" name="province" onchange="get_school(this.value)"></select> <select id="province" name="province" onchange="get_school(this.value)"></select>
</li> </li>
<li style="width: 50%; float: left"><input type="text" id="key_word" name="key_word" onkeydown="word_keydown(event);"/> <li style="width: 50%; float: left">
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="ssearch()"></li> <input type="text" id="key_word" name="key_word" onkeydown="word_keydown(event);"/>
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="ssearch()">
</li>
</ul> </ul>
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
<div class="school-index"> <div class="school-index">
<ul id="schoollist" style="line-height: 25px"> <ul id="schoollist" style="line-height: 25px">
</ul> </ul>
</div> </div>
<% html_title(l(:label_school_all)) -%> <% html_title(l(:label_school_all)) -%>

@ -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, <%= textAreailizable content, :text, :attachments => content.page.attachments,
:edit_section_links => (@sections_editable && {:controller => 'wiki', :action => 'edit', :project_id => @page.project, :id => @page.title}) %> :edit_section_links => (@sections_editable && {:controller => 'wiki', :action => 'edit', :project_id => @page.project, :id => @page.title}) %>
<%#= content.text.html_safe %> <%#= content.text.html_safe %>

@ -68,3 +68,15 @@
<%= render :partial => 'sidebar' %> <%= render :partial => 'sidebar' %>
<% end %> <% end %>
<% html_title @page.pretty_title %> <% 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>

@ -2057,7 +2057,6 @@ zh:
zero: 个动态 zero: 个动态
one: 个动态 one: 个动态
other: 个动态 other: 个动态
label_school_all: 中国高校
label_upload_files: 上传资源 label_upload_files: 上传资源
label_relation_files: 关联已有资源 label_relation_files: 关联已有资源
label_contest_settings: 配置竞赛 label_contest_settings: 配置竞赛

@ -2835,3 +2835,7 @@ div.repos_explain{
.projects-index{min-height: 350px} .projects-index{min-height: 350px}
.school-index{min-height: 400px} .school-index{min-height: 400px}
#membership_project_id option
{
width: 190px;
}
Loading…
Cancel
Save