course_group
alan 11 years ago
commit 42f3fbd4b8

@ -29,7 +29,7 @@ class CoursesController < ApplicationController
if course
@state = 4
else
unless (allow_join && User.current.member_of_course?(course))
unless (allow_join(course) && User.current.member_of_course?(course))
if params[:course_password] == course.password
members = []
members << Member.new(:role_ids => [10], :user_id => User.current.id)
@ -427,9 +427,7 @@ class CoursesController < ApplicationController
@course_type = params[:course_type]
@school_id = params[:school_id]
per_page_option = 10
if @school_id == "0" or @school_id.nil?
if @school_id == "0" || @school_id.nil?
@courses_all = Course.active.visible.
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id")
else
@ -437,49 +435,37 @@ class CoursesController < ApplicationController
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
where("#{Course.table_name}.school_id = ?", @school_id)
end
@course_count = @courses_all.count
@course_pages = Paginator.new @course_count, per_page_option, params['page']
@course_activity_count=Hash.new
@courses_all.each do |course|
@course_activity_count[course.id]=0
end
case params[:course_sort_type]
when '0'
@courses = @courses_all.order("created_at desc")
@s_type = 0
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses, @course_activity_count
@course_activity_count=get_course_activity @courses, @course_activity_count
when '1'
@courses = @courses_all.order("course_ac_para desc")
@s_type = 1
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses, @course_activity_count
when '2'
@courses = @courses_all.order("watchers_count desc")
@s_type = 2
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses, @course_activity_count
when '3'
@course_activity_count=get_course_activity @courses_all, @course_activity_count
@courses=handle_course @courses_all, @course_activity_count
@s_type = 3
@courses = @courses[@course_pages.offset, @course_pages.per_page]
else
@s_type = 0
@courses = @courses_all.order("created_at desc")
@courses = @courses.offset(@course_pages.offset).limit(@course_pages.per_page)
@course_activity_count=get_course_activity @courses, @course_activity_count
end
@ -521,18 +507,14 @@ class CoursesController < ApplicationController
# 新建作业
def new_homework
@homework = Bid.new
@homework.proportion
@homework.safe_attributes = params[:bid]
if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] ))
render :layout => 'base_courses'
else
render_403
end
end
def toggleCourse
@course_prefs = Course.find_by_extra(@course.extra)
unless (@course_prefs.teacher == User.current || User.current.admin?)
@ -700,8 +682,8 @@ class CoursesController < ApplicationController
private
def allow_join
if course_endTime_timeout? Course.find(params[:object_id])
def allow_join course
if course_endTime_timeout? course
respond_to do |format|
format.js {
@state = 2
@ -722,7 +704,4 @@ class CoursesController < ApplicationController
render_404
end
end
end

@ -479,7 +479,6 @@ module CoursesHelper
type << option2
type
end
#获取课程动态
def get_course_activity courses, activities
@course_ids=activities.keys()

@ -21,15 +21,18 @@
</script>
<%= 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, :onblur => "regexName();" %>
</p>
<p><span id="bid_name_span"></span></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><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :onchange => "regexDeadLine();") %>
<p>
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
</p>
<p>
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :onchange => "regexDeadLine();") %>
<%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span">
</span>
@ -44,6 +47,10 @@
<%= hidden_field_tag 'course_id', @course.id %>
</p>
<fieldset>
<legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @bid} %></p>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p>
<%= render :partial => 'attachments/form', :locals => {:container => @bid} %>
</p>
</fieldset>

@ -11,7 +11,9 @@
<p >
<%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%>
<% unless @course.is_public == 1 %>
<span class='private_project'><%= l(:label_private) %></span>
<span class='private_project'>
<%= l(:label_private) %>
</span>
<% end %>
<%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%>
</p>
@ -19,9 +21,8 @@
<%= content_tag('span', "#{l(:label_institution_name)}:", :class => "course-font")%>
<% @admin = @course.course_infos%>
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
<!-- <%#= @admin.first.user.user_extensions.occupation %> -->
<% unless @course.teacher.user_extensions.school.nil? %>
<%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %>
<%= link_to(@course.school.try(:name), school_course_list_path(@course.school)) if @course.school %>
<% end %>
<% end %>
</p>
@ -46,13 +47,11 @@
</p>
<p class="stats">
<%= content_tag('span', "#{garble @course.members.count}", :class => "info") %>
<%#= content_tag('span', l(:label_x_member, :count => @course.members.count)) %>
<%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>
</p>
<!--gcm-->
<p class="stats">
<%= content_tag('span', link_to("#{@course_activity_count[@course.id]}", course_path(@course)), :class => "info") %>
<%= content_tag('span', l(:label_x_activity, :count => @course_activity_count[@course.id])) %>
</p>
@ -62,7 +61,7 @@
<span class="info"></span>
<% if(course_endTime_timeout? @course) %>
<span class="font_lighter">
课程学期已结束
<%= l(:lable_course_end) %>
</span>
<% else %>
<%= join_in_course_for_list(@course, User.current,['regular'])%>
@ -80,10 +79,6 @@
<div class="add-info" style="margin-left: 30px; margin-top: -20px">
<%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %>
<%# desc = course.short_description.nil? ? "" : course.short_description%>
<!--<#div class="brief_introduction" title="<%#= desc.html_safe%>">
<%#= desc.html_safe%>
</div>-->
<%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
</div>

@ -2,7 +2,7 @@
function get_options(value) {
$.ajax({
type: "POST",
url: '/school/get_options/' + encodeURIComponent(value),
url: 'http://<%= Setting.host_name%>/school/get_options/' + encodeURIComponent(value),
data: 'text',
success: function (data) {
$("#occupation").html(data);

@ -21,30 +21,40 @@
</script>
<%= 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, :onblur => "regexName();" %>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;",
:maxlength => Bid::NAME_LENGTH_LIMIT,
:onblur => "regexName();" %>
</p>
<p><span id="bid_name_span"></span></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> -->
<p>
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;",
:maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
</p>
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>
<p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %>
<%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span">
</span>
</p>
<p><%= f.select :is_evaluation, is_evaluation_option %>
<p>
<%= f.select :is_evaluation, is_evaluation_option %>
</p>
<p><%= f.select :proportion, proportion_option %>
<p>
<%= f.select :proportion, proportion_option %>
</p>
<p><%= hidden_field_tag 'course_id', @course.id %>
<p>
<%= hidden_field_tag 'course_id', @course.id %>
</p>
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
<fieldset>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p>
<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
</p>
</fieldset>

@ -39,8 +39,6 @@
<div id="courses-index">
<%if @courses%>
<%= render_course_hierarchy(@courses)%>
<%#= render :partial => 'course', :locals => {:course => @courses.first}%>
<%#= "<a herf = 'aaa'>hello</a>".html_safe %>
<%end%>
</div>
@ -56,10 +54,6 @@
</p>
<% end %>
<%# other_formats_links do |f| %>
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<%# end %>
<% content_for :sidebar do %>
<%= form_tag({}, :method => :get) do %>
<h3><%= l(:label_project_plural) %></h3>

@ -51,7 +51,7 @@
:class => 'icon icon-edit' %>
<%= delete_link membership_path(member),
:remote => true,
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %>
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %>
</td>
<% end %>
<!--end-->
@ -82,7 +82,11 @@
<p style="padding-top: 5px"><%= l(:label_role_plural) %>:
<% roles.each do |role| %>
<label><%= radio_button_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<% if role.id == 10 %> <!-- 默认学生角色 -->
<label><%= radio_button_tag 'membership[role_ids][]', role.id, true %> <%= h role %></label>
<% else %>
<label><%= radio_button_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<% end %>
<% end %></p>
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>

@ -9,17 +9,20 @@
<div>
<table class="underline-evreycontent" style="font-size: 14px;">
<tr>
<td valign="top" width="50"><%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %></td>
<td valign="top" width="50">
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %>
</td>
<td>
<table width="580px" border="0" style="width: 100%;table-layout: fixed">
<tr>
<td colspan="2" valign="top" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<strong> <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %></strong>
<strong>
<%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %>
</strong>
<span class="font_lighter">
<% if @canShowRealName %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>
)
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>)
<% else %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% end %>
@ -32,15 +35,26 @@
<td colspan="2" width="580px">
<p class="info-break">
<%= h(truncate(strip_tags(e.event_description).gsub(/&nbsp;/, ' '), length: 30, omission: '...')) %>
</p></td>
</p>
</td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span>
<td align="left">
<span class="font_lighter">
<%= l :label_activity_time %>
&nbsp;
<%= format_activity_day(day) %>
<%= format_time(e.event_datetime, false) %>
</span>
</td>
<% if e.event_type == "issue" %>
<td align="right">
<span> <%= link_to l(:label_find_all_comments), issue_path(e.id) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count) %></span>
<span>
<%= link_to l(:label_find_all_comments), issue_path(e.id) %>
</span>
<span class="font_lighter">
<%= l(:label_comments_count, :count => e.journals.count) %>
</span>
</td>
<% end %>
</tr>
@ -51,30 +65,33 @@
</div>
<% end %>
</div>
<% end -%>
<% if (@events_pages.page == @events_pages.last_page) %>
<div class="font_description">
<table width="660">
<tr>
<td><%= image_tag(url_to_avatar(@user), :class => "avatar") %></td>
<td>
<%= image_tag(url_to_avatar(@user), :class => "avatar") %>
</td>
<td colspan="2">
<table width="580">
<tr>
<td>
<% if @canShowRealName %>
(<%= link_to_user(@user, @canShowRealName) %>
)
(<%= link_to_user(@user, @canShowRealName) %>)
<% else %>
<%= link_to_user(@user)%>
<% end %>
<%= l(:label_user_create_project) %> <%= link_to @course.name %>
<strong> !</strong></td>
<%= l(:label_user_create_project) %>
<%= link_to @course.name %>
<strong> !</strong>
</td>
</tr>
<tr>
<td class="font_lighter" style="float: right"><%= l :label_create_time %>
: <%= format_time(@course.created_at) %>
<td class="font_lighter" style="float: right">
<%= l :label_create_time %>:
<%= format_time(@course.created_at) %>
</table>
</td>
</tr>
@ -88,24 +105,27 @@
<div class="font_description">
<table width="660">
<tr>
<td><%= image_tag(url_to_avatar(@user), :class => "avatar") %></td>
<td>
<%= image_tag(url_to_avatar(@user), :class => "avatar") %>
</td>
<td colspan="2">
<table width="580">
<tr>
<td>
<% if @canShowRealName %>
(<%= link_to_user(@user, @canShowRealName) %>
)
(<%= link_to_user(@user, @canShowRealName) %>)
<% else %>
<%= link_to_user(@user)%>
<% end %>
<%= l(:label_user_create_project) %> <%= link_to @course.name %>
<strong> !</strong></td>
<%= l(:label_user_create_project) %>
<%= link_to @course.name %>
<strong> !</strong>
</td>
</tr>
<tr>
<td class="font_lighter" style="float: right"><%= l :label_create_time %>
: <%= format_time(@course.created_at) %>
<td class="font_lighter" style="float: right">
<%= l :label_create_time %>:
<%= format_time(@course.created_at) %>
</table>
</td>
</tr>

@ -2,11 +2,11 @@
<% attachmenttypes = @course.attachmenttypes %>
<% sufixtypes = @course.contenttypes %>
<span class="borad-title"><%= t(:label_user_course) %>资源共享区</span>
<span class="borad-title">
<%= l(:label_coursefile_sharingarea) %>
</span>
<div class="content-title-top">
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @course) %>
<div class="clearfix"></div>
<div id="file_buttons" class="nhidden">
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @course) %>
@ -55,7 +55,7 @@
<% if sufixtypes.any? %>
&nbsp;
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label>
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') + options_for_select(sufixtypes),
:onchange => "course_attachment_contenttypes_searchex(this.value)" %>
<% end %>
</div>

@ -9,57 +9,55 @@
<col class="vzebra-even"/>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<!-- <col class="vzebra-odd"/> -->
</colgroup>
<thead>
<tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %>
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
<%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<!-- <%#= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr>
</thead>
<tbody>
<%# @containers.each do |container| %>
<%# next if container.attachments.empty? -%>
<%# if container.is_a?(Version) -%>
<!--<tr>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
<%#= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</th>
</tr>-->
<%# end -%>
<% if @curse_attachments != nil %>
<% @curse_attachments.each do |file| %>
<%if file.is_public == 0 && !User.current.member_of_course?(@course)%>
<%next%>
<%end%>
<tr class="file <%= cycle("odd", "odd") %>">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize">
<%= number_to_human_size(file.filesize) %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName unless file.attachmentstype.nil? %></span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.attachmentstype.typeName unless file.attachmentstype.nil? %>
</span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type">
<%= file.show_suffix_type %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type"><%= file.show_suffix_type %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.file_dense_str %>
</span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads">
<%= file.downloads %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -77,13 +75,6 @@
</tr>
<% end -%>
<% end %>
<%# reset_cycle %>
<%# end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>
<!--分页-->

@ -3,25 +3,22 @@
<% attachmenttypes = @course.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @course) %>
<table class="list files" id="ver-zebra">
<table class="list files" id="ver-zebra" style="table-layout: fixed;">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<!-- <col class="vzebra-odd"/> -->
</colgroup>
<thead>
<tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %>
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
<%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
</tr>
</thead>
<tbody>
@ -33,28 +30,36 @@
<% end %>
<% if isTypeOk(file, selAttachType, selContentType) %>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filename" style="font-size: 13px; ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</td>
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %></span>
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %>
</span>
&nbsp;
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file, :contentype => selContentType} %>
</span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type">
<%= file.show_suffix_type %>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.file_dense_str %>
</span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'course_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
</td>
<td class="downloads">
<%= file.downloads %>
</td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -75,9 +80,6 @@
<% end -%>
<% reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>

@ -15,52 +15,51 @@
<thead>
<tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure",:class => "tableth") %>
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype",:class => "tableth") %>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<!-- <%#= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr>
</thead>
<tbody>
<%# @containers.each do |container| %>
<%# next if container.attachments.empty? -%>
<%# if container.is_a?(Version) -%>
<!--tr>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
<%#= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</th>
</tr-->
<%# end -%>
<% if @curse_attachments != nil %>
<% @curse_attachments.each do |file| %>
<%if file.is_public == 0 && !User.current.member_of?(@project)%>
<%next%>
<%end%>
<tr class="file <%= cycle("odd", "odd") %>">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize">
<%= number_to_human_size(file.filesize) %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.attachmentstype.typeName %>
</span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type"><%= file.show_suffix_type %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type">
<%= file.show_suffix_type %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.file_dense_str %>
</span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads">
<%= file.downloads %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -73,15 +72,13 @@
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>
<div class="read-more hidden">
<a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a>
</div>
</td>
</tr>
<% end -%>
<%# reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>
</div>

@ -3,7 +3,7 @@
<% attachmenttypes = @project.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<table class="list files" id="ver-zebra">
<table class="list files" id="ver-zebra" style="table-layout: fixed;">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
@ -13,15 +13,13 @@
</colgroup>
<thead>
<tr>
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %>
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
<%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype") %>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure" ,:class => "tableth") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
<%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
</tr>
</thead>
<tbody>
@ -33,28 +31,38 @@
<% end %>
<% if isTypeOk(file, selAttachType, selContentType) %>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="filename" style="font-size: 13px; ">
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
</td>
<td class="filesize">
<%= number_to_human_size(file.filesize) %>
</td>
<td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %></span>
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %>
</span>
&nbsp;
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file, :contentype => selContentType} %>
</span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type">
<%= file.show_suffix_type %>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;">
<%= file.file_dense_str %>
</span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'project_file_dense_edit', :locals => {:file_dense_list => file.file_dense_list,
:attachment => file} %>
</span>
</td>
<td class="downloads">
<%= file.downloads %>
</td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
@ -67,7 +75,8 @@
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a>
<div class="read-more hidden">
<a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a>
</div>
</td>
</tr>
@ -75,9 +84,6 @@
<% end -%>
<% reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>

@ -1,13 +1,13 @@
<% if @attachtype==0 && @contenttype=='0' %>
<% if @project%>
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
<%end%>
<% if @project%>
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
<%end%>
<%else%>
<% if @project%>
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>')
<% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>')
<%end%>;
<% if @project%>
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>')
<% elsif @course%>
$("#all_browse_div").html('<%= j(render partial: "course_sort_by_attachtypel")%>')
<%end%>;
<%end%>

@ -120,16 +120,15 @@
function course_attachment_contenttypes_searchex(value) {
<% if @course%>
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function course_attachtype_edit(value) {

@ -18,7 +18,7 @@
<%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share' %>
</div>
<div>
<script src="/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<p style="max-width:680px">
<%= f.text_area :description, :required => true, :id => 'editor01' %>
</p>

@ -6,7 +6,9 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title><%= h html_title %></title>
<title>
<%= h html_title %>
</title>
<meta name="description" content="<%= Redmine::Info.app_name %>"/>
<meta name="keywords" content="issue,bug,tracker"/>
<%= csrf_meta_tag %>
@ -32,7 +34,11 @@
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td style="color: #15bccf">
<strong>
<%= l(:label_user_location) %> :
</strong>
</td>
<td rowspan="2" width="250px">
<div class="top-content-search">
<%= form_tag(:controller => 'courses', :action => 'search', :method => :get) do %>
@ -43,10 +49,16 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %></td>
<td><p class="top-content-list"><%= link_to "主页", home_path %>
> <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %>
> <%= link_to @course.name, nil %></p></td>
<td style="padding-left: 8px">
<%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %>
</td>
<td>
<p class="top-content-list">
<%= link_to "主页", home_path %>
> <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %>
> <%= link_to @course.name, nil %>
</p>
</td>
</tr>
</table>
</div>
@ -67,7 +79,9 @@
<td>
<table>
<tr>
<td class="info-course"><%= link_to @course.name,course_path(@course) %></td>
<td class="info-course">
<%= link_to @course.name,course_path(@course) %>
</td>
</tr>
<tr>
<td align="center">
@ -101,17 +115,23 @@
<% if User.current.member_of_course?(@course) %>
<%= link_to "#{teacherCount(@course)}", course_member_path(@course, :role => 1), :course => '1' %>
<% else %>
<span><%= teacherCount(@course)%></span> <!--<%= link_to "#{teacherCount(@course)}", "javascript:void(0)", :course => '1' %>-->
<span>
<%= teacherCount(@course)%>
</span>
<% end%>
</td>
<td class="font_index">
<% if User.current.member_of_course?(@course) %>
<%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %>
<span><%= studentCount(@course)%></span>
<span>
<%= studentCount(@course)%>
</span>
<% end %>
</td>
<td class="font_index"><%= link_to files_count, course_files_path(@course) %></td>
<td class="font_index">
<%= link_to files_count, course_files_path(@course) %>
</td>
<tr class="font_aram">
<td align="center" width="80px" id="teacherCount">
<%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %>
@ -122,7 +142,6 @@
<td align="center" width="80px">
<%= l(:label_x_course_data, :count => files_count) %>
</td>
</tr>
</table>
<div class="user_underline"></div>
@ -134,45 +153,74 @@
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
<tr>
<td valign="top" style="padding-left: 8px; width:60px"><%= l(:label_main_teacher) %> :</td>
<td class="font_lighter_sidebar"><%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %></td>
<td valign="top" style="padding-left: 8px; width:60px">
<%= l(:label_main_teacher) %> :
</td>
<td class="font_lighter_sidebar">
<%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %>
</td>
</tr>
<tr class="hidden">
<td valign="top" style="padding-left: 8px;"><%= l(:label_setup_time) %> :</td>
<td class="font_lighter_sidebar"><%= @course.setup_time %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_setup_time) %> :
</td>
<td class="font_lighter_sidebar">
<%= @course.setup_time %>
</td>
</tr>
<tr class="hidden">
<td valign="top" style="padding-left: 8px;"><%= l(:label_endup_time) %> :</td>
<td class="font_lighter_sidebar"><%= @course.endup_time %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_endup_time) %> :
</td>
<td class="font_lighter_sidebar">
<%= @course.endup_time %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td>
<td class="font_lighter_sidebar"><%= @course.class_period %>&nbsp;<%= l(:label_class_hour) %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_class_period) %> :
</td>
<td class="font_lighter_sidebar">
<%= @course.class_period %>&nbsp;
<%= l(:label_class_hour) %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td>
<td class="font_lighter_sidebar"><%= @course.time %> <%= @course.term %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_main_term) %> :
</td>
<td class="font_lighter_sidebar">
<%= @course.time %>
<%= @course.term %>
</td>
</tr>
<!-- end -->
<% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<td class="font_lighter_sidebar"><a href="http://course.trustie.net/?school_id=<%= @course.teacher.user_extensions.school.id%>"><%= @course.teacher.user_extensions.school %></a></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> :
</td>
<td class="font_lighter_sidebar">
<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.teacher.user_extensions.school.id%>">
<%= @course.teacher.user_extensions.school %>
</a>
</td>
</tr>
<% else %>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<td class="font_lighter_sidebar"><%= l(:field_course_un) %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> :
</td>
<td class="font_lighter_sidebar">
<%= l(:field_course_un) %>
</td>
</tr>
<% end %>
</table>
</div>
<div class="user_underline"></div>
<!--description-->
@ -180,11 +228,9 @@
<div class="font_title_left">
<%= l(:label_new_course_description) %>
</div>
<div style="padding-bottom: 8px">
<% if @course.description && !@course.description.blank? %>
<div class="font_lighter_sidebar" style="word-break:break-all; word-wrap:break-word;">
<%= textilizable @course.description %>
</div>
<% else %>
@ -193,7 +239,10 @@
</div>
<% end %>
<div class="created_on_course">
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@course.created_at) %>
<strong style="color: #068d9c">
<%= l(:label_create_time) %>
</strong>
<%= format_time(@course.created_at) %>
</div>
</div>
<div class="user_underline"></div>
@ -233,10 +282,6 @@
<li>
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => link_class(:feedback) %>
</li>
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @course, :repository_id => nil, :path => nil, :rev => nil, :course => 1}) %></li> -->
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0)) %>
<% end %>
</ul>
</div>
<%= render_flash_messages %>
@ -250,7 +295,9 @@
<%= render :partial => 'layouts/base_footer' %>
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
<span>
<%= l(:label_loading) %>
</span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</div>

@ -8,7 +8,9 @@
<meta charset="utf-8" />
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<title><%=h html_title %></title>
<title>
<%=h html_title %>
</title>
<%= csrf_meta_tag %>
<%= favicon %>
@ -33,17 +35,26 @@
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td style="width: auto; color: #15bccf">
<strong><%= l(:label_user_location) %> : </strong>
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %></a></td>
<td><p class="top-content-list-homework"><%= link_to "主页", home_path %>
> <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
<span><%= link_to(course.name.to_s, homework_course_path(course)) if course %></span>
>
<%= link_to(@bid.name, respond_path(@bid)) %></p></td>
<a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %></a>
</td>
<td>
<p class="top-content-list-homework"><%= link_to "主页", home_path %>
>
<%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %>
>
<span>
<%= link_to(course.name.to_s, homework_course_path(course)) if course %>
</span>
>
<%= link_to(@bid.name, respond_path(@bid)) %>
</p>
</td>
</tr>
</table>
</div>
@ -93,53 +104,84 @@
<table>
<tr>
<td valign="top" colspan="2" style="font-size: 16px;padding-left: 8px;">
<strong><%= l(:label_new_course_description) %> :</strong></td>
<strong>
<%= l(:label_new_course_description) %> :
</strong>
</td>
</tr>
<tr>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;"><%= textilizable course.description %></td>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;">
<%= textilizable course.description %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_create_time) %> :</td>
<td class="font_lighter_sidebar"><%= format_time course.created_at %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_create_time) %> :
</td>
<td class="font_lighter_sidebar">
<%= format_time course.created_at %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width:60px">主讲老师 :</td>
<td class="font_lighter_sidebar"><%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %></td>
<td valign="top" style="padding-left: 8px; width:60px">
<%= l(:lable_course_teacher) %> :
</td>
<td class="font_lighter_sidebar">
<%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td>
<td class="font_lighter_sidebar"><%= course.class_period.to_s %>&nbsp;<%= l(:label_class_hour) %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_class_period) %> :
</td>
<td class="font_lighter_sidebar">
<%= course.class_period.to_s %>&nbsp;
<%= l(:label_class_hour) %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td>
<td class="font_lighter_sidebar"><%= course.time.to_s %> <%= course.term %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_main_term) %> :
</td>
<td class="font_lighter_sidebar">
<%= course.time.to_s %>
<%= course.term %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<!-- modified by zjc 有@user.user_extensions.occupation改为 @user.user_extensions.school 并添加超链接 -->
<% unless @user.user_extensions.nil? || @user.user_extensions.school.nil? %>
<td class="font_lighter_sidebar"><%= link_to @user.user_extensions.school,"http://course.trustie.net/?school_id=#{@user.user_extensions.school.id}" %></td>
<% end %>
</tr>
</table>
</div>
<div class="user_underline"></div>
<tr>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> :
</td>
<!-- modified by zjc 有@user.user_extensions.occupation改为 @user.user_extensions.school 并添加超链接 -->
<% unless @user.user_extensions.nil? || @user.user_extensions.school.nil? %>
<td class="font_lighter_sidebar">
<%= link_to @user.user_extensions.school,"http://#{Setting.host_course}/?school_id=#{@user.user_extensions.school.id}" %>
</td>
<% end %>
</tr>
</table>
</div>
<div class="user_underline"></div>
<!-- info -->
<div class="inf_user_image">
<table>
<tr>
<td><%= l(:label_limit_time) %>: <%= @bid.deadline %></td>
<td>
<%= l(:label_limit_time) %>:
<%= @bid.deadline %>
</td>
</tr>
<tr>
<td>作业类型: <%= @bid.homework_type==Bid::HomeworkFile ? "提交文件" : "提交项目" %></td>
<!--td>作业类型:
<%#= @bid.homework_type==Bid::HomeworkFile ? "提交文件" : "提交项目" %>
</td-->
</tr>
<% unless @bid.parent_id.nil? %>
<tr>
@ -160,7 +202,9 @@
<div class="user_underline"></div>
<table style="font-family:'微软雅黑'; padding-left: 8px">
<tr>
<td><!-- added by william -for tag --> <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %> </td>
<td><!-- added by william -for tag -->
<%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %>
</td>
</tr>
</table>
@ -238,7 +282,9 @@
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
<span>
<%= l(:label_loading) %>
</span>
</div>
<div id="ajax-modal" style="display:none;"></div>

@ -1,6 +1,11 @@
<% if @project%>
$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>');
<% elsif @course%>
var checked = $("#principals input:checked").size();
if(checked > 0)
{
alert('翻页或搜索后将丢失当前选择的用户数据!');
}
$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_course_members(@course)) %>');
<%end%>
var collection=$("#principals_for_new_member").children("#principals").children("label");

@ -1,13 +1,3 @@
<%= error_messages_for 'bid' %>
<!--[form:project]-->
<p><%= l(:label_homeworks_form_new_description) %></p>
<!-- % unless @memo.parent_id %>
<%# if @memo.safe_attribute? 'sticky' %>
<%#= f.check_box :sticky %> <lable><%= l(:label_board_sticky) %></lable>
<%# end %>
<%# if @memo.safe_attribute? 'locked' %>
<%#= f.check_box :locked %> <%#= label_tag 'memo_locked', l(:label_board_locked) %>
<%# end %>
<%# end %> -->
<p><%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %></p>
<p><%= hidden_field_tag 'subject', ||=@memo.subject %>

@ -178,7 +178,7 @@
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
<%#= submit_tag l(:button_submit) %>
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onclick="submit_message_replay();" >
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onmousemove="regexContent()" onclick="submit_message_replay();" >
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %>
<div id="preview" class="wiki"></div>
@ -188,12 +188,13 @@
<% html_title @topic.subject %>
<script type="text/javascript">
var flag = false
jQuery(document).ready(function($) {
transpotUrl('#content');
});
function submit_message_replay()
{
if(regexContent())
if(flag)
{
$("#message-form").submit();
}
@ -205,13 +206,13 @@
{
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
$("#message_content_span").css('color','#ff0000');
return false;
flag = false;
}
else
{
$("#message_content_span").text("<%= l(:label_field_correct) %>");
$("#message_content_span").css('color','#008000');
return true;
flag = true;
}
}
</script>

@ -16,10 +16,10 @@
function get_options(value) {
$.ajax({
type: "POST",
url: '<%= Setting.host_name == "micros.nudt.edu.cn" ? '/ros/school/get_options/' : '/school/get_options/'%>' + encodeURIComponent(value),
url: 'http://<%= Setting.host_name%>/school/get_options/' + encodeURIComponent(value),
data: 'text',
success: function (data) {
$("#province").val(value)
$("#province").val(value);
$("#schoollist").html(data);
}
});
@ -110,7 +110,7 @@
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span>
<input id="province" name="province" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
<input id="occupation" name="occupation" type="hidden" value="<%= User.current.user_extensions.school.id %>"/>
<input id="occupation_name" type="text" value="<%= User.current.user_extensions.school.name %>" readonly/>
<input id="occupation_name" type="text" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
<% end %>
</p>

@ -1,6 +1,6 @@
<%= wiki_page_breadcrumb(@page) %>
<script src="/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<script src="http://<%= Setting.host_name%>/javascripts/ckeditor/ckeditor.js?1404953555" type="text/javascript"></script>
<h3><%= h @page.pretty_title %></h3>
<%= form_for @content, :as => :content,

@ -2161,3 +2161,6 @@ zh:
lable_school_list: 学校列表
lable_teacher_evaluation_no: 老师还未进行评价
lable_teacher_evaluation: 作业综评
lable_course_teacher: 主讲老师
lable_course_end: 课程学期已结束
lable_file_sharingarea: 资源共享区

Loading…
Cancel
Save