Merge branch 'szzh' into guange_dev

This commit is contained in:
sw 2015-04-10 16:39:24 +08:00
commit 858a54267f
26 changed files with 93 additions and 62 deletions

View File

@ -1,5 +1,5 @@
class CoursesController < ApplicationController
layout 'base_courses'
# layout 'base_courses'
include CoursesHelper
include ActivitiesHelper
helper :activities
@ -73,6 +73,7 @@ class CoursesController < ApplicationController
if @course.errors.full_messages.count <= 0
respond_to do |format|
format.html {
# render :layout => 'base_courses'
flash[:notice] = l(:notice_successful_update)
redirect_to settings_course_url(@course)
}
@ -82,7 +83,7 @@ class CoursesController < ApplicationController
respond_to do |format|
format.html {
settings
render :action => 'settings'
redirect_to settings_course_url(@course)
}
format.api { render_validation_errors(@course) }
end
@ -407,6 +408,10 @@ class CoursesController < ApplicationController
@roles = Role.givable.all[3..5]
@members = @course.member_principals.includes(:roles, :principal).all.sort
respond_to do |format|
format.html { render :layout => 'base_courses' }
format.api { render_validation_errors(@course) }
end
else
render_403
end
@ -424,6 +429,7 @@ class CoursesController < ApplicationController
else
respond_to do |format|
format.html {
render :layout => 'base_courses'
flash[:notice] = l(:notice_successful_create)
if params[:continue]
redirect_to new_course_url(attrs, :course => '0')
@ -738,7 +744,7 @@ class CoursesController < ApplicationController
@user = User.find_by_id(CourseInfos.find_by_course_id(@course.id).user_id)
end
sorted_events = sort_activity_events_course(events);
sorted_events = sort_activity_events_course(events)
events = paginateHelper sorted_events,10
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
# documents

View File

@ -20,7 +20,7 @@ module CoursesHelper
# 返回教师数量即roles表中定义的Manager
def teacherCount project
project.members.count - studentCount(project).to_i
project ? project.members.count - studentCount(project).to_i : 0
# or
# searchTeacherAndAssistant(project).count
end
@ -152,7 +152,7 @@ module CoursesHelper
# 学生人数计算
# add by nwb
def studentCount course
course.student.count.to_s#course.student.count
course ? course.student.count.to_s : 0#course.student.count
end
#课程成员数计算
@ -782,6 +782,7 @@ module CoursesHelper
end
def visable_attachemnts_incourse course
return[] unless course
result = []
course.attachments.each do |attachment|
if attachment.is_public? || User.current.member_of_course?(course) || User.current.admin?

View File

@ -278,4 +278,29 @@ module UsersHelper
end
}
end
#获取用户留言相关的连接
def user_jour_feed_back_url active
if active.act_type == "JournalsForMessage"
jour = JournalsForMessage.find active.act_id
if jour
case jour.jour_type
when "Principal"
link_to(l(:label_goto), user_newfeedback_user_path(jour.jour_id))
when "Project"
link_to(l(:label_goto), project_feedback_path(jour.jour_id))
when "Bid"
link_to(l(:label_goto), course_for_bid_path(jour.jour_id))
when "Course"
link_to(l(:label_goto), course_feedback_path(jour.jour_id))
when "Contest"
link_to(l(:label_goto), show_contest_contest_path(jour.jour_id))
when "Softapplication"
link_to(l(:label_goto), softapplication_path(jour.jour_id))
when "HomeworkAttach"
link_to(l(:label_goto), course_for_bid_path(jour.jour_id))
end
end
end
end
end

View File

@ -15,7 +15,7 @@
<%= format_time(journal.created_on) %>
</span>
<div class="cl"></div>
<p>
<p class="upload_img">
<%= journal.notes.html_safe %>
</p>
</div>

View File

@ -31,7 +31,7 @@
$(function(){if($("#bid_description_<%= bid.id%>_content").height()>38){$("#bid_show_more_des_button<%= bid.id%>").show();}});
</script>
<div id="bid_description_<%= bid.id%>" class="news_description mt5">
<div id="bid_description_<%= bid.id%>_content">
<div id="bid_description_<%= bid.id%>_content" class="upload_img">
<%= bid.description.html_safe %>
</div>
</div>

View File

@ -9,12 +9,13 @@
<a class="problem_pic fl">
<%= image_tag(url_to_avatar(e.event_author), :width => "42", :height => "42") %>
</a>
<div class="problem_txt fl mt5">
<div class="problem_txt fl mt5 upload_img">
<%= link_to_user_header(e.event_author,false,:class => 'problem_name c_orange fl') if e.respond_to?(:event_author) %>
<%= link_to_user_header("(#{e.event_author})", @canShowRealName,:class => 'problem_name c_orange fl') if @canShowRealName && e.respond_to?(:event_author) %>
<span class="fl"> &nbsp;</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) : e.event_url,:class => "problem_tit c_dblue fl fb"%>
<%= 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"%>
<br />
<p class="mt5 break_word"><%= e.event_description.html_safe %>
<br />

View File

@ -9,7 +9,7 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>")
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("popbox_polls");
}

View File

@ -46,8 +46,8 @@
</div>
<div class="cl"></div>
<div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "10"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "10"} %>
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
</div>
<div class="cl"></div>
</div><!---re_con_box end-->

View File

@ -16,7 +16,7 @@
</td>
</tr>
<tr>
<td style="word-break: break-all;word-wrap: break-word;">
<td style="word-break: break-all;word-wrap: break-word;" class="upload_img">
<p>
<%= textAreailizable forum.description%>
</p>

View File

@ -173,7 +173,6 @@ function cookieget(n)
<% end %>
</div>
<div class="msgserver">
<a href="http://user.trustie.net/users/12/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>黄井泉</a>
<a href="http://user.trustie.net/users/34/user_newfeedback" style="color: #15BCCF;"><%= l(:label_technical_support) %>白&nbsp;&nbsp;&nbsp;羽</a>
</div>
</div>

View File

@ -21,10 +21,6 @@
<% end %>
</div>
<div class="msgserver">
<a href="http://user.trustie.net/users/12/user_newfeedback" target="_blank">
<%= l(:label_technical_support) %>
黄井泉
</a>
<a href="http://user.trustie.net/users/34/user_newfeedback" target="_blank">
<%= l(:label_technical_support) %>
白&nbsp;&nbsp;&nbsp;羽

View File

@ -43,7 +43,7 @@
<%=l(:label_courses_management_platform)%>
</a>
>
<%= link_to @course.name, nil %>
<%= link_to @course.name, course_path(@course) %>
</p>
</div>
<div class="search fl">

View File

@ -53,7 +53,7 @@
<div class="sidebar-forums">
<div class="forums-line">
<div class="forums-title"><%= @forum.name %></div>
<div class="forums-description"><%= @forum.description.html_safe %></div>
<div class="forums-description upload_img"><%= @forum.description.html_safe %></div>
</div>
<!--informations-->
<div class="formus-first-title" >创建人信息</div>

View File

@ -36,6 +36,7 @@
}
.span_wping a:hover{ background-color:#03a1b3;}
.span_wping_background{background: #CCC !important;}
.font_lighter_sidebar img{max-width: 100%}
</style>
</head>
<body class="<%= h body_css_classes %>">

View File

@ -84,7 +84,7 @@
<div class="sidebar-forums">
<div class="forums-line">
<div class="forums-title"><%= @forum.name %></div>
<div class="forums-description"><%= @forum.description.html_safe %></div>
<div class="forums-description upload_img"><%= @forum.description.html_safe %></div>
</div>
<!--informations-->
<div class="formus-first-title" >创建人信息</div>

View File

@ -30,7 +30,7 @@
:class => 'talk_edit fr'
) if @message.course_destroyable_by?(User.current) %>
<div class="cl"></div>
<div class="talk_info mb10"><%= @topic.content.html_safe %></div>
<div class="talk_info mb10 upload_img"><%= @topic.content.html_safe %></div>
<div class="talk_info mb10"><%= link_to_attachments_course @topic, :author => false %></div>
<!-- <a href="#" class=" link_file ml60">附件爱覅俄方if.zip(27.5kB)</a>-->
<div class="cl"></div>
@ -54,7 +54,7 @@
<div class="ping_C mb10" id="<%= "message-#{message.id}" %>">
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %></div>
<div class="ping_discon">
<div class="ping_distop">
<div class="ping_distop upload_img">
<%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %>
<span class="c_grey fr"><%= format_time(message.created_on) %></span>
<div class="cl"></div>

View File

@ -44,7 +44,7 @@
<%= f.kindeditor :content, :editor_id => 'message_content_editor',
:owner_id => @message.nil? ? 0: @message.id,
:owner_type => OwnerTypeHelper::MESSAGE,
:width => '91%',
:width => '90%',
:height => 300,
:class => 'talk_text fl',
:input_html => { :id => 'message_content',

View File

@ -26,7 +26,7 @@
</p>
<% else %>
<% @newss.each do |news| %>
<div class="problem_main">
<div class="problem_main upload_img">
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
<div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
@ -43,7 +43,7 @@
<%= l(:button_more)%>...
<span class="g-arr-down"></span>
</div>
<span class="fl"><%= l(:label_end_time)%><%= format_time(news.created_on)%></span>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
</div>
<div class="cl"></div>
</div><!--problem_main end-->

View File

@ -31,7 +31,7 @@
:onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @course) %>
<%= delete_link(news_path(@news),:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %>
<div class="cl"></div>
<div class="mb5">
<div class="mb5 upload_img">
<%= @news.description.html_safe %>
<br />
<%= l(:label_create_time) %> <%= format_time(@news.created_on) %>
@ -74,7 +74,7 @@
<%= format_time(comment.created_on) %>
</span>
<div class="cl"></div>
<p><%= comment.comments.html_safe %></p>
<p class="upload_img"><%= comment.comments.html_safe %></p>
</div>
<div class="ping_disfoot">
<%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},

View File

@ -6,20 +6,16 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n
$('#name-issue').val("");
<% elsif @obj_flag == '6'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name',
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$("#put-tag-form-<%#=@obj.class%>-<%#=@obj.id%>").hide();
$("#put-tag-form-<%=@obj.class%>-<%=@obj.id%> #name").val("");
$("#tags_name_<%=@obj.id%>").val("");
$("#add_tag_<%=@obj.id%>").hide();
<% elsif @obj_flag == '9'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#tags_name').val("");
<% elsif @obj_flag == '10'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$("#put-tag-form-<%#=@obj.class%>-<%#=@obj.id%>").hide();
$("#tags_name_<%=@obj.id%>").val("");
<% else%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');

View File

@ -97,13 +97,14 @@
</td>
</tr>
<tr>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description">
<%= textAreailizable act.notes %>
</p>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>
<% puts 11111111111111%>
<%= user_jour_feed_back_url e %>
</span>
</div>
</td>
@ -167,7 +168,7 @@
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description">
<%=textAreailizable act, :description %>
</p></td>
@ -227,7 +228,7 @@
<% else %>
<% desStr= textAreailizable(act, :notes) %>
<% end %>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description">
<%= desStr %>
</p>
@ -282,7 +283,7 @@
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description">
<%= textAreailizable act,:long_comments %>
</p>
@ -344,7 +345,7 @@
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description">
<%= textAreailizable(act,:content) %>
</p>
@ -385,7 +386,7 @@
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description"></p>
</td>
</tr>
@ -428,7 +429,7 @@
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description">
<%= textAreailizable act,:description %>
</p>
@ -559,7 +560,7 @@
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description">
<%= textAreailizable act, :description %>
</p>
@ -633,7 +634,7 @@
</td>
</tr>
<tr>
<td colspan="2" width="580">
<td colspan="2" width="580" class="upload_img">
<p class="font_description">
<%= textAreailizable e.notes %>
</p>

View File

@ -8,6 +8,9 @@ h3, .wiki h2 {font-size: 15px; padding-left: 5px}
h4, .wiki h3 {font-size: 13px;}
h4 {border-bottom: 1px dotted #bbb;}
/*上传图片处理*/
.upload_img img{max-width: 100%;}
/****翻页***/
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}

View File

@ -435,6 +435,9 @@ a.link_file_board{ background:url(../images/pic_file.png) 0 3px no-repeat !impor
#cboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
#cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
/*上传图片处理*/
.upload_img img{max-width: 100%;}
/*
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.

View File

@ -750,9 +750,9 @@ div.actions input[type="text"] {
.memo-content img, .comments img {
overflow: hidden;
/*width: 100%;*/
max-width: 500px;
max-width: 100%;
height: auto !important;
width: expression(this.width > 500 ? "500px" : this.width+"px");
/*width: expression(this.width > 500 ? "500px" : this.width+"px");*/
}
table.content-text-list tbody tr td.sticky, div.memo-section .sticky {

View File

@ -156,8 +156,8 @@ div#menu ul ul a:hover { color:#ff9900;}
div#menu ul ul li.last { margin-left:15px; }
div#menu ul ul li {width: 100%;}
/* menu::level3 */
div#menu ul ul ul {padding: 0;margin: -38px 0 0 92px !important; width:140px; }
div#menu ul ul ul li a{ width:125px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf;}
div#menu ul ul ul {padding: 0;margin: -38px 0 0 92px !important; width:200px; }
div#menu ul ul ul li a{ width:185px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf;}
/*主类容*/
@ -199,7 +199,7 @@ html{ overflow-x:hidden;}
.close_btn span { display:none;}
.side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;}
.msgserver { margin-top:5px;}
.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -112px; padding-left:22px; height:21px; display:block; }
.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -112px; padding-left:22px; height:21px; display:block; color:#15bccf;}
.opnionText{box-shadow:none; width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;}
a.opnionButton{ display:block; background:#15bccf; width:130px; height:23px; margin-top:5px; text-align:center; padding-top:3px;}
a:hover.opnionButton{background: #0fa9bb; }
@ -210,8 +210,7 @@ a:hover.opnionButton{background: #0fa9bb; }
a.close_btn {background-position:-44px 0;}
a:hover.close_btn {background-position:-66px 0;}
.show_btn {background-position:-119px 0;}
.msgserver a {color:#15bccf; }
.msgserver a:hover { text-decoration:underline; }
.msgserver a:hover { color: #0fa9bb; }
.break_word{word-break: break-all;word-wrap: break-word;}
/***** Ajax indicator ******/
#ajax-indicator {