diff --git a/.gitignore b/.gitignore index 52cf51417..a88fb8be7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ test/* tmp/* /app/models/tag.rb /app/models/tag.rb +/public/images/requirements/reference - 副本 - 副本.jpg + +/public/images/requirements/*.jpg diff --git a/app/assets/javascripts/teachers.js b/app/assets/javascripts/teachers.js new file mode 100644 index 000000000..dee720fac --- /dev/null +++ b/app/assets/javascripts/teachers.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/teachers.css b/app/assets/stylesheets/teachers.css new file mode 100644 index 000000000..afad32db0 --- /dev/null +++ b/app/assets/stylesheets/teachers.css @@ -0,0 +1,4 @@ +/* + Place all the styles related to the matching controller here. + They will automatically be included in application.css. +*/ diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index fa4de26f9..b865328f5 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -88,10 +88,12 @@ class AccountController < ApplicationController # create a new token for password recovery token = Token.new(:user => user, :action => "recovery") if token.save - Mailer.lost_password(token).deliver - flash[:notice] = l(:notice_account_lost_email_sent) - redirect_to signin_path - return + Thread.new do + Mailer.lost_password(token).deliver + end + flash[:notice] = l(:notice_account_lost_email_sent) + redirect_to signin_path + return end end end diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 4d6ed2966..ebf3c3ba5 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -115,13 +115,30 @@ class AttachmentsController < ApplicationController format.js end end + + def delete_homework + @bid = @attachment.container.bid + # Make sure association callbacks are called + container = @attachment.container + @attachment.container.attachments.delete(@attachment) + if container.attachments.empty? + container.delete + end + + respond_to do |format| + format.html { redirect_to_referer_or respond_path(@bid) } + format.js + end + end private def find_project @attachment = Attachment.find(params[:id]) # Show 404 if the filename in the url is wrong raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename - @project = @attachment.project + unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' + @project = @attachment.project + end rescue ActiveRecord::RecordNotFound render_404 end diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index df7f681e5..2e6f4b59d 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -3,10 +3,15 @@ class BidsController < ApplicationController #Added by young menu_item :respond menu_item :project, :only => :show_project + menu_item :homework_respond, :only => :homework_respond + menu_item :homework_statistics, :only => :homework_statistics #Ended by young - before_filter :find_bid, :only => [:show, :show_project, :create, :destroy, :more, :back, :add, :new] + before_filter :find_bid, :only => [:show, :show_project, :create, :destroy, :more, :back, :add, :new, :homework_respond, :add_homework, :homework_statistics] helper :watchers + helper :attachments + include AttachmentsHelper + def index # Modified by nie # @requirement_title = "4" @@ -92,11 +97,17 @@ class BidsController < ApplicationController # @journals = @bid.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all # @journals.each_with_index {|j,i| j.indice = i+1} respond_to do |format| + if @bid.reward_type == 3 format.html { + render :layout => 'base_homework' + } + else + format.html { render :layout => 'base_bids' } + end format.api - + end end @@ -111,14 +122,51 @@ class BidsController < ApplicationController # @project = Project.where("id in []", a) @user = @bid.author @bidding_project = @bid.biding_projects + if @bid.homework_type == 1 + @homework = HomeworkAttach.new + @homework_list = @bid.homeworks + end respond_to do |format| + if @bid.reward_type == 3 format.html { + render :layout => 'base_homework' + } + else + format.html { render :layout => 'base_bids' } + end format.api end end + + ##### by huang + def show_project_homework + # flash[:notice] = "" + @membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current)) + @option = [] + @membership.each do |membership| + @option << membership.project + end + # a = [1] + # @project = Project.where("id in []", a) + @user = @bid.author + @bidding_project = @bid.biding_projects + respond_to do |format| + if @bid.reward_type == 3 + format.html { + render :layout => 'base_homework' + } + else + format.html { + render :layout => 'base_bids' + } + end + format.api + end + end + ###添加应标项目 def add project = Project.where('name = ?', params[:bid]).first @@ -128,7 +176,11 @@ class BidsController < ApplicationController flash[:notice] = l(:label_bidding_succeed) end else + if @bid.reward_type == 3 + flash[:error] = l(:label_bidding_homework_fail) + else flash[:error] = l(:label_bidding_fail) + end end @bidding_project = @bid.biding_projects respond_to do |format| @@ -279,6 +331,70 @@ class BidsController < ApplicationController render :action => 'new_bid' end end + + def create_homework + @bid = Bid.new + @bid.name = params[:bid][:name] + @bid.description = params[:bid][:description] + @bid.reward_type = 3 + # @bid.budget = params[:bid][:budget] + @bid.deadline = params[:bid][:deadline] + @bid.budget = 0 + @bid.author_id = User.current.id + @bid.commit = 0 + @bid.homework_type = params[:bid][:homework_type] + @bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads])) + # @bid. + if @bid.save + HomeworkForCourse.create(:project_id => params[:course_id], :bid_id => @bid.id) + unless @bid.watched_by?(User.current) + if @bid.add_watcher(User.current) + flash[:notice] = l(:label_bid_succeed) + end + end + redirect_to respond_path(@bid) + else + @bid.safe_attributes = params[:bid] + render :action => 'new_bid' + end + end + + def add_homework + # homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id) + # homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads])) + @homework = HomeworkAttach.new + @homework.bid_id = @bid.id + @homework.user_id = User.current.id + @homework.save_attachments(params[:attachments]) + @homework.save + @homework_list = @bid.homeworks + + end + + # 作业统计 + def homework_statistics + @course = @bid.courses.first + @member = [] + @course.memberships.each do |member| + unless (member.roles && Role.where('id = ? ', 3)).empty? + @member.push member + end + end + if @bid.homework_type = 1 + @student = User.where("id in (select DISTINCT user_id from #{HomeworkAttach.table_name} where bid_id = ? )", @bid.id) + @homework_type = true + else + + @homework_type = false + end + @user = @bid.author + render :layout => 'base_homework' + end + + def homework_respond + @user = @bid.author + render :layout => 'base_homework' + end def more @jour = @bid.journals_for_messages @@ -291,6 +407,7 @@ class BidsController < ApplicationController #format.api { render_api_ok } end end + def back @jour = @bid.journals_for_messages diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 999544e7b..81192c597 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -19,8 +19,9 @@ class BoardsController < ApplicationController layout 'base_projects'#by young default_search_scope :messages before_filter :find_project_by_project_id, :find_board_if_available - before_filter :authorize, :except => [:new, :show, :create] + before_filter :authorize, :except => [:new, :show, :create, :index] accept_rss_auth :index, :show + helper :sort include SortHelper @@ -33,6 +34,11 @@ class BoardsController < ApplicationController @board = @boards.first show end + if @project.project_type == 1 + render :layout => 'base_courses' + else + render :layout => false if request.xhr? + end end def show @@ -54,7 +60,11 @@ class BoardsController < ApplicationController preload(:author, {:last_reply => :author}). all @message = Message.new(:board => @board) - render :action => 'show', :layout => !request.xhr? + if @project.project_type + render :action => 'show', :layout => 'base_courses' + else + render :action => 'show', :layout => !request.xhr? + end } format.atom { @messages = @board.messages. @@ -70,6 +80,9 @@ class BoardsController < ApplicationController def new @board = @project.boards.build @board.safe_attributes = params[:board] + if @project.project_type + render :layout => 'base_courses' + end end def create @@ -90,6 +103,9 @@ class BoardsController < ApplicationController end def update + if @project.project_type + render :layout => 'base_courses' + end @board.safe_attributes = params[:board] if @board.save redirect_to_settings_in_projects diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb new file mode 100644 index 000000000..137079233 --- /dev/null +++ b/app/controllers/courses_controller.rb @@ -0,0 +1,42 @@ +class CoursesController < ApplicationController + + + before_filter :require_login, :only => [:join, :unjoin] + + def join + if User.current.logged? + course = Project.find(params[:object_id]) + if params[:course_password].to_i == Course.find_by_extra(course.identifier).state + members = [] + members << Member.new(:role_ids => [5], :user_id => User.current.id) + course.members << members + + StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id]) + @state = 0 + else + @state = 1 + end + end + respond_to do |format| + # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} + format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} } + end + end + + def unjoin + if User.current.logged? + + @member = Member.where('project_id = ? and user_id = ?', params[:object_id], User.current.id) + @member.first.destroy + + joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id]) + joined.each do |join| + join.delete + end + end + respond_to do |format| + # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} + format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} } + end + end +end \ No newline at end of file diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index a311fc765..67c057eef 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -22,7 +22,7 @@ class DocumentsController < ApplicationController before_filter :find_project_by_project_id, :only => [:index, :new, :create] before_filter :find_model_object, :except => [:index, :new, :create] before_filter :find_project_from_association, :except => [:index, :new, :create] - before_filter :authorize #, :except => [:index]#Added by young + before_filter :authorize , :except => [:index]#Added by young helper :attachments @@ -40,11 +40,18 @@ class DocumentsController < ApplicationController @grouped = documents.group_by(&:category) end @document = @project.documents.build - render :layout => false if request.xhr? + if @project.project_type == 1 + render :layout => 'base_courses' + else + render :layout => false if request.xhr? + end end def show @attachments = @document.attachments.all + if @project.project_type + render :action => 'show', :layout => 'base_courses' + end end def new diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index cb4c1b8ff..1048c12bd 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -34,11 +34,20 @@ class FilesController < ApplicationController @containers = [ Project.includes(:attachments).reorder(sort_clause).find(@project.id)] @containers += @project.versions.includes(:attachments).reorder(sort_clause).all.sort.reverse - render :layout => !request.xhr? + + if @project.project_type == 1 + render :layout => 'base_courses' + else + render :layout => !request.xhr? + end end def new @versions = @project.versions.sort + @course_tag = @project.project_type + if @course_tag + render :layout => 'base_courses' + end end def create diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 27d195f0d..56422dcd6 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -49,7 +49,11 @@ class MessagesController < ApplicationController all @reply = Message.new(:subject => "RE: #{@message.subject}") - render :action => "show", :layout => "base_projects"#by young + if @message.board.project.project_type + render :action => "show", :layout => "base_courses"#by young + else + render :action => "show", :layout => "base_projects"#by young + end end # Create a new topic diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 48c6a7d59..91f04b4d2 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -77,7 +77,7 @@ class MyController < ApplicationController # ue.save # end - # added by bai 往数据库里写职业、性别和地区 + # added by bai ݿдְҵԱ͵ if @user.user_extensions.nil? se = UserExtensions.new se.user_id = @user.id diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 91da55dda..bf02dabce 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -46,12 +46,18 @@ class NewsController < ApplicationController @newss = scope.all(:include => [:author, :project], :order => "#{News.table_name}.created_on DESC", :offset => @offset, - :limit => @limit) - + :limit => @limit) + respond_to do |format| format.html { @news = News.new # for adding news inline + # huang + + if @project.project_type == 1 + render :layout => 'base_courses' + else render :layout => false if request.xhr? + end } format.api format.atom { render_feed(@newss, :title => (@project ? @project.name : Setting.app_title) + ": #{l(:label_news_plural)}") } @@ -61,10 +67,18 @@ class NewsController < ApplicationController def show @comments = @news.comments @comments.reverse! if User.current.wants_comments_in_reverse_order? + @course_tag = @project.project_type + if @course_tag + render :layout => 'base_courses' + end end def new @news = News.new(:project => @project, :author => User.current) + @course_tag = @project.project_type + if @course_tag + render :layout => 'base_courses' + end end def create diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 926b6a648..9ad847dde 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -15,20 +15,40 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class ProjectsController < ApplicationController + # if @project.project_type == 1 layout 'base_projects'# by young menu_item :overview menu_item :roadmap, :only => :roadmap menu_item :settings, :only => :settings + menu_item l(:label_sort_by_time), :only => :index menu_item l(:label_sort_by_active), :only => :index menu_item l(:label_sort_by_influence), :only => :index - - before_filter :find_project, :except => [ :index, :search, :list, :new, :create, :copy ] - before_filter :authorize, :except => [:watcherlist, :index, :search, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback, :project_respond] + + menu_item l(:label_homework), :only => :homework + menu_item l(:label_course_file), :only => :index + menu_item l(:label_course_news), :only => :index + # end + + + # layout 'base_courses'# by young + # menu_item :overview + # menu_item l(:label_homework), :only => :homework + # menu_item :files, :only => :files +# + # layout 'base_courses' + # menu_item l(:label_homework), :only => homework + # menu_item l(:label_course_file), :only => files + # menu_item l(:label_settings), :only => settings + + before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join] + before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback] before_filter :authorize_global, :only => [:new, :create] - before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ] + before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar] #by young - before_filter :member, :file, :statistics, :watcherlist + # before_filter :member, :file, :statistics, :watcherlist + # modified by fq + before_filter :file, :statistics, :watcherlist # accept_rss_auth :index accept_api_auth :index, :show, :create, :update, :destroy @@ -39,6 +59,8 @@ class ProjectsController < ApplicationController end end + helper :bids + include BidsHelper helper :sort include SortHelper helper :custom_fields @@ -222,6 +244,43 @@ class ProjectsController < ApplicationController end end + # added by fq + def new_join + @course = Project.find(params[:object_id]) + end + + #Added by young + def homework + @offset, @limit = api_offset_and_limit({:limit => 10}) + @bids = @project.homeworks + @bids = @bids.like(params[:name]) if params[:name].present? + @bid_count = @bids.count + @bid_pages = Paginator.new @bid_count, @limit, params['page'] + + @offset ||= @bid_pages.reverse_offset + #@bids = @bids.offset(@offset).limit(@limit).all.reverse + unless @offset == 0 + @bids = @bids.offset(@offset).limit(@limit).all.reverse + else + limit = @bid_count % @limit + @bids = @bids.offset(@offset).limit(limit).all.reverse + end + render :layout => 'base_courses' + + end + + def new_homework + if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0)) + @homework = Bid.new + @homework.safe_attributes = params[:bid] + render :layout => 'base_courses' + else + render_404 + end + + end + #Ended by young + def feedback @jours = @project.journals_for_messages.reverse @limit = 10 @@ -269,18 +328,36 @@ class ProjectsController < ApplicationController end def new + @course_tag = params[:course] @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all @project = Project.new @project.safe_attributes = params[:project] + ##add by huang + @course=Course.new + @course.safe_attributes = params[:course] + ##end render :layout => 'base' end def create + @course_tag = params[:project][:project_type] + if(@course_tag=="1") + @course = Course.new + @course.extra='course' + DateTime.parse(Time.now.to_s).strftime('%Y-%m-%d_%H-%M-%S').to_s + @course.safe_attributes = params[:project][:course] + @course.tea_id = User.current.id + @course.save + # project = ProjectInfo.create(:user_id => User.current.id, :project_id => @project.id) + # project_status = ProjectStatus.create(:project_id => @project.id) + end @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all @project = Project.new @project.safe_attributes = params[:project] + if @course_tag == '1' + @project.identifier = @course.extra + end if validate_parent_id && @project.save @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') @@ -300,7 +377,12 @@ class ProjectsController < ApplicationController flash[:notice] = l(:notice_successful_create) if params[:continue] attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?} - redirect_to new_project_path(attrs) + redirect_to new_project_path(attrs, :course => '0') + #Added by young + + elsif params[:course_continue] + redirect_to new_project_path(:course => '1') + #Ended by young else redirect_to settings_project_path(@project) end @@ -358,7 +440,6 @@ class ProjectsController < ApplicationController @user = User.find_by_id(ProjectInfo.find_by_project_id(@project.id).user_id) cond = @project.project_condition(Setting.display_subprojects_issues?) - @open_issues_by_tracker = Issue.visible.open.where(cond).count(:group => :tracker) @total_issues_by_tracker = Issue.visible.where(cond).count(:group => :tracker) @@ -378,7 +459,9 @@ class ProjectsController < ApplicationController "show_issues" => true, "show_files" => true, "show_documents" => true, - "show_messages" => true + "show_messages" => true, + "show_news" => true, + "show_bids" => true } @date_to ||= Date.today + 1 @date_from = @date_to - @days @@ -415,8 +498,9 @@ class ProjectsController < ApplicationController end @document = @project.documents.build # + @base_courses_tag = @project.project_type respond_to do |format| - format.html + format.html{render :layout => 'base_courses' if @base_courses_tag==1} format.api end end @@ -427,6 +511,16 @@ class ProjectsController < ApplicationController @member ||= @project.members.new @trackers = Tracker.sorted.all @wiki ||= @project.wiki + #Added by young + # @course_tag = params[:course] + # if @course_tag == '1' + if @project.project_type == 1 + @course = Course.find_by_extra(@project.identifier) + render :layout => 'base_courses' + else + render :layout => 'base_projects' + end + #Ended by young end def edit @@ -434,9 +528,27 @@ class ProjectsController < ApplicationController #by young def member + if @project.project_type == 1 + render :layout => 'base_courses' + end end + + # def news + # if @project.project_type == 1 + # render :layout => 'base_courses' + # end + # end def file + # if @project.project_type == 1 + # render :layout => 'base_courses' + # end + # @course_tag = params[:course] + # if @course_tag == '1' + # render :layout => 'base_courses' + # end + + # User.current end def statistics @@ -447,6 +559,10 @@ class ProjectsController < ApplicationController def update @project.safe_attributes = params[:project] if validate_parent_id && @project.save + @course = Course.find_by_extra(@project.identifier) + @course.state = params[:project][:course][:state] + @course.term = params[:project][:course][:term] + @course.save @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') if params[:project][:is_public] == '0' @@ -459,7 +575,7 @@ class ProjectsController < ApplicationController respond_to do |format| format.html { flash[:notice] = l(:notice_successful_update) - redirect_to settings_project_path(@project) + redirect_to settings_project_path(@project,:course => @project.project_type) } format.api { render_api_ok } end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 94de4bfbb..61a3bfb51 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -43,15 +43,26 @@ class RepositoriesController < ApplicationController @repository = Repository.factory(scm) @repository.is_default = @project.repository.nil? @repository.project = @project - render :layout => 'base_projects' + @course_tag = params[:course] + if @course_tag == 1 + render :layout => 'base_courses' + else + render :layout => 'base_projects' + end end + def newrepo scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first @repository = Repository.factory(scm) @repository.is_default = @project.repository.nil? @repository.project = @project - render :layout => 'base_projects' + @course_tag = params[:course] + if @course_tag == 1 + render :layout => 'base_courses' + else + render :layout => 'base_projects' + end end def fork @@ -209,7 +220,12 @@ class RepositoriesController < ApplicationController @changesets = @repository.latest_changesets(@path, @rev) @properties = @repository.properties(@path, @rev) @repositories = @project.repositories - render :action => 'show', :layout => 'base_projects' + @course_tag = params[:course] + if @course_tag == 1 + render :action => 'show', :layout => 'base_courses' + else + render :action => 'show', :layout => 'base_projects' + end end end @@ -369,6 +385,8 @@ class RepositoriesController < ApplicationController end def stats + @project_id = params[:id] + @repository_id = @repository.identifier render :layout => 'base_projects' end diff --git a/app/controllers/teachers_controller.rb b/app/controllers/teachers_controller.rb new file mode 100644 index 000000000..b4d0c4839 --- /dev/null +++ b/app/controllers/teachers_controller.rb @@ -0,0 +1,5 @@ +class TeachersController < ApplicationController + def show + + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index fa8879921..825c79060 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,21 +17,23 @@ class UsersController < ApplicationController layout 'base_users' #Added by young - menu_item :activity + menu_item :activity menu_item :user_information, :only => :info menu_item :user_project, :only => :user_projects menu_item :requirement_focus, :only => :watch_bids menu_item :user_newfeedback, :only => :user_newfeedback + menu_item :user_course, :only => :user_courses #Ended by young - before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist,:edit,:update] - before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, + before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist,:update, :user_courses] + #edit has been deleted by huang, 2013-9-23 + before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info] accept_api_auth :index, :show, :create, :update, :destroy,:tag_save #william - before_filter :require_login,:only => :tag_save + before_filter :require_login, :only => :tag_save helper :sort @@ -117,6 +119,68 @@ class UsersController < ApplicationController end end # end + + # added by fq + def user_courses + case params[:type] + when "2" + @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current)) + + @memberships = [] + @membership.each do |membership| + if membership.project.project_type == 1 + @membership << membership + end + end + @state = 2 + + when "1" + @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current)) + + @memberships = [] + @membership.each do |membership| + if membership.project.project_type == 1 + @memberships << membership + end + end + @bid = [] + @memberships.each do |membership| + @bid += membership.project.homeworks + end + @bid = @bid.group_by {|bid| bid.courses.first.id} + @state = 1 + + else + @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current)) + @memberships = [] + @membership.each do |membership| + if membership.project.project_type == 1 + @memberships << membership + end + end + @state = 0 + end + + # events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20) + # @events_by_day = events.group_by(&:event_date) + + # @state = 0 + + #add by huang + unless User.current.admin? + if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?) + render_404 + return + end + end + #end + + # respond_to do |format| + # format.html + # format.api + # end + end + # end # modified by fq def user_newfeedback diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index 29901aa6b..b06b8cbb3 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -23,6 +23,41 @@ class WatchersController < ApplicationController def unwatch set_watcher(@watchables, User.current, false) end + + def join + if User.current.logged? + course = Project.find(params[:object_id]) + if params[:course_password] == '123' + members = [] + members << Member.new(:role_ids => [5], :user_id => User.current.id) + course.members << members + + StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id]) + else + end + end + respond_to do |format| + # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} + format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} } + end + end + + def unjoin + if User.current.logged? + + @member = Member.where('project_id = ? and user_id = ?', params[:object_id], User.current.id) + @member.first.destroy + + joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id]) + joined.each do |join| + join.delete + end + end + respond_to do |format| + # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} + format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} } + end + end before_filter :find_project, :authorize, :only => [:new, :create, :append, :destroy, :autocomplete_for_user] accept_api_auth :create, :destroy diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5204788cf..b8a3fd791 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -31,7 +31,18 @@ module ApplicationHelper extend Forwardable def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter - + + #Added by young + #Define the course menu's link class + def link_class(label) + if current_menu_item == label + @class = 'selected' + else + @class = '' + end + return @class + end + #Ended by young # Return true if user is authorized for controller/action, otherwise false def authorize_for(controller, action) User.current.allowed_to?({:controller => controller, :action => action}, @project) diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb index a4925343f..f61399c85 100644 --- a/app/helpers/attachments_helper.rb +++ b/app/helpers/attachments_helper.rb @@ -31,6 +31,15 @@ module AttachmentsHelper :locals => {:attachments => container.attachments, :options => options, :thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)} end end + + def attach_delete(project) + if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0) || project.user_id == User.current.id) + true + else + false + end + + end def render_api_attachment(attachment, api) api.attachment do diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 0d12a22ea..7dac3bf47 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -35,6 +35,7 @@ module ProjectsHelper {:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities} ] tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)} + end def sort_project(state) @@ -60,6 +61,20 @@ module ProjectsHelper end + #Added by young + def course_settings_tabs + tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'}, + {:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural}, + # {:name => 'repositories', :action => :manage_repository, :partial => 'projects/settings/repositories', :label => :label_repository_plural}, + {:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural} + ] + tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)} + + end + #Ended by young + + + def parent_project_select_tag(project) selected = project.parent @@ -78,7 +93,13 @@ module ProjectsHelper # Renders the projects index def render_project_hierarchy(projects) render_project_nested_lists(projects) do |project| - s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") + #Modified by young + if (project.project_type==1) + s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")+"(#{l(:label_course)})".html_safe + else + s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") + end + #Ended by young if project.description.present? #Delete by nie. # s << content_tag('td', textilizable(project.short_description, :project => project), :class => 'wiki description') @@ -111,5 +132,18 @@ module ProjectsHelper def get_projects_by_tag(tag_name) Project.tagged_with(tag_name).order('updated_on desc') end + + # added by fq + def homework_type_option + type = [] + option1 = [] + option2 = [] + option1 << 'ҵԸʽύ' + option1 << 1 + option2 << 'ҵĿʽύ' + option2 << 2 + type << option1 + type << option2 + end end diff --git a/app/helpers/teachers_helper.rb b/app/helpers/teachers_helper.rb new file mode 100644 index 000000000..1015c8c9f --- /dev/null +++ b/app/helpers/teachers_helper.rb @@ -0,0 +1,2 @@ +module TeachersHelper +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 32c4b6142..32b546078 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -64,9 +64,9 @@ module UsersHelper # added by fq # def show_activity(state) @@ -90,6 +90,26 @@ module UsersHelper end content_tag('div', content, :class => "pagination") end + + def user_course(state) + content = ''.html_safe + case state + when 0 + s = content_tag('span', 'ҵĿγ', :class => "current-page") + content << content_tag('li', s) + content << content_tag('li', link_to('ҵҵ', {:controller => 'users', :action => 'user_courses', :type => 1})) + when 1 + s = content_tag('span', 'ҵҵ', :class => "current-page") + content << content_tag('li', link_to('ҵĿγ', {:controller => 'users', :action => 'user_courses'})) + content << content_tag('li', s, :class => "current-page") + when 2 + s = content_tag('span', 'γ֪ͨ', :class => "current-page") + content << content_tag('li', link_to('γ֪ͨ', {:controller => 'users', :action => 'user_courses'})) + content << content_tag('li', s, :class => "current-page") + end + content_tag('div', content, :class => "pagination") + + end # added by huang def sort_user(state) diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 052c3fd25..2baee6479 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -45,6 +45,21 @@ module WatchersHelper link_to text, url, :remote => true, :method => method, :class => css end + + # added by fq + def join_in_course(course, user) + return '' unless user && user.logged? + joined = user.member_of?(course) + text = joined ? '退出课程' : '加入课程' + url_t = join_path(:object_id => course.id) + url_f = try_join_path(:object_id => course.id) + method = joined ? 'delete' : 'post' + if joined + link_to text, url_t, :remote => true, :method => method, :id => 'join', :confirm => l(:text_are_you_sure) + else + link_to text, url_f, :remote => true, :method => method, :id => 'join' + end + end # Returns the css class used to identify watch links for a given +object+ def watcher_css(objects) diff --git a/app/models/bid.rb b/app/models/bid.rb index ef51e9589..bb254b6dc 100644 --- a/app/models/bid.rb +++ b/app/models/bid.rb @@ -1,20 +1,26 @@ ####by fq class Bid < ActiveRecord::Base - #attr_accessible :author_id, :budget, :deadline, :name, :description + attr_accessible :author_id, :budget, :deadline, :name, :description, :homework_type include Redmine::SafeAttributes belongs_to :author, :class_name => 'User', :foreign_key => :author_id + belongs_to :course has_many :biding_projects, :dependent => :destroy has_many :projects, :through => :biding_projects has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy + has_many :homework_for_courses, :dependent => :destroy + has_many :courses, :through => :homework_for_courses, :source => :project + has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy + + acts_as_attachable NAME_LENGTH_LIMIT = 60 DESCRIPTION_LENGTH_LIMIT = 250 validates_length_of :name, :maximum => NAME_LENGTH_LIMIT validates_length_of :description, :maximum => DESCRIPTION_LENGTH_LIMIT - validates_presence_of :author_id, :name, :deadline, :budget + validates_presence_of :author_id, :name, :deadline # validates_presence_of :deadline, :message => 'test' # validates_format_of :deadline, :with => validates_format_of :deadline, :with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/ @@ -45,7 +51,7 @@ class Bid < ActiveRecord::Base :author => :author, :url => Proc.new {|o| {:controller => 'bids', :action => 'show', :id => o.id}} - acts_as_activity_provider :find_options => {:include => [:author]}, + acts_as_activity_provider :find_options => {:include => [:projects, :author]}, :author_key => :author_id @@ -53,6 +59,10 @@ class Bid < ActiveRecord::Base 'description', 'budget', 'deadline' + + # safe_attributes 'name', + # 'description', + # 'deadline' def add_jour(user, notes, reference_user_id = 0) self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id) diff --git a/app/models/course.rb b/app/models/course.rb new file mode 100644 index 000000000..276cc7652 --- /dev/null +++ b/app/models/course.rb @@ -0,0 +1,20 @@ +class Course < ActiveRecord::Base + include Redmine::SafeAttributes + + attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term + belongs_to :project, :class_name => 'Project', :foreign_key => :extra # 定义一个project方法, 该方法通过extra来调用project表 + belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表 + has_many :bid + validates_presence_of :state, :term + safe_attributes 'extra', + 'time', + 'name', + 'extra', + 'code', + 'location', + 'tea_id', + 'state', + 'term' + + +end diff --git a/app/models/homework_attach.rb b/app/models/homework_attach.rb new file mode 100644 index 000000000..aea68abb5 --- /dev/null +++ b/app/models/homework_attach.rb @@ -0,0 +1,9 @@ +class HomeworkAttach < ActiveRecord::Base + attr_accessible :bid_id, :user_id + + belongs_to :user + belongs_to :bid + + acts_as_attachable + +end diff --git a/app/models/homework_for_course.rb b/app/models/homework_for_course.rb new file mode 100644 index 000000000..7a440449a --- /dev/null +++ b/app/models/homework_for_course.rb @@ -0,0 +1,8 @@ +class HomeworkForCourse < ActiveRecord::Base + attr_accessible :bid_id, :project_id + + belongs_to :bid + belongs_to :project + + +end diff --git a/app/models/journals_for_message_observer.rb b/app/models/journals_for_message_observer.rb new file mode 100644 index 000000000..3bca47791 --- /dev/null +++ b/app/models/journals_for_message_observer.rb @@ -0,0 +1,7 @@ +# Added by young +class JournalsForMessageObserver < ActiveRecord::Observer + def after_create(journal_for_message) + Mailer.journals_for_message_add(User.current, journal_for_message).deliver + end +end + diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 1db19f14e..ed942f0d3 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -26,6 +26,15 @@ class Mailer < ActionMailer::Base def self.default_url_options { :host => Setting.host_name, :protocol => Setting.protocol } end + + # Builds a Mail::Message object used to email recipients of the added journals for message. + # + # def journals_for_message_add(user, journals_for_message) + # @user = User.current + # @url = url_for(:controller => 'users', :action => 'user_newfeedback') + # mail :to => user.mail, + # :subject => "hello" + # end # Builds a Mail::Message object used to email recipients of the added issue. # diff --git a/app/models/project.rb b/app/models/project.rb index bd856f7d0..53e407246 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -53,13 +53,27 @@ class Project < ActiveRecord::Base has_many :changesets, :through => :repository # added by fq has_many :journals_for_messages, :as => :jour, :dependent => :destroy + has_many :homework_for_courses, :dependent => :destroy + has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy + has_many :students_for_courses, :dependent => :destroy + has_many :student, :through => :students_for_courses, :source => :user + # has_one :cour, :class_name => 'Course', :foreign_key => :extra, :dependent => :destroy + # end #ADDED BY NIE - has_many :project_infos, :dependent => :destroy + has_many :project_infos, :dependent => :destroy + has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy + has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy + has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy #end + has_one :wiki, :dependent => :destroy - # Custom field for the project issues + ##added by xianbo + has_one :course, :dependent => :destroy ,:order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC" + accepts_nested_attributes_for :course + ##end + # Custom field for the project issues has_and_belongs_to_many :issue_custom_fields, :class_name => 'IssueCustomField', :order => "#{CustomField.table_name}.position", @@ -682,7 +696,10 @@ class Project < ActiveRecord::Base 'custom_field_values', 'custom_fields', 'tracker_ids', - 'issue_custom_field_ids' + 'issue_custom_field_ids', + 'project_type' + + safe_attributes 'enabled_module_names', :if => lambda {|project, user| project.new_record? || user.allowed_to?(:select_project_modules, project) } @@ -1027,6 +1044,10 @@ class Project < ActiveRecord::Base def update_position_under_parent set_or_update_position_under(parent) end + + def course + @course + end # Inserts/moves the project so that target's children or root projects stay alphabetically sorted def set_or_update_position_under(target_parent) diff --git a/app/models/students_for_course.rb b/app/models/students_for_course.rb new file mode 100644 index 000000000..597d74da6 --- /dev/null +++ b/app/models/students_for_course.rb @@ -0,0 +1,10 @@ +class StudentsForCourse < ActiveRecord::Base + attr_accessible :course_id, :student_id + + belongs_to :course, :class_name => 'Project', :foreign_key => :course_id + belongs_to :student, :class_name => 'User', :foreign_key => :student_id + + validates_presence_of :course_id, :student_id + validates_uniqueness_of :student_id, :scope => :course_id + +end diff --git a/app/models/teacher.rb b/app/models/teacher.rb new file mode 100644 index 000000000..cf57a1be8 --- /dev/null +++ b/app/models/teacher.rb @@ -0,0 +1,13 @@ +class Teacher < ActiveRecord::Base + attr_accessible :course_code, :couurse_time, :location, :tea_name + include Redmine::SafeAttributes + + belongs_to :project + + safe_attributes'tea_name', + 'location', + 'couurse_time', + 'course_code', + 'extra' + +end diff --git a/app/models/user.rb b/app/models/user.rb index 978170017..981ff5af5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -82,8 +82,13 @@ class User < Principal has_many :bids, :foreign_key => 'author_id', :dependent => :destroy has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1" - has_many :journal_replies - has_many :activities + has_many :journal_replies, :dependent => :destroy + has_many :activities, :dependent => :destroy + has_many :students_for_courses, :dependent => :destroy + has_many :courses, :through => :students_for_courses, :source => :project + has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy + has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy + has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy ##### @@ -150,13 +155,27 @@ class User < Principal self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id, :status => true) end + ### fq + def join_in?(course) + joined = StudentsForCourse.where('student_id = ? and course_id = ?', self.id, course.id) + if joined.size > 0 + true + else + false + end + end + ## end + def count_new_jour count = self.new_jours.count end def set_mail_notification + ##add byxianbo + thread=Thread.new do self.mail_notification = Setting.default_notification_option if self.mail_notification.blank? true + end end def update_hashed_password diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index 1c9dd6854..26ce15af6 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -1,173 +1,173 @@ - + - + + +<% if User.current.logged? %> + + +<% end %> + +
+ <%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project} %> +
diff --git a/app/views/courses/_set_join.js.erb b/app/views/courses/_set_join.js.erb new file mode 100644 index 000000000..50bb692d4 --- /dev/null +++ b/app/views/courses/_set_join.js.erb @@ -0,0 +1,8 @@ +$('#join').html('<%= escape_javascript join_in_course(course, user) %>'); +<% if @state %> + <% if @state == 0 %> + alert("加入成功") + <% else %> + alert("密码错误") + <% end %> +<% end %> diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 001ae9596..bf42c5dbd 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -1,6 +1,14 @@ -
-<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> +<% if @project.project_type == 1 %> +
+ <% if User.current.member_of?(@project) %> +<%= link_to(l(:label_file_upload), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> + <% end %>
+<% else %> +
+<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> +
+<% end %>

<%=l(:label_attachment_plural)%>

@@ -11,8 +19,8 @@ <%= sort_header_tag('filename', :caption => l(:field_filename)) %> <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %> - <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %> - MD5 + + <%= sort_header_tag('description', :caption => l(:field_description)) %> @@ -30,8 +38,8 @@ <%= link_to_attachment file, :download => true, :title => file.description %> <%= format_time(file.created_on) %> <%= number_to_human_size(file.filesize) %> - <%= file.downloads %> - <%= file.digest %> + + <%= file.description %> <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> @@ -44,3 +52,4 @@ <% html_title(l(:label_attachment_plural)) -%> + diff --git a/app/helpers/issue_categories_helper.rb b/app/views/issue_categories/issue_categories_helper.rb similarity index 100% rename from app/helpers/issue_categories_helper.rb rename to app/views/issue_categories/issue_categories_helper.rb diff --git a/app/views/layouts/base_bids.html.erb b/app/views/layouts/base_bids.html.erb index eff2cd6f7..36be8c5f0 100644 --- a/app/views/layouts/base_bids.html.erb +++ b/app/views/layouts/base_bids.html.erb @@ -64,7 +64,7 @@
<%= link_to l(:label_x_followers, :count => @bid.watcher_users.count)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %>   <%= link_to l(:label_bidding_project)+"("+@bid.biding_projects.count.to_s+")", project_for_bid_path(@bid) %>  - <%= link_to l(:label_x_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%> + <%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb new file mode 100644 index 000000000..475bcb89b --- /dev/null +++ b/app/views/layouts/base_courses.html.erb @@ -0,0 +1,174 @@ + + + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> + <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> + <%= javascript_heads %> + <%= heads_for_theme %> + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> + + + +
+
+
+ <%= render :partial => 'layouts/base_header'%> + +
+ + +
+
+
    +
  • <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%>
  • +
  • <%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Homework')%>
  • +
  • <%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
  • +
  • <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%>
  • + + <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%> +
  • <%= link_to l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project}, :class => link_class(:settings)%>
+ <% end %> +
+ <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+ <%= render_flash_messages %> + +
+ <%= render :partial => 'layouts/base_footer'%> +
+ + + +
+
+ <%= call_hook :view_layouts_base_body_bottom %> + + \ No newline at end of file diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb new file mode 100644 index 000000000..a20f4e6f4 --- /dev/null +++ b/app/views/layouts/base_homework.html.erb @@ -0,0 +1,143 @@ + + + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> + <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> + <%= javascript_heads %> + <%= heads_for_theme %> + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> + + +
+
+
+ + <%= render :partial => 'layouts/base_header'%> + +
+ +
+ +
+
    +
  • + <%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show' },:class => link_class(:respond)%> +
  • +
  • + <% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 5, 7)).size >0) %> + <%= link_to l(:label_homework_commit), {:controller => 'bids', :action => 'show_project' },:class => link_class(:project)%> + <% else %> + <%= link_to l(:label_homework_info), {:controller => 'bids', :action => 'show_project' },:class => link_class(:project)%> + + <% end %> +
  • + +
      +
+ + <%= yield %> + <%= call_hook :view_layouts_base_content %> +
+
+ <%= render :partial => 'layouts/base_footer'%> +
+
+
+ + + + +
+ <%= call_hook :view_layouts_base_body_bottom %> + + diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 2cedd1815..7faf4b4e6 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -96,10 +96,10 @@
- + - + diff --git a/app/views/mailer/journals_for_message_added.html.erb b/app/views/mailer/journals_for_message_added.html.erb new file mode 100644 index 000000000..f68026492 --- /dev/null +++ b/app/views/mailer/journals_for_message_added.html.erb @@ -0,0 +1,2 @@ +

<%= link_to("hello", @url) %>

+<%=h @user %> diff --git a/app/views/news/_form.html.erb b/app/views/news/_form.html.erb index b4f55ebe8..df80a7483 100644 --- a/app/views/news/_form.html.erb +++ b/app/views/news/_form.html.erb @@ -2,7 +2,7 @@

<%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %>

-

<%= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %>

+

<%= f.text_area :description, :required => true, :cols => 60, :rows => 15, :class => 'wiki-edit', :style => "width:490px;" %>

<%= render :partial => 'attachments/form', :locals => {:container => @news} %>

diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index 64d633575..cded25576 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -1,12 +1,24 @@
-<%= link_to(l(:label_news_new), + <% if @project.project_type == 1%> +<%= link_to(l(:label_news_notice), new_project_news_path(@project), :class => 'icon icon-add', :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> + <% else %> + <%= link_to(l(:label_news_new), + new_project_news_path(@project), + :class => 'icon icon-add', + :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> + + <% end %>
<%= l(:label_user_joinin) %><%= format_date(@user.created_on) %><%= l(:label_user_joinin) %><%= format_time(@user.created_on) %>
<%= l(:label_user_login) %><%= format_date(@user.last_login_on) %><%= l(:label_user_login) %><%= format_time(@user.last_login_on) %>
<%= l(:label_user_mail) %><%= mail_to(h(@user.mail), nil, :encode => 'javascript') %>
+
<%=link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + <% if @project.project_type == 1 %> + + + <% else %> + - + + <% end %> diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb new file mode 100644 index 000000000..efc537113 --- /dev/null +++ b/app/views/projects/_course_form.html.erb @@ -0,0 +1,58 @@ +<%= error_messages_for 'project' %> +<%= error_messages_for 'course' %> + + +<% unless @project.new_record? %> +

<%= render :partial=>"avatar/avatar_form",:locals=> {source:@project} %>

+<% end %> +

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %>

+ +

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>

+ + + + <%= f.fields_for @course do |m| %> + + +

<%= m.text_field :state, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %>

+ <%= l(:text_command) %> +

<%= m.text_field :term, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %>

+ +<% end %> + +

<%= f.text_field :project_type, :value => 1 %>

+ + +<%= wikitoolbar_for 'project_description' %> + +<% @project.custom_field_values.each do |value| %> +

<%= custom_field_tag_with_label :project, value %>

+<% end %> +<%= call_hook(:view_projects_form, :project => @project, :form => f) %> + + + + + +<% unless @project.identifier_frozen? %> + <% content_for :header_tags do %> + <%= javascript_include_tag 'project_identifier' %> + <% end %> +<% end %> + +<% if !User.current.admin? && @project.inherit_members? && @project.parent && User.current.member_of?(@project.parent) %> + <%= javascript_tag do %> + $(document).ready(function() { + $("#project_inherit_members").change(function(){ + if (!$(this).is(':checked')) { + if (!confirm("<%= escape_javascript(l(:text_own_membership_delete_confirmation)) %>")) { + $("#project_inherit_members").attr("checked", true); + } + } + }); + }); + <% end %> +<% end %> diff --git a/app/views/projects/_edit.html.erb b/app/views/projects/_edit.html.erb index 8661b6874..1ec8b1ee8 100644 --- a/app/views/projects/_edit.html.erb +++ b/app/views/projects/_edit.html.erb @@ -1,6 +1,10 @@
<%= labelled_form_for @project do |f| %> -<%= render :partial => 'form', :locals => { :f => f } %> -<%= submit_tag l(:button_save) %> + <% if @project.project_type == 1%> + <%= render :partial => 'course_form', :locals => { :f => f } %> + <% else %> + <%= render :partial => 'form', :locals => { :f => f } %> + <% end %> + <%= submit_tag l(:button_save) %> <% end %> -
\ No newline at end of file + diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb index 8d9ee0dfc..2ccd84032 100644 --- a/app/views/projects/_form.html.erb +++ b/app/views/projects/_form.html.erb @@ -10,9 +10,9 @@ <% unless @project.identifier_frozen? %> <%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %> <% end %>

-

<%= f.text_field :homepage, :size => 60, :style => "width:488px;margin-left: 10px;" %>

-

<%= f.check_box :is_public, :style => "margin-left:10px;" %>

- + +

<%= f.check_box :is_public, :style => "margin-left:10px;" %><%= l(:label_public_info) %>

+

<%= f.text_field :project_type, :value => 0 %>

<%= wikitoolbar_for 'project_description' %> diff --git a/app/views/projects/_homework_form.html.erb b/app/views/projects/_homework_form.html.erb new file mode 100644 index 000000000..e4a471367 --- /dev/null +++ b/app/views/projects/_homework_form.html.erb @@ -0,0 +1,41 @@ + + + + +<%= error_messages_for 'bid' %> + +

<%= l(:label_homeworks_form_new_description) %>

+

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %>

+ +

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

+ +

<%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%> +

+

<%= f.select :homework_type, homework_type_option %> +

+

<%= hidden_field_tag 'course_id', @project.id %> +

+
<%= l(:label_attachment_plural) %> +

<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>

+
\ No newline at end of file diff --git a/app/views/projects/_new_homework.html.erb b/app/views/projects/_new_homework.html.erb new file mode 100644 index 000000000..1da188f3b --- /dev/null +++ b/app/views/projects/_new_homework.html.erb @@ -0,0 +1,81 @@ + + + + + +<%= form_tag({:controller => 'bids', +:action => 'new_bid', +:remote => true, +:method => :post, +:id => 'new-bid-form'}) do %> + +
<%=link_to_user(news.author)if news.respond_to?(:author) %> <%= l(:label_project_notice)%> <%= link_to h(news.title), news_path(news) %>
<%=link_to_user(news.author)if news.respond_to?(:author) %> <%= l(:label_project_newshare)%> <%= link_to h(news.title), news_path(news) %>
<%= textilizable(news, :description) %>
+ + + + + + + + + + + + + + + + + + + +
<%= text_field_tag 'bid_title', "#{l(:label_requirement_name)}", :class => 'noline', :required => true, :onfocus => "clearInfo('bid_title', '#{l(:label_requirement_name)}')", :onblur => "showInfo('bid_title', '#{l(:label_requirement_name)}')"%>
<%= text_area_tag 'bid_description', "#{l(:label_requirement_description)}", :class => 'noline', :required => true, :style => "resize: none;", :rows => 6, + :onfocus => "clearInfo('bid_description', '#{l(:label_requirement_description)}')", :onblur => "showInfo('bid_description', '#{l(:label_requirement_description)}')" %>
<%= text_field_tag 'bid_deadline', "#{l(:label_deadline)}", :class => 'noline', :required => true, + :onfocus => "clearInfo('bid_deadline', '#{l(:label_deadline)}')", :onblur => "showInfo('bid_deadline', '#{l(:label_deadline)}')"%> + <%= calendar_for('bid_deadline')%>
+ + + + +
<%= submit_tag l(:button_new_bid), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%>
+<%end%> \ No newline at end of file diff --git a/app/views/projects/_new_join.html.erb b/app/views/projects/_new_join.html.erb new file mode 100644 index 000000000..ca06715f3 --- /dev/null +++ b/app/views/projects/_new_join.html.erb @@ -0,0 +1,54 @@ + + + +

请输入课程密码

+ +<%= form_tag({:controller => 'courses', + :action => 'join', + :object_id => course.id}, + :remote => true, + :method => :post, + :id => 'new-watcher-form') do %> + + <%= text_field_tag 'course_password', nil, :size => 48%> + +

+ <%= submit_tag '加入', :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %> + <%= submit_tag l(:button_cancel), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);", :type => 'button' %> +

+<% end %> diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 0a1384353..8042cfe4d 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -25,7 +25,14 @@
- <%= content_tag('span', "#{l(:default_role_manager)}: ") %> + + <% if(@project.project_type==1)%> + <%= content_tag('span', "#{l(:field_tea_name)}: ") %> + <% else %> + <%= content_tag('span', "#{l(:default_role_manager)}: ") %> + <% end %> + + <% @admin = @project.project_infos%> <% if @admin.size > 0 %> <%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %> diff --git a/app/views/projects/homework.html.erb b/app/views/projects/homework.html.erb new file mode 100644 index 000000000..8db482544 --- /dev/null +++ b/app/views/projects/homework.html.erb @@ -0,0 +1,28 @@ + + +
+ + + + + + + +
<%= l(:label_course_homework_list)%><% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0))%> + + + <%= link_to(l(:label_course_homework_new), {:controller => 'projects', :action => 'new_homework'}, :class => 'icon icon-add') %> + + + <% end %> +
+
+ + +
+ <%= render :partial => 'bids/bid_homework_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %> +
+ diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index fae7d8bad..7f62bf070 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -7,8 +7,8 @@ - - + +
<%= l(:label_project_plural)%><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %><%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
-<%end%> +<% end %> + +<%= sort_project(@s_type)%> + + + + + + +<%= sort_project(@s_type)%> + + <%= sort_project(@s_type)%> + diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index 4f34d4988..027559317 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -1,12 +1,19 @@ -

<%=l(:label_project_new)%>

- <%= labelled_form_for @project do |f| %> -
- <%= render :partial => 'form', :locals => { :f => f } %> - <%= submit_tag l(:button_create) %> - <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> - <%= javascript_tag "$('#project_name').focus();" %> - <% end %> -
+ <% if @course_tag == '1' %> +

<%=l(:label_course_new)%>

+
+ <%= render :partial => 'course_form', :locals => { :f => f } %> + <%= submit_tag l(:button_create) %> + <%= submit_tag l(:button_create_and_continue), :name => 'course_continue' %> + <% else %> +

<%=l(:label_project_new)%>

+
+ <%= render :partial => 'form', :locals => { :f => f } %> + <%= submit_tag l(:button_create) %> + <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> + <% end %> + <%= javascript_tag "$('#project_name').focus();" %> +
+<% end %> diff --git a/app/views/projects/new_homework.html.erb b/app/views/projects/new_homework.html.erb new file mode 100644 index 000000000..3737a6509 --- /dev/null +++ b/app/views/projects/new_homework.html.erb @@ -0,0 +1,9 @@ +

<%=l(:label_course_new_homework)%>

+ +<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework'} do |f| %> +
+ <%= render :partial => 'homework_form', :locals => { :f => f } %> + <%= submit_tag l(:button_create) %> + <%= javascript_tag "$('#bid_name').focus();" %> + <% end %> +
\ No newline at end of file diff --git a/app/views/projects/new_join.js.erb b/app/views/projects/new_join.js.erb new file mode 100644 index 000000000..c0a6f4a50 --- /dev/null +++ b/app/views/projects/new_join.js.erb @@ -0,0 +1,3 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/new_join', :locals => {:course => @course}) %>'); +showModal('ajax-modal', '400px'); +$('#ajax-modal').addClass('new-watcher'); diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index d95ccb6ac..6682ced76 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -1,3 +1,7 @@

<%=l(:label_settings)%>

-<%= render_tabs project_settings_tabs %> +<% if @project.project_type == 1 %> + <%= render_tabs course_settings_tabs %> +<% else %> + <%= render_tabs project_settings_tabs %> +<% end %> <% html_title(l(:label_settings)) -%> diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb index e4b00fdb6..c4670e85c 100644 --- a/app/views/projects/settings/_members.html.erb +++ b/app/views/projects/settings/_members.html.erb @@ -17,7 +17,22 @@

<%= l(:label_role_plural) %>: <% roles.each do |role| %> - + <% end %>

@@ -40,11 +55,39 @@
<%= link_to_user member.principal %> - <%=h member.roles.sort.collect(&:to_s).join(', ') %> + + <% if @project.project_type == 1 %> + + <% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %> + Teacher + <% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %> + Student + <% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %> + TA + <% else %> + + <% end %> + + <% else %> + + <% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %> + Manager + <% elsif member.roles.sort.collect(&:to_s).join(', ') =='Developer' %> + Developer + <% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %> + Reporter + <% else %> + <% end %> + + <% end %> + + + <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), :method => :put, :html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }} ) do |f| %> +

<% roles.each do |role| %>
diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index c0f4d263b..83da6f79d 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -55,11 +55,12 @@

<%= l(:label_no_data) %>

<% end %> +<% course_tag = @project.project_type %> <% if User.current.allowed_to?(:manage_repository, @project) %> -

<%= link_to l(:label_repository_new), new_project_repository_path(@project), :class => 'icon icon-add' %>

+

<%= link_to l(:label_repository_new), new_project_repository_path(@project, :course => course_tag), :class => 'icon icon-add' %>

<% end %> <% if User.current.allowed_to?(:manage_repository, @project) %>

<%= l(:label_repository_no) %> - <%= link_to l(:label_repository_new_repos), newrepo_project_repository_path(@project), :class => 'icon icon-add' %>

+ <%= link_to l(:label_repository_new_repos), newrepo_project_repository_path(@project, :course => course_tag), :class => 'icon icon-add' %>

<% end %> \ No newline at end of file diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index cb7707781..b8d94ec3d 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -10,7 +10,7 @@
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
- +
<%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%> diff --git a/app/views/projects/statistics.html.erb b/app/views/projects/statistics.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb index a42daa8f5..e46e0dac2 100644 --- a/app/views/repositories/_navigation.html.erb +++ b/app/views/repositories/_navigation.html.erb @@ -3,7 +3,7 @@ <% end %> <%= link_to l(:label_statistics), - {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param}, + {:controller => 'repositories', :action => 'stats', :id => @project, :repository_id => @repository.identifier_param}, :class => 'icon icon-stats' if @repository.supports_all_revisions? %> <%= form_tag({:action => controller.action_name, diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index 8299af0f6..d790f3d57 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -1,12 +1,6 @@

<%= l(:label_statistics) %>

-

-<%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %> -

-

-<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %> -

- -

<%= link_to l(:button_back), :action => 'show', :id => @project %>

+<% src = "http://localhost:3000/statistics/"+@project_id+"/index.html"%> + <% html_title(l(:label_repository), l(:label_statistics)) -%> diff --git a/app/views/tags/_tag_name.html.erb b/app/views/tags/_tag_name.html.erb index d123b9053..49a81da2a 100644 --- a/app/views/tags/_tag_name.html.erb +++ b/app/views/tags/_tag_name.html.erb @@ -35,7 +35,7 @@ <% end %> <% else %> -
<%= l(:label_tags_no) %>
+
<%= l(:label_tags_no) %>
<% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_my_course.html.erb b/app/views/users/_my_course.html.erb new file mode 100644 index 000000000..1e155c5d9 --- /dev/null +++ b/app/views/users/_my_course.html.erb @@ -0,0 +1,57 @@ +
+ <% unless @memberships.empty? %> +
    + <% for membership in @memberships %> +
  • +
+ + + + + +
<%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %> + + + + + + + + + + + +
<%= link_to_project(membership.project) %> + <%= l(:label_homework) %> (<%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %>) +     + <%= l(:label_course_news)%> (<%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %>) +
+

+ <%= membership.project.description%> +

<%= format_time(membership.created_on) %> + + <% if membership.roles.sort.collect(&:to_s).join(', ') =='Manager' %> + Teacher + <% elsif membership.roles.sort.collect(&:to_s).join(', ') =='Reporter' %> + Student + <% elsif membership.roles.sort.collect(&:to_s).join(', ') =='TA' %> + TA + <% end %> +
+ + + <% end %> + + <% else %> + <% if @user != User.current %> +

+ <%= l(:label_project_course_un) %> +

+ <% else %> +

+ <%= l(:label_project_course_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new', :course => 1 %> +

+ <% end %> + <% end %> + <%= call_hook :view_account_left_bottom, :user => @user %> + diff --git a/app/views/users/_my_homework.html.erb b/app/views/users/_my_homework.html.erb new file mode 100644 index 000000000..4c4bd2138 --- /dev/null +++ b/app/views/users/_my_homework.html.erb @@ -0,0 +1,48 @@ + +<% if @bid.size > 0%> + +<% @bid.each do |bids|%> +

<%= link_to(Project.find(bids[0]).name, project_path(bids[0])) %>

+ +<% for bid in bids[1]%> + + + + + + +
<%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %> + + + + + + + + + + + +
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author), :class => 'bid_user') %>:  <%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %>
+ + + + + + + +
<% if bid.reward_type.nil? or bid.reward_type == 1 %> <%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%> <% elsif bid.reward_type == 2 %> <%= l(:label_bids_reward_method) %><%= bid.budget%> <% else %> <% end %>
<%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<%= link_to bid.biding_projects.count, project_for_bid_path(bid.id) %>)<%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>)
<%= format_time bid.created_on %>
+
+ + + + +
<%= bid.description%>
+
+ +<% end %> +<% end %> + +<% else %> +

暂无任何作业

+<% end %> \ No newline at end of file diff --git a/app/views/users/_my_notice.html.erb b/app/views/users/_my_notice.html.erb new file mode 100644 index 000000000..c317865e7 --- /dev/null +++ b/app/views/users/_my_notice.html.erb @@ -0,0 +1,48 @@ + +
+<% unless @memberships.empty? %> +
    + <% for membership in @memberships %> +
  • + + + + + + +
    <%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %> + + + + + + + + + + + +
    <%= link_to_project(membership.project) %> + <%= l(:label_homework) %> (8) + <%= l(:label_course_news)%> (8) + <%= l(:label_member)%>(<%=link_to (membership.project.members.count)%>) + + +
    +

    + <%= membership.project.description%> +

    <%= format_time(membership.created_on) %><%= h membership.roles.sort.collect(&:to_s).join(', ') %>
    + +
  • + <% end %> +
+<% else %> +<% if @user != User.current %> +

<%= l(:label_project_un) %>

+<% else %> +

<%= l(:label_project_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new'%>

+<% end %> + +<% end %> +<%= call_hook :view_account_left_bottom, :user => @user %> +
diff --git a/app/views/users/info.html.erb b/app/views/users/info.html.erb index d3940caf5..e63b71817 100644 --- a/app/views/users/info.html.erb +++ b/app/views/users/info.html.erb @@ -2,7 +2,7 @@ <% unless @message.empty? %>
<% @message.each do |e| -%> - +
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 6bd74fdb8..14b3556e5 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -7,7 +7,7 @@ <% @activity.each do |e| %> <% act = e.act %> <% unless act.nil? %> -
<%= link_to image_tag(url_to_avatar(e.user), :class => "avatar"), user_path(e.user), :class => "avatar" %>
+
diff --git a/app/views/users/user_courses.html.erb b/app/views/users/user_courses.html.erb new file mode 100644 index 000000000..409a38acd --- /dev/null +++ b/app/views/users/user_courses.html.erb @@ -0,0 +1,11 @@ + + +<%= user_course @state%> +<% if @state == 0 %> +<%= render :partial => 'my_course' %> +<% elsif @state == 1 %> +<%= render :partial => 'my_homework' %> +<% else @state == 2 %> +<%= render :partial => 'my_notice' %> +<% end %> + diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 55340902b..643ccfe96 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -6,7 +6,7 @@ <%= l(:label_newfeedback_message) %>(<%= @feedback_count%>) -
+
<%= render :partial => 'words/message', :locals => {:jour => @jour, :state => @state, :user => @user, :feedback_pages => @feedback_pages} %>
<%= link_to image_tag(url_to_avatar(e.user), :class => "avatar"), user_path(e.user_id), :class => "avatar" %>
+
<%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %> diff --git a/app/views/users/watch_bids.html.erb b/app/views/users/watch_bids.html.erb index 88b2c595b..747b79467 100644 --- a/app/views/users/watch_bids.html.erb +++ b/app/views/users/watch_bids.html.erb @@ -5,7 +5,7 @@ <% for bid in @bid%> - +
<%= link_to image_tag(url_to_avatar(bid.author), :class => 'avatar'),user_path(bid.author), :class => "avatar" %> @@ -18,19 +18,24 @@ diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index a95adc131..2eef3f356 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -61,7 +61,6 @@ <% issues.each do |issue| -%> - <% end -%> diff --git a/app/views/watchers/_set_join.js.erb b/app/views/watchers/_set_join.js.erb new file mode 100644 index 000000000..cd6ca1b59 --- /dev/null +++ b/app/views/watchers/_set_join.js.erb @@ -0,0 +1,3 @@ + + +$('#join').html('<%= escape_javascript join_in_course(course, user) %>'); diff --git a/config/locales/en.yml b/config/locales/en.yml index a423b8b83..e4f9941f2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -656,7 +656,7 @@ en: label_query_new: New query label_my_queries: My custom queries label_filter_add: Add filter - label_filter_plural: Filter + label_filter_plural: Query condition label_equals: is label_not_equals: is not label_in_less_than: in less than @@ -917,8 +917,8 @@ en: button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}" button_add: Add button_change: Change - button_apply: Apply - button_clear: Clear + button_apply: Query + button_clear: Cancel query button_lock: Lock button_unlock: Unlock button_download: Download @@ -1416,13 +1416,19 @@ en: label_identity: Identity label_teacher: Teacher label_student: Student - label_enterprise: Enterprise - label_developer: Developer + label_other: Other label_gender: Gender label_gender_male: male label_gender_female: female label_location: Location - label_brief_introduction: Modified my status - label_my_brief_introduction: Howdy guys! please leave your foot print~ #end + label_course: Course + label_course_new: New course + label_public_info: If you don't choose public, only the project's members can see the project. + label_course_student: Student + label_homework: Homework + label_course_new_homework: New homework + label_course_homework_list: Homework List + label_course_homework_new: new homework + label_course_data: Data diff --git a/config/locales/zh.yml b/config/locales/zh.yml index cef6891b5..c7171cab3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -216,6 +216,14 @@ zh: field_name: 名称 + #added by huang + field_tea_name: 教师 + field_location: 工作单位 + field_couurse_time: 学时 + field_course_code: 学分 + field_state: 加入课程口令 + field_term: 学期 + #end field_description: 描述 field_summary: 摘要 field_is_required: 必填 @@ -253,6 +261,8 @@ zh: field_principal: 用户/用户组 field_role: 角色 field_homepage: 主页 + field_time: 课时 + field_code: 学分 field_is_public: 公开 field_parent: 上级项目 field_is_in_roadmap: 在路线图中显示 @@ -510,6 +520,20 @@ zh: label_activities_settings: 显示设置 label_user_login_new: 登录 label_user_login_tips: 您还没有登录,请登录后留言 + #end + #by huang + label_term: 学期 + label_spring: 春季 + label_summer: 夏季 + label_autumn: 秋季 + label_followers: 关注 + label_teacher: 教师 + label_limit_time: 截止日期 + label_commit_homework: 提交作业 + label_course_homework: 对应课程 + label_homework_response: 作业咨询 + label_bidding_homework: 提交作业 + #end label_my_page: 我的工作台 label_my_account: 我的帐号 @@ -552,6 +576,7 @@ zh: label_history: 历史记录 label_attachment: 文件 label_attachment_new: 新建文件 + label_file_upload: 上传资料 label_attachment_delete: 删除文件 label_attachment_plural: 文件 label_file_added: 文件已添加 @@ -559,12 +584,20 @@ zh: label_report_plural: 报表 label_news: 新闻 label_news_new: 添加新闻 + bale_news_notice: 添加通知 #huang + label_news_notice: 发布课程通知 label_news_plural: 新闻 label_news_latest: 最近的新闻 label_news_view_all: 查看所有新闻 label_news_added: 新闻已添加 label_settings: 配置 - label_overview: 活动 + label_overview: 项目动态 + label_course_overview: "课程动态" + label_question_student: 学生反馈 #huang + label_homework_commit: 提交作业 #huang + label_homework_info: 作业情况 #huang + label_course_file: 资料下载 + label_course_news: 课程通知 label_version: 版本 label_version_new: 新建版本 label_version_plural: 版本 @@ -623,7 +656,7 @@ zh: label_query_new: 新建查询 label_filter_add: 增加过滤器 - label_filter_plural: 过滤器 + label_filter_plural: 查询条件 label_equals: 等于 label_not_equals: 不等于 label_in_less_than: 剩余天数小于 @@ -648,6 +681,7 @@ zh: label_not_contains: 不包含 label_day_plural: 天 label_repository: 版本库 + label_course_repository: 代码库 label_repository_plural: 版本库 label_browse: 浏览 label_branch: 分支 @@ -787,11 +821,12 @@ zh: label_project_issues: "缺陷" label_project_newother: "查看其他评论" label_project_newshare: "分享了" + label_project_notice: "发布了通知:" label_project_newadd: "添加了" label_project_unadd: "暂无项目,赶快去创建吧!" label_project_un: "该用户暂未参与任何项目!" - - + label_project_course_un: "该用户暂未加入任何课程!" + label_project_course_unadd: "你还未创建课程,赶快去创建吧!" #end by huang label_user_mail_option_selected: "收取选中项目的所有通知..." label_user_mail_option_none: "不收取任何通知" @@ -865,8 +900,9 @@ zh: button_add: 新增 button_change: 修改 - button_apply: 应用 - button_clear: 清除 + button_apply: 查询 + button_clear: 取消查询 + button_clear_requirement: 取消 button_lock: 锁定 button_unlock: 解锁 button_download: 下载 @@ -924,6 +960,7 @@ zh: text_caracters_maximum: "最多 %{count} 个字符。" text_caracters_minimum: "至少需要 %{count} 个字符。" text_length_between: "长度必须在 %{min} 到 %{max} 个字符之间。" + text_command: 口令仅数字可以使用,学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。 text_tracker_no_workflow: 此跟踪标签未定义工作流程 text_unallowed_characters: 非法字符 text_comma_separated: 可以使用多个值(用逗号,分开)。 @@ -1227,8 +1264,14 @@ zh: field_add: 添加于 %{time} 之前 button_more: 更多 label_user_response: 用户反馈 + label_student_response: 学生反馈 label_bidding_project: 参与项目 + label_homework_project: 已提交作业 #huang button_bidding: 我要参加 + + button_bidding_homework: 提交作业 #huang + field_homework_type: 作业类型 + label_homework_respond: 作业情况 label_new_call: 发布需求 label_user_information: "与我相关" @@ -1237,19 +1280,35 @@ zh: label_wrong_date: 时间格式错误,请输入正确的时间 yyyy-mm-dd label_bidding_succeed: 应标成功 label_bidding_fail: 应标失败,该项目已经应标 + label_bidding_homework_fail: 作业提交失败,该作业已经被提交! label_requirement_list: 需求列表 label_x_biding_project: #modify by men - zero: 项目 - one: 项目 - other: 项目 + zero: 应标项目 + one: 应标项目 + other: 应标项目 + #end + label_x_homework_project: #modify by huang + zero: 已提交的作业 + one: 已提交的作业 + other: 已提交的作业 #end label_x_responses: #modify by men zero: 留言 one: 留言 other: 留言 #end + label_x_responses: #modify by huang + zero: 学生提问 + one: 学生提问 + other: 学生提问 + #end + label_x_bids_responses: #modify by huang + zero: 用户反馈 + one: 用户反馈 + other: 用户反馈 + #end label_x_followers: #modify by men zero: 关注 one: 关注 @@ -1260,7 +1319,9 @@ zh: label_investment_budget: 投资预算: label_investment_time_limit: 投资时限: label_my_respond: 我要反馈: + label_my_question: 有疑问请在此处提出! label_respond_requirement: 对需求进行了反馈 + label_question_requirement: 对作业提出了问题! label_deadline: 投资时限yyyy-mm-dd label_requirement_name: 为你的需求起个名字~~ label_requirement_description: 内容:对你的需求进行描述 @@ -1274,6 +1335,7 @@ zh: label_praise: 赞 label_cancel_praise: 取消赞 label_bid_reason: 请输入参与理由 + label_bid_reason_homework: 请输入作业提交说明! label_create_new_projects: 创建项目 label_call_for_bids: 发布需求 label_create_course: 创建课程 @@ -1293,8 +1355,11 @@ zh: label_my: 我 label_i: 我 label_join_bidding: 参与了应标 + label_jion_bidding_homework: 已提交! label_bidding_user: 应标人: + label_bidding_user_homework: 作业提交者 label_bidding_reason: 应标宣言: + label_bidding_reason_homewrok: 作业提交说明 label_username: 用户名: label_password: 密码: label_about_requirement: 对需求: @@ -1356,6 +1421,7 @@ zh: field_birthday: 生日 field_brief_introduction: 个人简介 field_location: 现住址 + field_occupation: 工作单位 field_work_experience: 工作经验(年) field_zip_code: 邮编 label_reward: 奖励: @@ -1375,14 +1441,17 @@ zh: label_issue_cancel_query: 取消查询 field_reward_type: 奖励类型 label_tags_no: 暂无标签! + label_course_description_no: 你还未对该课程添加描述! label_bid_publish: 发布了 label_bid_project: 项目 label_project_no_follow: 该项目暂未被关注! label_no_bid_project: 暂无参与项目 + label_no_course_project: 暂无已提交的作业! label_bids_reward_method: 奖励方式 : label_bids_reward_what: 输入奖励内容 label_call_bonus: 奖金 label_bids_form_new_description: 发布一个需求,一次竞赛或者一个课程的作业 + label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式,在作业类型里面设置。 label_bids_new_money: 输入奖励金额,如 500,2.5等 label_bids_new_credit: 输入该作业对应课程的学分,如 3,2.5等 label_bids_new_content: 输入奖励内容,如 奖项,物品等 @@ -1395,6 +1464,7 @@ zh: label_welcome_trustie: Trustie label_welcome_trustie_description: 面向有创意和激情的高校大学生与创业者,提供社交化的项目管理、协同研究、软件开发和众包平台。 label_user_project: 项目 + label_user_course: 课程 label_bid_respond_quote: 回复 label_bid_if_agreement: 如果喜欢我,请点击我 label_bid_respond_delete: 删除 @@ -1419,22 +1489,28 @@ zh: button_projects_feedback_respond: 回复 label_projects_feedback_respond_content: 请输入回复内容 label_user_create_project: 创建了 - #added by bai label_identity: 身份 - label_teacher: 教师 + label_teacher: 教 师 + label_teacher_homework: 教师姓名 label_student: 学生 - label_enterprise: 企业 - label_developer: 开发者 - label_technical_title: "职称:" + label_other: 其他 label_gender: 性别 label_gender_male: 男 label_gender_female: 女 - label_location: "地区:" - field_occupation: "工作单位:" - notice_lost_location: 请选择地区信息 + label_location: 地区 label_brief_introduction: 修改我的状态 label_my_brief_introduction: 今天的心情如何?留下你的脚印吧~ #end - - + + label_course: 课程 + label_course_new: 新建课程 + label_public_info: 若不公开,仅项目成员可见该项目 + label_course_student: 学生 + label_homework: 课程作业 + label_course_file: 资料共享 + label_course_new_homework: 新建作业 + label_course_homework_list: 作业列表 + label_course_homework_new: 发布作业 + label_course_data: 资料 + label_homework_statistics: 作业统计 diff --git a/config/routes.rb b/config/routes.rb index 5cbd1d051..b0c06bd77 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -89,6 +89,7 @@ RedmineApp::Application.routes.draw do match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info' match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang + match 'user_courses', :to => 'users#user_courses', :via => :get end end match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback" @@ -124,25 +125,19 @@ RedmineApp::Application.routes.draw do post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue' delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue' - - resources :projects do + resources :projects do member do get 'settings(/:tab)', :action => 'settings', :as => 'settings' - # get 'show', :action => 'show', :as => 'project_show' - # get 'activity', :controller => 'activities', :action => 'index', :as => 'activity' - # get 'repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository' #by young get 'member', :controller => 'projects', :action => 'member', :as => 'member' -# get 'focus', :action => 'focus', :as => 'focus' -# get 'investor', :action => 'investor', :as => 'investor' -# get 'issue', :action =>'issue', :as => 'issue' -# get 'mission', :action => 'mission', :as => 'mission' -# get 'on', :action => 'on', :as => 'on' get 'file', :action => 'file', :as => 'file' get 'statistics', :action => 'statistics', :as => 'statistics' get 'feedback', :action => 'feedback', :as => 'project_feedback' get 'watcherlist', :action=> 'watcherlist' match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang + get 'homework', :action => 'homework', :as => 'homework' + get 'new_homework', :action => 'new_homework', :as => 'new_homework' + #get 'news', :action => 'news', :as => 'news' #end post 'modules' @@ -156,14 +151,11 @@ RedmineApp::Application.routes.draw do #by young match '/member', :controller => 'projects', :action => 'member', :as => 'member', :via => :get -# match '/focus', :controller => 'projects', :action => 'focus', :as => 'focus', :via => :get -# match '/mission', :controller => 'projects', :action => 'mission', :as => 'mission', :via => :get -# match '/on', :controller => 'projects', :action => 'on', :as => 'on', :via => :get -# match '/settings(/:tab)', :controller => 'projects', :action => 'settings', :as => 'settings', :via => :get match '/file', :controller => 'projects', :action => 'file', :as => 'file', :via => :get match '/statistics', :controller => 'projects', :action => 'statistics', :as => 'statistics', :via => :get # match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get - + match '/homework', :controller => 'projects', :action => 'homework', :as => 'homework', :via => :get + # match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get # match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get # match '/', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get @@ -172,6 +164,7 @@ RedmineApp::Application.routes.draw do # match '/show', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get match '/watcherlist', :controller=>'projects', :action=> 'watcherlist', :as => 'watcherlist', :via => :get #add by huang + # matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get #end resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do @@ -442,10 +435,20 @@ RedmineApp::Application.routes.draw do get 'calls/back', :to=> 'bids#back' match 'calls/new_bid', :controller => 'bids', :action => 'new_bid' match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid' + match 'calls/:id/show_project_homework', :controller => 'bids', :action => 'show_project_homework', :as => 'project_for_bid_homework' # by huang match 'calls/:id/add', :controller => 'bids', :action => 'add' + match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework' match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond' match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback' match 'calls/create_bid', :to => 'bids#create_bid' + match 'calls/create_homework', :to => 'bids#create_homework' + match 'calls/:id/homework_respond', :to => 'bids#homework_respond' + match 'calls/:id/homework_statistics', :to => 'bids#homework_statistics' + + post 'join_in/join', :to => 'courses#join', :as => 'join' + delete 'join_in/join', :to => 'courses#unjoin' + delete 'attachment/:id', :to => 'attachments#delete_homework' + match 'new_join', :to => 'projects#new_join', :as => 'try_join' match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post ## 测试用 # match 'test/index', :controller => 'test', :action => 'index' diff --git a/db/migrate/20130827003308_add_project_type_to_project.rb b/db/migrate/20130827003308_add_project_type_to_project.rb new file mode 100644 index 000000000..64455b638 --- /dev/null +++ b/db/migrate/20130827003308_add_project_type_to_project.rb @@ -0,0 +1,9 @@ +class AddProjectTypeToProject < ActiveRecord::Migration + def self.up + add_column :projects, :project_type, :integer + end + + def self.down + remove_column :projects, :project_type + end +end diff --git a/db/migrate/20130831080808_create_teachers.rb b/db/migrate/20130831080808_create_teachers.rb new file mode 100644 index 000000000..ce3d5f92c --- /dev/null +++ b/db/migrate/20130831080808_create_teachers.rb @@ -0,0 +1,12 @@ +class CreateTeachers < ActiveRecord::Migration + def change + create_table :teachers do |t| + t.string :tea_name + t.string :location + t.integer :couurse_time + t.integer :course_code + + t.timestamps + end + end +end diff --git a/db/migrate/20130831080955_add_extra_to_teacher.rb b/db/migrate/20130831080955_add_extra_to_teacher.rb new file mode 100644 index 000000000..1de12802c --- /dev/null +++ b/db/migrate/20130831080955_add_extra_to_teacher.rb @@ -0,0 +1,5 @@ +class AddExtraToTeacher < ActiveRecord::Migration + def change + add_column :teachers, :extra, :string + end +end diff --git a/db/migrate/20130904075504_create_courses.rb b/db/migrate/20130904075504_create_courses.rb new file mode 100644 index 000000000..682892696 --- /dev/null +++ b/db/migrate/20130904075504_create_courses.rb @@ -0,0 +1,14 @@ +class CreateCourses < ActiveRecord::Migration + def change + create_table :courses do |t| + t.integer :tea_id + t.string :name + t.integer :state + t.string :code + t.integer :time + t.string :extra + + t.timestamps + end + end +end diff --git a/db/migrate/20130906124330_add_location_to_course.rb b/db/migrate/20130906124330_add_location_to_course.rb new file mode 100644 index 000000000..bcf3bccac --- /dev/null +++ b/db/migrate/20130906124330_add_location_to_course.rb @@ -0,0 +1,5 @@ +class AddLocationToCourse < ActiveRecord::Migration + def change + add_column :courses, :location, :string + end +end diff --git a/db/migrate/20130910075221_create_homework_for_courses.rb b/db/migrate/20130910075221_create_homework_for_courses.rb new file mode 100644 index 000000000..429f6bee8 --- /dev/null +++ b/db/migrate/20130910075221_create_homework_for_courses.rb @@ -0,0 +1,8 @@ +class CreateHomeworkForCourses < ActiveRecord::Migration + def change + create_table :homework_for_courses do |t| + t.integer :project_id + t.integer :bid_id + end + end +end diff --git a/db/migrate/20130911005626_create_students_for_courses.rb b/db/migrate/20130911005626_create_students_for_courses.rb new file mode 100644 index 000000000..5e7f3a8a7 --- /dev/null +++ b/db/migrate/20130911005626_create_students_for_courses.rb @@ -0,0 +1,10 @@ +class CreateStudentsForCourses < ActiveRecord::Migration + def change + create_table :students_for_courses do |t| + t.integer :student_id + t.integer :course_id + + t.timestamps + end + end +end diff --git a/db/migrate/20130913005337_add_homework_type_to_bid.rb b/db/migrate/20130913005337_add_homework_type_to_bid.rb new file mode 100644 index 000000000..64a0d4cb7 --- /dev/null +++ b/db/migrate/20130913005337_add_homework_type_to_bid.rb @@ -0,0 +1,5 @@ +class AddHomeworkTypeToBid < ActiveRecord::Migration + def change + add_column :bids, :homework_type, :integer + end +end diff --git a/db/migrate/20130913125835_create_homework_attaches.rb b/db/migrate/20130913125835_create_homework_attaches.rb new file mode 100644 index 000000000..2caea7166 --- /dev/null +++ b/db/migrate/20130913125835_create_homework_attaches.rb @@ -0,0 +1,10 @@ +class CreateHomeworkAttaches < ActiveRecord::Migration + def change + create_table :homework_attaches do |t| + t.integer :bid_id + t.integer :user_id + + t.timestamps + end + end +end diff --git a/db/migrate/20130917123036_add_term_to_courses.rb b/db/migrate/20130917123036_add_term_to_courses.rb new file mode 100644 index 000000000..3f7f7ef30 --- /dev/null +++ b/db/migrate/20130917123036_add_term_to_courses.rb @@ -0,0 +1,6 @@ +class AddTermToCourses < ActiveRecord::Migration + def change + add_column :courses, :term, :string + add_column :courses, :string, :string + end +end diff --git a/db/migrate/20130918004629_add_technical_title_to_user_extensions.rb b/db/migrate/20130918004629_add_technical_title_to_user_extensions.rb new file mode 100644 index 000000000..7097e6aee --- /dev/null +++ b/db/migrate/20130918004629_add_technical_title_to_user_extensions.rb @@ -0,0 +1,5 @@ +class AddTechnicalTitleToUserExtensions < ActiveRecord::Migration + def change + add_column :user_extensions, :technical_title, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index a6452cbba..2ec42eb44 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -13,14 +13,6 @@ ActiveRecord::Schema.define(:version => 20130922123849) do - create_table "a_user_watchers", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "member_id" - end - create_table "activities", :force => true do |t| t.integer "act_id", :null => false t.string "act_type", :null => false @@ -284,9 +276,9 @@ ActiveRecord::Schema.define(:version => 20130922123849) do add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" create_table "issue_relations", :force => true do |t| - t.integer "issue_from_id", :null => false - t.integer "issue_to_id", :null => false - t.string "relation_type", :null => false + t.integer "issue_from_id", :null => false + t.integer "issue_to_id", :null => false + t.string "relation_type", :default => "", :null => false t.integer "delay" end @@ -428,22 +420,6 @@ ActiveRecord::Schema.define(:version => 20130922123849) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" - create_table "messages_for_bids", :force => true do |t| - t.string "message" - t.integer "user_id" - t.integer "bid_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "messages_for_users", :force => true do |t| - t.integer "messager_id" - t.integer "user_id" - t.string "message" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -583,6 +559,26 @@ ActiveRecord::Schema.define(:version => 20130922123849) do t.string "issues_visibility", :limit => 30, :default => "default", :null => false end + create_table "seems_rateable_cached_ratings", :force => true do |t| + t.integer "cacheable_id", :limit => 8 + t.string "cacheable_type" + t.float "avg", :null => false + t.integer "cnt", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_rates", :force => true do |t| + t.integer "rater_id", :limit => 8 + t.integer "rateable_id" + t.string "rateable_type" + t.float "stars", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -593,9 +589,9 @@ ActiveRecord::Schema.define(:version => 20130922123849) do create_table "shares", :force => true do |t| t.date "created_on" - t.string "title" - t.string "share_type" t.string "url" + t.string "title" + t.integer "share_type" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "project_id" @@ -603,8 +599,9 @@ ActiveRecord::Schema.define(:version => 20130922123849) do t.string "description" end - create_table "students", :force => true do |t| - t.string "name" + create_table "students_for_courses", :force => true do |t| + t.integer "student_id" + t.integer "course_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end @@ -667,7 +664,7 @@ ActiveRecord::Schema.define(:version => 20130922123849) do create_table "tokens", :force => true do |t| t.integer "user_id", :default => 0, :null => false t.string "action", :limit => 30, :default => "", :null => false - t.string "value", :limit => 40 + t.string "value", :limit => 40, :default => "", :null => false t.datetime "created_on", :null => false end @@ -722,12 +719,13 @@ ActiveRecord::Schema.define(:version => 20130922123849) do create_table "user_tags", :force => true do |t| t.integer "user_id" - t.integer "tag_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end + add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" + add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" + create_table "users", :force => true do |t| t.string "login", :default => "", :null => false t.string "hashed_password", :limit => 40, :default => "", :null => false diff --git a/files/2013/08/130806152654_desktop.ini b/files/2013/08/130806152654_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806152654_desktop.ini differ diff --git a/files/2013/08/130806153250_desktop.ini b/files/2013/08/130806153250_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806153250_desktop.ini differ diff --git a/files/2013/08/130806153331_desktop.ini b/files/2013/08/130806153331_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806153331_desktop.ini differ diff --git a/files/2013/08/130806153435_desktop.ini b/files/2013/08/130806153435_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806153435_desktop.ini differ diff --git a/files/2013/08/130806153511_desktop.ini b/files/2013/08/130806153511_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806153511_desktop.ini differ diff --git a/files/2013/08/130806153649_desktop.ini b/files/2013/08/130806153649_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806153649_desktop.ini differ diff --git a/files/2013/08/130806153715_desktop.ini b/files/2013/08/130806153715_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806153715_desktop.ini differ diff --git a/files/2013/08/130806153855_desktop.ini b/files/2013/08/130806153855_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806153855_desktop.ini differ diff --git a/files/2013/08/130806153935_desktop.ini b/files/2013/08/130806153935_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806153935_desktop.ini differ diff --git a/files/2013/08/130806154013_desktop.ini b/files/2013/08/130806154013_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806154013_desktop.ini differ diff --git a/files/2013/08/130806154103_desktop.ini b/files/2013/08/130806154103_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806154103_desktop.ini differ diff --git a/files/2013/08/130806154135_desktop.ini b/files/2013/08/130806154135_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806154135_desktop.ini differ diff --git a/files/2013/08/130806154627_desktop.ini b/files/2013/08/130806154627_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806154627_desktop.ini differ diff --git a/files/2013/08/130806154720_desktop.ini b/files/2013/08/130806154720_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806154720_desktop.ini differ diff --git a/files/2013/08/130806154826_desktop.ini b/files/2013/08/130806154826_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806154826_desktop.ini differ diff --git a/files/2013/08/130806154843_desktop.ini b/files/2013/08/130806154843_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806154843_desktop.ini differ diff --git a/files/2013/08/130806154858_desktop.ini b/files/2013/08/130806154858_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806154858_desktop.ini differ diff --git a/files/2013/08/130806155359_desktop.ini b/files/2013/08/130806155359_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806155359_desktop.ini differ diff --git a/files/2013/08/130806155534_desktop.ini b/files/2013/08/130806155534_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806155534_desktop.ini differ diff --git a/files/2013/08/130806155622_desktop.ini b/files/2013/08/130806155622_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806155622_desktop.ini differ diff --git a/files/2013/08/130806155745_desktop.ini b/files/2013/08/130806155745_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806155745_desktop.ini differ diff --git a/files/2013/08/130806155911_desktop.ini b/files/2013/08/130806155911_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806155911_desktop.ini differ diff --git a/files/2013/08/130806160031_desktop.ini b/files/2013/08/130806160031_desktop.ini new file mode 100644 index 000000000..d5d42888f Binary files /dev/null and b/files/2013/08/130806160031_desktop.ini differ diff --git a/files/2013/08/130807094116_Chrysanthemum.jpg b/files/2013/08/130807094116_Chrysanthemum.jpg new file mode 100644 index 000000000..757c2a628 Binary files /dev/null and b/files/2013/08/130807094116_Chrysanthemum.jpg differ diff --git a/files/2013/08/130807094539_Jellyfish.jpg b/files/2013/08/130807094539_Jellyfish.jpg new file mode 100644 index 000000000..fa4fd4110 Binary files /dev/null and b/files/2013/08/130807094539_Jellyfish.jpg differ diff --git a/files/2013/08/130827170642_1675b2d45e868443acb3447a529c1ace.txt b/files/2013/08/130827170642_1675b2d45e868443acb3447a529c1ace.txt new file mode 100644 index 000000000..0faa795e7 --- /dev/null +++ b/files/2013/08/130827170642_1675b2d45e868443acb3447a529c1ace.txt @@ -0,0 +1,4 @@ +ͻϵͳUbuntu Linux64λ +汾8 +Cpu2vcpu +ڴ棺4196MB diff --git a/files/2013/08/130829095300_1675b2d45e868443acb3447a529c1ace.txt b/files/2013/08/130829095300_1675b2d45e868443acb3447a529c1ace.txt new file mode 100644 index 000000000..0faa795e7 --- /dev/null +++ b/files/2013/08/130829095300_1675b2d45e868443acb3447a529c1ace.txt @@ -0,0 +1,4 @@ +ͻϵͳUbuntu Linux64λ +汾8 +Cpu2vcpu +ڴ棺4196MB diff --git a/files/2013/09/130909091918_twurn.com_.png b/files/2013/09/130909091918_twurn.com_.png new file mode 100644 index 000000000..2e8198241 Binary files /dev/null and b/files/2013/09/130909091918_twurn.com_.png differ diff --git a/files/2013/09/130909102300_twurn.com_.png b/files/2013/09/130909102300_twurn.com_.png new file mode 100644 index 000000000..2e8198241 Binary files /dev/null and b/files/2013/09/130909102300_twurn.com_.png differ diff --git a/files/2013/09/130909102607_48a3823e1ee72a1a06a62cbdcb4a5cd0.txt b/files/2013/09/130909102607_48a3823e1ee72a1a06a62cbdcb4a5cd0.txt new file mode 100644 index 000000000..4eeb9c90d --- /dev/null +++ b/files/2013/09/130909102607_48a3823e1ee72a1a06a62cbdcb4a5cd0.txt @@ -0,0 +1,7 @@ + + <% if(@project.project_type)%> + <%= content_tag('span', "#{l(:field_tea_name)}: ") %> + <% else %> + <%= content_tag('span', "#{l(:default_role_manager)}: ") %> + <% end %> + \ No newline at end of file diff --git a/files/2013/09/130913110338_YodaoDict.exe b/files/2013/09/130913110338_YodaoDict.exe new file mode 100644 index 000000000..cb0fb4658 Binary files /dev/null and b/files/2013/09/130913110338_YodaoDict.exe differ diff --git a/files/2013/09/130913112844_YodaoDict.exe b/files/2013/09/130913112844_YodaoDict.exe new file mode 100644 index 000000000..cb0fb4658 Binary files /dev/null and b/files/2013/09/130913112844_YodaoDict.exe differ diff --git a/files/2013/09/130913150242_YodaoDict.exe b/files/2013/09/130913150242_YodaoDict.exe new file mode 100644 index 000000000..cb0fb4658 Binary files /dev/null and b/files/2013/09/130913150242_YodaoDict.exe differ diff --git a/files/2013/09/130913150350_89d0a4acf8770fc08309561559c49b62.exe b/files/2013/09/130913150350_89d0a4acf8770fc08309561559c49b62.exe new file mode 100644 index 000000000..6b17f167a Binary files /dev/null and b/files/2013/09/130913150350_89d0a4acf8770fc08309561559c49b62.exe differ diff --git a/files/2013/09/130913152235_XMP.exe b/files/2013/09/130913152235_XMP.exe new file mode 100644 index 000000000..bf062e124 Binary files /dev/null and b/files/2013/09/130913152235_XMP.exe differ diff --git a/files/2013/09/130913152553_d53d97d93a897698e1b597ba567568fe.exe b/files/2013/09/130913152553_d53d97d93a897698e1b597ba567568fe.exe new file mode 100644 index 000000000..6231c923e Binary files /dev/null and b/files/2013/09/130913152553_d53d97d93a897698e1b597ba567568fe.exe differ diff --git a/files/2013/09/130913152811_XMP.exe b/files/2013/09/130913152811_XMP.exe new file mode 100644 index 000000000..bf062e124 Binary files /dev/null and b/files/2013/09/130913152811_XMP.exe differ diff --git a/files/2013/09/130913205349_XMP.exe b/files/2013/09/130913205349_XMP.exe new file mode 100644 index 000000000..bf062e124 Binary files /dev/null and b/files/2013/09/130913205349_XMP.exe differ diff --git a/files/2013/09/130913211043_d53d97d93a897698e1b597ba567568fe.exe b/files/2013/09/130913211043_d53d97d93a897698e1b597ba567568fe.exe new file mode 100644 index 000000000..6231c923e Binary files /dev/null and b/files/2013/09/130913211043_d53d97d93a897698e1b597ba567568fe.exe differ diff --git a/files/2013/09/130913211313_navicat.exe b/files/2013/09/130913211313_navicat.exe new file mode 100644 index 000000000..cde21f595 Binary files /dev/null and b/files/2013/09/130913211313_navicat.exe differ diff --git a/files/2013/09/130913214441_89d0a4acf8770fc08309561559c49b62.exe b/files/2013/09/130913214441_89d0a4acf8770fc08309561559c49b62.exe new file mode 100644 index 000000000..6b17f167a Binary files /dev/null and b/files/2013/09/130913214441_89d0a4acf8770fc08309561559c49b62.exe differ diff --git a/files/2013/09/130913214715_navicat.exe b/files/2013/09/130913214715_navicat.exe new file mode 100644 index 000000000..cde21f595 Binary files /dev/null and b/files/2013/09/130913214715_navicat.exe differ diff --git a/files/2013/09/130913214952_YodaoDict.exe b/files/2013/09/130913214952_YodaoDict.exe new file mode 100644 index 000000000..cb0fb4658 Binary files /dev/null and b/files/2013/09/130913214952_YodaoDict.exe differ diff --git a/lib/redmine.rb b/lib/redmine.rb index 8da5b5336..96cca91b2 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -218,11 +218,18 @@ end Redmine::MenuManager.map :bid_menu do |menu| menu.push :respond, { :controller => 'bids', :action => 'show' }, :caption => :label_user_response menu.push :project, { :controller => 'bids', :action => 'show_project' }, :caption => :label_bidding_project + # menu.push :homework_respond, {:controller => 'bids', :action => 'homework_respond'} end Redmine::MenuManager.map :application_menu do |menu| # Empty end +###### +Redmine::MenuManager.map :homework_menu do |menu| + menu.push :respond, { :controller => 'bids', :action => 'show' }, :caption => :label_homework_response + menu.push :project, { :controller => 'bids', :action => 'show_project' }, :caption => :label_bidding_homework +end +########end Redmine::MenuManager.map :admin_menu do |menu| menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural menu.push :users, {:controller => 'users'}, :caption => :label_user_plural @@ -241,7 +248,7 @@ Redmine::MenuManager.map :admin_menu do |menu| menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true end -#by young +#Modified by young Redmine::MenuManager.map :project_menu do |menu| menu.push :overview, { :controller => 'projects', :action => 'show' } # menu.push :activity, { :controller => 'activities', :action => 'index' } @@ -265,10 +272,22 @@ Redmine::MenuManager.map :project_menu do |menu| end #end + #added by young +Redmine::MenuManager.map :course_menu do |menu| + menu.push :overview, { :controller => 'projects', :action => 'show'} + menu.push :homework, { :controller => 'projects', :action => 'homework' } +# menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural +# menu.push :files, { :controller => 'files', :action => 'index' }, :caption => :label_file_new, :param => :project_id + menu.push :repository, { :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :course => 1 } + menu.push :settings, { :controller => 'projects', :action => 'settings', :course => 1 }, :last => true + +end Redmine::MenuManager.map :user_menu do |menu| menu.push :activity, {:controller => 'users', :action => 'show' } + menu.push :user_course, {:controller => 'users', :action => 'user_courses'} menu.push :user_project, {:controller => 'users', :action => 'user_projects'} + menu.push :requirement_focus, {:controller => 'users', :action => 'watch_bids'} menu.push :user_newfeedback, {:controller => 'users', :action => 'user_newfeedback'} diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index 25974ed83..887c3a4b7 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -74,10 +74,11 @@ module Redmine def current_menu_item controller.current_menu_item end + # Renders the application main menu def render_main_menu(project) - render_menu((project && !project.new_record?) ? :project_menu : :application_menu, project) + render_menu((project && !project.new_record?) ? :project_menu : :application_menu, project) end def display_main_menu?(project) diff --git a/public/images/avatars/Project/6316 b/public/images/avatars/Project/6316 new file mode 100644 index 000000000..fa4fd4110 Binary files /dev/null and b/public/images/avatars/Project/6316 differ diff --git a/public/images/avatars/Project/6356 b/public/images/avatars/Project/6356 new file mode 100644 index 000000000..757c2a628 Binary files /dev/null and b/public/images/avatars/Project/6356 differ diff --git a/public/images/avatars/Project/6358 b/public/images/avatars/Project/6358 new file mode 100644 index 000000000..030ab8a68 Binary files /dev/null and b/public/images/avatars/Project/6358 differ diff --git a/public/images/avatars/Project/6446 b/public/images/avatars/Project/6446 new file mode 100644 index 000000000..90e0e8474 Binary files /dev/null and b/public/images/avatars/Project/6446 differ diff --git a/public/statistics/trustie2/arrow-down.gif b/public/statistics/trustie2/arrow-down.gif new file mode 100644 index 000000000..997f02f6b Binary files /dev/null and b/public/statistics/trustie2/arrow-down.gif differ diff --git a/public/statistics/trustie2/arrow-none.gif b/public/statistics/trustie2/arrow-none.gif new file mode 100644 index 000000000..d011a4999 Binary files /dev/null and b/public/statistics/trustie2/arrow-none.gif differ diff --git a/public/statistics/trustie2/arrow-up.gif b/public/statistics/trustie2/arrow-up.gif new file mode 100644 index 000000000..15eabb351 Binary files /dev/null and b/public/statistics/trustie2/arrow-up.gif differ diff --git a/public/statistics/trustie2/gitstats.cache b/public/statistics/trustie2/gitstats.cache new file mode 100644 index 000000000..82669a176 Binary files /dev/null and b/public/statistics/trustie2/gitstats.cache differ diff --git a/public/statistics/trustie2/gitstats.css b/public/statistics/trustie2/gitstats.css new file mode 100644 index 000000000..2e401fe1f --- /dev/null +++ b/public/statistics/trustie2/gitstats.css @@ -0,0 +1,154 @@ +/** + * GitStats - default style + */ +body { + color: black; + background-color: #fff; +} + +dt { + font-size: 12px; + font-weight: bold; + float: left; + margin-right: 1em; + margin-left: 10px; +} + +dt:after { + content: ': '; +} + +dd { + font-size: 11px; + display: block; + clear: left; +} + +table { + border: 1px solid black; + border-collapse: collapse; + font-size: 70%; + margin-bottom: 1em; +} + +table.noborders { + border: none; +} + +table.noborders td { + border: none; +} + +.vtable { + float: right; + clear: both; +} + +table.tags td { + vertical-align: top; +} + +th { + background-color: #ddf; +} + +th a { + text-decoration: none; +} + +tr:hover { + background-color: #ddf; +} + +td { + border: 1px solid black; + padding: 0.2em; + padding-left: 0.3em; + padding-right: 0.2em; +} + +/* Navigation bar; tabbed style */ +.nav { + height: 2em; margin-bottom:1.2em; position:relative; overflow:hidden;margin-top: -10px; +} + +.nav ul { + margin:0; position:absolute; bottom:0; padding-left:0.5em; +} + +.nav li { + float:left; + list-style-type:none; + white-space:nowrap; + margin-right:0px; + background:#fff; + position:relative; + margin-bottom:5px; +} + +.nav li a { + font-size: 0.8em; + text-decoration:none; + line-height:1.3em; + padding:2px 6px 2px 6px; + border: 1px solid #ccc; + border-bottom: 1px solid #bbbbbb; + background-color:#FFFFFF; + color:#999; + font-weight:bold; + border-top-left-radius:3px; + border-top-right-radius:3px; +} + +.nav li a:hover { + background-color: #cacbcb; + text-decoration:none; +} + +img { + border: 1px solid black; + padding: 0.5em; + background-color: white; +} + +th img { + border: 0px; + padding: 0px; + background-color: #ddf; +} + +h1 a, h2 a { + color: black; + text-decoration: none; +} + +h1:hover a:after, +h2:hover a:after { + color: #555; +} + +h1 { + font-size: x-large; +} + +h2 { + background-color: #C6E9F1; + border: 1px solid #C6E9F1; + padding-left: 0.5em; + padding-right: 0.5em; + color: black; + font-size: 0.8em; + clear: both; +} + +h2 a { + color: black; +} + +p{ + font-size: 0.7em; +} + +.moreauthors { + font-size: 70%; +} diff --git a/public/statistics/trustie2/index.html b/public/statistics/trustie2/index.html new file mode 100644 index 000000000..950f664bc --- /dev/null +++ b/public/statistics/trustie2/index.html @@ -0,0 +1,20 @@ + + + + + + + + + + + +

项目信息(Project Information)

+
项目名(Project name)
trustie2
统计时段(Report Period)
2013-08-01 02:33:49 to 2013-08-23 22:41:30
项目活跃时段(Project Active Period)
2013-08-01 02:33:49 to 2013-08-09 09:24:38 (9 days)
+

代码文件信息(Files Information of Code)

+ +
<% if bid.reward_type.nil? or bid.reward_type == 1%> - <%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%> + <%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%> <% elsif bid.reward_type == 2%> - <%= l(:label_bids_reward_method) %><%= bid.budget%> + <%= l(:label_bids_reward_method) %><%= bid.budget%> <% else %> - <%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %> + <%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %> <% end %>
- <%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<%=link_to bid.biding_projects.count, project_for_bid_path(bid) %>) + <% if bid.reward_type == 3 %> + <%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<%=link_to bid.biding_projects.count, project_for_bid_path(bid) %>) <%= l(:label_x_responses, :count => bid.commit) %>(<%=link_to bid.commit, respond_path(bid) %>) + <% else %> + <%= l(:label_x_biding_project, :count => bid.biding_projects.count) %>(<%=link_to bid.biding_projects.count, project_for_bid_path(bid) %>) + <%= l(:label_x_bids_responses, :count => bid.commit) %>(<%=link_to bid.commit, respond_path(bid) %>) + <% end %> <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<%=link_to bid.watcher_users.count, respond_path(bid) %>)
»<%= l(:label_related_issues) %>
<%= check_box_tag 'ids[]', issue.id, false, :id => nil %> <%= link_to_issue(issue, :project => (@project != issue.project)) %>
文件类型(File Type)文件数(Files Number)代码行数(Lines Number of Code)
.rb67759777
.erb42310688
.js1093891
.yml7752743
.css235820
.py1196
.c00
.html5334
.php2700
代码文件总数(Total files number of Code)
1317
代码总数(Total Lines number of Code)
134149
修改代码总数(Total Modified Lines Number of Code)
3197 (5961 added, 2764 removed)
+

作者信息(Authors Information)

+ +
作者名(Author Name)提交次数及占百分比(Commits)(%)增加代码行数(+ lines)删除代码行数(- lines)首次提交日期(First commit)最后一次提交日期(Last commit)活跃年龄(Age)活跃天数(Active days)#提交排名(# by commits)
zhangyang27 (26.73%)6533592013-08-012013-08-076 days, 2:35:4271
huangjingquan21 (20.79%)8385082013-08-012013-08-098 days, 4:34:4882
nieguanghui20 (19.80%)11695682013-08-012013-08-097 days, 21:52:0673
fanqiang17 (16.83%)246715952013-08-012013-08-097 days, 20:37:3894
william9 (8.91%)16141692013-08-012013-08-087 days, 1:46:5445
kaizheng6 (5.94%)809682013-08-012013-08-097 days, 20:04:0146
wanglinchun1 (0.99%)742013-08-072013-08-070:00:0017
作者总数(Authors Number)
7
提交总数(Total Commits Number)
101 (average 11.2 commits per active day, 11.2 per all days)
+ \ No newline at end of file diff --git a/public/statistics/trustie2/sortable.js b/public/statistics/trustie2/sortable.js new file mode 100644 index 000000000..89477324a --- /dev/null +++ b/public/statistics/trustie2/sortable.js @@ -0,0 +1,324 @@ +/* +Table sorting script by Joost de Valk, check it out at http://www.joostdevalk.nl/code/sortable-table/. +Based on a script from http://www.kryogenix.org/code/browser/sorttable/. +Distributed under the MIT license: http://www.kryogenix.org/code/browser/licence.html . + +Copyright (c) 1997-2007 Stuart Langridge, Joost de Valk. + +Version 1.5.7 +*/ + +/* You can change these values */ +var image_path = ""; +var image_up = "arrow-up.gif"; +var image_down = "arrow-down.gif"; +var image_none = "arrow-none.gif"; +var europeandate = true; +var alternate_row_colors = true; + +/* Don't change anything below this unless you know what you're doing */ +addEvent(window, "load", sortables_init); + +var SORT_COLUMN_INDEX; +var thead = false; + +function sortables_init() { + // Find all tables with class sortable and make them sortable + if (!document.getElementsByTagName) return; + tbls = document.getElementsByTagName("table"); + for (ti=0;ti 0) { + if (t.tHead && t.tHead.rows.length > 0) { + var firstRow = t.tHead.rows[t.tHead.rows.length-1]; + thead = true; + } else { + var firstRow = t.rows[0]; + } + } + if (!firstRow) return; + + // We have a first row: assume it's the header, and make its contents clickable links + for (var i=0;i'+txt+'  ↓'; + } + } + if (alternate_row_colors) { + alternate(t); + } +} + +function ts_getInnerText(el) { + if (typeof el == "string") return el; + if (typeof el == "undefined") { return el }; + if (el.innerText) return el.innerText; //Not needed but it is faster + var str = ""; + + var cs = el.childNodes; + var l = cs.length; + for (var i = 0; i < l; i++) { + switch (cs[i].nodeType) { + case 1: //ELEMENT_NODE + str += ts_getInnerText(cs[i]); + break; + case 3: //TEXT_NODE + str += cs[i].nodeValue; + break; + } + } + return str; +} + +function ts_resortTable(lnk, clid) { + var span; + for (var ci=0;ci'; + newRows.reverse(); + span.setAttribute('sortdir','up'); + } else { + ARROW = '  ↑'; + span.setAttribute('sortdir','down'); + } + // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones + // don't do sortbottom rows + for (i=0; i'; + } + } + } + span.innerHTML = ARROW; + alternate(t); +} + +function getParent(el, pTagName) { + if (el == null) { + return null; + } else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) { + return el; + } else { + return getParent(el.parentNode, pTagName); + } +} + +function sort_date(date) { + // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX + dt = "00000000"; + if (date.length == 11) { + mtstr = date.substr(3,3); + mtstr = mtstr.toLowerCase(); + switch(mtstr) { + case "jan": var mt = "01"; break; + case "feb": var mt = "02"; break; + case "mar": var mt = "03"; break; + case "apr": var mt = "04"; break; + case "may": var mt = "05"; break; + case "jun": var mt = "06"; break; + case "jul": var mt = "07"; break; + case "aug": var mt = "08"; break; + case "sep": var mt = "09"; break; + case "oct": var mt = "10"; break; + case "nov": var mt = "11"; break; + case "dec": var mt = "12"; break; + // default: var mt = "00"; + } + dt = date.substr(7,4)+mt+date.substr(0,2); + return dt; + } else if (date.length == 10) { + if (europeandate == false) { + dt = date.substr(6,4)+date.substr(0,2)+date.substr(3,2); + return dt; + } else { + dt = date.substr(6,4)+date.substr(3,2)+date.substr(0,2); + return dt; + } + } else if (date.length == 8) { + yr = date.substr(6,2); + if (parseInt(yr) < 50) { + yr = '20'+yr; + } else { + yr = '19'+yr; + } + if (europeandate == true) { + dt = yr+date.substr(3,2)+date.substr(0,2); + return dt; + } else { + dt = yr+date.substr(0,2)+date.substr(3,2); + return dt; + } + } + return dt; +} + +function ts_sort_date(a,b) { + dt1 = sort_date(ts_getInnerText(a.cells[SORT_COLUMN_INDEX])); + dt2 = sort_date(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); + + if (dt1==dt2) { + return 0; + } + if (dt1 span{ + text-align: justify; + width: 180px; +} .font_lighter_sidebar{ /*font-family:微软雅黑;*/ color:#919294; @@ -325,7 +329,7 @@ ul.tool li{list-style-type:none; .user_tags{ padding-top: 5px; padding-bottom: 5px; - padding-left: 8px; + padding-left: 12px; } .tool{ @@ -441,6 +445,10 @@ a.htags{ padding: 0px 4px 0px 4px; margin:0 3px; } +a.logical_int{ + color: #ed8924; +} + .contextdescription2{font-family: '微软雅黑'; font-size:12px; font-weight:ligher; @@ -1173,6 +1181,12 @@ ul.properties li span {font-style:italic;} .total-hours { font-size: 110%; font-weight: bold; } .total-hours span.hours-int { font-size: 120%; } +.gender { width: 20%; } +/*added by bai 增加了性别、地区和单位的样式 */ +#my_account_form select.gender { width: 20%; } +#my_account_form select.location {width: 31%;} +#my_account_form .occupation { width: 56%; } +/*end*/ /*added by bai 增加了性别、地区和单位的样式 */ #my_account_form select.gender { width: 20%; } diff --git a/statistics/trustie2/trustie/activity.html b/statistics/trustie2/trustie/activity.html new file mode 100644 index 000000000..937bd4b16 --- /dev/null +++ b/statistics/trustie2/trustie/activity.html @@ -0,0 +1,47 @@ + + + + + + + + + + + + + +

周活动(Weekly activity)

+ +

前24周(Last 24 weeks)

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
48
53
0
0
242322212019181716151413121110987654321
+

每天时统计(Hour of Day)

+ + + +
Hour01234567891011121314151617181920212223
Commits6617900148604141016000000000
%5.945.9416.838.910.000.000.993.967.925.940.003.9613.869.9015.840.000.000.000.000.000.000.000.000.00
Hour of Day +

每周天统计(Day of Week)

+ +
DayTotal (%)
14 (3.96%)
215 (14.85%)
311 (10.89%)
434 (33.66%)
518 (17.82%)
69 (8.91%)
710 (9.90%)
Day of Week +

每周时统计(Hour of Week)

+ +
Weekday01234567891011121314151617181920212223
11111
2413322
32112212
415133957
53154221
611214
722321
+

每年月统计(Month of Year)

+ +
MonthCommits (%)
10 (0.00 %)
20 (0.00 %)
30 (0.00 %)
40 (0.00 %)
50 (0.00 %)
60 (0.00 %)
70 (0.00 %)
8101 (100.00 %)
90 (0.00 %)
100 (0.00 %)
110 (0.00 %)
120 (0.00 %)
Month of Year +

提交统计(年/月)Commits by year/month

+ +
MonthCommits
2013-08101
Commits by year/month +

提交统计(年)(Commits by Year)

+ +
YearCommits (% of all)
2013101 (100.00%)
Commits by Year +

提交统计(时区)Commits by Timezone

+ +
TimezoneCommits
+0800101
\ No newline at end of file diff --git a/statistics/trustie2/trustie/arrow-down.gif b/statistics/trustie2/trustie/arrow-down.gif new file mode 100644 index 000000000..997f02f6b Binary files /dev/null and b/statistics/trustie2/trustie/arrow-down.gif differ diff --git a/statistics/trustie2/trustie/arrow-none.gif b/statistics/trustie2/trustie/arrow-none.gif new file mode 100644 index 000000000..d011a4999 Binary files /dev/null and b/statistics/trustie2/trustie/arrow-none.gif differ diff --git a/statistics/trustie2/trustie/arrow-up.gif b/statistics/trustie2/trustie/arrow-up.gif new file mode 100644 index 000000000..15eabb351 Binary files /dev/null and b/statistics/trustie2/trustie/arrow-up.gif differ diff --git a/statistics/trustie2/trustie/authors.html b/statistics/trustie2/trustie/authors.html new file mode 100644 index 000000000..b6e2f85f3 --- /dev/null +++ b/statistics/trustie2/trustie/authors.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + +

作者列表(List of Authors)

+ +
AuthorCommits (%)+ lines- linesFirst commitLast commitAgeActive days# by commits
zhangyang27 (26.73%)6533592013-08-012013-08-076 days, 2:35:4271
huangjingquan21 (20.79%)8385082013-08-012013-08-098 days, 4:34:4882
nieguanghui20 (19.80%)11695682013-08-012013-08-097 days, 21:52:0673
fanqiang17 (16.83%)246715952013-08-012013-08-097 days, 20:37:3894
william9 (8.91%)16141692013-08-012013-08-087 days, 1:46:5445
kaizheng6 (5.94%)809682013-08-012013-08-097 days, 20:04:0146
wanglinchun1 (0.99%)742013-08-072013-08-070:00:0017
+

月最佳作者(Author of Month)

+ +
MonthAuthorCommits (%)Next top 5
2013-08zhangyang27 (26.73% of 101)huangjingquan, nieguanghui, fanqiang, william
+

年最佳作者(Author of Year)

+ +
YearAuthorCommits (%)Next top 5
2013zhangyang27 (26.73% of 101)huangjingquan, nieguanghui, fanqiang, william
+

提交统计(邮箱)Commits by Domains

+ +
DomainsTotal (%)
gmail.com56 (55.45%)
163.com28 (27.72%)
qq.com17 (16.83%)
Commits by Domains \ No newline at end of file diff --git a/statistics/trustie2/trustie/commits_by_year.dat b/statistics/trustie2/trustie/commits_by_year.dat new file mode 100644 index 000000000..e8acf84f3 --- /dev/null +++ b/statistics/trustie2/trustie/commits_by_year.dat @@ -0,0 +1 @@ +2013 101 diff --git a/statistics/trustie2/trustie/commits_by_year.plot b/statistics/trustie2/trustie/commits_by_year.plot new file mode 100644 index 000000000..51374b3d6 --- /dev/null +++ b/statistics/trustie2/trustie/commits_by_year.plot @@ -0,0 +1,10 @@ +set terminal svg +set size 1.0,0.9 + +set output 'commits_by_year.svg' +unset key +set xtics 1 rotate by 90 +set grid y +set ylabel "Commits" +set yrange [0:] +plot 'commits_by_year.dat' using 1:2:(0.5) w boxes fs solid diff --git a/statistics/trustie2/trustie/commits_by_year.svg b/statistics/trustie2/trustie/commits_by_year.svg new file mode 100644 index 000000000..7f06bf69f --- /dev/null +++ b/statistics/trustie2/trustie/commits_by_year.svg @@ -0,0 +1,110 @@ + + + + +Gnuplot +Produced by GNUPLOT 4.6 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + 20 + + + + + + + 40 + + + + + + + 60 + + + + + + + 80 + + + + + + + 100 + + + + + + + 120 + + + 2012 + + + 2013 + + + 2014 + + + Commits + + + gnuplot_plot_1 + + + + + + + + + + + diff --git a/statistics/trustie2/trustie/commits_by_year_month.dat b/statistics/trustie2/trustie/commits_by_year_month.dat new file mode 100644 index 000000000..13a314638 --- /dev/null +++ b/statistics/trustie2/trustie/commits_by_year_month.dat @@ -0,0 +1 @@ +2013-08 101 diff --git a/statistics/trustie2/trustie/commits_by_year_month.plot b/statistics/trustie2/trustie/commits_by_year_month.plot new file mode 100644 index 000000000..64394d1de --- /dev/null +++ b/statistics/trustie2/trustie/commits_by_year_month.plot @@ -0,0 +1,13 @@ +set terminal svg +set size 1.0,0.9 + +set output 'commits_by_year_month.svg' +unset key +set xdata time +set timefmt "%Y-%m" +set format x "%Y-%m" +set xtics rotate by 90 15768000 +set bmargin 5 +set grid y +set ylabel "Commits" +plot 'commits_by_year_month.dat' using 1:2:(0.5) w boxes fs solid diff --git a/statistics/trustie2/trustie/commits_by_year_month.svg b/statistics/trustie2/trustie/commits_by_year_month.svg new file mode 100644 index 000000000..bc677a04b --- /dev/null +++ b/statistics/trustie2/trustie/commits_by_year_month.svg @@ -0,0 +1,110 @@ + + + + +Gnuplot +Produced by GNUPLOT 4.6 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 99.5 + + + + + + + 100 + + + + + + + 100.5 + + + + + + + 101 + + + + + + + 101.5 + + + + + + + 102 + + + + + + + 102.5 + + + 2013-07 + + + 2014-01 + + + Commits + + + gnuplot_plot_1 + + + + + + + + + + + diff --git a/statistics/trustie2/trustie/day_of_week.dat b/statistics/trustie2/trustie/day_of_week.dat new file mode 100644 index 000000000..e9f9dce11 --- /dev/null +++ b/statistics/trustie2/trustie/day_of_week.dat @@ -0,0 +1,7 @@ +1 4 +2 15 +3 11 +4 34 +5 18 +6 9 +7 10 diff --git a/statistics/trustie2/trustie/day_of_week.plot b/statistics/trustie2/trustie/day_of_week.plot new file mode 100644 index 000000000..65be4afde --- /dev/null +++ b/statistics/trustie2/trustie/day_of_week.plot @@ -0,0 +1,10 @@ +set terminal svg +set size 1.0,0.9 + +set output 'day_of_week.svg' +unset key +set xrange [0.5:7.5] +set xtics 1 +set grid y +set ylabel "Commits" +plot 'day_of_week.dat' using 1:2:(0.5) w boxes fs solid diff --git a/statistics/trustie2/trustie/day_of_week.svg b/statistics/trustie2/trustie/day_of_week.svg new file mode 100644 index 000000000..30ef94ded --- /dev/null +++ b/statistics/trustie2/trustie/day_of_week.svg @@ -0,0 +1,147 @@ + + + + +Gnuplot +Produced by GNUPLOT 4.6 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + 5 + + + + + + + 10 + + + + + + + 15 + + + + + + + 20 + + + + + + + 25 + + + + + + + 30 + + + + + + + 35 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + Commits + + + gnuplot_plot_1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/statistics/trustie2/trustie/domains.dat b/statistics/trustie2/trustie/domains.dat new file mode 100644 index 000000000..082a980f0 --- /dev/null +++ b/statistics/trustie2/trustie/domains.dat @@ -0,0 +1,3 @@ +gmail.com 1 56 +163.com 2 28 +qq.com 3 17 diff --git a/statistics/trustie2/trustie/domains.plot b/statistics/trustie2/trustie/domains.plot new file mode 100644 index 000000000..fb2b932a9 --- /dev/null +++ b/statistics/trustie2/trustie/domains.plot @@ -0,0 +1,9 @@ +set terminal svg +set size 1.0,0.9 + +set output 'domains.svg' +unset key +unset xtics +set grid y +set ylabel "Commits" +plot 'domains.dat' using 2:3:(0.5) with boxes fs solid, '' using 2:3:1 with labels rotate by 45 offset 0,1 diff --git a/statistics/trustie2/trustie/domains.svg b/statistics/trustie2/trustie/domains.svg new file mode 100644 index 000000000..fe12b4260 --- /dev/null +++ b/statistics/trustie2/trustie/domains.svg @@ -0,0 +1,143 @@ + + + + +Gnuplot +Produced by GNUPLOT 4.6 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 15 + + + + + + + 20 + + + + + + + 25 + + + + + + + 30 + + + + + + + 35 + + + + + + + 40 + + + + + + + 45 + + + + + + + 50 + + + + + + + 55 + + + + + + + 60 + + + Commits + + + gnuplot_plot_1 + + + + + + + + + + + + + gnuplot_plot_2 + + + + + gmail.com + + + 163.com + + + qq.com + + + + + + + + diff --git a/statistics/trustie2/trustie/files.html b/statistics/trustie2/trustie/files.html new file mode 100644 index 000000000..f22c4792b --- /dev/null +++ b/statistics/trustie2/trustie/files.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + +
+
文件总数(Total files)
1848
代码总行数(Total Lines of Code)
193300
修改代码行数(Total Modified lines)
3197
平均文件大小(Average file size)
173.00 bytes
+ +

文件数目统计(File count by date)

+ +Files by Date +

代码行数统计(Lines of Code)

+ + +

文件信息统计(File information)

+ +
TypeFiles (%)Lines (%)Lines/file
72 (3.90%)13511 (422.61%)187
15/AUTHORS1 (0.05%)38 (1.19%)38
15/BUGS1 (0.05%)3 (0.09%)3
15/LICENSE1 (0.05%)98 (3.07%)98
15/NEWS1 (0.05%)789 (24.68%)789
15/README1 (0.05%)59 (1.85%)59
TXT4 (0.22%)327 (10.23%)81
autotest1 (0.05%)12 (0.38%)12
builder2 (0.11%)61 (1.91%)30
conf1 (0.05%)32 (1.00%)32
css23 (1.24%)6761 (211.48%)293
db1 (0.05%)578 (18.08%)578
eot1 (0.05%)127 (3.97%)127
erb422 (22.84%)11803 (369.19%)27
example5 (0.27%)337 (10.54%)67
exe1 (0.05%)1972 (61.68%)1972
gemfile2 (0.11%)14 (0.44%)7
gemspec3 (0.16%)82 (2.56%)27
gif16 (0.87%)603 (18.86%)37
gitignore2 (0.11%)22 (0.69%)11
html5 (0.27%)419 (13.11%)83
ico2 (0.11%)60 (1.88%)30
jpg66 (3.57%)1577 (49.33%)23
js109 (5.90%)4121 (128.90%)37
lock1 (0.05%)157 (4.91%)157
map20 (1.08%)4996 (156.27%)249
md4 (0.22%)445 (13.92%)111
me1 (0.05%)0 (0.00%)0
noencode2 (0.11%)0 (0.00%)0
otf1 (0.05%)1271 (39.76%)1271
php2 (0.11%)723 (22.61%)361
pm1 (0.05%)544 (17.02%)544
png229 (12.39%)5379 (168.25%)23
pptx1 (0.05%)1224 (38.29%)1224
py1 (0.05%)220 (6.88%)220
rake19 (1.03%)2212 (69.19%)116
rb677 (36.63%)66276 (2073.07%)97
rdoc4 (0.22%)162 (5.07%)40
rfpdf1 (0.05%)114 (3.57%)114
rsb32 (1.73%)510 (15.95%)15
rspec1 (0.05%)2 (0.06%)2
ru1 (0.05%)4 (0.13%)4
sample1 (0.05%)19 (0.59%)19
sqlite31 (0.05%)0 (0.00%)0
svg1 (0.05%)338 (10.57%)338
tmpl1 (0.05%)12 (0.38%)12
ttf1 (0.05%)708 (22.15%)708
txt6 (0.32%)5520 (172.66%)920
woff1 (0.05%)105 (3.28%)105
yml77 (4.17%)54013 (1689.49%)701
z17 (0.92%)4940 (154.52%)290
\ No newline at end of file diff --git a/statistics/trustie2/trustie/files_by_date.dat b/statistics/trustie2/trustie/files_by_date.dat new file mode 100644 index 000000000..b28457f4d --- /dev/null +++ b/statistics/trustie2/trustie/files_by_date.dat @@ -0,0 +1,34 @@ +2013-08-01 1695 +2013-08-01 1696 +2013-08-01 1697 +2013-08-01 1698 +2013-08-01 1699 +2013-08-01 1704 +2013-08-01 1709 +2013-08-01 1711 +2013-08-01 1712 +2013-08-01 1714 +2013-08-01 1720 +2013-08-02 1712 +2013-08-02 1717 +2013-08-02 1718 +2013-08-03 1718 +2013-08-03 1719 +2013-08-04 1719 +2013-08-04 1721 +2013-08-04 1724 +2013-08-05 1724 +2013-08-05 1725 +2013-08-06 1725 +2013-08-06 1783 +2013-08-06 1784 +2013-08-07 1784 +2013-08-08 1784 +2013-08-08 1785 +2013-08-08 1839 +2013-08-08 1844 +2013-08-08 1845 +2013-08-08 1846 +2013-08-08 1847 +2013-08-09 1847 +2013-08-09 1849 diff --git a/statistics/trustie2/trustie/files_by_date.plot b/statistics/trustie2/trustie/files_by_date.plot new file mode 100644 index 000000000..e09f27324 --- /dev/null +++ b/statistics/trustie2/trustie/files_by_date.plot @@ -0,0 +1,14 @@ +set terminal svg +set size 1.0,0.9 + +set output 'files_by_date.svg' +unset key +set xdata time +set timefmt "%Y-%m-%d" +set format x "%Y-%m-%d" +set grid y +set ylabel "Files" +set xtics rotate by 90 +set ytics autofreq +set bmargin 6 +plot 'files_by_date.dat' using 1:2 w steps diff --git a/statistics/trustie2/trustie/files_by_date.svg b/statistics/trustie2/trustie/files_by_date.svg new file mode 100644 index 000000000..e78eb9f19 --- /dev/null +++ b/statistics/trustie2/trustie/files_by_date.svg @@ -0,0 +1,166 @@ + + + + +Gnuplot +Produced by GNUPLOT 4.6 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1680 + + + + + + + 1700 + + + + + + + 1720 + + + + + + + 1740 + + + + + + + 1760 + + + + + + + 1780 + + + + + + + 1800 + + + + + + + 1820 + + + + + + + 1840 + + + + + + + 1860 + + + 2013-08-01 + + + 2013-08-02 + + + 2013-08-03 + + + 2013-08-04 + + + 2013-08-05 + + + 2013-08-06 + + + 2013-08-07 + + + 2013-08-08 + + + 2013-08-09 + + + Files + + + gnuplot_plot_1 + + + + + + + + diff --git a/statistics/trustie2/trustie/gitstats.cache b/statistics/trustie2/trustie/gitstats.cache new file mode 100644 index 000000000..2fc19781e Binary files /dev/null and b/statistics/trustie2/trustie/gitstats.cache differ diff --git a/statistics/trustie2/trustie/gitstats.css b/statistics/trustie2/trustie/gitstats.css new file mode 100644 index 000000000..6a341e6f4 --- /dev/null +++ b/statistics/trustie2/trustie/gitstats.css @@ -0,0 +1,155 @@ +/** + * GitStats - default style + */ +body { + color: black; + background-color: #fff; +} + +dt { + font-size: 12px; + font-weight: bold; + float: left; + margin-right: 1em; + margin-left: 10px; +} + +dt:after { + content: ': '; +} + +dd { + font-size: 11px; + display: block; + clear: left; +} + +table { + border: 1px solid black; + border-collapse: collapse; + font-size: 59%; + margin-bottom: 1em; +} + +table.noborders { + border: none; +} + +table.noborders td { + border: none; +} + +.vtable { + float: right; + clear: both; +} + +table.tags td { + vertical-align: top; +} + +th { + background-color: #ddf; +} + +th a { + text-decoration: none; +} + +tr:hover { + background-color: #ddf; +} + +td { + border: 1px solid black; + padding: 0.2em; + padding-left: 0.3em; + padding-right: 0.2em; +} + +/* Navigation bar; tabbed style */ +.nav { + height: 2em; margin-bottom:1.2em; position:relative; overflow:hidden;margin-top: -10px; +} + +.nav ul { + margin:0; position:absolute; bottom:0; padding-left:0.5em; +} + +.nav li { + float:left; + list-style-type:none; + white-space:nowrap; + margin-right:0px; + background:#fff; + position:relative; + margin-bottom:5px; +} + +.nav li a { + font-size: 0.8em; + text-decoration:none; + line-height:1.3em; + padding:2px 6px 2px 6px; + border: 1px solid #ccc; + border-bottom: 1px solid #bbbbbb; + background-color:#DEEBF0; + color:#999; + font-weight:bold; + border-top-left-radius:3px; + border-top-right-radius:3px; +} + +.nav li a:hover { + background-color: #cacbcb; + text-decoration:none; +} + +img { + border: 1px solid black; + padding: 0.5em; + background-color: white; +} + +th img { + border: 0px; + padding: 0px; + background-color: #ddf; +} + +h1 a, h2 a { + color: black; + text-decoration: none; +} + +h1:hover a:after, +h2:hover a:after { + content: '^'; + color: #555; +} + +h1 { + font-size: x-large; +} + +h2 { + background-color: #C6E9F1; + border: 1px solid #C6E9F1; + padding-left: 0.5em; + padding-right: 0.5em; + color: black; + font-size: 0.8em; + clear: both; +} + +h2 a { + color: black; +} + +p{ + font-size: 0.7em; +} + +.moreauthors { + font-size: 70%; +} diff --git a/statistics/trustie2/trustie/hour_of_day.dat b/statistics/trustie2/trustie/hour_of_day.dat new file mode 100644 index 000000000..328fc206f --- /dev/null +++ b/statistics/trustie2/trustie/hour_of_day.dat @@ -0,0 +1,24 @@ +1 6 +2 6 +3 17 +4 9 +5 0 +6 0 +7 1 +8 4 +9 8 +10 6 +11 0 +12 4 +13 14 +14 10 +15 16 +16 0 +17 0 +18 0 +19 0 +20 0 +21 0 +22 0 +23 0 +24 0 diff --git a/statistics/trustie2/trustie/hour_of_day.plot b/statistics/trustie2/trustie/hour_of_day.plot new file mode 100644 index 000000000..1fee4c643 --- /dev/null +++ b/statistics/trustie2/trustie/hour_of_day.plot @@ -0,0 +1,10 @@ +set terminal svg +set size 1.0,0.9 + +set output 'hour_of_day.svg' +unset key +set xrange [0.5:24.5] +set xtics 4 +set grid y +set ylabel "Commits" +plot 'hour_of_day.dat' using 1:2:(0.5) w boxes fs solid diff --git a/statistics/trustie2/trustie/hour_of_day.svg b/statistics/trustie2/trustie/hour_of_day.svg new file mode 100644 index 000000000..b9c4b9e3b --- /dev/null +++ b/statistics/trustie2/trustie/hour_of_day.svg @@ -0,0 +1,173 @@ + + + + +Gnuplot +Produced by GNUPLOT 4.6 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + 2 + + + + + + + 4 + + + + + + + 6 + + + + + + + 8 + + + + + + + 10 + + + + + + + 12 + + + + + + + 14 + + + + + + + 16 + + + + + + + 18 + + + 4 + + + 8 + + + 12 + + + 16 + + + 20 + + + 24 + + + Commits + + + gnuplot_plot_1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/statistics/trustie2/trustie/index.html b/statistics/trustie2/trustie/index.html new file mode 100644 index 000000000..c37a29fbd --- /dev/null +++ b/statistics/trustie2/trustie/index.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + +
项目名(Project name)
trustie2
生成时间(Generated)
2013-08-19 17:17:34 (in 0 seconds)
统计时段(Report Period)
2013-08-01 02:33:49 to 2013-08-09 09:24:38
项目年龄(Age)
9 days, 9 active days (100.00%)
文件总数(Total files)
1848
代码总数(Total Lines of Code)
193300
修改代码总数(Total Modified Lines of Code)
3197 (5961 added, 2764 removed)
提交总数(Total Commits)
101 (average 11.2 commits per active day, 11.2 per all days)
作者总数(Authors)
7
+ \ No newline at end of file diff --git a/statistics/trustie2/trustie/lines.html b/statistics/trustie2/trustie/lines.html new file mode 100644 index 000000000..0c5f5abcf --- /dev/null +++ b/statistics/trustie2/trustie/lines.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + +
+
Total lines
3197
+ +

Lines of Code

+ + \ No newline at end of file diff --git a/statistics/trustie2/trustie/lines_of_code.dat b/statistics/trustie2/trustie/lines_of_code.dat new file mode 100644 index 000000000..2329820b3 --- /dev/null +++ b/statistics/trustie2/trustie/lines_of_code.dat @@ -0,0 +1,101 @@ +1375324429 0 +1375325261 0 +1375325513 0 +1375326539 5 +1375348247 17 +1375357090 22 +1375357126 22 +1375357950 -8 +1375359056 -10 +1375359979 300 +1375360034 300 +1375360370 300 +1375360399 307 +1375360718 314 +1375360773 314 +1375361220 370 +1375361969 370 +1375363600 367 +1375364197 374 +1375364231 374 +1375364851 374 +1375365286 374 +1375367130 374 +1375367154 374 +1375404304 374 +1375404787 428 +1375404847 428 +1375411272 468 +1375412616 477 +1375520088 542 +1375530129 545 +1375531744 552 +1375533998 552 +1375537672 560 +1375538767 560 +1375539510 562 +1375539737 635 +1375541502 701 +1375577739 702 +1375577875 702 +1375578771 702 +1375580252 697 +1375582298 721 +1375585016 769 +1375585165 784 +1375585710 786 +1375586586 786 +1375597392 787 +1375663459 792 +1375672793 928 +1375710068 953 +1375714021 1031 +1375755135 1031 +1375755411 1022 +1375755682 1022 +1375757597 1022 +1375775588 1065 +1375776534 1066 +1375777957 1053 +1375778683 1065 +1375790992 1072 +1375793734 1072 +1375793858 1084 +1375794491 1086 +1375796586 1217 +1375799002 1217 +1375799212 1304 +1375838465 1305 +1375840139 1305 +1375846140 1327 +1375860564 1316 +1375863871 1316 +1375865104 1479 +1375866365 1482 +1375866864 1482 +1375881037 1511 +1375884832 1511 +1375885356 1511 +1375925934 1521 +1375927484 1562 +1375927618 1562 +1375952516 2981 +1375953997 2954 +1375971555 3045 +1375971932 3076 +1375972006 3169 +1375972025 3169 +1375972078 3195 +1376013008 3212 +1376013984 3197 +1376014860 3143 +1376015554 3128 +1376016127 3130 +1376017691 3130 +1376018093 3145 +1376018682 3145 +1376031773 3147 +1376032117 3147 +1376036786 3176 +1376037020 3197 +1376040278 3197 diff --git a/statistics/trustie2/trustie/lines_of_code.plot b/statistics/trustie2/trustie/lines_of_code.plot new file mode 100644 index 000000000..6737f9e8a --- /dev/null +++ b/statistics/trustie2/trustie/lines_of_code.plot @@ -0,0 +1,13 @@ +set terminal svg +set size 1.0,0.9 + +set output 'lines_of_code.svg' +unset key +set xdata time +set timefmt "%s" +set format x "%Y-%m-%d" +set grid y +set ylabel "Lines" +set xtics rotate by 90 +set bmargin 6 +plot 'lines_of_code.dat' using 1:2 w lines diff --git a/statistics/trustie2/trustie/lines_of_code.svg b/statistics/trustie2/trustie/lines_of_code.svg new file mode 100644 index 000000000..87a8216c0 --- /dev/null +++ b/statistics/trustie2/trustie/lines_of_code.svg @@ -0,0 +1,171 @@ + + + + +Gnuplot +Produced by GNUPLOT 4.6 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -500 + + + + + + + 0 + + + + + + + 500 + + + + + + + 1000 + + + + + + + 1500 + + + + + + + 2000 + + + + + + + 2500 + + + + + + + 3000 + + + + + + + 3500 + + + 2013-08-01 + + + 2013-08-02 + + + 2013-08-03 + + + 2013-08-04 + + + 2013-08-05 + + + 2013-08-06 + + + 2013-08-07 + + + 2013-08-08 + + + 2013-08-09 + + + 2013-08-10 + + + Lines + + + gnuplot_plot_1 + + + + + + + + diff --git a/statistics/trustie2/trustie/month_of_year.dat b/statistics/trustie2/trustie/month_of_year.dat new file mode 100644 index 000000000..db65ab734 --- /dev/null +++ b/statistics/trustie2/trustie/month_of_year.dat @@ -0,0 +1,12 @@ +1 0 +2 0 +3 0 +4 0 +5 0 +6 0 +7 0 +8 101 +9 0 +10 0 +11 0 +12 0 diff --git a/statistics/trustie2/trustie/month_of_year.plot b/statistics/trustie2/trustie/month_of_year.plot new file mode 100644 index 000000000..0ad60313e --- /dev/null +++ b/statistics/trustie2/trustie/month_of_year.plot @@ -0,0 +1,10 @@ +set terminal svg +set size 1.0,0.9 + +set output 'month_of_year.svg' +unset key +set xrange [0.5:12.5] +set xtics 1 +set grid y +set ylabel "Commits" +plot 'month_of_year.dat' using 1:2:(0.5) w boxes fs solid diff --git a/statistics/trustie2/trustie/month_of_year.svg b/statistics/trustie2/trustie/month_of_year.svg new file mode 100644 index 000000000..4f5ca8aad --- /dev/null +++ b/statistics/trustie2/trustie/month_of_year.svg @@ -0,0 +1,137 @@ + + + + +Gnuplot +Produced by GNUPLOT 4.6 patchlevel 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + 20 + + + + + + + 40 + + + + + + + 60 + + + + + + + 80 + + + + + + + 100 + + + + + + + 120 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 + + + 10 + + + 11 + + + 12 + + + Commits + + + gnuplot_plot_1 + + + + + + + + + + + diff --git a/statistics/trustie2/trustie/sortable.js b/statistics/trustie2/trustie/sortable.js new file mode 100644 index 000000000..89477324a --- /dev/null +++ b/statistics/trustie2/trustie/sortable.js @@ -0,0 +1,324 @@ +/* +Table sorting script by Joost de Valk, check it out at http://www.joostdevalk.nl/code/sortable-table/. +Based on a script from http://www.kryogenix.org/code/browser/sorttable/. +Distributed under the MIT license: http://www.kryogenix.org/code/browser/licence.html . + +Copyright (c) 1997-2007 Stuart Langridge, Joost de Valk. + +Version 1.5.7 +*/ + +/* You can change these values */ +var image_path = ""; +var image_up = "arrow-up.gif"; +var image_down = "arrow-down.gif"; +var image_none = "arrow-none.gif"; +var europeandate = true; +var alternate_row_colors = true; + +/* Don't change anything below this unless you know what you're doing */ +addEvent(window, "load", sortables_init); + +var SORT_COLUMN_INDEX; +var thead = false; + +function sortables_init() { + // Find all tables with class sortable and make them sortable + if (!document.getElementsByTagName) return; + tbls = document.getElementsByTagName("table"); + for (ti=0;ti 0) { + if (t.tHead && t.tHead.rows.length > 0) { + var firstRow = t.tHead.rows[t.tHead.rows.length-1]; + thead = true; + } else { + var firstRow = t.rows[0]; + } + } + if (!firstRow) return; + + // We have a first row: assume it's the header, and make its contents clickable links + for (var i=0;i'+txt+'  ↓'; + } + } + if (alternate_row_colors) { + alternate(t); + } +} + +function ts_getInnerText(el) { + if (typeof el == "string") return el; + if (typeof el == "undefined") { return el }; + if (el.innerText) return el.innerText; //Not needed but it is faster + var str = ""; + + var cs = el.childNodes; + var l = cs.length; + for (var i = 0; i < l; i++) { + switch (cs[i].nodeType) { + case 1: //ELEMENT_NODE + str += ts_getInnerText(cs[i]); + break; + case 3: //TEXT_NODE + str += cs[i].nodeValue; + break; + } + } + return str; +} + +function ts_resortTable(lnk, clid) { + var span; + for (var ci=0;ci'; + newRows.reverse(); + span.setAttribute('sortdir','up'); + } else { + ARROW = '  ↑'; + span.setAttribute('sortdir','down'); + } + // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones + // don't do sortbottom rows + for (i=0; i'; + } + } + } + span.innerHTML = ARROW; + alternate(t); +} + +function getParent(el, pTagName) { + if (el == null) { + return null; + } else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) { + return el; + } else { + return getParent(el.parentNode, pTagName); + } +} + +function sort_date(date) { + // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX + dt = "00000000"; + if (date.length == 11) { + mtstr = date.substr(3,3); + mtstr = mtstr.toLowerCase(); + switch(mtstr) { + case "jan": var mt = "01"; break; + case "feb": var mt = "02"; break; + case "mar": var mt = "03"; break; + case "apr": var mt = "04"; break; + case "may": var mt = "05"; break; + case "jun": var mt = "06"; break; + case "jul": var mt = "07"; break; + case "aug": var mt = "08"; break; + case "sep": var mt = "09"; break; + case "oct": var mt = "10"; break; + case "nov": var mt = "11"; break; + case "dec": var mt = "12"; break; + // default: var mt = "00"; + } + dt = date.substr(7,4)+mt+date.substr(0,2); + return dt; + } else if (date.length == 10) { + if (europeandate == false) { + dt = date.substr(6,4)+date.substr(0,2)+date.substr(3,2); + return dt; + } else { + dt = date.substr(6,4)+date.substr(3,2)+date.substr(0,2); + return dt; + } + } else if (date.length == 8) { + yr = date.substr(6,2); + if (parseInt(yr) < 50) { + yr = '20'+yr; + } else { + yr = '19'+yr; + } + if (europeandate == true) { + dt = yr+date.substr(3,2)+date.substr(0,2); + return dt; + } else { + dt = yr+date.substr(0,2)+date.substr(3,2); + return dt; + } + } + return dt; +} + +function ts_sort_date(a,b) { + dt1 = sort_date(ts_getInnerText(a.cells[SORT_COLUMN_INDEX])); + dt2 = sort_date(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); + + if (dt1==dt2) { + return 0; + } + if (dt1 + + + + + + + + + + + +
Total tags
0
NameDateCommitsAuthors
\ No newline at end of file