Merge remote-tracking branch 'origin/szzh' into szzh
This commit is contained in:
commit
c155ebdfd7
|
@ -624,7 +624,9 @@ class CoursesController < ApplicationController
|
||||||
"show_course_journals_for_messages" => true
|
"show_course_journals_for_messages" => true
|
||||||
}
|
}
|
||||||
@date_to ||= Date.today + 1
|
@date_to ||= Date.today + 1
|
||||||
@date_from = @date_to - @days-1.years
|
#
|
||||||
|
@date_from = (@date_to - @days) > @course.created_at.to_date ? (@date_to - @days) : @course.created_at.to_date
|
||||||
|
#@date_from = @date_to - @days-1.years
|
||||||
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
|
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
|
||||||
# 决定显示所用用户或单个用户活动
|
# 决定显示所用用户或单个用户活动
|
||||||
@activity = Redmine::Activity::Fetcher.new(User.current, :course => @course,
|
@activity = Redmine::Activity::Fetcher.new(User.current, :course => @course,
|
||||||
|
|
|
@ -40,7 +40,32 @@ class FilesController < ApplicationController
|
||||||
render :layout => !request.xhr?
|
render :layout => !request.xhr?
|
||||||
elsif params[:course_id]
|
elsif params[:course_id]
|
||||||
@isproject = false
|
@isproject = false
|
||||||
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
|
|
||||||
|
if params[:sort]
|
||||||
|
if params[:sort].include?":"
|
||||||
|
@orderBy = params[:sort].split(":")[0];
|
||||||
|
@orderType = params[:sort].split(":")[1].split(",")[0];
|
||||||
|
else
|
||||||
|
@orderBy = params[:sort].split(",")[0];
|
||||||
|
@orderType = "asc";
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if @orderBy=="size"
|
||||||
|
@orderBy="filesize"
|
||||||
|
elsif @orderBy=="field_file_dense"
|
||||||
|
@orderBy="is_public"
|
||||||
|
elsif @orderBy=="attach_type"
|
||||||
|
@orderBy="attachtype"
|
||||||
|
elsif @orderBy=="content_type"
|
||||||
|
@orderBy="attachtype"
|
||||||
|
end
|
||||||
|
|
||||||
|
if @orderBy
|
||||||
|
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
|
||||||
|
else
|
||||||
|
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)]
|
||||||
|
end
|
||||||
render :layout => 'base_courses'
|
render :layout => 'base_courses'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -40,7 +40,17 @@ class MemosController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@quote = params[:quote][:quote]
|
|
||||||
|
if params[:quote].nil?
|
||||||
|
@quote = ""
|
||||||
|
else
|
||||||
|
@quote = params[:quote]
|
||||||
|
end
|
||||||
|
|
||||||
|
#unless params[:quote].nil?
|
||||||
|
# @quote = params[:quote][:quote]
|
||||||
|
#end
|
||||||
|
|
||||||
@memo = Memo.new(params[:memo])
|
@memo = Memo.new(params[:memo])
|
||||||
@memo.forum_id = params[:forum_id]
|
@memo.forum_id = params[:forum_id]
|
||||||
@memo.author_id = User.current.id
|
@memo.author_id = User.current.id
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
class ProjectScoreHelper
|
||||||
|
#缺陷数量
|
||||||
|
def issue_num project
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -44,7 +44,7 @@
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<%= content_tag('span', "#{garble @course.members.count}", :class => "info") %>
|
<%= 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 => @course.members.count)) %>
|
||||||
<%= content_tag('span', l(:label_x_member, :count => studentCount(@course)+teacherCount(@course))) %>
|
<%= content_tag('span', l(:label_x_member, :count => memberCount(@course))) %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!--gcm-->
|
<!--gcm-->
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="content-title-top-avtive">
|
<div class="content-title-top-avtive">
|
||||||
<!-- <h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> -->
|
<!-- <h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> -->
|
||||||
<p class="subtitle">
|
<p class="subtitle">
|
||||||
<%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
|
<%= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<% @events_by_day.keys.sort.reverse.each do |day| %>
|
<% @events_by_day.keys.sort.reverse.each do |day| %>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
|
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
|
||||||
<div id="message_quote" class="wiki"></div>
|
<div id="message_quote" class="wiki"></div>
|
||||||
|
|
||||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
|
||||||
<%= label_tag(l(:label_reply_plural)) %>:
|
<%= label_tag(l(:label_reply_plural)) %>:
|
||||||
<!-- <p> < %= f.text_area :content, :required => true, :size => "75%", :resize => "none", id: 'editor01' %> </p> -->
|
<!-- <p> < %= f.text_area :content, :required => true, :size => "75%", :resize => "none", id: 'editor01' %> </p> -->
|
||||||
<%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %></p>
|
<%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %></p>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//ckeditor.setData("<%= raw escape_javascript(@content) %>");
|
//ckeditor.setData("<%= raw escape_javascript(@content) %>");
|
||||||
$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>");
|
$('#message_quote').html("<%= raw escape_javascript(@temp.content) %>");
|
||||||
$('#quote_quote').html("<%= raw escape_javascript(@content) %>");
|
$('#quote').val("<%= raw escape_javascript(@content) %>");
|
||||||
showAndScrollTo("new_memo", "cke_editor01");
|
showAndScrollTo("new_memo", "cke_editor01");
|
|
@ -92,15 +92,15 @@
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
<h1></h1>
|
|
||||||
|
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
|
<h1></h1>
|
||||||
<p id="errorExplanation">
|
<p id="errorExplanation">
|
||||||
该学校未开设任何课程,您可以查看其他学校课程
|
该学校未开设任何课程,您可以查看其他学校课程
|
||||||
</p>
|
</p>
|
||||||
|
<h1></h1>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<h1></h1>
|
|
||||||
<% find_all_new_hot_course(9, @school_id).map do |course| %>
|
<% find_all_new_hot_course(9, @school_id).map do |course| %>
|
||||||
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>>
|
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>>
|
||||||
<div class='avatar'>
|
<div class='avatar'>
|
||||||
|
|
15
db/schema.rb
15
db/schema.rb
|
@ -419,9 +419,9 @@ ActiveRecord::Schema.define(:version => 20140801034242) do
|
||||||
t.string "web_title"
|
t.string "web_title"
|
||||||
t.string "title"
|
t.string "title"
|
||||||
t.text "description"
|
t.text "description"
|
||||||
|
t.string "page_type"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
t.string "page_type"
|
|
||||||
t.integer "sort_type"
|
t.integer "sort_type"
|
||||||
t.integer "image_width", :default => 107
|
t.integer "image_width", :default => 107
|
||||||
t.integer "image_height", :default => 63
|
t.integer "image_height", :default => 63
|
||||||
|
@ -882,19 +882,6 @@ ActiveRecord::Schema.define(:version => 20140801034242) do
|
||||||
|
|
||||||
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
|
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
|
||||||
|
|
||||||
create_table "rich_rich_files", :force => true do |t|
|
|
||||||
t.datetime "created_at", :null => false
|
|
||||||
t.datetime "updated_at", :null => false
|
|
||||||
t.string "rich_file_file_name"
|
|
||||||
t.string "rich_file_content_type"
|
|
||||||
t.integer "rich_file_file_size"
|
|
||||||
t.datetime "rich_file_updated_at"
|
|
||||||
t.string "owner_type"
|
|
||||||
t.integer "owner_id"
|
|
||||||
t.text "uri_cache"
|
|
||||||
t.string "simplified_type", :default => "file"
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "roles", :force => true do |t|
|
create_table "roles", :force => true do |t|
|
||||||
t.string "name", :limit => 30, :default => "", :null => false
|
t.string "name", :limit => 30, :default => "", :null => false
|
||||||
t.integer "position", :default => 1
|
t.integer "position", :default => 1
|
||||||
|
|
Loading…
Reference in New Issue