diff --git a/app/controllers/attachment_type_edit_controller.rb b/app/controllers/attachment_type_edit_controller.rb new file mode 100644 index 00000000..91e14f65 --- /dev/null +++ b/app/controllers/attachment_type_edit_controller.rb @@ -0,0 +1,6 @@ + #资源类型编辑control +class AttachmentTypeEditController < ApplicationController + def index + + end +end diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index c67310f6..a2dd8c86 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -19,8 +19,8 @@ class FilesController < ApplicationController layout 'base_projects'#by young menu_item :files - before_filter :find_project_by_project_id - before_filter :authorize + before_filter :find_project_by_project_id#, :except => [:getattachtype] + before_filter :authorize, :except => [:getattachtype] helper :sort include SortHelper @@ -62,20 +62,22 @@ class FilesController < ApplicationController redirect_to project_files_path(@project) end - def showbyattachtype - sort_init 'created_on', 'desc' - sort_update 'created_on' => "#{Attachment.table_name}.created_on", + # 返回制定资源类型的资源列表 + def getattachtype + sort_init 'created_on', 'desc' + sort_update 'created_on' => "#{Attachment.table_name}.created_on", 'filename' => "#{Attachment.table_name}.filename", 'size' => "#{Attachment.table_name}.filesize", 'downloads' => "#{Attachment.table_name}.downloads" - + @containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] #modify by Long Jun @containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort + + @attachtype = params[:type].to_i + @contenttype = params[:contentType].to_s - if @project.project_type == 1 - render :layout => 'base_courses' - else - render :layout => !request.xhr? + respond_to do |format| + format.js end end end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index d26cf698..a120394e 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -198,7 +198,7 @@ class ProjectsController < ApplicationController @project_type = params[:project_type] @school_id = params[:school_id] per_page_option = 10 - if @school_id == "0" or @school.nil? + if @school_id == "0" or @school_id.nil? @projects_all = Project.active.visible. joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id"). where("#{Project.table_name}.project_type = ? ", Project::ProjectType_course) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index b4f5b046..b8fb7a6f 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -23,7 +23,7 @@ class SchoolController < ApplicationController end end - + def upload_logo end diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index ffa1348f..16a3d8b5 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -44,9 +44,22 @@ module FilesHelper File.new(zipfile_name,'w+') end - def browseByCategory - isCategoryBrowser = 1 - #isCategoryBrowser + # 判断指定的资源时候符合类型 + def isTypeOk(attachment, type, contentType) + result = false + if type != 0 + if attachment.attachtype == type + result = true + end + else + result = true + end + if result + if contentType != l(:attachment_all) && contentType != attachment.suffix_type + result = false + end + end + result end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 708c23ca..a42a626d 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -62,33 +62,33 @@ module ProjectsHelper content_tag('div', content, :class => "tabs_enterprise") end - def sort_course(state, project_type) + def sort_course(state, project_type, school_id) content = ''.html_safe case state when 0 - content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected") - content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :school_id => school_id, :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id))) # content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type))) - content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id))) when 1 - content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type))) - content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id))) + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id), :class=>"selected"), :class=>"selected") # content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type))) - content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id))) when 2 - content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type))) - content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id))) + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id))) # content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected") - content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id))) #gcm when 3 - content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type))) - content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type))) + content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id))) + content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id))) # content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type))) - content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type), :class=>"selected"), :class=>"selected") + content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id), :class=>"selected"), :class=>"selected") end #gcmend diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index ed435fe6..e05f789a 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -154,6 +154,12 @@ module WelcomeHelper sort_course_by_hot limit end + def find_all_new_hot_course limit = 9 + #sort_project_by_hot_rails 1, 'course_ac_para DESC', limit + time_now = Time.new.strftime("%Y"); + Project.visible.joins(:project_status).where("#{Project.table_name}.project_type = ? and #{Project.table_name}.created_on like '%#{time_now}%'", 1).order("course_ac_para DESC").limit(limit).all + end + def find_all_hot_bid sort_bid_by_hot end diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 6a62613b..3bfd705f 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -66,6 +66,30 @@ class Attachment < ActiveRecord::Base copy end + #获取资源的后缀类型 + def suffix_type + childArr = self.filename.split('.') + suffix = '*' + if childArr.length > 1 + suffix = childArr[childArr.length-1] + end + suffix + end + + #获取用来显示的后缀名称 + def show_suffix_type + suffix = 'other' + temp = self.suffix_type.downcase + if self.attachmentstype.suffixArr.include?(temp) + suffix = temp + end + suffix + end + + def suffixArr + @@SuffixArr + end + def validate_max_file_size if @temp_file && self.filesize > Setting.attachment_max_size.to_i.kilobytes errors.add(:base, l(:error_attachment_too_big, :max_size => Setting.attachment_max_size.to_i.kilobytes)) diff --git a/app/models/attachmentstype.rb b/app/models/attachmentstype.rb index 54102ee7..6a37cc51 100644 --- a/app/models/attachmentstype.rb +++ b/app/models/attachmentstype.rb @@ -1,4 +1,11 @@ class Attachmentstype < ActiveRecord::Base attr_accessible :typeId, :typeName has_many :attachments, :foreign_key => "attachtype",:primary_key => "id" + + # 当前使用的文件内容分类列表 + @@SuffixArr = ['pdf','zip','doc','docx','rar','txt','jpg','bmp','xls','xlsx'] + + def suffixArr + @@SuffixArr + end end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index d8e3d29b..e5ede628 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -63,7 +63,7 @@ class Mailer < ActionMailer::Base # Mailer.issue_add(issue).deliver => sends an email to issue recipients def issue_add(issue) redmine_headers 'Project' => issue.project.identifier, - 'Issue-Id' => issue.id, + 'Issue-Id' => (issue.project.issues.index(issue).to_i + 1).to_s, 'Issue-Author' => issue.author.login redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to message_id issue @@ -85,7 +85,7 @@ class Mailer < ActionMailer::Base def issue_edit(journal) issue = journal.journalized.reload redmine_headers 'Project' => issue.project.identifier, - 'Issue-Id' => issue.id, + 'Issue-Id' => (issue.project.issues.index(issue).to_i + 1).to_s, 'Issue-Author' => issue.author.login redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to message_id journal diff --git a/app/models/project.rb b/app/models/project.rb index 007f7e30..3c2956a9 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -164,6 +164,14 @@ class Project < ActiveRecord::Base @attachmenttypes = Attachmentstype.find(:all, :conditions => ["#{Attachmentstype.table_name}.typeId= ?",self.attachmenttype ]) end + # 获取资源后缀名列表 + def contenttypes + attachmenttypes + if @attachmenttypes.length >0 + @attachmenttypes.last().suffixArr + end + end + #自定义验证 def validation if !class_period.match([0-9]) diff --git a/app/views/attachment_type_edit/_show_attchment_type.html.erb b/app/views/attachment_type_edit/_show_attchment_type.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/files/_new.html.erb b/app/views/files/_new.html.erb index fcb916e3..4c1b97fa 100644 --- a/app/views/files/_new.html.erb +++ b/app/views/files/_new.html.erb @@ -13,7 +13,7 @@ <% if attachmenttypes.any? %>

- <%= select_tag "attachment_type", content_tag('option', '') + + <%= select_tag "attachment_type", options_from_collection_for_select(attachmenttypes, "id", "typeName") %>

diff --git a/app/views/files/_show_all_attachment.html.erb b/app/views/files/_show_all_attachment.html.erb new file mode 100644 index 00000000..57ac897d --- /dev/null +++ b/app/views/files/_show_all_attachment.html.erb @@ -0,0 +1,64 @@ +<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> +<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> + diff --git a/app/views/files/_show_by_attachtype.html.erb b/app/views/files/_show_by_attachtype.html.erb deleted file mode 100644 index eedc9068..00000000 --- a/app/views/files/_show_by_attachtype.html.erb +++ /dev/null @@ -1,421 +0,0 @@ - -<%isCategoryBrowser=true%> -<% selAttachType =1%> -<% attachmenttypes = @project.attachmenttypes %> - - - -<%=(@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区 - -
- <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> -
-
- <%#= link_to('上传文件', new_project_file_path(@project), :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> - <%= link_to( l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %> - <%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> - - <% if attachmenttypes.any? %> - - <%= select_tag "attachment_browse", content_tag('option', '') +options_from_collection_for_select(attachmenttypes, "id", "typeName"), - :onchange=>"attachmenttypes_search(this.value)"%> - <% end %> - - - -
- -
-<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %> - - -<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> - -<%if !isCategoryBrowser%> -
- -
-<%else%> -
- -
-<%end%> -<% html_title(l(:label_attachment_plural)) -%> - - - -<%inited=false%> - \ No newline at end of file diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb new file mode 100644 index 00000000..5d5f2865 --- /dev/null +++ b/app/views/files/_sort_by_attachtypel.html.erb @@ -0,0 +1,66 @@ +<% selAttachType =@attachtype %> +<% selContentType =@contenttype %> +<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> +<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> +
+ +
\ No newline at end of file diff --git a/app/views/files/getattachtype.js.erb b/app/views/files/getattachtype.js.erb new file mode 100644 index 00000000..fe8458e2 --- /dev/null +++ b/app/views/files/getattachtype.js.erb @@ -0,0 +1,5 @@ + <% if @attachtype==0 && @contenttype==l(:attachment_all)%> + $("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>'); + <%else%> + $("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>'); + <%end%> diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 0a367e7e..a43b2ae0 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -1,7 +1,6 @@ -<%isCategoryBrowser=false%> -<% selAttachType =1%> <% attachmenttypes = @project.attachmenttypes %> +<% sufixtypes = @project.contenttypes %> - - -<%=(@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区 - -
- <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> -
-
- <%#= link_to('上传文件', new_project_file_path(@project), :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> - <%= link_to( l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %> - <%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> - - <% if attachmenttypes.any? %> - - <%= select_tag "attachment_browse", content_tag('option', '') +options_from_collection_for_select(attachmenttypes, "id", "typeName"), - :onchange=>"attachmenttypes_search(this.value)"%> - <% end %> - - - -
- -
-<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %> - - -<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> - -<%if !isCategoryBrowser%> -
- -
-<%else%> -
- -
-<%end%> -<% html_title(l(:label_attachment_plural)) -%> - - - -<%inited=false%> - \ No newline at end of file diff --git a/app/views/projects/course.html.erb b/app/views/projects/course.html.erb index 1359b8be..98228c16 100644 --- a/app/views/projects/course.html.erb +++ b/app/views/projects/course.html.erb @@ -30,7 +30,7 @@ <% end %> -<%= sort_course(@s_type, @project_type)%> +<%= sort_course(@s_type, @project_type, @school_id)%>
<%= render_project_hierarchy(@projects)%> diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 286ff60d..005f5371 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -1,197 +1,204 @@ <%= stylesheet_link_tag 'welcome' %> <%= javascript_include_tag 'welcome' %>
- -
-
- <%= image_tag(@logoLink, size:'75x75') %> + +
+
+ <%= image_tag(@logoLink, size:'75x75') %> -
-
-
+
+
+
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %> - <% else%> + <% else%> <% if params[:school_id] == "0" %> - <% else %> + <% else %> <% if params[:school_id].nil? %> <%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course',:school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school',:method => 'get'}%> -
+
<% else %> <%= link_to School.find(params[:school_id]).name ,options={:action => 'course',:school_id => params[:school_id]}, html_options={:class => 'font_welcome_school',:method => 'get'}%> -
+
<% end %> <% end %> <% end %>
- <%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> - <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %> - , <%= l(:label_welcome_trustie_course_description) %> - <% else %> - <% if params[:school_id] == "0" %> - , <%= l(:label_welcome_trustie_course_description) %> - <% end %> - <% end %> -
- -
-
+ <%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %> + <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %> + , <%= l(:label_welcome_trustie_course_description) %> + <% else %> + <% if params[:school_id] == "0" %> + , <%= l(:label_welcome_trustie_course_description) %> + <% end %> + <% end %> +
+ +
+
-
+
-

新开课程

- <%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => params[:school_id]} %> -
-
    +

    新开课程

    + <% if(find_miracle_course(10, 7,params[:school_id]).map.count == 0) %> + <%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => nil} %> +
    +
      -
    - -
      - <% if(find_miracle_course(10, 7,params[:school_id]).map.count == 0) %> -

      -

      - 该学校未开设任何课程,您可以查看其他学校课程 -

      -

      - <% find_all_hot_course(9).map do |project| %> -
    • > -
      - <%= image_tag(get_course_avatar(project), :class => "avatar-4") %> -
      - -
      - [<%= get_course_term project %>] - <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> - (<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>) - <% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> - (<%=link_to "#{files_count}份", project_files_path(project) %>资料) -
      -
      - - <% course = Course.find_by_extra(project.identifier)%> - <% if(course.school == nil) %> -               - <% else %> - <%= course.school.name.try(:gsub, /(.+)$/, '\1:') %> - <% end %> - - - <%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %> - <%#=course.try(:teacher).try(:name)%> - -
      - - -
    • - <% end %> - <% else %> - <% find_miracle_course(10, 7,params[:school_id]).map do |project| %> -
    • > -
      - <%= image_tag(get_course_avatar(project), :class => "avatar-4") %> -
      - -
      - [<%= get_course_term project %>] - <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> - (<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>) - <% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> - (<%=link_to "#{files_count}份", project_files_path(project) %>资料) -
      -
      - - <% course = Course.find_by_extra(project.identifier) %> - <%= course.school.name.try(:gsub, /(.+)$/, '\1:') %> - - - <%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %> +
    +
      +

      +

      + 该学校未开设任何课程,您可以查看其他学校课程 +

      +

      + <% find_all_new_hot_course(9).map do |project| %> +
    • > +
      + <%= image_tag(get_course_avatar(project), :class => "avatar-4") %> +
      + +
      + + <% course = Course.find_by_extra(project.identifier)%> + <% if(course.school == nil) %> +               + <% else %> + <%= course.school.name.try(:gsub, /(.+)$/, '\1:') %> + <% end %> + + + <%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %> <%#=course.try(:teacher).try(:name)%> - -
      - - -
    • - <% end; reset_cycle %> + +
    +
    + [<%= get_course_term project %>] + <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> + (<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>) + <% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %> + (<%=link_to "#{files_count}份", project_files_path(project) %>资料) +
    + +
    + <% if !course_endTime_timeout?(project)%> +
    + <%= new_watcher_link(project, User.current)%> +
    + <% end %> +
    + <% end %> -
-
+ +
+ <% else %> + <%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => params[:school_id]} %> +
+ + +
+ <% end %>
-

- 问题和反馈动态 - <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> - <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> -

- <%= link_to "更多>>", forums_path %> -
- +
\ No newline at end of file diff --git a/config/environment.rb b/config/environment.rb index 1d9a3966..f44e25ae 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -10,5 +10,6 @@ if Dir.glob(File.join(vendor_plugins_dir, "*")).any? exit 1 end + # Initialize the rails application RedmineApp::Application.initialize! diff --git a/config/locales/en.yml b/config/locales/en.yml index b092c3d1..4f995d79 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -132,8 +132,10 @@ en: actionview_instancetag_blank_option: Please select - attachment_browse: 'Attachment Browse' - attachment_type: 'Attachment Type' + attachment_all: "All" + attachment_browse: "Attachment Content Browse" + attachment_sufix_browse: "Attachment Type Browse" + attachment_type: "Attachment Type" general_text_No: 'No' general_text_Yes: 'Yes' general_text_no: 'no' diff --git a/config/locales/zh.yml b/config/locales/zh.yml index e8fafa47..6b4a925c 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -140,7 +140,9 @@ zh: actionview_instancetag_blank_option: 请选择 - attachment_browse: '分类浏览' + attachment_all: "全部" + attachment_sufix_browse: "文件类型" + attachment_browse: "内容类型" attachment_type: '资源分类' general_text_No: '否' general_text_Yes: '是' diff --git a/config/routes.rb b/config/routes.rb index d804e5b0..a5dc322c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -19,7 +19,7 @@ RedmineApp::Application.routes.draw do resources :no_uses delete 'no_uses', :to => 'no_uses#delete' - resources :apply_project_masters + resources :apply_project_masters delete 'apply_project_masters', :to => 'apply_project_masters#delete' @@ -299,7 +299,12 @@ RedmineApp::Application.routes.draw do # issue form update match 'issues/update_form', :controller => 'issues', :action => 'update_form', :via => [:put, :post], :as => 'issue_form' - resources :files, :only => [:index, :new, :create,:showbyattachtype] + resources :files, :only => [:index, :new, :create] do + collection do + match "getattachtype" , via: [:get, :post] + #match 'getattachtype/:attachtype', :to => 'files#getattachtype', via: [:get, :post] + end + end resources :versions, :except => [:index, :show, :edit, :update, :destroy] do collection do diff --git a/db/migrate/20140508030039_create_attachmentstypes.rb b/db/migrate/20140508030039_create_attachmentstypes.rb index 62568634..c8cfdd9d 100644 --- a/db/migrate/20140508030039_create_attachmentstypes.rb +++ b/db/migrate/20140508030039_create_attachmentstypes.rb @@ -4,6 +4,12 @@ class CreateAttachmentstypes < ActiveRecord::Migration t.column :typeId, :integer, :null => false t.column :typeName, :string, :limit =>50 end + Attachmentstype.create(typeId:1,typeName:'源代码') + Attachmentstype.create(typeId:1,typeName:'课件') + Attachmentstype.create(typeId:1,typeName:'研究报告') + Attachmentstype.create(typeId:2,typeName:'源代码') + Attachmentstype.create(typeId:2,typeName:'课件') + Attachmentstype.create(typeId:2,typeName:'研究报告') end def self.down diff --git a/db/schema.rb b/db/schema.rb index a15eca7b..1d329f3c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -23,6 +23,15 @@ ActiveRecord::Schema.define(:version => 20140509020307) do add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + create_table "apply_project_masters", :force => true do |t| + t.integer "user_id" + t.string "apply_type" + t.integer "apply_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "attachments", :force => true do |t| t.integer "container_id" t.string "container_type", :limit => 30 @@ -36,7 +45,7 @@ ActiveRecord::Schema.define(:version => 20140509020307) do t.datetime "created_on" t.string "description" t.string "disk_directory" - t.integer "attachtype" + t.integer "attachtype", :default => 1 end add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" @@ -527,6 +536,14 @@ ActiveRecord::Schema.define(:version => 20140509020307) do add_index "news", ["created_on"], :name => "index_news_on_created_on" add_index "news", ["project_id"], :name => "news_project_id" + create_table "no_uses", :force => true do |t| + t.integer "user_id", :null => false + t.string "no_use_type" + t.integer "no_use_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "open_id_authentication_associations", :force => true do |t| t.integer "issued" t.integer "lifetime" @@ -542,6 +559,19 @@ ActiveRecord::Schema.define(:version => 20140509020307) do t.string "salt", :null => false end + create_table "open_source_projects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "commit_count", :default => 0 + t.integer "code_line", :default => 0 + t.integer "users_count", :default => 0 + t.date "last_commit_time" + t.string "url" + t.date "date_collected" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "praise_tread_caches", :force => true do |t| t.integer "object_id", :null => false t.string "object_type" @@ -622,6 +652,24 @@ ActiveRecord::Schema.define(:version => 20140509020307) do add_index "queries", ["project_id"], :name => "index_queries_on_project_id" add_index "queries", ["user_id"], :name => "index_queries_on_user_id" + create_table "relative_memos", :force => true do |t| + t.integer "osp_id", :null => false + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :null => false + t.integer "author_id" + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 + t.string "url" + end + create_table "repositories", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "url", :default => "", :null => false