| @@ -19,7 +19,6 @@ | |||
| /public/images/avatars/* | |||
| /Gemfile | |||
| /Gemfile.lock | |||
| /db/schema.rb | |||
| /Gemfile.lock | |||
| /lib/plugins/acts_as_versioned/test/debug.log | |||
| .rbenv-gemsets | |||
| @@ -40,6 +40,7 @@ gem 'ruby-ole' | |||
| gem 'rails_kindeditor',path:'lib/rails_kindeditor' | |||
| gem 'binding_of_caller' | |||
| gem 'chinese_pinyin' | |||
| gem 'jbuilder' | |||
| # gem 'sunspot_rails', '~> 1.3.3' | |||
| # gem 'sunspot_solr' | |||
| # gem 'sunspot' | |||
| @@ -59,6 +60,7 @@ gem 'elasticsearch-rails' | |||
| group :development do | |||
| gem 'grape-swagger' | |||
| gem 'sextant' | |||
| gem 'better_errors', '~> 1.1.0' | |||
| # gem "query_reviewer" | |||
| gem 'rack-mini-profiler', '~> 0.9.3' | |||
| @@ -0,0 +1,74 @@ | |||
| # API文档 | |||
| --- | |||
| ## 基本介绍 | |||
| trustie平台同步其他平台数据的相关接口,如Educode、Openl,在获得许可权限后,如下接口可在其他任何平台调用。 | |||
| #### token认证 | |||
| token在trustie控制台下通过Setting.api_token获取,获取后可放环境变量中或者某个配置文件中 | |||
| #### 同步用户数量、开源项目数量、实训项目数量 | |||
| ``` | |||
| PUT homes/sync_count | |||
| ``` | |||
| *示例* | |||
| ``` | |||
| curl -X PUT http://localhost:3001/api/v1/homes/sync_count \ | |||
| -d "token=34c82f51e0b699d9d16d70fd6497c9b1e4821d6ea3e872558a6537a091076b8e" \ | |||
| -d "type=project" | jq | |||
| ``` | |||
| 请求参数说明: | |||
| token(requires): String,权限验证 | |||
| type(requires): String;同步的类型,取值范围: {user(用户) | project(开源项目) | practical_training_project(实训项目) | school(应用高校)} | |||
| number(optional): Integer;同步数量, 该参数可选,不传时,后台默认值为1 | |||
| 返回值 | |||
| ``` | |||
| { | |||
| "status": 1, | |||
| "message": "token is invalid!" | |||
| } | |||
| ``` | |||
| --- | |||
| #### 同步动态新闻 | |||
| ``` | |||
| PUT homes/sync_news | |||
| ``` | |||
| *示例* | |||
| ``` | |||
| curl -X PUT http://localhost:3001/api/v1/homes/sync_news \ | |||
| -d "token=34c82f51e0b699d9d16d70fd6497c9b1e4821d6ea3e872558a6537a091076b8e" \ | |||
| -d "title=“基于OpenI海参的视频编码大赛”海口启动" \ | |||
| -d "simple_intruduce=2019年8月31日下午,“AVS工作组第70次会议暨AI标准工作组第8次会议”闭幕式在海口召开,会上启动了“基于OpenI海参的视频编码大赛”,哈尔滨工业大学范晓鹏教授介绍了大赛背景、选题及参赛流程等信息,正式开启大赛参赛团队招募。" \ | |||
| -d "remote_url=https://www.openi.org.cn/html/2019/dongtai_0903/255.html" | jq | |||
| ``` | |||
| 请求参数说明: | |||
| cover_remote_url(optional): String, 封面访问地址 | |||
| category_id(optional): Integer, 分类ID | |||
| content(optional): String, 新闻内容 | |||
| title(requires): String, 新闻标题 | |||
| simple_intruduce(requires): String, 新闻简介 | |||
| remote_url(requires): String, 新闻访问地址 | |||
| platform(requires): String, 该条数据的来源{educoder | trusite | ihub | gcc | openi |toschina | military | jiaotong_university}; 如educoder说明是来源educoder平台 | |||
| 返回值 | |||
| ``` | |||
| { | |||
| "status": 1, | |||
| "message": "token is invalid!" | |||
| } | |||
| ``` | |||
| --- | |||
| @@ -1,5 +0,0 @@ | |||
| = Redmine | |||
| Redmine is a flexible project management web application written using Ruby on Rails framework. | |||
| More details can be found in the doc directory or on the official website http://www.redmine.org | |||
| @@ -21,6 +21,7 @@ module Mobile | |||
| require_relative 'apis/resources' | |||
| require_relative 'apis/syllabuses' | |||
| require_relative 'apis/projects' | |||
| require_relative 'apis/homes' | |||
| class API < Grape::API | |||
| version 'v1', using: :path | |||
| @@ -56,6 +57,11 @@ module Mobile | |||
| nil | |||
| end | |||
| # 使用固定token来简单验证用户是否有调用某个api权限 | |||
| def authenticate_token! | |||
| raise 'token is invalid!' unless params[:token].strip == Setting.api_token | |||
| end | |||
| end | |||
| mount Apis::Auth | |||
| @@ -77,10 +83,9 @@ module Mobile | |||
| mount Apis::Resources | |||
| mount Apis::Syllabuses | |||
| mount Apis::Projects | |||
| mount Apis::Homes | |||
| add_swagger_documentation ({api_version: 'v1', base_path: '/api'}) if Rails.env.development? | |||
| end | |||
| end | |||
| @@ -0,0 +1,71 @@ | |||
| #coding=utf-8 | |||
| module Mobile | |||
| module Apis | |||
| class Homes< Grape::API | |||
| resources :homes do | |||
| desc "Current user's information in access token's scope<span class='accstr'>*</span>", { | |||
| headers: { | |||
| "Authorization" => { | |||
| description: "Valdates your identity", | |||
| required: true | |||
| } | |||
| } | |||
| } | |||
| desc "同步用户数量、开源项目数量、实训项目数量" | |||
| params do | |||
| optional :number, type: Integer, default: 1, desc: "同步的数量" | |||
| requires :token, type: String, desc: "token is validate user identity" | |||
| requires :type, type: String, values: ['user', 'project', 'practical_training_project', 'school'], desc: "type requires." | |||
| end | |||
| put 'sync_count' do | |||
| authenticate_token! | |||
| begin | |||
| HomesService.new.sync_count(params[:type].strip, params[:number].to_i) | |||
| present :status, 0 | |||
| present :message, "sync success." | |||
| rescue Exception=>e | |||
| present :status, -1 | |||
| present :message, e.message | |||
| end | |||
| end | |||
| desc "同步社区动态新闻" | |||
| params do | |||
| optional :cover_remote_url, type: String, regexp: Home::REG_URL_FORMAT | |||
| optional :category_id, type: Integer | |||
| optional :content, type: String | |||
| requires :title, type: String | |||
| requires :simple_intruduce, type: String | |||
| requires :remote_url, type: String, regexp: Home::REG_URL_FORMAT | |||
| requires :platform, type: String, desc: "platform requires." , values: DynamicNew::PLATFORMS | |||
| end | |||
| put 'sync_news' do | |||
| authenticate_token! | |||
| news_params = { | |||
| title: params[:title], | |||
| simple_intruduce: params[:simple_intruduce], | |||
| remote_url: params[:remote_url], | |||
| category_id: params[:category_id], | |||
| content: params[:content], | |||
| cover_remote_url: params[:cover_remote_url], | |||
| platform: params[:platform] | |||
| } | |||
| begin | |||
| DynamicNewsService.new.sync(news_params) | |||
| present :status, 0 | |||
| present :message, 'sync success' | |||
| rescue => e | |||
| logger.info e | |||
| present :status, -1 | |||
| present :message, e.message | |||
| end | |||
| end | |||
| end | |||
| end | |||
| end | |||
| end | |||
| @@ -0,0 +1,3 @@ | |||
| # Place all the behaviors and hooks related to the matching controller here. | |||
| # All this logic will automatically be available in application.js. | |||
| # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | |||
| @@ -0,0 +1,3 @@ | |||
| // Place all the styles related to the private_messages controller here. | |||
| // They will automatically be included in application.css. | |||
| // You can use Sass (SCSS) here: http://sass-lang.com/ | |||
| @@ -134,7 +134,7 @@ class AccountController < ApplicationController | |||
| Mailer.run.lost_password(token) | |||
| flash[:notice] = l(:notice_account_lost_email_sent) | |||
| redirect_to lost_password_path | |||
| return | |||
| return | |||
| end | |||
| end | |||
| render :layout => 'static_base' | |||
| @@ -379,7 +379,7 @@ class AccountController < ApplicationController | |||
| def password_authentication | |||
| user, last_login_on = User.try_to_login(params[:username], params[:password]) | |||
| if user.nil? | |||
| invalid_credentials | |||
| elsif user.status == 2 | |||
| @@ -447,8 +447,8 @@ class AccountController < ApplicationController | |||
| call_hook(:controller_account_success_authentication_after, {:user => user }) | |||
| code = /\d*/ | |||
| #根据home_url生产正则表达式 | |||
| eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/") | |||
| #根据homes_url生产正则表达式 | |||
| eval("code = " + "/^" + homes_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/") | |||
| if (code=~params[:back_url] || params[:back_url].to_s.include?('lost_password')) && last_login_on != '' | |||
| redirect_to user_activities_path(user,host: Setting.host_user) | |||
| elsif params[:back_url64] | |||
| @@ -502,7 +502,7 @@ class AccountController < ApplicationController | |||
| # render :layout => 'login' | |||
| redirect_to signin_path(:login=>true) | |||
| end | |||
| def invalid_credentials_new | |||
| logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}" | |||
| # flash[:error] = l(:notice_account_invalid_creditentials_new) | |||
| @@ -712,6 +712,21 @@ class AdminController < ApplicationController | |||
| end | |||
| end | |||
| # 动态消息列表 | |||
| def dynamic_news | |||
| @category_id = params[:category_id] || 0 | |||
| scope = DynamicNew.desc.like(params[:title]) | |||
| scope = scope.by_category(@category_id.to_i) unless @category_id.to_i == 0 | |||
| @dynamic_news_count = scope.count | |||
| @dynamic_news = paginateHelper scope, 15 | |||
| @page = (params['page'] || 1).to_i - 1 | |||
| respond_to do |format| | |||
| format.js | |||
| format.html | |||
| end | |||
| end | |||
| # 单位审核 | |||
| # 未审批tab页 | |||
| # status: 0 未审批; 1 已批阅; 2已更改; 3拒绝; | |||
| @@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base | |||
| include Redmine::Pagination | |||
| include RoutesHelper | |||
| helper :routes | |||
| #added by william | |||
| helper :watchers | |||
| @@ -57,7 +57,7 @@ class ApplicationController < ActionController::Base | |||
| helper Redmine::MenuManager::MenuHelper | |||
| def user_agent | |||
| logger.info "HTTP_USER_AGENT #{request.env["HTTP_USER_AGENT"]}" | |||
| logger.info "HTTP_USER_AGENT #{request.env["HTTP_USER_AGENT"]}" | |||
| end | |||
| def session_expiration | |||
| @@ -72,7 +72,7 @@ class ApplicationController < ActionController::Base | |||
| end | |||
| end | |||
| def session_expired? | |||
| if Setting.session_lifetime? | |||
| unless session[:ctime] && (Time.now.utc.to_i - session[:ctime].to_i <= Setting.session_lifetime.to_i * 60) | |||
| @@ -474,7 +474,7 @@ class ApplicationController < ActionController::Base | |||
| rescue ActiveRecord::RecordNotFound | |||
| render_404 | |||
| end | |||
| # Finds and sets @project based on @object.project | |||
| def find_project_from_association | |||
| render_404 unless @object.present? | |||
| @@ -488,7 +488,7 @@ class ApplicationController < ActionController::Base | |||
| end | |||
| end | |||
| def find_contest_from_association | |||
| render_404 unless @object.present? | |||
| @@ -810,10 +810,10 @@ class ApplicationController < ActionController::Base | |||
| end | |||
| if offset.nil? && options[:page].present? | |||
| offset = (options[:page].to_i - 1) * limit | |||
| offset = 0 if offset < 0 | |||
| offset = 0 if offset < 0 | |||
| offset ||= 0 | |||
| end | |||
| [offset, limit] | |||
| end | |||
| @@ -876,7 +876,7 @@ class ApplicationController < ActionController::Base | |||
| if unsaved_issue_ids.empty? | |||
| flash[:notice] = l(:notice_successful_update) unless issues.empty? | |||
| else | |||
| flash[:error] = l(:notice_failed_to_save_issues, | |||
| flash[:error] = l(:notice_failed_to_save_issues, | |||
| :count => unsaved_issue_ids.size, | |||
| :total => issues.size, | |||
| :ids => '#' + unsaved_issue_ids.join(', #')) | |||
| @@ -961,7 +961,7 @@ class ApplicationController < ActionController::Base | |||
| def find_web_footer | |||
| @organizer = WebFooterOranizer.first | |||
| @companies = WebFooterCompany.all | |||
| @companies = WebFooterCompany.partners | |||
| end | |||
| @@ -0,0 +1,61 @@ | |||
| class DynamicNewsController < ApplicationController | |||
| layout 'admin', only: [:new, :destroy, :edit] | |||
| before_filter :require_admin, :except => [:index, :show] | |||
| before_filter :find_dynamic_new, :only => [:destroy, :edit, :update] | |||
| def index | |||
| end | |||
| def new | |||
| @category_id = params[:category_id] || 0 | |||
| @dynamic_new = DynamicNew.new | |||
| end | |||
| def create | |||
| tmp_file = params[:cover] | |||
| @dynamic_new = DynamicNew.new(params[:dynamic_new]) | |||
| begin | |||
| identity = SecureRandom.uuid | |||
| unless tmp_file.nil? | |||
| File.open(Rails.root.join('public', 'images', 'dynamic_new', identity.to_s+'.png'), 'wb') do |file| | |||
| file.write(tmp_file.read) | |||
| end | |||
| @dynamic_new.cover_remote_url = "/images/dynamic_new/#{identity}.png" | |||
| end | |||
| # TODO: 如下警告信息导致值写不进库 | |||
| # WARNING: Can't mass-assign protected attributes: simple_intruduce, | |||
| @dynamic_new.simple_intruduce = params[:dynamic_new][:simple_intruduce] | |||
| if @dynamic_new.save! | |||
| redirect_to admin_dynamic_news_path | |||
| else | |||
| render :action => 'new' | |||
| end | |||
| rescue => e | |||
| logger.info e | |||
| render 'new' | |||
| end | |||
| end | |||
| def destroy | |||
| @dynamic_new.destroy | |||
| redirect_to admin_dynamic_news_path | |||
| end | |||
| def edit | |||
| end | |||
| def update | |||
| @dynamic_new.update_attributes!(params[:dynamic_new]) | |||
| redirect_to admin_dynamic_news_path | |||
| end | |||
| def show | |||
| end | |||
| private | |||
| def find_dynamic_new | |||
| @dynamic_new = DynamicNew.find params[:id] | |||
| end | |||
| end | |||
| @@ -0,0 +1,106 @@ | |||
| class HomesController < ApplicationController | |||
| layout 'base_introduce' | |||
| before_filter :find_home, :except => [:index, :new, :create, :partners, :news] | |||
| def index | |||
| @home = Home.includes(:banners, :cover => [:file]).first | |||
| @dynamic_news = DynamicNew.desc.limit(4) | |||
| @companies = WebFooterCompany.dedicators | |||
| @partners = WebFooterCompany.opensources | |||
| @first_companies_group = Array(@companies.slice(0, 5)) | |||
| @second_companies_group = Array(@companies.slice(5, 8)) | |||
| @third_companies_group = Array(@companies.slice(13, 5)) | |||
| end | |||
| def partners | |||
| @companies = WebFooterCompany.where(key: ['opensource', 'dedicator']).group_by(&:key).sort { |a, b| b[0]<=>a[0] } | |||
| end | |||
| def news | |||
| scope = DynamicNew.desc | |||
| @dynamic_news_count = scope.count | |||
| @dynamic_news = paginateHelper scope, 15 | |||
| @page = (params['page'] || 1).to_i - 1 | |||
| respond_to do |format| | |||
| format.js | |||
| format.html | |||
| end | |||
| end | |||
| # GET /homes/1 | |||
| # GET /homes/1.json | |||
| def show | |||
| respond_to do |format| | |||
| format.html # show.html.erb | |||
| format.json { render json: @home } | |||
| end | |||
| end | |||
| # GET /homes/new | |||
| # GET /homes/new.json | |||
| def new | |||
| @home = Home.new | |||
| respond_to do |format| | |||
| format.html # new.html.erb | |||
| format.json { render json: @home } | |||
| end | |||
| end | |||
| # GET /homes/1/edit | |||
| def edit | |||
| end | |||
| # POST /homes | |||
| # POST /homes.json | |||
| def create | |||
| @home = Home.new(params[:home]) | |||
| respond_to do |format| | |||
| if @home.save | |||
| format.html { redirect_to @home, notice: 'Home was successfully created.' } | |||
| format.json { render json: @home, status: :created, location: @home } | |||
| else | |||
| format.html { render action: "new" } | |||
| format.json { render json: @home.errors, status: :unprocessable_entity } | |||
| end | |||
| end | |||
| end | |||
| # PUT /homes/1 | |||
| # PUT /homes/1.json | |||
| def update | |||
| respond_to do |format| | |||
| if @home.update_attributes(params[:home]) | |||
| format.html { redirect_to @home, notice: 'Home was successfully updated.' } | |||
| format.json { head :no_content } | |||
| else | |||
| format.html { render action: "edit" } | |||
| format.json { render json: @home.errors, status: :unprocessable_entity } | |||
| end | |||
| end | |||
| end | |||
| # DELETE /homes/1 | |||
| # DELETE /homes/1.json | |||
| def destroy | |||
| @home.destroy | |||
| respond_to do |format| | |||
| format.html { redirect_to homes_url } | |||
| format.json { head :no_content } | |||
| end | |||
| end | |||
| private | |||
| def find_home | |||
| @home = Home.find_by_frendly_id! params[:id] | |||
| end | |||
| end | |||
| @@ -0,0 +1,139 @@ | |||
| class PrivateMessagesController < ApplicationController | |||
| before_filter :require_login | |||
| before_filter :set_user | |||
| before_filter :set_message, except: [:index] | |||
| before_filter :set_type_and_count | |||
| def index | |||
| #用户更新私信为全部已读 | |||
| if User.current == @user || User.current.admin? | |||
| @onclick_time = User.current.onclick_time.onclick_time | |||
| User.current.onclick_time.update_attribute(:onclick_time, Time.now) | |||
| jours = PrivateMessage.find_by_sql("SELECT ui.* FROM (SELECT * FROM private_messages WHERE STATUS != 2 AND user_id = #{@user.id} ORDER BY id DESC) ui GROUP BY ui.target_id ORDER BY ui.send_time DESC") | |||
| @unred_all_messages = @user.count_new_message("all") | |||
| @unred_private_messages = @user.unread_private_messages | |||
| # jours = PrivateMessage.without_deleted.where("user_id = ?", @user.id).order("created_at desc") | |||
| @limit = 20 | |||
| @jours_count = jours.count | |||
| @jours_all_pages = Paginator.new @jours_count, @limit, params['page'] || 1 | |||
| @offset ||= @jours_all_pages.offset | |||
| @jours_alls = paginateHelper jours, @limit | |||
| render :layout=>'base_user_message' | |||
| else | |||
| render_403 | |||
| end | |||
| end | |||
| def new | |||
| end | |||
| def create | |||
| ActiveRecord::Base.transaction do | |||
| begin | |||
| user_id = params[:private_message][:receiver_id] | |||
| receiver_user = User.find_by_id(user_id) | |||
| if receiver_user.present? | |||
| content = params[:private_message][:content].strip.truncate(200) | |||
| sender_params = { | |||
| user_id: current_user.id, | |||
| target_id: user_id, | |||
| sender_id: current_user.id, | |||
| receiver_id: user_id, | |||
| content: content, | |||
| status: 0, | |||
| send_time: Time.now | |||
| } | |||
| receiver_params = { | |||
| user_id: user_id, | |||
| target_id: current_user.id, | |||
| sender_id: current_user.id, | |||
| receiver_id: user_id, | |||
| content: content, | |||
| status: 0, | |||
| send_time: Time.now | |||
| } | |||
| @sender_message = PrivateMessage.new(sender_params) | |||
| @receiver_message = PrivateMessage.new(receiver_params) | |||
| @sender_message.save! | |||
| @receiver_message.save! | |||
| respond_to do |format| | |||
| format.js | |||
| format.html{ | |||
| redirect_to private_messages_detail_user_private_messages_path(@user, target_ids: user_id) | |||
| } | |||
| end | |||
| else | |||
| redirect_to user_private_messages_path(current_user), notice: "用户不存在" | |||
| end | |||
| rescue Exception => e | |||
| Rails.logger.info("#######___________####{e}") | |||
| raise ActiveRecord::Rollback | |||
| end | |||
| end | |||
| end | |||
| def private_messages_detail | |||
| if User.current == @user || User.current.admin? | |||
| @unred_private_messages = @user.unread_private_messages | |||
| @unred_all_messages = 0 | |||
| @target_user = User.where(:id => params[:target_ids]).includes(:user_extensions).first | |||
| if @target_user.present? | |||
| target_user_messages = @user.private_messages.where(:target_id => params[:target_ids], :status => [0, 1]) | |||
| @message_list = target_user_messages.order("send_time asc") | |||
| target_user_messages.where(status: 0).update_all(status: 1) | |||
| @onclick_time = User.current.onclick_time.onclick_time | |||
| User.current.onclick_time.update_attribute(:onclick_time, Time.now) | |||
| @all_users = params[:all_user] || "0" | |||
| user_message_details = PrivateMessage.find_by_sql("SELECT ui.* FROM (SELECT * FROM private_messages WHERE STATUS != 2 AND user_id = #{@user.id} ORDER BY id DESC) ui GROUP BY ui.target_id ORDER BY ui.send_time DESC") | |||
| user_message_details_count = user_message_details.size | |||
| if user_message_details_count > 10 && @all_users == "0" | |||
| user_message_details = user_message_details.first(10) | |||
| end | |||
| @user_message_details = user_message_details | |||
| render :layout=>'base_user_message' | |||
| else | |||
| render_404 | |||
| end | |||
| else | |||
| render_403 | |||
| end | |||
| end | |||
| def destroy | |||
| @message.update_attribute(:status, 2) | |||
| end | |||
| def get_recent_users | |||
| @recent_users = User.where(:id => @user.private_messages.without_deleted.order("created_at desc").map(&:target_id)).includes(:user_extensions).limit(10) | |||
| render "get_recent_users", layout: false | |||
| end | |||
| def message_search_users | |||
| @search_users = User.where("id != #{@user.id} and LOWER(concat(lastname, firstname)) LIKE '%#{params[:receiver_name].strip.to_s.downcase}%'").includes(:user_extensions) | |||
| # @search_users = User.where("LOWER(concat(lastname, ifnull(firstname, ''), login)) LIKE ?", "#{params[:receiver_name].strip.to_s.downcase}") | |||
| render "message_search_users", layout: false | |||
| end | |||
| private | |||
| def set_user | |||
| @user = User.find_by_login(params[:user_id]) | |||
| end | |||
| def set_message | |||
| @message = PrivateMessage.find_by_id(params[:id]) | |||
| end | |||
| def set_type_and_count | |||
| @unred_all_messages = 0 | |||
| @user_message_type = "2" | |||
| end | |||
| end | |||
| @@ -291,7 +291,7 @@ class PullRequestsController < ApplicationController | |||
| rescue Gitlab::Error::NotFound => e | |||
| @message = l(:label_pull_request_notfound) | |||
| rescue Exception => e | |||
| puts e | |||
| logger.info e | |||
| end | |||
| end | |||
| @@ -42,7 +42,7 @@ class UsersController < ApplicationController | |||
| :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,:user_contestlist, :user_manage_issues, :user_receive_issues, | |||
| :user_courses4show,:user_projects4show,:user_contests4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction, | |||
| :user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list, | |||
| :sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community, :contest_community] | |||
| :sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community, :contest_community, :undo_items] | |||
| before_filter :auth_user_extension, only: :show | |||
| before_filter :show_system_message, :only => [:show] | |||
| #before_filter :rest_user_score, only: :show | |||
| @@ -477,19 +477,28 @@ class UsersController < ApplicationController | |||
| messages.each do |message_all| | |||
| # 未读的消息存放在数组 | |||
| mess = message_all.message | |||
| if (message_all.message_type != "SystemMessage" && !mess.nil? && (mess.viewed == 0 || !mess.viewed)) || (message_all.message_type == "SystemMessage"&& !mess.nil? && mess.created_at > onclick_time) | |||
| unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1) | |||
| if (message_all.message_type != "SystemMessage" && !mess.nil? && (mess.viewed == 0 || !mess.viewed) && mess.created_at > onclick_time) || (message_all.message_type == "SystemMessage"&& !mess.nil? && mess.created_at > onclick_time) | |||
| unless (message_all.message_type == 'CourseMessage') && mess && mess.course && (mess.course.is_delete == 1) | |||
| @message_alls << mess | |||
| end | |||
| break if @message_alls.length == 10 | |||
| end | |||
| end | |||
| #未读私信 | |||
| unred_private_messages = User.current.private_messages.where(status: 0) | |||
| unred_private_messages.each do |message| | |||
| @message_alls << message | |||
| break if @message_alls.length == 10 | |||
| end | |||
| end | |||
| # 用户消息 | |||
| # 说明: homework 发布作业;message:讨论区; news:新闻; poll:问卷;works_reviewers:作品评阅;works_reply:作品回复,exercise:课程测验 | |||
| # issue:问题;journal:缺陷状态更新; forum:公共贴吧: user_feedback: 用户留言; new_reply:新闻回复(comment) | |||
| def user_messages | |||
| @user_message_type = "1" | |||
| @msg_type = params[:type] || "all" | |||
| if !User.current.logged? | |||
| redirect_to signin_url | |||
| return | |||
| @@ -497,72 +506,41 @@ class UsersController < ApplicationController | |||
| return render_403 | |||
| end | |||
| # 初始化/更新 点击按钮时间, 24小时内显示系统消息 | |||
| update_onclick_time | |||
| user_all_messages = MessageAll.where(:user_id => @user.id).includes(:message) | |||
| # 全部设为已读 | |||
| # if params[:viewed] == "all" | |||
| # update_message_viewed(@user) | |||
| # end | |||
| # @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count | |||
| courses = @user.courses.where("is_delete = 1") | |||
| course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")" | |||
| case params[:type] | |||
| when nil | |||
| # 系统消息为管理员发送,我的消息中包含有系统消息 | |||
| @message_alls = [] | |||
| messages = MessageAll.where(:user_id => @user.id).includes(:message).order("created_at desc") | |||
| messages.each do |message_all| | |||
| mess = message_all.message | |||
| unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1) | |||
| @message_alls << mess | |||
| end | |||
| end | |||
| when 'unviewed' | |||
| @message_alls = [] | |||
| messages = MessageAll.where("message_alls.user_id =?", @user.id).includes(:message).order("created_at desc") | |||
| messages.each do |message_all| | |||
| # 在点击或者刷新消息列表后未读的消息存放在数组 | |||
| mess = message_all.message | |||
| if message_all.message_type != "SystemMessage"&& !mess.nil? && (mess.viewed == 0 || !mess.viewed) | |||
| unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1) | |||
| @message_alls << mess | |||
| end | |||
| end | |||
| end | |||
| #课程相关消息 | |||
| when 'homework' | |||
| @message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork','Exercise') and user_id =? and course_id NOT IN #{course_ids}", @user.id).order("created_at desc") | |||
| when 'course_message' | |||
| @message_alls = CourseMessage.where("course_message_type =? and user_id =? and course_id NOT IN #{course_ids}", "Message", @user.id).order("created_at desc") | |||
| when 'course_news' | |||
| # 课程通知包含发布的通知和回复的通知 | |||
| @message_alls = CourseMessage.where("course_message_type in ('News', 'Comment') and user_id =? and course_id NOT IN #{course_ids}", @user.id).order("created_at desc") | |||
| when 'poll' | |||
| @message_alls = CourseMessage.where("course_message_type =? and user_id =? and course_id NOT IN #{course_ids}", "Poll", @user.id).order("created_at desc") | |||
| #项目相关消息 | |||
| when 'issue' | |||
| @message_alls = ForgeMessage.where("forge_message_type in ('Issue', 'Journal') and user_id =?" , @user.id).order("created_at desc") | |||
| when 'forge_message' | |||
| @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user.id).order("created_at desc") | |||
| when 'forge_news' | |||
| @message_alls = ForgeMessage.where("forge_message_type in (?,?) and user_id =?", "News", "Comment", @user.id).order("created_at desc") | |||
| when 'apply' | |||
| @message_alls = ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject', 'JoinProject', 'RemoveFromProject') and user_id =?", @user.id).order("created_at desc") | |||
| #贴吧消息 | |||
| when 'forum' | |||
| @message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user.id).order("created_at desc") | |||
| #用户留言 | |||
| when 'user_feedback' | |||
| @message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user.id).order("created_at desc") | |||
| case @msg_type | |||
| when "all" | |||
| @message_alls = user_all_messages | |||
| when "course" | |||
| @message_alls = user_all_messages.where(message_type: "CourseMessage") | |||
| when "project" | |||
| @message_alls = user_all_messages.where(message_type: "ForgeMessage") | |||
| when "at" | |||
| @message_alls = user_all_messages.where(message_type: %w(UserFeedbackMessage MemoMessage AtMessage BlogMessage)) | |||
| when "apply" | |||
| @message_alls = user_all_messages.where(message_type: "AppliedMessage") | |||
| else | |||
| render_404 | |||
| return | |||
| @message_alls = user_all_messages.where(message_type: %w(SystemMessage ContestMessage OrgMessage)) | |||
| end | |||
| @unred_all_messages = @user.count_new_message(@msg_type) | |||
| # @unred_private_messages = 0 | |||
| @unred_private_messages = @user.unread_private_messages | |||
| @message_alls = @message_alls.order("created_at desc") | |||
| #点击进入tab后,全部更新为已读,全部页面除外 | |||
| @message_alls = paginateHelper @message_alls, 25 | |||
| @limit = 20 | |||
| @message_count = @message_alls.count | |||
| @message_all_pages = Paginator.new @message_count, @limit, params['page'] || 1 | |||
| @offset ||= @message_all_pages.offset | |||
| @message_alls = paginateHelper @message_alls, @limit | |||
| respond_to do |format| | |||
| format.js | |||
| format.html{render :layout=>'new_base_user'} | |||
| format.html{render layout: "base_user_message"} | |||
| end | |||
| end | |||
| # 初始化/更新 点击按钮时间 | |||
| @@ -1671,41 +1649,6 @@ class UsersController < ApplicationController | |||
| render :layout=>'base_users_new' | |||
| end | |||
| # modified by fq | |||
| def user_newfeedback | |||
| unless User.current.logged? | |||
| redirect_to signin_url | |||
| return | |||
| end | |||
| # 自己访问自己的页面才更新消息状态 | |||
| UserFeedbackMessage.where("user_id =? and viewed =? and journals_for_message_type =? ", User.current.id, 0, "JournalsForMessage").update_all(:viewed => true) | |||
| # end | |||
| @page = params[:page] ? params[:page].to_i + 1 : 0 | |||
| if params[:type].present? | |||
| case params[:type] | |||
| when "public" | |||
| jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 0').order('updated_on DESC') | |||
| when "private" | |||
| jours = @user.journals_for_messages.where('m_parent_id IS NULL and private = 1').order('updated_on DESC') | |||
| else | |||
| jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('updated_on DESC') | |||
| end | |||
| else | |||
| jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('updated_on DESC') | |||
| end | |||
| @jour_count = jours.count | |||
| @jour = jours.limit(10).offset(@page * 10) | |||
| @type = params[:type] | |||
| # if User.current == @user | |||
| # @jour.update_all(:is_readed => true, :status => false) | |||
| # @jour.each do |journal| | |||
| # # fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false) | |||
| # journal.delay.set_children_readed_delay | |||
| # end | |||
| # end | |||
| @state = false | |||
| render :layout=>'new_base_user' | |||
| end | |||
| #给某人留言 | |||
| def feedBackTo | |||
| @@ -2092,154 +2035,180 @@ class UsersController < ApplicationController | |||
| end | |||
| def show | |||
| if User.current == @user | |||
| # 点击小铃铛,更新点击时间 | |||
| update_onclick_time if params[:click_user_message] == 'true' | |||
| # 全部设为已读 | |||
| # 自己的主页显示消息 | |||
| messages_all = MessageAll.where(:user_id => @user.id) | |||
| @message_count = messages_all.count | |||
| # REDO:已删除的内容应该在页面中显示不点击 | |||
| @message_all_pages = Paginator.new @message_count, per_page_option, params['page'] | |||
| @message_alls = messages_all.includes(:message). | |||
| limit(@message_all_pages.per_page). | |||
| offset(@message_all_pages.offset). | |||
| reorder("#{MessageAll.table_name}.created_at desc") | |||
| @unsolved_issues_count = Issue.where(:assigned_to_id => @user.id, :status_id => [1, 2, 4, 6]).includes(:author, :project).count | |||
| my_course_ids = StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").blank? ? "(-1)" : "(" + StudentsForCourse.includes(:course). | |||
| where("student_id = #{@user.id} and courses.is_delete = 0").map{|sc| sc.course_id}.join(",") + ")" | |||
| # 用户待完成的作业 | |||
| homeworks = HomeworkCommon.where("course_id in #{my_course_ids} and publish_time <= '#{Time.now}'") | |||
| homework_ids = homeworks.blank? ? "(-1)" : "(" + homeworks.map{|homework| homework.id}.join(",") + ")" | |||
| student_works = StudentWork.where("user_id = #{@user.id} and homework_common_id in #{homework_ids} and work_status != 0") | |||
| @unfinished_homework_count = homeworks.count - student_works.count | |||
| # 用户待完成的测验 | |||
| exercises = Exercise.where("course_id in #{my_course_ids} and exercise_status = 2") | |||
| exercise_users = ExerciseUser.where(:user_id => @user.id, :exercise_id => exercises.map{|ex| ex.id}) | |||
| @unfinished_test_count = exercises.count - exercise_users.count | |||
| # 用户待完成的问卷 | |||
| polls = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2") | |||
| poll_users = PollUser.where(:user_id => @user.id, :poll_id => polls.map{|poll| poll.id}) | |||
| @unfinished_poll_count = polls.count - poll_users.count | |||
| # 用户待匿评的作品 | |||
| homeworks = HomeworkCommon.includes(:homework_detail_manual).where("homework_commons.course_id in #{my_course_ids} and homework_detail_manuals.comment_status = 2") | |||
| student_work_scores = @user.student_works_scores.where("reviewer_role = 3") | |||
| anonymous_evaluation_ids = student_work_scores.blank? ? "(-1)" : "(" + student_work_scores.map{|st| st.student_work_id}.join(",") + ")" | |||
| unfinished_evaluations = @user.student_works_evaluation_distributions.where("student_work_id not in #{anonymous_evaluation_ids}") | |||
| @anonymous_evaluation_count = StudentWork.where(:id => unfinished_evaluations.map{|ev| ev.student_work_id}, :homework_common_id => homeworks.map{|hw| hw.id}).count | |||
| # 待评阅的作业 暂不做 | |||
| # @unreview_homework = 1 | |||
| # 待审批的申请 | |||
| #applied_message_count = AppliedMessage.where(:applied_type => ["Organization", "AppliedContest", "StudentWorksScoresAppeal", "AppliedProject", "ApplyAddSchools"], :user_id => User.current.id, :status => 0).count | |||
| #applied_course_message_count = CourseMessage.where(:user_id => User.current.id, :course_message_type => "JoinCourseRequest", :status => 0).count | |||
| # applied_pull_request_message_count = ForgeMessage.where(:user_id => User.current.id, :forge_message_type => "PullRequest", :status => [1,3]).count | |||
| # @applied_message_alls_count = applied_message_count + applied_course_message_count + applied_pull_request_message_count | |||
| user_id = User.current.id | |||
| sql = "SELECT * FROM `message_alls` ma left join `forge_messages` fm on ma.message_id=fm.id | |||
| left join `course_messages` cm on ma.message_id=cm.id left join `applied_messages` apm on ma.message_id=apm.id | |||
| where (ma.user_id =#{user_id} and ma.message_type = 'ForgeMessage' and fm.forge_message_type='PullRequest' and fm.status=0 and fm.user_id=#{user_id} ) or | |||
| (ma.user_id=#{user_id} and ma.message_type='AppliedMessage' and apm.applied_type in ('Organization', 'AppliedContest', 'StudentWorksScoresAppeal', 'AppliedProject', 'ApplyAddSchools') and apm.user_id =#{user_id} and apm.status =0 ) or | |||
| (ma.user_id=#{user_id} and ma.message_type='CourseMessage' and cm.course_message_type='JoinCourseRequest' and cm.status=0 and cm.user_id=#{user_id} );" | |||
| message_alls = MessageAll.find_by_sql(sql) | |||
| @applied_message_alls_count = message_alls.count | |||
| else | |||
| # 看别人的主页显示动态 | |||
| #更新用户申请成为课程老师或教辅消息的状态 | |||
| if params[:course_id] != nil | |||
| join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", | |||
| params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false) | |||
| join_course_messages.update_all(:viewed => true) | |||
| end | |||
| shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) | |||
| shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) | |||
| @page = params[:page] ? params[:page].to_i + 1 : 0 | |||
| user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" | |||
| user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" | |||
| course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')" | |||
| project_types = "('Message','Issue','Project')" | |||
| principal_types = "JournalsForMessage" | |||
| container_type = '' | |||
| act_type = '' | |||
| # 他的动态 | |||
| sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))" | |||
| if params[:type].present? | |||
| case params[:type] | |||
| when "course_homework" | |||
| container_type = 'Course' | |||
| act_type = 'HomeworkCommon' | |||
| when "course_news" | |||
| container_type = 'Course' | |||
| act_type = 'News' | |||
| when "course_message" | |||
| container_type = 'Course' | |||
| act_type = 'Message' | |||
| when "course_poll" | |||
| container_type = 'Course' | |||
| act_type = 'Poll' | |||
| when "course_journals" | |||
| container_type = 'Course' | |||
| act_type = 'JournalsForMessage' | |||
| when "project_issue" | |||
| container_type = 'Project' | |||
| act_type = 'Issue' | |||
| when "project_message" | |||
| container_type = 'Project' | |||
| act_type = 'Message' | |||
| when "user_journals" | |||
| container_type = 'Principal' | |||
| act_type = 'JournalsForMessage' | |||
| when "current_user" | |||
| container_type = 'Principal' | |||
| act_type = 'Principal' | |||
| when "all" | |||
| container_type = 'all' | |||
| act_type = 'all' | |||
| end | |||
| end | |||
| if container_type != '' && container_type != 'all' | |||
| if container_type == 'Course' | |||
| sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'" | |||
| elsif container_type == 'Project' | |||
| sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'" | |||
| elsif container_type == 'Principal' && act_type == 'JournalsForMessage' | |||
| sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}" | |||
| elsif container_type == 'Principal' && act_type == 'Principal' | |||
| sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))" | |||
| end | |||
| if User.current != @user | |||
| sql += " and user_id = #{@user.id}" | |||
| end | |||
| else | |||
| if User.current != @user | |||
| blog_ids = "("+@user.blog.id.to_s+")" | |||
| else | |||
| blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" | |||
| end | |||
| sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + | |||
| "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ | |||
| "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + | |||
| "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})" | |||
| if container_type != 'all' && User.current != @user | |||
| sql = "user_id = #{@user.id} and(" + sql + ")" | |||
| end | |||
| end | |||
| @user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count | |||
| @user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10) | |||
| @type = params[:type] | |||
| end | |||
| # @user_projects = @user.projects.order("updated_on desc") | |||
| messages_all = @user.project_relate_messages | |||
| @limit = 20 | |||
| @message_count = messages_all.count | |||
| # REDO:已删除的内容应该在页面中显示不点击 | |||
| @message_all_pages = Paginator.new @message_count, @limit, params['page'] || 1 | |||
| @offset ||= @message_all_pages.offset | |||
| @message_alls = messages_all | |||
| @message_alls = paginateHelper @message_alls, @limit | |||
| respond_to do |format| | |||
| format.js | |||
| format.html {render :layout => 'new_base_user'} | |||
| end | |||
| end | |||
| # #以前的用户show页面,暂时不删除 | |||
| # def show | |||
| # @user_projects = @user.projects.order("updated_on desc") | |||
| # if User.current == @user | |||
| # # 点击小铃铛,更新点击时间 | |||
| # update_onclick_time if params[:click_user_message] == 'true' | |||
| # # 全部设为已读 | |||
| # # 自己的主页显示消息 | |||
| # messages_all = MessageAll.where(:user_id => @user.id) | |||
| # @limit = 20 | |||
| # | |||
| # @message_count = messages_all.count | |||
| # # REDO:已删除的内容应该在页面中显示不点击 | |||
| # @message_all_pages = Paginator.new @message_count, @limit, params['page'] || 1 | |||
| # @offset ||= @message_all_pages.offset | |||
| # @message_alls = messages_all.includes(:message).reorder("#{MessageAll.table_name}.created_at desc") | |||
| # @message_alls = paginateHelper @message_alls, @limit | |||
| # | |||
| # @unsolved_issues_count = Issue.where(:assigned_to_id => @user.id, :status_id => [1, 2, 4, 6]).includes(:author, :project).count | |||
| # | |||
| # my_course_ids = StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").blank? ? "(-1)" : "(" + StudentsForCourse.includes(:course). | |||
| # where("student_id = #{@user.id} and courses.is_delete = 0").map{|sc| sc.course_id}.join(",") + ")" | |||
| # # 用户待完成的作业 | |||
| # homeworks = HomeworkCommon.where("course_id in #{my_course_ids} and publish_time <= '#{Time.now}'") | |||
| # homework_ids = homeworks.blank? ? "(-1)" : "(" + homeworks.map{|homework| homework.id}.join(",") + ")" | |||
| # student_works = StudentWork.where("user_id = #{@user.id} and homework_common_id in #{homework_ids} and work_status != 0") | |||
| # @unfinished_homework_count = homeworks.count - student_works.count | |||
| # # 用户待完成的测验 | |||
| # exercises = Exercise.where("course_id in #{my_course_ids} and exercise_status = 2") | |||
| # exercise_users = ExerciseUser.where(:user_id => @user.id, :exercise_id => exercises.map{|ex| ex.id}) | |||
| # @unfinished_test_count = exercises.count - exercise_users.count | |||
| # # 用户待完成的问卷 | |||
| # polls = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2") | |||
| # poll_users = PollUser.where(:user_id => @user.id, :poll_id => polls.map{|poll| poll.id}) | |||
| # @unfinished_poll_count = polls.count - poll_users.count | |||
| # # 用户待匿评的作品 | |||
| # homeworks = HomeworkCommon.includes(:homework_detail_manual).where("homework_commons.course_id in #{my_course_ids} and homework_detail_manuals.comment_status = 2") | |||
| # student_work_scores = @user.student_works_scores.where("reviewer_role = 3") | |||
| # anonymous_evaluation_ids = student_work_scores.blank? ? "(-1)" : "(" + student_work_scores.map{|st| st.student_work_id}.join(",") + ")" | |||
| # unfinished_evaluations = @user.student_works_evaluation_distributions.where("student_work_id not in #{anonymous_evaluation_ids}") | |||
| # @anonymous_evaluation_count = StudentWork.where(:id => unfinished_evaluations.map{|ev| ev.student_work_id}, :homework_common_id => homeworks.map{|hw| hw.id}).count | |||
| # # 待评阅的作业 暂不做 | |||
| # # @unreview_homework = 1 | |||
| # | |||
| # # 待审批的申请 | |||
| # #applied_message_count = AppliedMessage.where(:applied_type => ["Organization", "AppliedContest", "StudentWorksScoresAppeal", "AppliedProject", "ApplyAddSchools"], :user_id => User.current.id, :status => 0).count | |||
| # #applied_course_message_count = CourseMessage.where(:user_id => User.current.id, :course_message_type => "JoinCourseRequest", :status => 0).count | |||
| # # applied_pull_request_message_count = ForgeMessage.where(:user_id => User.current.id, :forge_message_type => "PullRequest", :status => [1,3]).count | |||
| # # @applied_message_alls_count = applied_message_count + applied_course_message_count + applied_pull_request_message_count | |||
| # user_id = User.current.id | |||
| # sql = "SELECT * FROM `message_alls` ma left join `forge_messages` fm on ma.message_id=fm.id | |||
| # left join `course_messages` cm on ma.message_id=cm.id left join `applied_messages` apm on ma.message_id=apm.id | |||
| # where (ma.user_id =#{user_id} and ma.message_type = 'ForgeMessage' and fm.forge_message_type='PullRequest' and fm.status=0 and fm.user_id=#{user_id} ) or | |||
| # (ma.user_id=#{user_id} and ma.message_type='AppliedMessage' and apm.applied_type in ('Organization', 'AppliedContest', 'StudentWorksScoresAppeal', 'AppliedProject', 'ApplyAddSchools') and apm.user_id =#{user_id} and apm.status =0 ) or | |||
| # (ma.user_id=#{user_id} and ma.message_type='CourseMessage' and cm.course_message_type='JoinCourseRequest' and cm.status=0 and cm.user_id=#{user_id} );" | |||
| # message_alls = MessageAll.find_by_sql(sql) | |||
| # @applied_message_alls_count = message_alls.count | |||
| # else | |||
| # # 看别人的主页显示动态 | |||
| # #更新用户申请成为课程老师或教辅消息的状态 | |||
| # if params[:course_id] != nil | |||
| # join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", | |||
| # params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false) | |||
| # join_course_messages.update_all(:viewed => true) | |||
| # end | |||
| # shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) | |||
| # shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) | |||
| # @page = params[:page] ? params[:page].to_i + 1 : 0 | |||
| # user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" | |||
| # user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" | |||
| # course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')" | |||
| # project_types = "('Message','Issue','Project')" | |||
| # principal_types = "JournalsForMessage" | |||
| # container_type = '' | |||
| # act_type = '' | |||
| # # 他的动态 | |||
| # sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))" | |||
| # if params[:type].present? | |||
| # case params[:type] | |||
| # when "course_homework" | |||
| # container_type = 'Course' | |||
| # act_type = 'HomeworkCommon' | |||
| # when "course_news" | |||
| # container_type = 'Course' | |||
| # act_type = 'News' | |||
| # when "course_message" | |||
| # container_type = 'Course' | |||
| # act_type = 'Message' | |||
| # when "course_poll" | |||
| # container_type = 'Course' | |||
| # act_type = 'Poll' | |||
| # when "course_journals" | |||
| # container_type = 'Course' | |||
| # act_type = 'JournalsForMessage' | |||
| # when "project_issue" | |||
| # container_type = 'Project' | |||
| # act_type = 'Issue' | |||
| # when "project_message" | |||
| # container_type = 'Project' | |||
| # act_type = 'Message' | |||
| # when "user_journals" | |||
| # container_type = 'Principal' | |||
| # act_type = 'JournalsForMessage' | |||
| # when "current_user" | |||
| # container_type = 'Principal' | |||
| # act_type = 'Principal' | |||
| # when "all" | |||
| # container_type = 'all' | |||
| # act_type = 'all' | |||
| # end | |||
| # end | |||
| # if container_type != '' && container_type != 'all' | |||
| # if container_type == 'Course' | |||
| # sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'" | |||
| # elsif container_type == 'Project' | |||
| # sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'" | |||
| # elsif container_type == 'Principal' && act_type == 'JournalsForMessage' | |||
| # sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}" | |||
| # elsif container_type == 'Principal' && act_type == 'Principal' | |||
| # sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))" | |||
| # end | |||
| # if User.current != @user | |||
| # sql += " and user_id = #{@user.id}" | |||
| # end | |||
| # else | |||
| # if User.current != @user | |||
| # blog_ids = "("+@user.blog.id.to_s+")" | |||
| # else | |||
| # blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" | |||
| # end | |||
| # sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + | |||
| # "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ | |||
| # "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + | |||
| # "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})" | |||
| # if container_type != 'all' && User.current != @user | |||
| # sql = "user_id = #{@user.id} and(" + sql + ")" | |||
| # end | |||
| # end | |||
| # @user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count | |||
| # @user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10) | |||
| # @type = params[:type] | |||
| # end | |||
| # respond_to do |format| | |||
| # format.js | |||
| # format.html {render :layout => 'new_base_user'} | |||
| # # format.html {render :layout => 'base'} | |||
| # | |||
| # end | |||
| # end | |||
| # 待解决的Issue | |||
| def unsolved_issues_list | |||
| @unsolved_issues = Issue.where(:assigned_to_id => @user.id, :status_id => [1, 2, 4, 6]).includes(:author, :project).order("updated_on desc") | |||
| @undo_show_type = 1 | |||
| @unsolved_issues = @user.user_unsolve_issues | |||
| @unsolved_issues_count = @unsolved_issues.count | |||
| @message_count = @user.user_unsolve_messages.count | |||
| @limit = 20 | |||
| @is_remote = true | |||
| @unsolved_issues_pages = Paginator.new @unsolved_issues_count, @limit, params['page'] || 1 | |||
| @@ -2250,20 +2219,28 @@ class UsersController < ApplicationController | |||
| end | |||
| end | |||
| # 待审批的申请 | |||
| # 待审批的消息一般不多,可以特殊处理 | |||
| def unapproval_applied_list | |||
| @undo_show_type = 6 | |||
| @message_alls = @user.user_unsolve_messages | |||
| @message_count = @message_alls.count | |||
| @unsolved_issues_count = @user.user_unsolve_issues.count | |||
| @message_alls = paginateHelper @message_alls, 20 | |||
| respond_to do |format| | |||
| format.js | |||
| end | |||
| end | |||
| # 待完成的作业 | |||
| def unfinished_homework_list | |||
| my_course_ids = StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").blank? ? "(-1)" : "(" + StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").map{|sc| sc.course_id}.join(",") + ")" | |||
| homeworks = HomeworkCommon.where("course_id in #{my_course_ids} and publish_time <= '#{Time.now}'") | |||
| homework_ids = homeworks.blank? ? "(-1)" : "(" + homeworks.map{|homework| homework.id}.join(",") + ")" | |||
| student_works = StudentWork.where("user_id = #{@user.id} and homework_common_id in #{homework_ids} and work_status != 0") | |||
| finished_works_id = student_works.blank? ? "(-1)" : "(" + student_works.map{ |sw| sw.homework_common_id.to_i }.join(",") + ")" | |||
| @unfinished_homeworks = HomeworkCommon.where("course_id in #{my_course_ids} and publish_time <= '#{Time.now}' and id not in #{finished_works_id}").order("updated_at desc") | |||
| @unfinished_homeworks_count = @unfinished_homeworks.count | |||
| @undo_show_type = 2 | |||
| @unfinished_homeworks = @user.user_undo_homeworks | |||
| @unfinished_homeworks_count = @unfinished_homeworks.size | |||
| @limit = 20 | |||
| @unfinished_homework_pages = Paginator.new @unfinished_homeworks_count, @limit, params['page'] || 1 | |||
| @offset ||= @unfinished_homework_pages.offset | |||
| @unfinished_homeworks = paginateHelper @unfinished_homeworks, @limit | |||
| respond_to do |format| | |||
| format.js | |||
| end | |||
| @@ -2271,12 +2248,8 @@ class UsersController < ApplicationController | |||
| # 待完成的测验 | |||
| def unfinished_test_list | |||
| my_course_ids = StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").blank? ? "(-1)" : "(" + StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").map{|sc| sc.course_id}.join(",") + ")" | |||
| exercises = Exercise.where("course_id in #{my_course_ids} and exercise_status = 2") | |||
| exercise_ids = exercises.blank? ? "(-1)" : "(" + exercises.map{|ex| ex.id}.join(",") + ")" | |||
| exercise_users = ExerciseUser.where("user_id = #{@user.id} and exercise_id in #{exercise_ids}") | |||
| finished_test_ids = exercise_users.blank? ? "(-1)" : "(" + exercise_users.map{|eu| eu.exercise_id }.join(",") + ")" | |||
| @unfinished_test = Exercise.where("course_id in #{my_course_ids} and exercise_status = 2 and id not in #{finished_test_ids}") | |||
| @undo_show_type = 3 | |||
| @unfinished_test = @user.user_undo_tests | |||
| @unfinished_test_count = @unfinished_test.count | |||
| @limit = 20 | |||
| @unfinished_test_pages = Paginator.new @unfinished_test_count, @limit, params['page'] || 1 | |||
| @@ -2289,12 +2262,14 @@ class UsersController < ApplicationController | |||
| # 待完成的问卷 | |||
| def unfinished_poll_list | |||
| my_course_ids = StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").blank? ? "(-1)" : "(" + StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").map{|sc| sc.course_id}.join(",") + ")" | |||
| polls = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2") | |||
| poll_ids = polls.blank? ? "(-1)" : "(" + polls.map{|poll| poll.id}.join(",") + ")" | |||
| poll_users = PollUser.where("user_id = #{@user.id} and poll_id in #{poll_ids}") | |||
| finished_poll_ids = poll_users.blank? ? "(-1)" : "(" + poll_users.map{|pu| pu.poll_id }.join(",") + ")" | |||
| @unfinished_poll = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2 and id not in #{finished_poll_ids}").order("updated_at desc") | |||
| @undo_show_type = 4 | |||
| # my_course_ids = StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").blank? ? "(-1)" : "(" + StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").map{|sc| sc.course_id}.join(",") + ")" | |||
| # polls = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2") | |||
| # poll_ids = polls.blank? ? "(-1)" : "(" + polls.map{|poll| poll.id}.join(",") + ")" | |||
| # poll_users = PollUser.where("user_id = #{@user.id} and poll_id in #{poll_ids}") | |||
| # finished_poll_ids = poll_users.blank? ? "(-1)" : "(" + poll_users.map{|pu| pu.poll_id }.join(",") + ")" | |||
| # @unfinished_poll = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2 and id not in #{finished_poll_ids}").order("updated_at desc") | |||
| @unfinished_poll = @user.user_undo_polls | |||
| @unfinished_poll_count = @unfinished_poll.count | |||
| @limit = 20 | |||
| @unfinished_poll_pages = Paginator.new @unfinished_poll_count, @limit, params['page'] || 1 | |||
| @@ -2307,16 +2282,20 @@ class UsersController < ApplicationController | |||
| # 待匿评的作业 | |||
| def anonymous_evaluation_list | |||
| my_course_ids = StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").blank? ? "(-1)" : "(" + StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").map{|sc| sc.course_id}.join(",") + ")" | |||
| homeworks = HomeworkCommon.includes(:homework_detail_manual).where("homework_commons.course_id in #{my_course_ids} and homework_detail_manuals.comment_status in (1,2)") | |||
| homework_ids = homeworks.blank? ? "(-1)" : "(" + homeworks.map{|homework| homework.id}.join(",") + ")" | |||
| student_work_scores = @user.student_works_scores.where("reviewer_role = 3") | |||
| anonymous_evaluation_ids = student_work_scores.blank? ? "(-1)" : "(" + student_work_scores.map{|st| st.student_work_id}.join(",") + ")" | |||
| unfinished_evaluations = @user.student_works_evaluation_distributions.where("student_work_id not in #{anonymous_evaluation_ids}") | |||
| unfinished_evaluations_work_ids = unfinished_evaluations.blank? ? "(-1)" : "(" + unfinished_evaluations.map{|st| st.student_work_id}.join(",") + ")" | |||
| @anonymous_evaluation_count = StudentWork.where("student_works.id in #{unfinished_evaluations_work_ids} and homework_common_id in #{homework_ids}").count | |||
| homework_ids = StudentWork.where("id in #{unfinished_evaluations_work_ids} and homework_common_id in #{homework_ids}").blank? ? "(-1)" : "(" + StudentWork.where("id in #{unfinished_evaluations_work_ids} and homework_common_id in #{homework_ids}").map{|st| st.homework_common_id}.join(",") + ")" | |||
| @anonymous_evaluation = HomeworkCommon.where("homework_commons.id in #{homework_ids}") | |||
| @undo_show_type = 5 | |||
| # my_course_ids = StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").blank? ? "(-1)" : "(" + StudentsForCourse.includes(:course).where("student_id = #{@user.id} and courses.is_delete = 0").map{|sc| sc.course_id}.join(",") + ")" | |||
| # homeworks = HomeworkCommon.includes(:homework_detail_manual).where("homework_commons.course_id in #{my_course_ids} and homework_detail_manuals.comment_status in (1,2)") | |||
| # homework_ids = homeworks.blank? ? "(-1)" : "(" + homeworks.map{|homework| homework.id}.join(",") + ")" | |||
| # student_work_scores = @user.student_works_scores.where("reviewer_role = 3") | |||
| # anonymous_evaluation_ids = student_work_scores.blank? ? "(-1)" : "(" + student_work_scores.map{|st| st.student_work_id}.join(",") + ")" | |||
| # unfinished_evaluations = @user.student_works_evaluation_distributions.where("student_work_id not in #{anonymous_evaluation_ids}") | |||
| # unfinished_evaluations_work_ids = unfinished_evaluations.blank? ? "(-1)" : "(" + unfinished_evaluations.map{|st| st.student_work_id}.join(",") + ")" | |||
| # @anonymous_evaluation_count = StudentWork.where("student_works.id in #{unfinished_evaluations_work_ids} and homework_common_id in #{homework_ids}").count | |||
| # homework_ids = StudentWork.where("id in #{unfinished_evaluations_work_ids} and homework_common_id in #{homework_ids}").blank? ? "(-1)" : "(" + StudentWork.where("id in #{unfinished_evaluations_work_ids} and homework_common_id in #{homework_ids}").map{|st| st.homework_common_id}.join(",") + ")" | |||
| # | |||
| # @anonymous_evaluation = HomeworkCommon.where("homework_commons.id in #{homework_ids}") | |||
| @anonymous_evaluation = @user.user_undo_anonymous | |||
| @anonymous_evaluation_count = @anonymous_evaluation.size | |||
| @limit = 20 | |||
| @anonymous_evaluation_pages = Paginator.new @anonymous_evaluation.count, @limit, params['page'] || 1 | |||
| @offset ||= @anonymous_evaluation_pages.offset | |||
| @@ -2326,22 +2305,7 @@ class UsersController < ApplicationController | |||
| end | |||
| end | |||
| # 待审批的申请 | |||
| # 待审批的消息一般不多,可以特殊处理 | |||
| def unapproval_applied_list | |||
| user_id = User.current.id | |||
| sql = "SELECT * FROM `message_alls` ma left join `forge_messages` fm on ma.message_id=fm.id | |||
| left join `course_messages` cm on ma.message_id=cm.id left join `applied_messages` apm on ma.message_id=apm.id | |||
| where (ma.user_id =#{user_id} and ma.message_type = 'ForgeMessage' and fm.forge_message_type='PullRequest' and fm.status=0 and fm.user_id=#{user_id} ) or | |||
| (ma.user_id=#{user_id} and ma.message_type='AppliedMessage' and apm.applied_type in ('Organization', 'AppliedContest', 'StudentWorksScoresAppeal', 'AppliedProject', 'ApplyAddSchools') and apm.user_id =#{user_id} and apm.status =0 ) or | |||
| (ma.user_id=#{user_id} and ma.message_type='CourseMessage' and cm.course_message_type='JoinCourseRequest' and cm.status=0 and cm.user_id=#{user_id}) order by ma.created_at desc;" | |||
| @message_alls = MessageAll.find_by_sql(sql) | |||
| @message_count = @message_alls.count | |||
| @message_alls = paginateHelper @message_alls, 20 | |||
| respond_to do |format| | |||
| format.js | |||
| end | |||
| end | |||
| # 课程社区 | |||
| def course_community | |||
| @@ -2674,7 +2638,7 @@ class UsersController < ApplicationController | |||
| #Modified by nie | |||
| unless User.current.admin? | |||
| if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?) | |||
| # redirect_to home_path | |||
| # redirect_to homes_path | |||
| render_404 | |||
| return | |||
| end | |||
| @@ -4,9 +4,27 @@ class WebFooterCompaniesController < ApplicationController | |||
| menu_item :plugins, :only => :plugins | |||
| menu_item :info, :only => :info | |||
| before_filter :require_admin | |||
| before_filter :find_company, :except => [:index, :new, :create] | |||
| def index | |||
| @companys = WebFooterCompany.all | |||
| @key = params[:key] || 'opensource' | |||
| scope = | |||
| case @key | |||
| when 'partner' | |||
| WebFooterCompany.partners | |||
| when 'dedicator' | |||
| WebFooterCompany.dedicators | |||
| when 'opensource' | |||
| WebFooterCompany.opensources | |||
| end | |||
| @companies = paginateHelper scope, 25 | |||
| @page = (params['page'] || 1).to_i - 1 | |||
| respond_to do |format| | |||
| format.js | |||
| format.html | |||
| end | |||
| end | |||
| def new | |||
| @@ -15,38 +33,50 @@ class WebFooterCompaniesController < ApplicationController | |||
| def create | |||
| @company = WebFooterCompany.new(params[:web_footer_company]) | |||
| if @company.save | |||
| @key = params[:web_footer_company][:key] | |||
| if @company.save! | |||
| flash[:notice] = l(:notice_successful_create) | |||
| redirect_to web_footer_companies_url | |||
| redirect_to web_footer_companies_url(key: @key) | |||
| else | |||
| flash[:error] = "#{l :web_footer_company_create_fail}: #{@company.errors.full_messages[0]}" | |||
| respond_to do |format| | |||
| format.html { render :action => 'new'} | |||
| format.html { redirect_to new_web_footer_company_path(key: @key) } | |||
| format.api { render_validation_errors(@company) } | |||
| end | |||
| end | |||
| end | |||
| def move | |||
| if request.put? and @company.update_attributes(params[:company]) | |||
| flash[:notice] = l(:notice_successful_update) | |||
| redirect_to web_footer_companies_url(type: @type) | |||
| else | |||
| render :action => 'edit' | |||
| end | |||
| end | |||
| def destroy | |||
| @company = WebFooterCompany.find(params[:id]) | |||
| @company.destroy | |||
| redirect_to web_footer_companies_url | |||
| redirect_to web_footer_companies_url(type: @type) | |||
| end | |||
| def edit | |||
| @company = WebFooterCompany.find(params[:id]) | |||
| end | |||
| def update | |||
| @company = WebFooterCompany.find(params[:id]) | |||
| if @company.update_attributes(params[:web_footer_company]) | |||
| flash[:notice] = l(:notice_successful_update) | |||
| redirect_to web_footer_companies_url | |||
| redirect_to web_footer_companies_url(type: @type) | |||
| else | |||
| flash[:error] = "#{l :web_footer_company_update_fail}: #{@company.errors.full_messages[0]}" | |||
| render :action => 'edit' | |||
| end | |||
| end | |||
| private | |||
| def find_company | |||
| @company = WebFooterCompany.find(params[:id]) | |||
| end | |||
| end | |||
| @@ -24,4 +24,8 @@ module AdminHelper | |||
| [l(:project_status_closed), '5'], | |||
| [l(:project_status_archived), '9']], selected.to_s) | |||
| end | |||
| def dynamic_news_category_options_for_select(selected) | |||
| options_for_select(Category.all.collect{|item| [item.name, item.id]}.insert(0, ['全部', 0]), selected) | |||
| end | |||
| end | |||
| @@ -0,0 +1,2 @@ | |||
| module DynamicNewHelper | |||
| end | |||
| @@ -0,0 +1,31 @@ | |||
| module HomesHelper | |||
| def home_cover_tag(home) | |||
| file_path = home&.cover&.file.nil? ? "/images/introduce/activeBanner.jpg": local_path(home.cover.file) | |||
| image_tag(file_path, class: 'mb30', width: '592px') | |||
| end | |||
| def home_banner_tag(banner) | |||
| image_tag local_path(banner.file) | |||
| end | |||
| def default_banner_tag(home) | |||
| return unless home.banners.size == 0 | |||
| content_tag :a do | |||
| image_tag "/images/introduce/trustie.jpg" | |||
| end | |||
| end | |||
| def local_path(file) | |||
| File.join("/files/uploads/image", file.disk_directory, file.disk_filename) | |||
| end | |||
| def render_pool_name poll | |||
| case poll | |||
| when 'opensource' then '合作共建开源' | |||
| when 'partner' then '合作机构' | |||
| when 'dedicator' then '技术合作单位' | |||
| end | |||
| end | |||
| end | |||
| @@ -0,0 +1,2 @@ | |||
| module PrivateMessagesHelper | |||
| end | |||
| @@ -30,7 +30,7 @@ module UsersHelper | |||
| end | |||
| def task_count(unsolved_issues_count, unfinished_homework_count, unfinished_test_count, unfinished_poll_count, anonymous_evaluation_count, unapproval_homework) | |||
| result = unsolved_issues_count + unfinished_homework_count + unfinished_test_count + unfinished_poll_count + anonymous_evaluation_count + unapproval_homework | |||
| result = unsolved_issues_count.to_i + unfinished_homework_count.to_i + unfinished_test_count.to_i + unfinished_poll_count.to_i + anonymous_evaluation_count.to_i + unapproval_homework.to_i | |||
| end | |||
| # 判断某个时间再多少天前 | |||
| @@ -132,13 +132,13 @@ module UsersHelper | |||
| def pull_request_message_status ma | |||
| case ma.status | |||
| when 1 | |||
| "创建了PullRequest:" | |||
| "创建了PullRequest" | |||
| when 2 | |||
| "接受了PullRequest:" | |||
| "接受了PullRequest" | |||
| when 3 | |||
| "重新打开了PullRequest:" | |||
| "重新打开了PullRequest" | |||
| when 4 | |||
| "关闭了PullRequest:" | |||
| "关闭了PullRequest" | |||
| end | |||
| end | |||
| @@ -169,11 +169,11 @@ module UsersHelper | |||
| def applied_project_tip applied_message | |||
| case applied_message.status | |||
| when 4 | |||
| "拒绝申请加入:" | |||
| "拒绝申请加入" | |||
| when 5,3,2,1,7 | |||
| "申请加入:" | |||
| "申请加入" | |||
| when 6 | |||
| "同意申请加入:" | |||
| "同意申请加入" | |||
| end | |||
| end | |||
| @@ -187,9 +187,9 @@ module UsersHelper | |||
| def applied_school_tip applied_message | |||
| case applied_message.status | |||
| when 1,2,3 | |||
| "您添加新的单位:" | |||
| "您添加新的单位" | |||
| when 0 | |||
| "申请了单位:" | |||
| "申请了单位" | |||
| end | |||
| end | |||
| @@ -202,7 +202,7 @@ module UsersHelper | |||
| when 4 | |||
| "婉拒您" | |||
| when 5,3,2,1,7 | |||
| "申请:" | |||
| "申请" | |||
| when 6 | |||
| "同意您" | |||
| end | |||
| @@ -0,0 +1,21 @@ | |||
| module WebFooterCompaniesHelper | |||
| def label_new_button_name type | |||
| (@type == WebFooterCompany::RELATION_TYPE[1]) ? l(:label_new_open_source_company) : l(:label_new_company) | |||
| end | |||
| def label_title_name type | |||
| (@type == WebFooterCompany::RELATION_TYPE[1]) ? l(:label_web_footer_open_source_compnay) : l(:label_web_footer_cooperation_compnay) | |||
| end | |||
| def label_root_name type | |||
| (@type == WebFooterCompany::RELATION_TYPE[1]) ? l(:label_open_source_compnay) : l(:label_cooperation_compnay) | |||
| end | |||
| def label_edit_button_name type | |||
| (@type == WebFooterCompany::RELATION_TYPE[1]) ? l(:label_new_open_source_company) : l(:label_edit_company) | |||
| end | |||
| def hash_company_types | |||
| { "首页合作共建开源" => "opensource", "首页技术合作单位" => "dedicator", "网站页脚合作单位" => "partner" } | |||
| end | |||
| end | |||
| @@ -0,0 +1,3 @@ | |||
| class Banner < ActiveRecord::Base | |||
| has_one :file, :as => :container, :class_name => 'Attachment', dependent: :destroy | |||
| end | |||
| @@ -0,0 +1,3 @@ | |||
| class Category < ActiveRecord::Base | |||
| has_many :dynamic_news | |||
| end | |||
| @@ -0,0 +1,5 @@ | |||
| class Cover < ActiveRecord::Base | |||
| belongs_to :coverable, polymorphic: true | |||
| has_one :file, :as => :container, :class_name => 'Attachment', dependent: :destroy | |||
| end | |||
| @@ -0,0 +1,14 @@ | |||
| class DynamicNew < ActiveRecord::Base | |||
| PLATFORMS = %w(educoder trusite ihub gcc openi toschina military jiaotong_university) | |||
| belongs_to :category | |||
| validates_presence_of :title, :simple_intruduce, :category_id | |||
| scope :desc, -> { order('id desc') } | |||
| scope :like, ->(q) { where("title LIKE ?", "#{q.to_s.strip.downcase}") unless q.blank? } | |||
| scope :by_category, ->(category_id) { where(category_id: category_id) } | |||
| def cover_url | |||
| cover_remote_url || "/images/dynamic_new/default.png" | |||
| end | |||
| end | |||
| @@ -0,0 +1,26 @@ | |||
| class Home < ActiveRecord::Base | |||
| SHOW_CONTENT_LENGTH = 400 | |||
| REG_URL_FORMAT = /(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?/ | |||
| has_one :cover, as: :coverable, dependent: :destroy | |||
| has_many :banners, dependent: :destroy | |||
| # validates_presence_of :name, :content, :frendly_id | |||
| # validates_format_of :friendly_id, :with => /\A[a-z0-9\-]+\z/ | |||
| # before_validation :generate_friendly_id, :on => :create | |||
| validates_presence_of :name, :content | |||
| def more_content? | |||
| content.html_safe.length > Home::SHOW_CONTENT_LENGTH | |||
| end | |||
| def to_param | |||
| self.frendly_id | |||
| end | |||
| private | |||
| def generate_friendly_id | |||
| self.frendly_id ||= SecureRandom.uuid | |||
| end | |||
| end | |||
| @@ -0,0 +1,13 @@ | |||
| class PrivateMessage < ActiveRecord::Base | |||
| # 私信 | |||
| belongs_to :user | |||
| belongs_to :target, class_name: "User" | |||
| belongs_to :sender, class_name: "User" | |||
| belongs_to :receiver, class_name: "User" | |||
| #status 0表示未读,1表示已读,2表示已删除 | |||
| scope :without_deleted, -> { where("status != 2") } | |||
| scope :only_unread, -> { where(status: 0) } | |||
| end | |||
| @@ -90,7 +90,7 @@ class Project < ActiveRecord::Base | |||
| # end | |||
| #ADDED BY NIE | |||
| has_one :project_score, :dependent => :destroy | |||
| has_many :project_infos, :dependent => :destroy | |||
| has_many :project_infos, :dependent => :destroy | |||
| has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy | |||
| has_many :user_grades, :class_name => "UserGrade", :dependent => :destroy | |||
| #end | |||
| @@ -106,7 +106,7 @@ class Project < ActiveRecord::Base | |||
| :order => "#{CustomField.table_name}.position", | |||
| :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", | |||
| :association_foreign_key => 'custom_field_id' | |||
| has_many :tags, :through => :project_tags, :class_name => 'Tag' | |||
| has_many :project_tags, :class_name => 'ProjectTags' | |||
| # 动态级联删除 | |||
| @@ -131,11 +131,11 @@ class Project < ActiveRecord::Base | |||
| :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o}}, | |||
| :author => nil | |||
| ############################added by william | |||
| acts_as_taggable | |||
| acts_as_taggable | |||
| scope :by_join_date, order("created_on DESC") | |||
| ###################added by liuping 关注 | |||
| acts_as_watchable | |||
| acts_as_watchable | |||
| attr_protected :status | |||
| validates_presence_of :name, :identifier | |||
| @@ -157,7 +157,7 @@ class Project < ActiveRecord::Base | |||
| #ActiveModel::Dirty 这里有一个changed方法。对任何对象都可以用 | |||
| after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?} | |||
| # 创建project之后默认创建一个board,之后的board去掉了board的概念 | |||
| after_create :create_board_sync,:acts_as_forge_activities, :create_project_ealasticsearch_index | |||
| after_create :create_board_sync,:acts_as_forge_activities, :create_project_ealasticsearch_index, :sync_projects_count_to_home | |||
| before_destroy :delete_all_members,:delete_project_ealasticsearch_index | |||
| after_update :update_project_ealasticsearch_index | |||
| @@ -173,7 +173,7 @@ class Project < ActiveRecord::Base | |||
| scope :status, lambda {|arg| where(arg.blank? ? nil : {:status => arg.to_i}) } | |||
| scope :all_public, lambda { where(:is_public => true) } | |||
| scope :visible, lambda {|*args| where(Project.visible_condition(args.shift || User.current, *args)) } | |||
| scope :allowed_to, lambda {|*args| | |||
| scope :allowed_to, lambda {|*args| | |||
| user = User.current | |||
| permission = nil | |||
| if args.first.is_a?(Symbol) | |||
| @@ -223,6 +223,10 @@ class Project < ActiveRecord::Base | |||
| ) | |||
| end | |||
| def sync_projects_count_to_home | |||
| HomesService.new.sync_count('project', 1) | |||
| end | |||
| # 判断项目是否为实训项目 | |||
| def is_training_project? | |||
| (!self.enabled_modules.where("name = 'training_tasks'").empty? && self.training_status == 1) ? true : false | |||
| @@ -265,7 +269,7 @@ class Project < ActiveRecord::Base | |||
| pjfm.save | |||
| pjfm | |||
| end | |||
| def self.add_new_jour(user, notes, id, options={}) | |||
| project = Project.find(id) | |||
| if options.count == 0 | |||
| @@ -844,7 +848,7 @@ class Project < ActiveRecord::Base | |||
| 'attachmenttype', | |||
| 'enterprise_name', | |||
| 'gpid' | |||
| safe_attributes 'enabled_module_names', | |||
| @@ -1225,7 +1229,7 @@ class Project < ActiveRecord::Base | |||
| def update_position_under_parent | |||
| set_or_update_position_under(parent) | |||
| end | |||
| def course | |||
| @course | |||
| end | |||
| @@ -1258,7 +1262,7 @@ class Project < ActiveRecord::Base | |||
| def create_board_sync | |||
| @board = self.boards.build | |||
| @board.name = " #{l(:label_borad_project) }" | |||
| @board.description = self.name.to_s | |||
| @board.description = self.name.to_s | |||
| if @board.save | |||
| logger.debug "[Project Model] ===> #{@board.to_json}" | |||
| else | |||
| @@ -1310,4 +1314,3 @@ class Project < ActiveRecord::Base | |||
| end | |||
| #Project.where('is_public = 1').import :force=>true | |||
| @@ -1,9 +1,15 @@ | |||
| class School < ActiveRecord::Base | |||
| attr_accessible :name, :province,:pinyin | |||
| after_create :sync_schools_count_to_home | |||
| has_many :courses | |||
| def to_s | |||
| self.name.to_s | |||
| end | |||
| def sync_schools_count_to_home | |||
| HomesService.new.sync_count('school', 1) | |||
| end | |||
| end | |||
| @@ -22,7 +22,7 @@ class User < Principal | |||
| STUDENT = 1 | |||
| ENTERPRISE = 2 | |||
| DEVELOPER = 3 | |||
| include Redmine::SafeAttributes | |||
| seems_rateable_rater | |||
| #elasticsearch | |||
| @@ -137,12 +137,16 @@ class User < Principal | |||
| has_many :versions, :dependent => :destroy | |||
| has_many :organizations, :through => :org_members | |||
| # belongs_to :ucourse, :class_name => 'Course', :foreign_key => :id #huang | |||
| ## added by xianbo for delete | |||
| ## added by xianbo for delete | |||
| # has_many :biding_projects, :dependent => :destroy | |||
| belongs_to :softapplication, :foreign_key => 'id', :dependent => :destroy | |||
| ##ended by xianbo | |||
| #####fq | |||
| # 新版私信 | |||
| has_many :private_messages, dependent: :destroy | |||
| has_many :recent_contacts, through: :private_messages, source: :target | |||
| has_many :jours, :class_name => 'JournalsForMessage', :dependent => :destroy | |||
| has_many :journals_messages, :class_name => 'JournalsForMessage', :foreign_key => "user_id", :dependent => :destroy | |||
| # has_many :bids, :foreign_key => 'author_id', :dependent => :destroy | |||
| @@ -206,15 +210,15 @@ class User < Principal | |||
| scope :visible, lambda {|*args| | |||
| nil | |||
| } | |||
| acts_as_attachable :view_permission => :view_files, | |||
| :delete_permission => :manage_files | |||
| acts_as_customizable | |||
| ############################added by william | |||
| acts_as_taggable | |||
| acts_as_taggable | |||
| scope :by_join_date, order("created_on DESC") | |||
| ############################# added by liuping 关注 | |||
| acts_as_watchable | |||
| acts_as_watchable | |||
| has_one :user_extensions,:dependent => :destroy | |||
| has_one :homepage, :dependent => :destroy | |||
| @@ -262,7 +266,7 @@ class User < Principal | |||
| before_save :update_hashed_password | |||
| before_destroy :remove_references_before_destroy,:delete_user_ealasticsearch_index | |||
| # added by fq | |||
| after_create :add_onclick_time, :act_as_principal_activity,:create_user_ealasticsearch_index,:add_new_jour | |||
| after_create :add_onclick_time, :act_as_principal_activity,:create_user_ealasticsearch_index,:add_new_jour, :sync_to_home | |||
| # end | |||
| # 更新邮箱用户或用户名的同事,同步更新邀请信息 | |||
| after_update :update_user_ealasticsearch_index | |||
| @@ -324,6 +328,11 @@ class User < Principal | |||
| ) | |||
| end | |||
| # 同步新增首页的社区用户量 | |||
| def sync_to_home | |||
| HomesService.new.sync_count('user', 1) | |||
| end | |||
| # ====================================================================== | |||
| def my_workplace | |||
| self.user_extensions.try(:occupation).to_s | |||
| @@ -336,6 +345,24 @@ class User < Principal | |||
| (self.login.to_i.to_s == self.login || self.login.include?(".") || self.login.include?("%") || self.login.include?("?")) ? id : login | |||
| end | |||
| def check_user_him(user_id) | |||
| if id == user_id | |||
| "我" | |||
| else | |||
| "TA" | |||
| end | |||
| end | |||
| def get_user_contact_messages(user_id) | |||
| private_messages.where(target_id: user_id).size | |||
| end | |||
| #判断是否可以点击项目或issue | |||
| def user_can_see_project(target) | |||
| return false if target.blank? | |||
| self.admin? || target.is_public || target.user_id == id || User.current.member_of?(target) | |||
| end | |||
| def my_blogs_count | |||
| self.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count | |||
| @@ -386,14 +413,97 @@ class User < Principal | |||
| @base_homepage | |||
| end | |||
| def get_user_projects | |||
| projects.order("updated_on desc") | |||
| end | |||
| #未解决的issue | |||
| def user_unsolve_issues | |||
| Issue.where(:assigned_to_id => id, :status_id => [1, 2, 4, 6]).includes(:author, :project).order("updated_on desc") | |||
| end | |||
| def project_relate_messages | |||
| sql = "SELECT * FROM `message_alls` ma left join `forge_messages` fm on ma.message_id=fm.id | |||
| left join `applied_messages` apm on ma.message_id=apm.id | |||
| where (ma.user_id =#{id} and ma.message_type = 'ForgeMessage' and fm.user_id=#{id} and fm.forge_message_type != 'News') or | |||
| (ma.user_id=#{id} and ma.message_type='AppliedMessage' and apm.applied_type = 'AppliedProject' and apm.user_id =#{id}) ORDER BY ma.created_at desc;" | |||
| MessageAll.find_by_sql(sql) | |||
| end | |||
| #未处理的消息通知 | |||
| def user_unsolve_messages | |||
| sql = "SELECT * FROM `message_alls` ma left join `forge_messages` fm on ma.message_id=fm.id | |||
| left join `course_messages` cm on ma.message_id=cm.id left join `applied_messages` apm on ma.message_id=apm.id | |||
| where (ma.user_id =#{id} and ma.message_type = 'ForgeMessage' and fm.forge_message_type='PullRequest' and fm.status=0 and fm.user_id=#{id}) or | |||
| (ma.user_id=#{id} and ma.message_type='AppliedMessage' and apm.applied_type in ('Organization', 'AppliedContest', 'StudentWorksScoresAppeal', 'AppliedProject', 'ApplyAddSchools') and apm.user_id =#{id} and apm.status =0) or | |||
| (ma.user_id=#{id} and ma.message_type='CourseMessage' and cm.course_message_type='JoinCourseRequest' and cm.status=0 and cm.user_id=#{id}) ORDER BY ma.created_at desc;" | |||
| MessageAll.find_by_sql(sql) | |||
| end | |||
| def get_user_course_ids #获取用户的全部课堂id | |||
| StudentsForCourse.includes(:course).where("student_id = #{id} and courses.is_delete = 0").map{|sf| sf.try(:course_id)} | |||
| end | |||
| def user_undo_homeworks | |||
| user_course_ids = get_user_course_ids #学生的全部课堂 | |||
| publish_homeworks = HomeworkCommon.where(course_id: user_course_ids)&.where("publish_time <= '#{Time.now}'") #已发布的作业 | |||
| publish_homeworks_ids = publish_homeworks.pluck(:id) | |||
| user_homeworks = student_works&.where(homework_common_id: publish_homeworks_ids) | |||
| finished_user_homework_ids = user_homeworks&.where("work_status != 0").pluck(:homework_common_id) #用户已完成的作业 | |||
| publish_homeworks.where(id: (publish_homeworks_ids - finished_user_homework_ids)).order("updated_at desc") | |||
| end | |||
| #待完成测验 | |||
| def user_undo_tests | |||
| user_course_ids = get_user_course_ids #学生的全部课堂 | |||
| publish_exercises = Exercise.where(course_id: user_course_ids, exercise_status: 2) #已发布的作业 | |||
| publish_exercises_ids = publish_exercises.pluck(:id).uniq | |||
| finished_user_exercises_ids = exercise_user&.where(exercise_id: publish_exercises_ids, commit_status: 1).pluck(:exercise_id).uniq | |||
| publish_exercises.where(id: (publish_exercises_ids - finished_user_exercises_ids)).order("updated_at desc") | |||
| end | |||
| #待完成的问卷 | |||
| def user_undo_polls | |||
| user_course_ids = get_user_course_ids #学生的全部课堂 | |||
| publish_polls = Poll.where(polls_type: "Course",polls_group_id: user_course_ids, polls_status: 2) | |||
| publish_polls_ids = publish_polls.pluck(:id).uniq | |||
| finished_user_polls_ids = poll_users&.where(poll_id: publish_polls_ids).pluck(:poll_id).uniq | |||
| publish_polls.where(id: (publish_polls_ids - finished_user_polls_ids)).order("updated_at desc") | |||
| end | |||
| #待完成的匿评作品 | |||
| def user_undo_anonymous | |||
| user_course_ids = get_user_course_ids #学生的全部课堂 | |||
| homework_anonymous_works = HomeworkCommon.where(course_id: user_course_ids).includes(:homework_detail_manual).where("homework_detail_manuals.comment_status in (1,2)") | |||
| homework_ids = homework_anonymous_works.map{|h| h.try(:id)} | |||
| user_student_work_scores = student_works_scores.where(reviewer_role: 3) | |||
| anonymous_evaluation_ids = user_student_work_scores.blank? ? "(-1)" : "(#{user_student_work_scores.pluck(:student_work_id).join(",")})" | |||
| unfinished_evaluations_work_ids = student_works_evaluation_distributions.where("student_work_id not in #{anonymous_evaluation_ids}").pluck(:student_work_id) | |||
| homework_ids = StudentWork.where(id: unfinished_evaluations_work_ids, homework_common_id: homework_ids ).pluck(:homework_common_id) | |||
| homework_anonymous_works.where(id: homework_ids) | |||
| end | |||
| #用户的待办事项计数,包括通知和issue的数量 | |||
| def count_undo_items | |||
| issues_count = user_unsolve_issues.count | |||
| apply_messages_count = user_unsolve_messages.count | |||
| undo_homeworks_count = user_undo_homeworks.size | |||
| undo_tests_count = user_undo_tests.size | |||
| undo_polls_count = user_undo_polls.size | |||
| undo_anonymous_count = user_undo_anonymous.size | |||
| issues_count + apply_messages_count + undo_homeworks_count + undo_tests_count + undo_polls_count + undo_anonymous_count | |||
| end | |||
| # 查询指派给我的缺陷记录 | |||
| def count_new_issue_assign_to | |||
| self.issue_assigns | |||
| end | |||
| # 新消息统计 | |||
| def count_new_message | |||
| if OnclickTime.where("user_id =?", User.current).first.nil? | |||
| # 新消息统计, | |||
| def count_new_message(type) | |||
| message_new_time = OnclickTime.where("user_id =?", User.current).first | |||
| if message_new_time.nil? | |||
| message_new_time = OnclickTime.new | |||
| message_new_time.user_id = User.current.id | |||
| # 第一次初始化点击铃铛时间 | |||
| @@ -403,17 +513,58 @@ class User < Principal | |||
| user = User.current | |||
| onclick_time = user.onclick_time.onclick_time | |||
| delete_courses = Course.where(:is_delete => 1).blank? ? "(-1)" : "(" + Course.where(:is_delete => 1).map(&:id).join(",") + ")" | |||
| course_count = CourseMessage.where("user_id =? and viewed =? and created_at >? and course_id not in #{delete_courses}", user.id, 0, onclick_time).count | |||
| contest_count = ContestMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count | |||
| forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count | |||
| user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count | |||
| user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count | |||
| system_messages_count = SystemMessage.where("created_at >?", onclick_time).count | |||
| at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count | |||
| org_count = OrgMessage.where("user_id=? and viewed =? and created_at >?", user.id,0, onclick_time).count | |||
| applied_count = AppliedMessage.where("user_id=? and viewed =? and created_at >?", user.id, 0, onclick_time).count | |||
| blog_message_count = BlogMessage.where("user_id=? and viewed=? and created_at >?", user.id, 0, onclick_time).count | |||
| messages_count = course_count + contest_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count + applied_count + blog_message_count | |||
| course_messages = CourseMessage.where("user_id =? and viewed =? and created_at >? and course_id not in #{delete_courses}", user.id, 0, onclick_time) | |||
| course_count = course_messages.size | |||
| contest_messages = ContestMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time) | |||
| contest_count = contest_messages.count | |||
| forge_messages = ForgeMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time) | |||
| forge_count = forge_messages.count | |||
| user_feedbacks = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time) | |||
| user_feedback_count = user_feedbacks.count | |||
| user_memos = MemoMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time) | |||
| user_memo_count = user_memos.count | |||
| system_messages = SystemMessage.where("created_at >?", onclick_time) | |||
| system_messages_count = system_messages.count | |||
| at_messages = AtMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time) | |||
| at_count = at_messages.count | |||
| org_messages = OrgMessage.where("user_id=? and viewed =? and created_at >?", user.id,0, onclick_time) | |||
| org_count = org_messages.count | |||
| applied_messages = AppliedMessage.where("user_id=? and viewed =? and created_at >?", user.id, 0, onclick_time) | |||
| applied_count = applied_messages.count | |||
| blog_messages = BlogMessage.where("user_id=? and viewed=? and created_at >?", user.id, 0, onclick_time) | |||
| blog_message_count = blog_messages.count | |||
| user_private_messages = PrivateMessage.where("user_id=? and status=?",user.id, 0) | |||
| private_messages_count = user_private_messages.size | |||
| if type != "all" | |||
| Rails.logger.info("######________type__________##########{type}") | |||
| message_new_time.update_attribute(:onclick_time, Time.now) | |||
| course_messages.update_all(:viewed => true) unless course_messages.nil? | |||
| forge_messages.update_all(:viewed => true) unless forge_messages.nil? | |||
| user_feedbacks.update_all(:viewed => true) unless user_feedbacks.nil? | |||
| user_memos.update_all(:viewed => true) unless user_memos.nil? | |||
| org_messages.update_all(:viewed => true) unless org_messages.nil? | |||
| at_messages.update_all(:viewed => true) unless at_messages.nil? | |||
| contest_messages.update_all(:viewed => true) unless contest_messages.nil? | |||
| blog_messages.update_all(:viewed => true) unless blog_messages.nil? | |||
| applied_messages.update_all(:viewed => true) unless applied_messages.nil? | |||
| end | |||
| messages_count = course_count + contest_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count + applied_count + blog_message_count + private_messages_count | |||
| end | |||
| #未读私信数量 | |||
| def unread_private_messages | |||
| private_messages.where(status: 0).size | |||
| end | |||
| # 查询指派给我的缺陷记录 | |||
| @@ -447,18 +598,18 @@ class User < Principal | |||
| end | |||
| info | |||
| end | |||
| ###添加留言 fq | |||
| def add_jour(user, notes, reference_user_id = 0, options = {}) | |||
| if options.count == 0 | |||
| self.journals_for_messages << JournalsForMessage.new(:user_id => user.id, :notes => notes, :reply_id => reference_user_id, :status => true, :is_readed => false) | |||
| else | |||
| else | |||
| jfm = self.journals_for_messages.build(options) | |||
| jfm.save | |||
| jfm | |||
| end | |||
| end | |||
| ### fq | |||
| def join_in?(course) | |||
| joined = StudentsForCourse.where('student_id = ? and course_id = ?', self.id, course.id) | |||
| @@ -468,7 +619,7 @@ class User < Principal | |||
| false | |||
| end | |||
| end | |||
| def show_name | |||
| name = lastname + firstname | |||
| name.empty? || name.nil? ? login : name | |||
| @@ -485,12 +636,12 @@ class User < Principal | |||
| name = show_name | |||
| (name != self.login) ? "#{name} #{self.login}" : name | |||
| end | |||
| #added by nie | |||
| def count_new_journal_reply | |||
| count = self.journal_reply.count | |||
| end | |||
| def set_mail_notification | |||
| ##add byxianbo | |||
| thread=Thread.new do | |||
| @@ -1,8 +1,19 @@ | |||
| class WebFooterCompany < ActiveRecord::Base | |||
| attr_accessible :logo_size, :name, :url | |||
| # key字段说明: | |||
| # partner:网站页脚合作单位(管理员页面页脚), dedicator: 首页技术合作单位; opensource: 首页共建开源单位 | |||
| RELATION_TYPE = %w(partner dedicator opensource) | |||
| acts_as_list | |||
| attr_accessible :logo_size, :name, :url, :position, :move_to, :key | |||
| validates :name, presence: true, length: { maximum: 500 } | |||
| validates :key, inclusion: { in: %w(partner dedicator opensource), message: "%{value} is not a valid value." } | |||
| validates :url, length: { maximum: 500 }, | |||
| format: { with: /(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?/, | |||
| message: :invalid | |||
| } | |||
| scope :desc, -> { order('position ASC') } | |||
| scope :partners, -> { desc.where(:key => 'partner') } | |||
| scope :dedicators, -> { desc.where(:key => 'dedicator') } | |||
| scope :opensources, -> { desc.where(:key => 'opensource') } | |||
| end | |||
| @@ -0,0 +1,9 @@ | |||
| class DynamicNewsService | |||
| def sync(news_params) | |||
| if news_params["category_id"].blank? | |||
| default_category = Category.find_by_name "社区动态" | |||
| news_params = news_params.merge({category_id: default_category&.id}) | |||
| end | |||
| DynamicNew.create!(news_params) | |||
| end | |||
| end | |||
| @@ -0,0 +1,15 @@ | |||
| class HomesService | |||
| def sync_count(type, sync_count) | |||
| home = Home.first | |||
| case type | |||
| when "user" | |||
| home.update_attributes!(users_count: home.users_count + sync_count) | |||
| when "project" | |||
| home.update_attributes!(projects_count: home.projects_count + sync_count) | |||
| when 'school' | |||
| home.update_attributes!(scholls_count: home.scholls_count + sync_count) | |||
| when "practical_training_project" | |||
| home.update_attributes!(practical_training_projects_count: home.practical_training_projects_count + sync_count) | |||
| end | |||
| end | |||
| end | |||
| @@ -1,488 +0,0 @@ | |||
| <% if false %> | |||
| <div> | |||
| <div class="clearfix homepage_banner"> | |||
| <p class="fl"> | |||
| <span class="f32">Trustie</span> | |||
| <span class="fw400 ml20" style="line-height: 70px">持续构建协同、共享、可信的软件创新生态系统</span> | |||
| </p> | |||
| <ul class="fr homepage_banner_nav"> | |||
| <li> | |||
| <a href="javascript:void(0)">开源托管平台</a> | |||
| </li> | |||
| <li> | |||
| <a href="javascript:void(0)">智能学习平台</a> | |||
| </li> | |||
| <li> | |||
| <a href="javascript:void(0)">资源共享平台</a> | |||
| </li> | |||
| <li> | |||
| <a href="javascript:void(0)">众包学习平台</a> | |||
| </li> | |||
| </ul> | |||
| </div> | |||
| <div class="pr mt60 banner"> | |||
| <ul class="img"> | |||
| <li><a href="javascript:void(0)"><img src="/images/introduce/trustie8_01.jpg"/></a></li> | |||
| </ul> | |||
| </div> | |||
| <div class="homepage_activity"> | |||
| <div class="mr35"> | |||
| <img src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2634306427,1511025022&fm=26&gp=0.jpg" class="mb25" width="592px" height="226px" /> | |||
| <p class="f26 lh26 color-grey3 mb15">关于Trustie</p> | |||
| <p class="f16 c_grey02 break_full_word"> | |||
| Trustie社区力争打造全球领先的群体协同创新平台,已建成协同开发创新、资源汇聚评估与智能学习实践三大平台,持续激发汇聚互联网上自治分散的海量智力资源,为全球软件创新生态助力赋能。 | |||
| Trustie社区及其核心技术,直接支持了国家9个软件园区创新平台的建设,服务于2500余家中小型软件企业研发和5000余个创新项目孵化,以及600多所大学软件开发人才培养, | |||
| 已成为国家新一代人工智能发展规划重点开源社区和国家绿色计算基础软硬件开源社区的基础设施,直接推动了我国开源软件生态的快速构建。 | |||
| </p> | |||
| <a href="JavaScript:void(0)" class="homepage_activity_more">MORE<span>→</span></a> | |||
| </div> | |||
| <div> | |||
| <p class="clearfix mb10"> | |||
| <span class="f26 lh26 color-grey3 fl mt3">社区动态</span> | |||
| <a href="javaScript:void(0)" class="fr fontGrey4 mt8">更多>></a> | |||
| </p> | |||
| <div class="homepage_activity_list"> | |||
| <div class="homepage_activity_list_item"> | |||
| <div> | |||
| <p class="f18 mb15 lh20 color-grey3">工业互联网体系架构2.0</p> | |||
| <p class="f13 mb8 c_grey02 task-hide-2" style="height: 38px;">网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。</p> | |||
| <p> | |||
| <span class="activity_tag">行业动态</span> | |||
| <span class="fontGrey4 ml14 fl"><i class="iconfont icon-shijian f12 mr5 lh18 fl"></i>2019-10-09</span> | |||
| </p> | |||
| </div> | |||
| <img src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2634306427,1511025022&fm=26&gp=0.jpg" class="ml20" width="158px" height="100px" /> | |||
| </div> | |||
| <div class="homepage_activity_list_item"> | |||
| <div> | |||
| <p class="f18 mb15 lh20 color-grey3">工业互联网体系架构2.0</p> | |||
| <p class="f13 mb8 c_grey02 task-hide-2" style="height: 38px;">网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。</p> | |||
| <p> | |||
| <span class="activity_tag">行业动态</span> | |||
| <span class="fontGrey4 ml14 fl"><i class="iconfont icon-shijian f12 mr5 lh18 fl"></i>2019-10-09</span> | |||
| </p> | |||
| </div> | |||
| <img src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2634306427,1511025022&fm=26&gp=0.jpg" class="ml20" width="158px" height="100px" /> | |||
| </div> | |||
| <div class="homepage_activity_list_item"> | |||
| <div> | |||
| <p class="f18 mb15 lh20 color-grey3">工业互联网体系架构2.0</p> | |||
| <p class="f13 mb8 c_grey02 task-hide-2" style="height: 38px;">网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。</p> | |||
| <p> | |||
| <span class="activity_tag">行业动态</span> | |||
| <span class="fontGrey4 ml14 fl"><i class="iconfont icon-shijian f12 mr5 lh18 fl"></i>2019-10-09</span> | |||
| </p> | |||
| </div> | |||
| <img src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2634306427,1511025022&fm=26&gp=0.jpg" class="ml20" width="158px" height="100px" /> | |||
| </div> | |||
| <div class="homepage_activity_list_item"> | |||
| <div> | |||
| <p class="f18 mb15 lh20 color-grey3">工业互联网体系架构2.0</p> | |||
| <p class="f13 mb8 c_grey02 task-hide-2" style="height: 38px;">网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。</p> | |||
| <p> | |||
| <span class="activity_tag">行业动态</span> | |||
| <span class="fontGrey4 ml14 fl"><i class="iconfont icon-shijian f12 mr5 lh18 fl"></i>2019-10-09</span> | |||
| </p> | |||
| </div> | |||
| <img src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2634306427,1511025022&fm=26&gp=0.jpg" class="ml20" width="158px" height="100px" /> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="homepage_introduce"> | |||
| <ul> | |||
| <li class="active"> | |||
| <div> | |||
| <img src="/images/nav_logo.png" width="50" class="mb40"> | |||
| <p class="f18">TrustieForge</p> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <img src="/images/introduce/edulogo.png" width="50" class="mb15"> | |||
| <p class="f18">TrustieEduCode</p> | |||
| <p class="f16 mb20">智能学习平台</p> | |||
| <p class="f12">实现实践教学的课程软件化、过程游戏化、<br/>环境生产化和评测全栈化</p> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <p class="f28 mb50">OSSEAN</p> | |||
| <p class="f18">TrustieOSSEAN</p> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <p class="f18">TrustieCoderpedia</p> | |||
| </div> | |||
| </li> | |||
| </ul> | |||
| </div> | |||
| <div class="homepage_introduce_content"> | |||
| <div class="homepage_introduce_trustieForge homepage_introduce_content_item active"> | |||
| <div class="cartoonTitle"> | |||
| <p class="f20 mb20">协同开发平台</p> | |||
| <p class="f16 color-grey3 mb50">支撑国家9个软件园区创新平台,服务2500余家中小型软件企业研发</p> | |||
| </div> | |||
| <ul class="cartoon"> | |||
| <li class="plateContainer"> | |||
| <div class="plate_before"> | |||
| <div> | |||
| <p><i class="iconfont icon-menu_date colorWhite f40"></i></p> | |||
| <span class="content_span">项目管理</span> | |||
| </div> | |||
| </div> | |||
| <div class="plate_back"> | |||
| <div> | |||
| <p><i class="iconfont icon-menu_date colorWhite f40"></i></p> | |||
| <span class="f20 lh20 mt10">项目管理</span> | |||
| <p class="lh20 mt60 mb80 f14 justify" style="height: 60px;">项目进程管理应用于研发管理、任务分配、目标跟踪等让项目管理流程高效完成。</p> | |||
| <a href="javascript:void(0)" class="homepage_detailBtn">查看详情</a> | |||
| </div> | |||
| </div> | |||
| </li> | |||
| <li class="plateContainer"> | |||
| <div class="plate_before"> | |||
| <div> | |||
| <p><i class="iconfont icon-menu_date colorWhite f40"></i></p> | |||
| <span class="content_span">代码托管</span> | |||
| </div> | |||
| </div> | |||
| <div class="plate_back"> | |||
| <div> | |||
| <p><i class="iconfont icon-menu_date colorWhite f40"></i></p> | |||
| <span class="f20 lh20 mt10">代码托管</span> | |||
| <p class="lh20 mt60 mb80 f14 justify" style="height: 60px;">基于Git的代码托管,提供高性能远端仓库,可保护分支、历史版本比对等高级功能。</p> | |||
| <a href="javascript:void(0)" class="homepage_detailBtn">查看详情</a> | |||
| </div> | |||
| </div> | |||
| </li> | |||
| <li class="plateContainer"> | |||
| <div class="plate_before"> | |||
| <div> | |||
| <p><i class="iconfont icon-menu_date colorWhite f40"></i></p> | |||
| <span class="content_span">质量检测</span> | |||
| </div> | |||
| </div> | |||
| <div class="plate_back"> | |||
| <div> | |||
| <p><i class="iconfont icon-menu_date colorWhite f40"></i></p> | |||
| <span class="f20 lh20 mt10">质量检测</span> | |||
| <p class="lh20 mt60 mb80 f14 justify" style="height: 60px;">采用一定检验测试手段和检查方法测定代码质量。</p> | |||
| <a href="javascript:void(0)" class="homepage_detailBtn">查看详情</a> | |||
| </div> | |||
| </div> | |||
| </li> | |||
| <li class="plateContainer"> | |||
| <div class="plate_before"> | |||
| <div> | |||
| <p><i class="iconfont icon-menu_date colorWhite f40"></i></p> | |||
| <span class="content_span">交流社区</span> | |||
| </div> | |||
| </div> | |||
| <div class="plate_back"> | |||
| <div> | |||
| <p><i class="iconfont icon-menu_date colorWhite f40"></i></p> | |||
| <span class="f20 lh20 mt10">交流社区</span> | |||
| <p class="lh20 mt60 mb80 f14 justify" style="height: 60px;">提供给IT开发者资源分享、学习交流、了解Trustie的社区。</p> | |||
| <a href="javascript:void(0)" class="homepage_detailBtn">查看详情</a> | |||
| </div> | |||
| </div> | |||
| </li> | |||
| </ul> | |||
| </div> | |||
| <div class="homepage_introduce_trustieEduCode homepage_introduce_content_item"> | |||
| <div class="trustieEduCode_container"> | |||
| </div> | |||
| </div> | |||
| <div class="homepage_introduce_ossean homepage_introduce_content_item"></div> | |||
| <div class="homepage_introduce_trustieCoderpedia homepage_introduce_content_item"></div> | |||
| </div> | |||
| </div> | |||
| <%end %> | |||
| <div class="content_Intruduce"> | |||
| <div class="in_head"> | |||
| <p class="in_head_rederect"> | |||
| <% if User.current.logged? %> | |||
| <a href="<%= user_path(User.current) %>" target="_blank" class="rightline">TrustieForge</a> | |||
| <% else %> | |||
| <a href="<%= signin_url() %>" target="_blank" class="rightline">TrustieForge</a> | |||
| <% end %> | |||
| <a href="http://ossean.trustie.net/" target="_blank" class="rightline">TrustieOSSEAN</a> | |||
| <a href="http://www.educoder.net" target="_blank" class="rightline">TrustieEduCoder</a> | |||
| <a href="http://codepedia.trustie.net/" target="_blank">TrustieCoderpedia</a> | |||
| </p> | |||
| </div> | |||
| <div class="in_second in_panel"> | |||
| <img src="/images/introduce/trustielogo_word.png" width="255px" height="45px" class="mb20"> | |||
| <p class="f28 mb12">TruestieForge</p> | |||
| <p class="mb30"><span class="blueUnderLine">协同开发平台</span></p> | |||
| <p class="mb40 c_grey02 f16">支撑国家9个软件园区创新平台,服务2500余家中小型软件企业研发</p> | |||
| <div class="forgeList"> | |||
| <div class="inline"> | |||
| <a href="<%= user_path(User.current) %>" target="_blank" class="forgeListItem"> | |||
| <div> | |||
| <div class="imgPart"> | |||
| <div> | |||
| <img src="/images/introduce/issue.png" width="52"> | |||
| <p>项目管理</p> | |||
| </div> | |||
| </div> | |||
| <p class="fontPanel"> | |||
| <span>项目进程管理应用于研发管理、任务分配、目标跟踪等让项目管理流程高效完成。</span> | |||
| </p> | |||
| </div> | |||
| </a> | |||
| <a href="<%= user_path(User.current) %>" target="_blank" class="forgeListItem"> | |||
| <div> | |||
| <div class="imgPart"> | |||
| <div> | |||
| <img src="/images/introduce/lichengbei.png" width="52"> | |||
| <p>代码托管</p> | |||
| </div> | |||
| </div> | |||
| <p class="fontPanel"> | |||
| <span>基于Git的代码托管,提供高性能远端仓库,可保护分支、历史版本比对等高级功能。</span> | |||
| </p> | |||
| </div> | |||
| </a> | |||
| <a href="<%= user_path(User.current) %>" target="_blank" class="forgeListItem"> | |||
| <div> | |||
| <div class="imgPart"> | |||
| <div> | |||
| <img src="/images/introduce/zhiliang.png" width="52"> | |||
| <p>质量检测</p> | |||
| </div> | |||
| </div> | |||
| <p class="fontPanel"> | |||
| <span>采用一定检验测试手段和检查方法测定代码质量。</span> | |||
| </p> | |||
| </div> | |||
| </a> | |||
| <a href="<%= user_path(User.current) %>" target="_blank" class="forgeListItem"> | |||
| <div> | |||
| <div class="imgPart"> | |||
| <div> | |||
| <img src="/images/introduce/jiaoliu.png" width="52"> | |||
| <p>交流社区</p> | |||
| </div> | |||
| </div> | |||
| <p class="fontPanel"> | |||
| <span>提供给IT开发者资源分享、学习交流、了解Trustie的社区。</span> | |||
| </p> | |||
| </div> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="in_third"> | |||
| <div> | |||
| <img src="/images/nav_logo.png" width="50" class="mb20"> | |||
| <img src="/images/introduce/edulogo.png" width="50" class="ml20 mb20"> | |||
| <p class="f28 mb12 colorWhite">TrustieEduCoder</p> | |||
| <p class="mb30"><span class="blueUnderLine" style="color: #fff;">智能学习平台</span></p> | |||
| <p class="mb40 colorWhite f16">600多所大学参与共建共享,支持全技术栈的实验和实训教学</p> | |||
| <div class="clearfix third_main_part"> | |||
| <div class="img_box"> | |||
| <img src="/images/introduce/computer.png" width="100%" class="img0"/> | |||
| <img src="/images/introduce/lesson.png" width="100%" class="img1 none"/> | |||
| <img src="/images/introduce/game.png" width="100%" class="img2 none"/> | |||
| <img src="/images/introduce/homework.png" width="100%" class="img3 none"/> | |||
| <img src="/images/introduce/Engineering.png" width="100%" class="img4 none"/> | |||
| </div> | |||
| <div class="introduce_box"> | |||
| <a href="http://www.educoder.net" target="_blank" class="sub_box active"> | |||
| <img src="/images/introduce/3-1-1.png" width="46" height="40" class="img1"/> | |||
| <img src="/images/introduce/3-1-2.png" width="46" height="40" class="img2"/> | |||
| <div class="sub_box_font"> | |||
| <p class="mb10 f20">实训课程</p> | |||
| <p><span>实现实践教学的课程软件化、过程游戏化、环境生产化和评测全栈化</span></p> | |||
| </div> | |||
| </a> | |||
| <a href="http://www.educoder.net" target="_blank" class="sub_box"> | |||
| <img src="/images/introduce/3-2-1.png" width="46" height="44" class="img1"/> | |||
| <img src="/images/introduce/3-2-2.png" width="46" height="44" class="img2"/> | |||
| <div class="sub_box_font"> | |||
| <p class="mb10 f20">翻转课堂</p> | |||
| <p><span>支持老师在线建立课堂,发布任务,学生完成任务,提交作业等各类教学场景</span></p> | |||
| </div> | |||
| </a> | |||
| <a href="http://www.educoder.net" target="_blank" class="sub_box"> | |||
| <img src="/images/introduce/3-3-1.png" width="43" height="41" class="img1"/> | |||
| <img src="/images/introduce/3-3-2.png" width="43" height="41" class="img2"/> | |||
| <div class="sub_box_font"> | |||
| <p class="mb10 f20">竞赛活动</p> | |||
| <p><span>汇集以高校竞赛为主,活动、社区为辅的竞赛活动平台</span></p> | |||
| </div> | |||
| </a> | |||
| <a href="http://www.educoder.net" target="_blank" class="sub_box"> | |||
| <img src="/images/introduce/3-4-1.png" width="39" height="39" class="img1"/> | |||
| <img src="/images/introduce/3-4-2.png" width="39" height="39" class="img2"/> | |||
| <div class="sub_box_font"> | |||
| <p class="mb10 f20">作业查重</p> | |||
| <p><span>把好学生“质量关”,为高校教师提供教学过程中课程作业的查重服务</span></p> | |||
| </div> | |||
| </a> | |||
| <a href="http://www.educoder.net" target="_blank" class="sub_box"> | |||
| <img src="/images/introduce/3-5-1.png" width="48" height="45" class="img1"/> | |||
| <img src="/images/introduce/3-5-2.png" width="48" height="45" class="img2"/> | |||
| <div class="sub_box_font"> | |||
| <p class="mb10 f20">工程教育</p> | |||
| <p><span>达成度自动计算,自评报告一键导出,切实提升相关工程技术人才从业教育质量</span></p> | |||
| </div> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="in_fourth"> | |||
| <div> | |||
| <img src="/images/introduce/trustielogo.png" width="50" class="mb20"> | |||
| <p class="f28 mb12">TruestieOSSEAN</p> | |||
| <p class="mb30"><span class="blueUnderLine">资源共享平台</span></p> | |||
| <p class="mb40 c_grey02 f16">统计分析392个开源项目,汇聚超过600TB软件开发数据和应用数据</p> | |||
| <div class="forgeList"> | |||
| <div class="inline"> | |||
| <a href="http://ossean.trustie.net/" target="_blank" class="osseanListItem"> | |||
| <div class="df"> | |||
| <p class="img-ring"><img src="/images/introduce/guanlian.png" width="60"></p> | |||
| <div class="right_font"> | |||
| <div style="width: 100%"> | |||
| <p class="mb20 f22" style="color: #373D41">多源关联与反馈</p> | |||
| <p class="c_grey02 f16"><span>对多源数据进行检测、关联、组合、反馈的过程</span></p> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </a> | |||
| <a href="http://ossean.trustie.net/" target="_blank" class="osseanListItem"> | |||
| <div class="df"> | |||
| <p class="img-ring"><img src="/images/introduce/pinggu.png" width="60"></p> | |||
| <div class="right_font"> | |||
| <div style="width: 100%"> | |||
| <p class="mb20 f22" style="color: #373D41">多维评估</p> | |||
| <p class="c_grey02 f16"><span>从互联网到资源库,从主观到客观的多维度评估</span></p> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </a> | |||
| <a href="http://ossean.trustie.net/" target="_blank" class="osseanListItem"> | |||
| <div class="df"> | |||
| <p class="img-ring"><img src="/images/introduce/ziyuan.png" width="60"></p> | |||
| <div class="right_font"> | |||
| <div style="width: 100%"> | |||
| <p class="mb20 f22" style="color: #373D41">资源排行和推荐</p> | |||
| <p class="c_grey02 f16"><span>开源软件排行榜及相关软件推荐</span></p> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </a> | |||
| <a href="http://ossean.trustie.net/" target="_blank" class="osseanListItem"> | |||
| <div class="df"> | |||
| <p class="img-ring"><img src="/images/introduce/fenxi.png" width="60"></p> | |||
| <div class="right_font"> | |||
| <div style="width: 100%"> | |||
| <p class="mb20 f22" style="color: #373D41">分析工具</p> | |||
| <p class="c_grey02 f16"><span>结合缺陷检测、代码风格、测试覆盖率和注释率等整体分析</span></p> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="in_fifth"> | |||
| <div> | |||
| <img src="/images/nav_logo.png" width="50" class="mb20"> | |||
| <p class="f28 mb12 colorWhite">TrustieCodepedia</p> | |||
| <p class="mb30"><span class="whiteUnderLine" style="color: #fff;">众包学习平台</span></p> | |||
| <p class="mb40 colorWhite f16">提供实验数据集给智能化软件开发技术研究和基准软件推荐</p> | |||
| <div class="educoderList"> | |||
| <a href="http://codepedia.trustie.net/" target="_blank" class="educoderItem"> | |||
| <div> | |||
| <span class="white_ring"><img src="/images/introduce/biaozhu.png" width="50"/></span> | |||
| <p class="f22 colorWhite mb20">标注引导</p> | |||
| <span style="color: #DDCDFF">高质量代码标注<br/>提升代码可理解性</span> | |||
| </div> | |||
| </a> | |||
| <a href="http://codepedia.trustie.net/" target="_blank" class="educoderItem"> | |||
| <div> | |||
| <span class="white_ring"><img src="/images/introduce/qunti.png" width="50"/></span> | |||
| <p class="f22 colorWhite mb20">群体标注</p> | |||
| <span style="color: #DDCDFF">提供开源项目群体标注<br/>方便团队理解和查看</span> | |||
| </div> | |||
| </a> | |||
| <a href="http://codepedia.trustie.net/" target="_blank" class="educoderItem"> | |||
| <div> | |||
| <span class="white_ring"><img src="/images/introduce/fankui.png" width="50"/></span> | |||
| <p class="f22 colorWhite mb20">反馈修正</p> | |||
| <span style="color: #DDCDFF">及时的反馈机制<br/>指出瑕疵并进行改进和修正</span> | |||
| </div> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="in_sixth in_panel" style="padding-bottom: 40px;"> | |||
| <p class="mb30 f28">合作机构</p> | |||
| <div class="clearfix partnerInfo"> | |||
| <a href="https://www.ccf.org.cn/" target="_blank"> | |||
| <div> | |||
| <span class="imgLoGO"><img src="/images/introduce/CCF.png" /></span> | |||
| <span class="name">中国计算机学会</span> | |||
| </div> | |||
| </a> | |||
| <a href="http://www.cmooc.cn/" target="_blank"> | |||
| <div> | |||
| <span class="imgLoGO"><img src="/images/introduce/MOOC.png" /></span> | |||
| <span class="name">MOOC联盟</span> | |||
| </div> | |||
| </a> | |||
| <a href="http://opengcc.org/" target="_blank"> | |||
| <div> | |||
| <span class="imgLoGO"><img src="/images/introduce/openGCC.png" /></span> | |||
| <span class="name">绿色计算产业联盟</span> | |||
| </div> | |||
| </a> | |||
| <a href="http://xgk.csia.org.cn/" target="_blank"> | |||
| <div> | |||
| <span class="imgLoGO"><img src="/images/introduce/EEE.png" /></span> | |||
| <span class="name">新工科联盟</span> | |||
| </div> | |||
| </a> | |||
| <a href="http://www.educg.net.cn/" target="_blank"> | |||
| <div> | |||
| <span class="imgLoGO"><img src="/images/introduce/CG.png" /></span> | |||
| <span class="name">新一代人工智能</span> | |||
| </div> | |||
| </a> | |||
| <a href="http://www.iscas.ac.cn/" target="_blank"> | |||
| <div> | |||
| <span class="imgLoGO"><img src="/images/introduce/ISCAS.png" style="margin-top: 26px;" /></span> | |||
| <span class="name">中国科学院软件研究所</span> | |||
| </div> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <script> | |||
| $(function(){ | |||
| $(".sub_box").hover(function(){ | |||
| $(".sub_box").removeClass("active"); | |||
| $(this).addClass("active"); | |||
| var index = $(this).index(); | |||
| $(".img_box img").addClass("none"); | |||
| $(".img_box").find(".img"+index).removeClass("none"); | |||
| }) | |||
| }) | |||
| </script> | |||
| @@ -0,0 +1,66 @@ | |||
| <table class="list" style="width: 100%;table-layout: fixed"> | |||
| <thead> | |||
| <tr> | |||
| <th style="width: 15px;"> | |||
| 序号 | |||
| </th> | |||
| <th style="width: 40px;"> | |||
| 封面 | |||
| </th> | |||
| <th style="width: 60px;"> | |||
| 标题 | |||
| </th> | |||
| <th style="width: 60px;" class = ""> | |||
| 简介 | |||
| </th> | |||
| <th style="width: 60px;" class = ""> | |||
| 所属分类 | |||
| </th> | |||
| <th style="width: 50px;"> | |||
| 创建时间 | |||
| </th> | |||
| <th style="width: 80px;"> | |||
| </th> | |||
| </tr> | |||
| </thead> | |||
| <tbody> | |||
| <% @count= @page * 15 %> | |||
| <% @dynamic_news.each do |dynamic_new| %> | |||
| <tr class="<%= cycle("odd", "even") %>"> | |||
| <!td style="text-align:center;vertical-align: middle;"> | |||
| <!%= dynamic_new.id %> | |||
| <% @count +=1 %> | |||
| <td align="center"> | |||
| <%=@count %> | |||
| </td> | |||
| <td align="center"> | |||
| <%= image_tag(dynamic_new.cover_url, width:40, height:40) %> | |||
| <!%= dynamic_new.title %> | |||
| </td> | |||
| <td style="text-align:center;vertical-align: middle;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=dynamic_new.title%>'> | |||
| <span> | |||
| <%= link_to dynamic_new.title, dynamic_new.remote_url %> | |||
| </span> | |||
| </td> | |||
| <td style="vertical-align: middle;text-align:center"> | |||
| <%= truncate(dynamic_new.simple_intruduce, :length => 30) %> | |||
| </td> | |||
| <td style="vertical-align: middle;text-align:center"> | |||
| <%= dynamic_new.category&.name %> | |||
| </td> | |||
| <td style="vertical-align: middle;text-align:center"> | |||
| <%= format_time(dynamic_new.created_at) %> | |||
| </td> | |||
| <td class="buttons" style="vertical-align: middle;text-align:center"> | |||
| <%= link_to("修改", edit_dynamic_news_path(dynamic_new), :class => 'icon icon-copy') %> | |||
| <%= link_to(l(:button_delete), dynamic_news_path(dynamic_new), :method => :delete,:confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> | |||
| </td> | |||
| </tr> | |||
| <% end %> | |||
| </tbody> | |||
| </table> | |||
| <div class="pagination"> | |||
| <%= pagination_links_full @obj_pages, @obj_count ,:per_page_links => true, :remote => true, :flag => true, :is_new => true %> | |||
| </div> | |||
| @@ -0,0 +1,30 @@ | |||
| <div class="contextual"> | |||
| <%= link_to l(:label_dynamic_new), {:controller => 'dynamic_news', :action => 'new'}, :class => 'icon icon-add' %> | |||
| </div> | |||
| <h3> | |||
| <%=l(:label_dynamic_new_plural)%> | |||
| </h3> | |||
| <%= form_tag({}, :method => :get) do %> | |||
| <fieldset> | |||
| <legend> | |||
| <%= l(:label_filter_plural) %> | |||
| </legend> | |||
| <label for='status'> | |||
| <%= l(:field_category) %> : | |||
| </label> | |||
| <%= select_tag 'category_id', dynamic_news_category_options_for_select(@category_id), :class => "small", :onchange => "this.form.submit(); return false;" %> | |||
| <label for='name'> | |||
| <%= l(:label_project) %>: | |||
| </label> | |||
| <%= text_field_tag 'title', params[:title], :size => 30, :placeholder => '输入新闻标题进行搜索' %> | |||
| <%= submit_tag l(:button_apply), :class => "small", :name => nil %> | |||
| <%= link_to l(:button_clear), {:controller => 'admin', :action => 'dynamic_news'}, :class => 'icon icon-reload' %> | |||
| </fieldset> | |||
| <% end %> | |||
| | |||
| <div class="autoscroll" id="admin_dynamic_news_list"> | |||
| <%= render :partial => "dynamic_news" %> | |||
| </div> | |||
| @@ -0,0 +1 @@ | |||
| $("#admin_dynamic_news_list").html("<%= escape_javascript(render :partial => 'dynamic_news') %>"); | |||
| @@ -24,7 +24,7 @@ | |||
| <tr class="<%= cycle("odd", "even") %>"> | |||
| <td style="text-align:center;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=org.name%>'> | |||
| <span> | |||
| <%#= link_to org.name,home_path(:organization => org.id) %> | |||
| <%#= link_to org.name,homes_path(:organization => org.id) %> | |||
| <%= link_to org.name, organization_path(org) %> | |||
| </span> | |||
| </td> | |||
| @@ -6,7 +6,7 @@ | |||
| <%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %> | |||
| </p> | |||
| <%= render 'tab_partial' %> | |||
| <div style="float:right"><%= link_to l(:label_cooperation_compnay), web_footer_companies_path %></div> | |||
| <div style="float:right;"><%= link_to l(:label_cooperation_compnay), web_footer_companies_path %></div> | |||
| <h4><%=l(:label_web_footer_page)%></h4> | |||
| <p style="margin-left:60px;padding-right: 20px;"> | |||
| @@ -21,8 +21,3 @@ | |||
| </p> | |||
| <%= submit_tag l(:button_save), :class => "small", :name => nil %> | |||
| <% end %> | |||
| <div> | |||
| </div> | |||
| @@ -1,37 +1,53 @@ | |||
| <div style="width:460px;"> | |||
| <div class="sy_popup_top"> | |||
| <div class="sy_popup_top clearfix"> | |||
| <h3 class="fl">欢迎加入项目</h3> | |||
| <a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a> | |||
| <div class="cl"></div> | |||
| <!-- <a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>--> | |||
| </div> | |||
| <div class="sy_popup_con" style="width:370px;"> | |||
| <div class="sy_popup_con" style="width:400px;"> | |||
| <%= form_tag( url_for(:controller => 'applied_project', :action => 'applied_project_info', :project_id => (@project.nil? ? nil : @project.id)), :remote => true, :id => 'project_applied_form') do %> | |||
| <ul class="sy_popup_add "> | |||
| <% if @is_teacher && @is_teacher == 1 %> | |||
| <li class="none"> | |||
| <label >项目邀请码:</label> | |||
| <input name="invite_code" class=" sy_input_txt fl" placeholder="请输入六位项目邀请码" value="<%=@project.invite_code %>" style="width:250px"/> | |||
| <div class="cl"></div> | |||
| <li class="none t-center"> | |||
| <span class="inline"> | |||
| <label >项目邀请码:</label> | |||
| <input name="invite_code" class=" sy_input_txt fl" placeholder="请输入六位项目邀请码" value="<%=@project.invite_code %>" style="width:250px"/> | |||
| <div class="cl"></div> | |||
| </span> | |||
| </li> | |||
| <% else %> | |||
| <li> | |||
| <label >项目邀请码:</label> | |||
| <input name="invite_code" class=" sy_input_txt fl" placeholder="请输入六位项目邀请码" style="width:250px"/> | |||
| <div class="cl"></div> | |||
| <li class="t-center"> | |||
| <span class="inline"> | |||
| <label >项目邀请码:</label> | |||
| <input name="invite_code" class=" sy_input_txt fl" placeholder="请输入六位项目邀请码" style="width:250px"/> | |||
| <div class="cl"></div> | |||
| </span> | |||
| </li> | |||
| <% end %> | |||
| <li> | |||
| <label >身份:</label> | |||
| <input name="member" value="member_manager" type="radio" class="ml5 mr5 " /><span class="mr10">管理人员</span> | |||
| <input name="member" value="member_developer" type="radio" class="ml5 mr5 " /><span class="mr10">开发人员</span> | |||
| <input name="member" value="member_reporter" type="radio" class="ml5 mr5 " /><span class="mr10">报告人员</span> | |||
| <div class="cl"></div> | |||
| <li class="mt10 text_c"> | |||
| <span class="inline"> | |||
| <label >身份:</label> | |||
| <span class="fl mr10 mt3"> | |||
| <input type="radio" class="magic-radio" name="indentity" value="member_manager" id="member_manager"/> | |||
| <label for="member_manager" style="line-height: 28px">管理人员</label> | |||
| </span> | |||
| <span class="fl mr10 mt3"> | |||
| <input type="radio" class="magic-radio" name="indentity" value="member_developer" id="member_developer"/> | |||
| <label for="member_developer" style="line-height: 28px">开发人员</label> | |||
| </span> | |||
| <span class="fl mr10 mt3"> | |||
| <input type="radio" class="magic-radio" name="indentity" value="member_reporter" id="member_reporter"/> | |||
| <label for="member_reporter" style="line-height: 28px">报告人员</label> | |||
| </span> | |||
| <!-- <input name="member" value="member_manager" type="radio" class="ml5 mr5 " /><span class="mr10">管理人员</span>--> | |||
| <!-- <input name="member" value="member_developer" type="radio" class="ml5 mr5 " /><span class="mr10">开发人员</span>--> | |||
| <!-- <input name="member" value="member_reporter" type="radio" class="ml5 mr5 " /><span class="mr10">报告人员</span>--> | |||
| </span> | |||
| </li> | |||
| <li> | |||
| <label class="mr27"> </label> | |||
| <a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#project_applied_form').submit();hideModal()">确 定</a> | |||
| <a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取 消</a> | |||
| <div class="cl"></div> | |||
| <li class="mt15 text_c" > | |||
| <span class="inline"> | |||
| <a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#project_applied_form').submit();hideModal()">确 定</a> | |||
| <a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取 消</a> | |||
| </span> | |||
| </li> | |||
| </ul> | |||
| <% end %> | |||
| @@ -12,28 +12,28 @@ | |||
| </td> | |||
| <td rowspan="2"> | |||
| <% if User.current.logged? %> | |||
| <% unless User.current.user_extensions.identity == 1 %> | |||
| <%= link_to(l(:label_newtype_contest), {:controller => 'bids', :action => 'new_contest'}, :class => 'icon icon-add') %> | |||
| <% end %> | |||
| <% end %> | |||
| <% unless User.current.user_extensions.identity == 1 %> | |||
| <%= link_to(l(:label_newtype_contest), {:controller => 'bids', :action => 'new_contest'}, :class => 'icon icon-add') %> | |||
| <% end %> | |||
| <% end %> | |||
| </td> | |||
| <td rowspan="2" > | |||
| <div class="project-search" style="float: right"> | |||
| <td rowspan="2" > | |||
| <div class="project-search" style="float: right"> | |||
| <%= text_field_tag 'name', params[:name], :size => 30 %> | |||
| <%= hidden_field_tag 'project_type', params[:project_type] %> | |||
| <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> | |||
| </div> | |||
| <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td > | |||
| <%=link_to l(:field_homepage), home_path %> > | |||
| <%=link_to l(:field_homepage), homes_path %> > | |||
| <a><%= l(:label_contest_innovate) %></a> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| <% end %> | |||
| </div> | |||
| </div> | |||
| @@ -14,24 +14,24 @@ | |||
| <td rowspan="2"> | |||
| <% if User.current.logged? %> | |||
| <%= link_to(l(:label_new_call), {:controller => 'bids', :action => 'new_bid'}, :class => 'icon icon-add') %> | |||
| <% end %> | |||
| <% end %> | |||
| </td> | |||
| <td rowspan="2" > | |||
| <td rowspan="2" > | |||
| <div class="project-search" style="float: right"> | |||
| <%= text_field_tag 'name', params[:name], :size => 28 %> | |||
| <%= hidden_field_tag 'reward_type', params[:reward_type] %> | |||
| <%= hidden_field_tag 'project_type', params[:project_type] %> | |||
| <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> | |||
| </div> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td style="padding-left: 8px"><a><%= link_to request.host()+"/calls", :controller => 'bids', :action => 'index' %> </a></td> | |||
| <td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %></td> | |||
| <td ><%=link_to l(:field_homepage), homes_path %> > <%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %></td> | |||
| </tr> | |||
| </table> | |||
| <% end %> | |||
| </div> | |||
| </div> | |||
| <% if @bids.size > 0 %> | |||
| <div id="bid-show"> | |||
| <%= sort_bid(@s_state, @project_type)%> | |||
| @@ -42,4 +42,4 @@ | |||
| <% end %> | |||
| <% html_title l(:label_requirement_enterprise_list)%> | |||
| <% html_title l(:label_requirement_enterprise_list)%> | |||
| @@ -35,7 +35,7 @@ | |||
| </tr> | |||
| <tr> | |||
| <td > | |||
| <%=link_to l(:field_homepage), home_path %> > | |||
| <%=link_to l(:field_homepage), homes_path %> > | |||
| <a href="http://<%= Setting.host_course%>" class="link_other_item"> | |||
| <%=l(:label_courses_management_platform)%> | |||
| </a> | |||
| @@ -29,7 +29,7 @@ | |||
| </tr> | |||
| <tr> | |||
| <td > | |||
| <%=link_to l(:field_homepage), home_path %> > | |||
| <%=link_to l(:field_homepage), homes_path %> > | |||
| <a href="http://<%= Setting.host_course%>" class="link_other_item"> | |||
| <%=l(:label_courses_management_platform)%> | |||
| </a> | |||
| @@ -37,7 +37,7 @@ | |||
| </tr> | |||
| </table> | |||
| <% end %> | |||
| </div> | |||
| </div> | |||
| <% if @courses && !@courses.empty? %> | |||
| <div id="courses-index"> | |||
| @@ -0,0 +1,70 @@ | |||
| <%= form_for(@dynamic_new, :url=> { :action => params[:action] == 'new'? :create : :update }, :html => {:id =>'system_messages-form',:multipart => true }) do |f| %> | |||
| <li> | |||
| <%= image_tag(params[:action] == 'new' ? '' : @dynamic_new.cover_url, id: "avatar_image", :class=>"school_avatar dynamic_new_image" )%> | |||
| <a type="button" onclick="$('#file').click();" style="margin: 86px 0 0 15px;float: left;padding: 2px 5px;border: 1px solid #eaeaea;cursor: pointer;text-decoration: none;width: 55px;">上传封面</a> | |||
| <%= file_field_tag 'cover',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%> | |||
| <div style="clear: both;"></div> | |||
| </li> | |||
| <li> | |||
| <label><span class="">*</span> <%= l(:field_category) %> :</label> | |||
| <%= f.select :category_id, options_for_select(Category.all.collect{|item| [item.name, item.id]}, @category_id), :class => "small" %> | |||
| <p id="title_notice_span" class="ml55"></p> | |||
| </li> | |||
| <li> | |||
| <label><span class="">*</span> <%= l(:field_title) %> :</label> | |||
| <input type="text" name="dynamic_new[title]" class="hwork_input_news" id="dynamic_new_title" width="576px" onblur="regexTitle($(this));" maxlength="255" placeholder="255个字符以内" value="<%= @dynamic_new.title %>"> | |||
| <p id="title_notice_span" class="ml55"></p> | |||
| </li> | |||
| <li> | |||
| <label><span class="">*</span> <%= l(:field_summary) %> :</label> | |||
| <input type="textarea" name="dynamic_new[simple_intruduce]" class="hwork_input_news" id="dynamic_new_simple_introduce" width="576px" onblur="regexTitle($(this));" maxlength="255" placeholder="255个字符以内" value="<%= @dynamic_new.simple_intruduce %>"> | |||
| <p id="title_notice_span" class="ml55"></p> | |||
| </li> | |||
| <li> | |||
| <label class="fl" > <span class="c_red"></span> <%= l(:field_content) %> :</label> | |||
| <%= f.kindeditor :content,:width=>'87.5%',:editor_id=>'dynamic_new_editor' %> | |||
| <p id="content_notice_span" class="ml55"></p> | |||
| </li> | |||
| <div> | |||
| <p id="content_notice_span" class="ml55"></p> | |||
| </div> | |||
| <div class="cl"></div> | |||
| <div class="actions"> | |||
| <%= link_to l(:label_submit), "javascript:void(0)", :class => "btn_message_free", :onclick => "dynamic_new_editor.sync();submit_message($(this));" %> | |||
| </div> | |||
| <% end %> | |||
| <script> | |||
| function system_message_length() { | |||
| var obj = dynamic_new_editor.html(); | |||
| if (obj.length > 10000) { | |||
| $("#content_notice_span").text("内容过长,超过10000个字符"); | |||
| $("#content_notice_span").css('color', '#ff0000'); | |||
| $("#content_notice_span").focus(); | |||
| return false; | |||
| } else { | |||
| $("#content_notice_span").text("填写正确"); | |||
| $("#content_notice_span").css('color', '#008000'); | |||
| return true; | |||
| } | |||
| } | |||
| function regexTitle(obj) { | |||
| var title = obj.val(); | |||
| if (title.length == 0) { | |||
| $("#title_notice_span").text("标题不能为空").css("color", "#ff0000").focus(); | |||
| return false; | |||
| } else if (title.length > 255) { | |||
| $("#title_notice_span").text("标题长度过长,不能超过255个字符").css("color", "#ff0000").focus(); | |||
| return false; | |||
| } else { | |||
| $("#title_notice_span").text("填写正确").css("color", "#008000"); | |||
| return true; | |||
| } | |||
| } | |||
| function submit_message(dom) { | |||
| if (system_message_length() && regexTitle($("#dynamic_new_title")) && regexTitle($("#dynamic_new_simple_introduce"))) { | |||
| $("#system_messages-form").submit(); | |||
| } | |||
| } | |||
| </script> | |||
| @@ -0,0 +1,23 @@ | |||
| <script> | |||
| function showPreview(source) { | |||
| var file = source.files[0]; | |||
| if (window.FileReader) { | |||
| var fr = new FileReader(); | |||
| fr.onloadend = function (e) { | |||
| document.getElementById("avatar_image").src = e.target.result; | |||
| }; | |||
| fr.readAsDataURL(file); | |||
| } | |||
| } | |||
| </script> | |||
| <%= content_for(:header_tags) do %> | |||
| <%= import_ke(enable_at: false) %> | |||
| <% end %> | |||
| <h3 style="float: left"> | |||
| <%=l(:label_new_dynamic_new)%> | |||
| </h3><br/> | |||
| <div style="padding-top: 20px; padding-left: 5px;"> | |||
| <%= error_messages_for 'dynamic_new' %> | |||
| <%= render 'form' %> | |||
| </div> | |||
| @@ -0,0 +1,2 @@ | |||
| <h1>DynamicNew#index</h1> | |||
| <p>Find me in app/views/dynamic_new/index.html.erb</p> | |||
| @@ -0,0 +1,22 @@ | |||
| <script> | |||
| function showPreview(source) { | |||
| var file = source.files[0]; | |||
| if (window.FileReader) { | |||
| var fr = new FileReader(); | |||
| fr.onloadend = function (e) { | |||
| document.getElementById("avatar_image").src = e.target.result; | |||
| }; | |||
| fr.readAsDataURL(file); | |||
| } | |||
| } | |||
| </script> | |||
| <%= content_for(:header_tags) do %> | |||
| <%= import_ke(enable_at: false) %> | |||
| <% end %> | |||
| <h3 style="float: left"> | |||
| <%=l(:label_new_dynamic_new)%> | |||
| </h3><br/> | |||
| <div style="padding-top: 20px; padding-left: 5px;"> | |||
| <%= render 'form' %> | |||
| </div> | |||
| @@ -0,0 +1,5 @@ | |||
| <%= default_banner_tag(@home) %> | |||
| <% @home.banners.each do |banner| %> | |||
| <a href="<%= banner.remote_path %>"><%= home_banner_tag(banner) %></a> | |||
| <% end %> | |||
| @@ -0,0 +1,45 @@ | |||
| <ul class="partnerMenu"> | |||
| <li class="inline"> | |||
| <a href="javascript:void(0)" class="active">合作共建开源</a> | |||
| <a href="javascript:void(0)">技术合作单位</a> | |||
| </li> | |||
| </ul> | |||
| <div class="partner_lump active partnerSource"> | |||
| <ul class="inline"> | |||
| <%= render partial: 'partners', locals: {partners: @partners} %> | |||
| </ul> | |||
| </div> | |||
| <div class="partner_lump"> | |||
| <% unless @first_companies_group.blank? %> | |||
| <div class="partner_item"> | |||
| <li class="inline"> | |||
| <% @first_companies_group.each do |company| %> | |||
| <%= link_to image_tag(url_to_avatar(company),:alt=> company.name ), company.url, :target => "_blank" %> | |||
| <% end %> | |||
| </li> | |||
| </div> | |||
| <% end %> | |||
| <% unless @second_companies_group.blank? %> | |||
| <div class="partner_item"> | |||
| <li class="inline"> | |||
| <% @second_companies_group.each do |company| %> | |||
| <%= link_to image_tag(url_to_avatar(company),:alt=> company.name ), company.url, :target => "_blank" %> | |||
| <% end %> | |||
| </li> | |||
| </div> | |||
| <% end %> | |||
| <% unless @third_companies_group.blank? %> | |||
| <div class="partner_item"> | |||
| <li class="inline"> | |||
| <% @third_companies_group.each do |company| %> | |||
| <%= link_to image_tag(url_to_avatar(company),:alt=> company.name ), company.url, :target => "_blank" %> | |||
| <% end %> | |||
| <%# if @companies.length > 17 %> | |||
| <!-- <a href="<%#= partners_homes_path %>"><img src="/images/introduce/more.png"/></a>--> | |||
| <%# end %> | |||
| </li> | |||
| </div> | |||
| <% end %> | |||
| </div> | |||
| @@ -0,0 +1,15 @@ | |||
| <% dynamic_news&.each do |dynamic_new| %> | |||
| <a href="<%= dynamic_new.remote_url %>"> | |||
| <div class="homepage_activity_list_item"> | |||
| <div> | |||
| <p class="f18 mb15 lh20 color-grey3"><%= h dynamic_new.title %></p> | |||
| <p class="f13 mb8 c_grey02 task-hide-2" style="height: 38px;"><%= h dynamic_new.simple_intruduce %></p> | |||
| <p> | |||
| <span class="activity_tag">行业动态</span> | |||
| <span class="fontGrey4 ml14 fl"><i class="iconfont icon-shijian f12 mr5 lh18 fl"></i><%= format_time(dynamic_new.created_at) %></span> | |||
| </p> | |||
| </div> | |||
| <img src="<%= dynamic_new.cover_url %>" class="ml20" width="158px" height="100px" /> | |||
| </div> | |||
| </a> | |||
| <% end %> | |||
| @@ -0,0 +1,60 @@ | |||
| <div class="homepage_introduce_trustieEduCode homepage_introduce_content_item"> | |||
| <div class="trustieEduCode_container cartoon"> | |||
| <div class="edu_c_panel"> | |||
| <ul class="edu_c_p_left"> | |||
| <a href="https://www.educoder.net/"> | |||
| <li class="active"><i class="iconfont icon-menu_map mr15 f20"></i>实训项目</li> | |||
| </a> | |||
| <a href="https://www.educoder.net/"> | |||
| <li><i class="iconfont icon-menu_voucher mr15 f20"></i>翻转课堂</li> | |||
| </a> | |||
| <a href="https://www.educoder.net/"> | |||
| <li><i class="iconfont icon-huodong mr15 f20"></i>竞赛活动</li> | |||
| </a> | |||
| <a href="https://www.educoder.net/"> | |||
| <li><i class="iconfont icon-menu_events mr15 f20"></i>作业查重</li> | |||
| </a> | |||
| <a href="https://www.educoder.net/"> | |||
| <li><i class="iconfont icon-gongcheng mr15 f20"></i>工程教育</li> | |||
| </a> | |||
| </ul> | |||
| <div class="edu_c_p_right"> | |||
| <div class="c_p_right_item active"> | |||
| <div class="c_r_title"> | |||
| <p class="f22 mb20">翻转课堂</p> | |||
| <p class="fontGrey4 f16">支持老师在线建立课堂,发布任务,学生完成任务,提交作业等各类教学场景</p> | |||
| </div> | |||
| <img src="/images/introduce/content2.png" style="margin-top: 45px"/> | |||
| </div> | |||
| <div class="c_p_right_item"> | |||
| <div class="c_r_title"> | |||
| <p class="f22 mb20">实训课程</p> | |||
| <p class="fontGrey4 f16">实现实践教学的课程软件化、过程游戏化、环境生产化和评测全栈化</p> | |||
| </div> | |||
| <img src="/images/introduce/content1.png" style="margin-top: 45px"/> | |||
| </div> | |||
| <div class="c_p_right_item"> | |||
| <div class="c_r_title"> | |||
| <p class="f22 mb20">竞赛活动</p> | |||
| <p class="fontGrey4 f16">汇集以高校竞赛为主,活动、社区为辅助的竞赛活动平台</p> | |||
| </div> | |||
| <img src="/images/introduce/content3.png" style="margin-top: 45px"/> | |||
| </div> | |||
| <div class="c_p_right_item"> | |||
| <div class="c_r_title"> | |||
| <p class="f22 mb20">作业查重</p> | |||
| <p class="fontGrey4 f16">把好学生“质量关”,为高校教师提供教学过程中课程作业的查重服务</p> | |||
| </div> | |||
| <img src="/images/introduce/content4.png" style="margin-top: 45px"/> | |||
| </div> | |||
| <div class="c_p_right_item"> | |||
| <div class="c_r_title"> | |||
| <p class="f22 mb20">工程教育</p> | |||
| <p class="fontGrey4 f16">达成度自动计算,自评报告一键导出,切实提升相关工程技术人才从业教育质量</p> | |||
| </div> | |||
| <img src="/images/introduce/content5.png" style="margin-top: 45px"/> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -0,0 +1,30 @@ | |||
| <ul> | |||
| <li class="active"> | |||
| <div> | |||
| <p class="f18 floatingName"><a href="<%= current_user.logged? ? user_path(current_user) : host_with_protocol %>" target="_blank"class="colorWhite">TrustieForge</a></p> | |||
| <p class="f16 mb20">协同开发平台</p> | |||
| <p class="f12 mb30 break_full_word floatingContent">开源创作与软件生产相结合,支持大规模群体开展软件协同创新活动。</p> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <p class="f18 floatingName"><a href="https://www.educoder.net/" target="_blank"class="colorWhite">EduCoder</a></p> | |||
| <p class="f16 mb20">智能学习平台</p> | |||
| <p class="f12 mb30 break_full_word floatingContent">实现实践教学的课程软件化、过程游戏化、环境生产化和评测全栈化</p> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <p class="f18 floatingName"><a href="http://ossean.trustie.net/" target="_blank"class="colorWhite">OSSEAN</a></p> | |||
| <p class="f16 mb20">资源共享平台</p> | |||
| <p class="f12 mb30 break_full_word floatingContent">高效汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势</p> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <p class="f18 floatingName"><a href="http://codepedia.trustie.net/" target="_blank"class="colorWhite">Codepedia</a></p> | |||
| <p class="f16 mb20">众包标注平台</p> | |||
| <p class="f12 mb30 break_full_word floatingContent">实践群体智能硬币的两面,即为学习者提供高效易用的代码阅读环境,也为软件领域积累丰富的自然语言标注。</p> | |||
| </div> | |||
| </li> | |||
| </ul> | |||
| @@ -0,0 +1,25 @@ | |||
| <%= form_for(@home) do |f| %> | |||
| <% if @home.errors.any? %> | |||
| <div id="error_explanation"> | |||
| <h2><%= pluralize(@home.errors.count, "error") %> prohibited this home from being saved:</h2> | |||
| <ul> | |||
| <% @home.errors.full_messages.each do |msg| %> | |||
| <li><%= msg %></li> | |||
| <% end %> | |||
| </ul> | |||
| </div> | |||
| <% end %> | |||
| <div class="field"> | |||
| <%= f.label :name %><br /> | |||
| <%= f.text_field :name %> | |||
| </div> | |||
| <div class="field"> | |||
| <%= f.label :content %><br /> | |||
| <%= f.text_area :content %> | |||
| </div> | |||
| <div class="actions"> | |||
| <%= f.submit %> | |||
| </div> | |||
| <% end %> | |||
| @@ -0,0 +1,8 @@ | |||
| <div class="mr35"> | |||
| <%= home_cover_tag(home) %> | |||
| <p class="f26 lh26 color-grey3 mb20"><%= home.name %></p> | |||
| <p class="f16 c_grey02 break_full_word lh30"> | |||
| <%= truncate(home.content.html_safe, length: Home::SHOW_CONTENT_LENGTH) %> | |||
| </p> | |||
| <!-- <a href="<%##= home.more_content? ? homes_path(home) : 'JavaScript:void(0)'%>" class="homepage_activity_more <%#= home.more_content? ? 'visit_color' : 'disabled_color' %>">MORE<span>→</span></a>--> | |||
| </div> | |||
| @@ -0,0 +1,16 @@ | |||
| <li> | |||
| <% if User.current.logged? %> | |||
| <a href="<%= user_path(User.current) %>" target="_blank" class="rightline">开源托管平台</a> | |||
| <% else %> | |||
| <a href="<%= signin_url() %>" target="_blank" class="rightline">开源托管平台</a> | |||
| <% end %> | |||
| </li> | |||
| <li> | |||
| <a href="https://www.educoder.net/" target="_blank">智能学习平台</a> | |||
| </li> | |||
| <li> | |||
| <a href="http://ossean.trustie.net/" target="_blank">资源共享平台</a> | |||
| </li> | |||
| <li> | |||
| <a href="http://codepedia.trustie.net/" target="_blank">众包学习平台</a> | |||
| </li> | |||
| @@ -0,0 +1,17 @@ | |||
| <% @dynamic_news.each do |dynamic_new| %> | |||
| <li> | |||
| <img src="<%= dynamic_new.cover_url %>" width="158px" height="100px" class="mr20"/> | |||
| <div> | |||
| <p class="mb15 clearfix"> | |||
| <a href="<%= dynamic_new.remote_url %>" class="f18 color-grey3 mr10 fl lh24"><%= h dynamic_new.title %></a> | |||
| <span class="activitiesTag">行业动态</span> | |||
| <span class="f12 fontGrey4 fr"><i class="iconfont icon-shijian f14 fl mr5 lh18"></i><%= format_time(dynamic_new.created_at) %></span> | |||
| </p> | |||
| <p class="introduce_a_content break_full_word"> | |||
| <span><%= h dynamic_new.simple_intruduce %></span> | |||
| </p> | |||
| </div> | |||
| </li> | |||
| <% end %> | |||
| @@ -0,0 +1,52 @@ | |||
| <div class="homepage_introduce_ossean homepage_introduce_content_item"> | |||
| <div class="cartoonTitle mt30 mb40"> | |||
| <p class="f34 mb20">资源共享平台</p> | |||
| <p class="f16 color-grey3">汇聚全球开源开放的软件工程大数据,持续分析与评估开源生态发展态势。</p> | |||
| </div> | |||
| <ul class="cartoon ossean_list"> | |||
| <li> | |||
| <a href="http://ossean.trustie.net/" target="_blank"> | |||
| <div> | |||
| <p class="f20 color-grey3 mb20">多元关联与反馈</p> | |||
| <p class="f16 fontGrey4">对多扩社区多源异构数据进行清洗、关联、组合与结构化。</p> | |||
| </div> | |||
| <div> | |||
| <i class="iconfont icon-gongyiliucheng"></i> | |||
| </div> | |||
| </a> | |||
| </li> | |||
| <li> | |||
| <a href="http://ossean.trustie.net/" target="_blank"> | |||
| <div> | |||
| <p class="f20 color-grey3 mb20">多维评估</p> | |||
| <p class="f16 fontGrey4">从互联网到资源库,从主观到客观的多维度评估</p> | |||
| </div> | |||
| <div> | |||
| <i class="iconfont icon-shengmingzhouqi"></i> | |||
| </div> | |||
| </a> | |||
| </li> | |||
| <li> | |||
| <a href="http://ossean.trustie.net/" target="_blank"> | |||
| <div> | |||
| <p class="f20 color-grey3 mb20">资源排行和推荐</p> | |||
| <p class="f16 fontGrey4">对开源项目进行评测排行,对相关资源进行关联推荐。</p> | |||
| </div> | |||
| <div> | |||
| <i class="iconfont icon-healthmode" style="font-size: 80px!important;"></i> | |||
| </div> | |||
| </a> | |||
| </li> | |||
| <li> | |||
| <a href="http://ossean.trustie.net/" target="_blank"> | |||
| <div> | |||
| <p class="f20 color-grey3 mb20">态势感知</p> | |||
| <p class="f16 fontGrey4">从数据到知识,从知识到态势。</p> | |||
| </div> | |||
| <div> | |||
| <i class="iconfont icon-yunweijiankong"></i> | |||
| </div> | |||
| </a> | |||
| </li> | |||
| </ul> | |||
| </div> | |||
| @@ -0,0 +1,3 @@ | |||
| <% partners.each do |partner| %> | |||
| <%= link_to image_tag(url_to_avatar(partner),:alt=> partner.name ), partner.url, :target => "_blank" %> | |||
| <% end %> | |||
| @@ -0,0 +1,18 @@ | |||
| <ul> | |||
| <li> | |||
| <p class="data_number"><%= @home.users_count %></p> | |||
| <p class="f16">社区用户量</p> | |||
| </li> | |||
| <li> | |||
| <p class="data_number"><%= @home.projects_count %></p> | |||
| <p class="f16">开源项目</p> | |||
| </li> | |||
| <li> | |||
| <p class="data_number"><%= @home.practical_training_projects_count %></p> | |||
| <p class="f16">实训项目</p> | |||
| </li> | |||
| <li> | |||
| <p class="data_number"><%= @home.scholls_count %></p> | |||
| <p class="f16">应用高校</p> | |||
| </li> | |||
| </ul> | |||
| @@ -0,0 +1,51 @@ | |||
| <div class="homepage_introduce_trustieCoderpedia homepage_introduce_content_item"> | |||
| <div class="cartoonTitle mt30 "> | |||
| <p class="f34 mb20">众包标注平台</p> | |||
| <p class="f16 color-grey3">群体智能硬币的两面,即为学习者提供高效易用的代码阅读环境,也为软件领域积累丰富的自然语言标注。</p> | |||
| </div> | |||
| <ul class="cartoon clearfix Coderpedia_list"> | |||
| <li> | |||
| <div class="h_logo"> | |||
| <i class="iconfont icon-shebeiguanli"></i> | |||
| </div> | |||
| <p class="hoverLine"></p> | |||
| <a href="http://codepedia.trustie.net/" target="_blank"> | |||
| <div class="coderpedia_i_content"> | |||
| <div> | |||
| <p class="color-grey3 f20 lh20 mb20">标注引导</p> | |||
| <p class="c_grey02 lh22">高质量代码标注<br/>提升代码可理解性</p> | |||
| </div> | |||
| </div> | |||
| </a> | |||
| </li> | |||
| <li> | |||
| <div class="h_logo"> | |||
| <i class="iconfont icon-shebeiguanli"></i> | |||
| </div> | |||
| <p class="hoverLine"></p> | |||
| <a href="http://codepedia.trustie.net/" target="_blank"> | |||
| <div class="coderpedia_i_content"> | |||
| <div> | |||
| <p class="color-grey3 f20 lh20 mb20">群体标注</p> | |||
| <p class="c_grey02 lh22">提供开源项目群体标注<br/>方便团队理解和查看</p> | |||
| </div> | |||
| </div> | |||
| </a> | |||
| </li> | |||
| <li> | |||
| <div class="h_logo"> | |||
| <i class="iconfont icon-zhiliangkongzhi"></i> | |||
| </div> | |||
| <p class="hoverLine"></p> | |||
| <a href="http://codepedia.trustie.net/" target="_blank"> | |||
| <div class="coderpedia_i_content"> | |||
| <div> | |||
| <p class="color-grey3 f20 lh20 mb20">反馈修正</p> | |||
| <p class="c_grey02 lh22">及时的反馈机制<br/>指出瑕疵并进行改进和修正</p> | |||
| </div> | |||
| </div> | |||
| </a> | |||
| </li> | |||
| </ul> | |||
| </div> | |||
| @@ -0,0 +1,49 @@ | |||
| <% url = current_user.logged? ? user_path(current_user) : host_with_protocol %> | |||
| <div class="homepage_introduce_trustieForge homepage_introduce_content_item active"> | |||
| <div class="cartoonTitle mt30 mb40"> | |||
| <p class="f34 mb20">协同开发平台</p> | |||
| <p class="f16 color-grey3">支撑国家9个软件园区创新平台,服务2500余家中小型软件企业研发</p> | |||
| </div> | |||
| <ul class="cartoon ossean_list"> | |||
| <li> | |||
| <div> | |||
| <p class="f20 color-grey3 mb20 trustieTabName">项目管理</p> | |||
| <p class="f16 fontGrey4">项目进程管理应用于研发管理、任务分配、目标跟踪等让项目管理流程高效完成。</p> | |||
| <a href="<%= url %>" target="_blank" class="trustieMore">查看详情</a> | |||
| </div> | |||
| <div class="mt20"> | |||
| <i class="iconfont icon-projectx" style="font-size: 80px"></i> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <p class="f20 color-grey3 mb20 trustieTabName">代码托管</p> | |||
| <p class="f16 fontGrey4">项目进程管理应用于研发管理、任务分配、目标跟踪等让项目管理流程高效完成。</p> | |||
| <a href="<%= url %>" target="_blank" class="trustieMore">查看详情</a> | |||
| </div> | |||
| <div> | |||
| <i class="iconfont icon-hostingx2"></i> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <p class="f20 color-grey3 mb20 trustieTabName">质量检测</p> | |||
| <p class="f16 fontGrey4">基于Sonar的代码静态分析工具,及时发现代码中的潜在隐患,全面提升软件开发质量。</p> | |||
| <a href="<%= url %>" target="_blank" class="trustieMore">查看详情</a> | |||
| </div> | |||
| <div> | |||
| <i class="iconfont icon-detectionx"></i> | |||
| </div> | |||
| </li> | |||
| <li> | |||
| <div> | |||
| <p class="f20 color-grey3 mb20 trustieTabName">交流社区</p> | |||
| <p class="f16 fontGrey4">为IT开发者营造活跃、开放的社区环境,提供即时通讯、资源分享、学习交流等社交化服务。</p> | |||
| <a href="<%= url %>" target="_blank" class="trustieMore">查看详情</a> | |||
| </div> | |||
| <div> | |||
| <i class="iconfont icon-communityx"></i> | |||
| </div> | |||
| </li> | |||
| </ul> | |||
| </div> | |||
| @@ -0,0 +1,54 @@ | |||
| <div> | |||
| <div class="clearfix homepage_banner"> | |||
| <p class="fl"> | |||
| <img src="/images/introduce/whiteLogo_word.png" height="24px" class="mt18 fl"/> | |||
| <span class="fw400 ml20 fl" style="opacity: 0.7;line-height: 67px">持续构建协同、共享、可信的软件创新生态</span> | |||
| </p> | |||
| <ul class="fr homepage_banner_nav"> | |||
| <%= render :partial => 'nav_buttons' %> | |||
| </ul> | |||
| </div> | |||
| <div class="pr mt60 banner"> | |||
| <ul class="img"> | |||
| <li> | |||
| <%= render :partial => 'banners'%> | |||
| </li> | |||
| </ul> | |||
| </div> | |||
| <div class="homepage_activity"> | |||
| <%= render :partial => 'home', :locals => {:home => @home} %> | |||
| <div> | |||
| <p class="clearfix mb10"> | |||
| <span class="f26 lh26 color-grey3 fl mt3">社区动态</span> | |||
| <a href="<%= news_homes_path %>" class="fr fontGrey4 mt8">更多>></a> | |||
| </p> | |||
| <div class="homepage_activity_list"> | |||
| <%= render :partial => 'dynamic_news', :locals => {:dynamic_news => @dynamic_news}%> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="homepage_introduce"> | |||
| <%= render 'floating_tabs' %> | |||
| </div> | |||
| <div class="homepage_introduce_content"> | |||
| <div> | |||
| <%= render :partial => 'trustie_forge' %> | |||
| <%= render :partial => 'educoder' %> | |||
| <%= render :partial => 'ossean' %> | |||
| <%= render :partial => 'trustie_coderpedia' %> | |||
| </div> | |||
| </div> | |||
| <div class="data_panel"> | |||
| <%= render :partial => 'statistics'%> | |||
| </div> | |||
| <div class="partner_container"> | |||
| <p class="f32 mb30">开源生态</p> | |||
| <div class="partner_list"> | |||
| <%= render :partial => 'companies' %> | |||
| </div> | |||
| <p class="mt40"> | |||
| <a href="<%= partners_homes_path %>" class="more-Partner">查看更多</a> | |||
| </p> | |||
| </div> | |||
| </div> | |||
| @@ -0,0 +1,15 @@ | |||
| <div class="smallPanel"> | |||
| <p class="mt15 mb25"> | |||
| <a href="<%= homes_path %>" class="c_grey02">首页</a><span class="c_grey02 ml3 mr3">></span> | |||
| <span>行业动态</span> | |||
| </p> | |||
| <p class="f28 lh24">社区动态</p> | |||
| <ul class="introduce_a_list"> | |||
| <%= render :partial => 'news_list'%> | |||
| </ul> | |||
| <div class="pages" style="text-align: center"> | |||
| <ul class="inline mt30 mb40"> | |||
| <%= pagination_links_full @obj_pages, @obj_count ,:per_page_links => true, :remote => true, :flag => true, :is_new => true %> | |||
| </ul> | |||
| </div> | |||
| </div> | |||
| @@ -0,0 +1 @@ | |||
| $(".introduce_a_list").html("<%= escape_javascript(render :partial => 'news_list') %>"); | |||
| @@ -0,0 +1,17 @@ | |||
| <div class="smallPanel"> | |||
| <p class="mt15 mb25"> | |||
| <a href="<%= homes_path %>" class="c_grey02">首页</a><span class="c_grey02 ml3 mr3">></span> | |||
| <span>开源生态</span> | |||
| </p> | |||
| <% @companies.each do |pool, coms| %> | |||
| <p class="f28 lh24 mb20"><%= render_pool_name(pool) %></p> | |||
| <ul class="partnerList clearfix mb30"> | |||
| <% coms.each do |company|%> | |||
| <li> | |||
| <%= link_to image_tag(url_to_avatar(company),:alt=> company.name ), company.url, :target => "_blank" %> | |||
| </li> | |||
| <% end %> | |||
| </ul> | |||
| <% end %> | |||
| </div> | |||
| @@ -0,0 +1,14 @@ | |||
| <p id="notice"><%= notice %></p> | |||
| <p> | |||
| <b>Name:</b> | |||
| <%= @home.name %> | |||
| </p> | |||
| <p> | |||
| <b>Content:</b> | |||
| <%= @home.content %> | |||
| </p> | |||
| <%= link_to 'Back', homes_path %> | |||
| @@ -1,7 +1,6 @@ | |||
| <%= content_for(:header_tags) do %> | |||
| <%= import_ke(enable_at: true,init_activity: true) %> | |||
| <% end %> | |||
| <script xmlns="http://www.w3.org/1999/html"> | |||
| function add_style(){ | |||
| if($("select[id='tracker_id']").val() != 0){ | |||
| @@ -256,11 +255,7 @@ | |||
| </a> | |||
| </li> | |||
| <div class="cl"></div> | |||
| </ul> | |||
| <div class="issues_filter "> | |||
| <div class="issues_form_filter mt5 mr5"> | |||
| <%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["发布人",0]), | |||
| @@ -309,6 +304,7 @@ | |||
| </div> | |||
| <div class="cl"></div> | |||
| </div><!--issues_filter end--> | |||
| </div> | |||
| <% end %> | |||
| <% end %> | |||
| @@ -319,15 +315,14 @@ | |||
| <%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> | |||
| </div><!--issues_con_list end--> | |||
| <div class="cl"></div> | |||
| </div><!--issues_filter end--> | |||
| <div id="issues_list_content_1"> | |||
| </div><!--issues_list_content_1 end--> | |||
| <div id="issues_list_content_2" class="undis"> | |||
| </div><!--issues_list_content_2 end--> | |||
| <div id="issues_list_content_3" class="undis"> | |||
| </div><!--issues_list_content_3 end--> | |||
| </div><!--issues_con_list end--> | |||
| <!--issues_filter end--> | |||
| <div id="issues_list_content_1"> | |||
| </div><!--issues_list_content_1 end--> | |||
| <div id="issues_list_content_2" class="undis"> | |||
| </div><!--issues_list_content_2 end--> | |||
| <div id="issues_list_content_3" class="undis"> | |||
| </div><!--issues_list_content_3 end--> | |||
| <!--issues_con_list end--> | |||
| </div> | |||
| <!--缺陷列表结束--> | |||
| @@ -2,7 +2,7 @@ xml.instruct! | |||
| xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do | |||
| xml.title @title | |||
| xml.link "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.rss_key, :only_path => false) | |||
| xml.link "rel" => "alternate", "href" => home_url(:only_path => false) | |||
| xml.link "rel" => "alternate", "href" => homes_url(:only_path => false) | |||
| xml.id url_for(:controller => 'welcome', :only_path => false) | |||
| xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema) | |||
| xml.author { xml.name "#{Setting.app_title}" } | |||
| @@ -1,14 +1,13 @@ | |||
| <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> | |||
| <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> | |||
| <div class="welcome_logo"> | |||
| <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), home_path %> | |||
| <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), homes_path %> | |||
| </div> | |||
| <div id="account"> | |||
| <%= render_menu :account_menu -%> | |||
| </div> | |||
| <%= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| <%= render_menu :top_college_menu if User.current.logged? || !Setting.login_required? -%> | |||
| </div> | |||
| <div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 5px;margin-top: -10px;"></div> | |||
| @@ -1,35 +1,35 @@ | |||
| <!-- <table id="top-menu" style="background-color: #ac344f;margin-top: 10px;margin-bottom: 0px; padding-top: 3px; "> | |||
| <tr><td ><%#=link_to image_tag("/images/logo_ent.png",weight:"38px", height: "38px"), home_path %></td> | |||
| <!-- <table id="top-menu" style="background-color: #ac344f;margin-top: 10px;margin-bottom: 0px; padding-top: 3px; "> | |||
| <tr><td ><%#=link_to image_tag("/images/logo_ent.png",weight:"38px", height: "38px"), homes_path %></td> | |||
| <td valign="top" width="300px"><%#= render_menu :top_enterprise_menu if User.current.logged? || !Setting.login_required? -%></td> | |||
| <td><%#=link_to "企业入口"%></td> | |||
| <td valign="top" style=" padding-left: 380px"> | |||
| <td valign="top" style=" padding-left: 380px"> | |||
| <%#= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| <%#= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| </td> | |||
| <td valign="top"> | |||
| <td valign="top"> | |||
| <%#= render_menu :account_menu -%> | |||
| </td> | |||
| </td> | |||
| </tr> | |||
| </table> --> | |||
| <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> | |||
| </table> --> | |||
| <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> | |||
| <div class="welcome_logo"> | |||
| <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), home_path %> | |||
| <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), homes_path %> | |||
| </div> | |||
| <div id="account"> | |||
| <%= render_menu :account_menu -%> | |||
| </div> | |||
| <%= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| <%= render_menu :top_enterprise_menu if User.current.logged? || !Setting.login_required? -%> | |||
| </div> | |||
| <!-- <div style="float: right; margin-top: 13px;"> | |||
| <%#= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :title => "留言") if User.current.logged? %> | |||
| </div> --> | |||
| @@ -39,6 +39,6 @@ | |||
| <!-- <%#= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> --> | |||
| <!-- 消息#{link_to((User.current.count_new_jour), feedback_path(User.current))} --> | |||
| <!-- <%#= content_tag('div', "消息(#{User.current.journals_for_messages.count})".html_safe, :id => 'loggedas')%> --> | |||
| <!-- <div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 5px;margin-top: -10px;"></div> --> | |||
| @@ -1,13 +1,13 @@ | |||
| <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> | |||
| <div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;"> | |||
| <div class="welcome_logo"> | |||
| <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), home_path %> | |||
| <%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), homes_path %> | |||
| </div> | |||
| <div id="account"> | |||
| <%= render_menu :account_menu -%> | |||
| </div> | |||
| <%= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> | |||
| <!-- <div style="float: right; margin-top: 13px;"> | |||
| <%#= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :title => "留言") if User.current.logged? %> | |||
| </div> --> | |||
| @@ -20,4 +20,3 @@ | |||
| <%= render_menu :top_home_menu if User.current.logged? || !Setting.login_required? -%> | |||
| </div> | |||
| <div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 5px;margin-top: -10px;"></div> | |||
| @@ -18,7 +18,7 @@ | |||
| <tr> | |||
| <td> | |||
| <p class="top-content-list-homework"> | |||
| <%=link_to "主页", home_path %> > | |||
| <%=link_to "主页", homes_path %> > | |||
| <a href="http://<%= Setting.host_course%>" class="link_other_item"> | |||
| <%=l(:label_courses_management_platform)%> | |||
| </a> > | |||
| @@ -33,4 +33,4 @@ | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| @@ -35,9 +35,9 @@ | |||
| <tr> | |||
| <td > | |||
| <%=link_to l(:field_homepage), home_path %> > | |||
| <%=link_to l(:field_homepage), homes_path %> > | |||
| <%=link_to l(:label_contest_work), :controller=>'softapplications', :action=>'index' %> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| @@ -11,17 +11,17 @@ | |||
| </td> | |||
| <td rowspan="2" width="250px"></td> | |||
| </tr> | |||
| <tr> | |||
| <td > | |||
| <%=link_to l(:field_homepage), home_path %> > | |||
| <%=link_to l(:field_homepage), homes_path %> > | |||
| <a><%= l(:label_contest_innovate) %></a> | |||
| <span> | |||
| <% contest = @softapplication.contests.first %> | |||
| <%= contest ? link_to(">" + contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> | |||
| </span> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| @@ -1,3 +1,4 @@ | |||
| <% if false %> | |||
| <div id="Footer" class="f12"> | |||
| <div class="footerAboutContainer"> | |||
| <ul class="footerAbout"> | |||
| @@ -42,4 +43,19 @@ | |||
| <p ><%= l(:label_rights_reserved)%><span class="mr10"></span><a href="http://beian.miit.gov.cn" class=" f_grey" target="_blank"><%= l(:label_license)%></a></p> | |||
| </div> | |||
| </ul> | |||
| </div><!--Footer end--> | |||
| </div><!--Footer end--> | |||
| <% end %> | |||
| <div class="tac tac_footer"> | |||
| <div> | |||
| <p class="mb20 tac_f_link"> | |||
| <a href="<%= agreement_path %>" class="mr20 ml20 fontGrey8" target="_blank">服务协议</a> | |||
| <% memo = Memo.where(:id => 1168).first %> | |||
| <% if hidden_unproject_infos && !memo.nil? %> | |||
| <%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "mr20 ml20 fontGrey8", :target=>"_blank" %> | |||
| <% end %> | |||
| <a href="<%= forums_path %>" class="mr20 ml20 fontGrey8" target="_blank" ><%= l(:label_forums)%></a> | |||
| <%= link_to "合作伙伴", "#{Setting.protocol}://#{Setting.host_name}/cooperation", :class => "mr20 ml20 fontGrey8", :target=>"_blank" %> | |||
| </p> | |||
| <%= l(:label_rights_reserved)%><span class="mr10"></span><a href="http://beian.miit.gov.cn/" class="colorWhite" target="_blank"><%= l(:label_license)%></a> | |||
| </div> | |||
| </div> | |||
| @@ -1,38 +1,38 @@ | |||
| <div class="navHomepage"> | |||
| <div class="navHomepageLogo fl"> | |||
| <%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), home_path()%> | |||
| <%=link_to image_tag("../images/logo_blue.png",width:"51px", height: "45px",class: "mt3"), ''%> | |||
| </div> | |||
| <div class="fl"> | |||
| <ul> | |||
| <li class="navHomepageMenu fl"> | |||
| <%= link_to "首页", user_activities_path(User.current), :class => "c_white f16 db p10", :title => "回到个人首页" %> | |||
| <%= link_to "首页", user_activities_path(User.current), :class => "color-grey3 f16 db p10", :title => "回到个人首页" %> | |||
| </li> | |||
| <% if !hidden_unproject_infos %> | |||
| <li class="navHomepageMenu fl"> | |||
| <%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :class => "c_white f16 db p10", :target => "_blank" %> | |||
| <%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :class => "color-grey3 f16 db p10", :target => "_blank" %> | |||
| </li> | |||
| <% end %> | |||
| <% if hidden_unproject_infos %> | |||
| <li class="navHomepageMenu fl"> | |||
| <%= link_to "课程", user_course_community_path(User.current), :class => "c_white f16 db p10", :target => "_blank" %> | |||
| <%= link_to "课程", user_course_community_path(User.current), :class => "color-grey3 f16 db p10", :target => "_blank" %> | |||
| </li> | |||
| <% end %> | |||
| <li class="navHomepageMenu fl"> | |||
| <%= link_to "项目", user_project_community_path(User.current), :class => "c_white f16 db p10", :target => "_blank" %> | |||
| <%= link_to "项目", user_project_community_path(User.current), :class => "color-grey3 f16 db p10", :target => "_blank" %> | |||
| </li> | |||
| <li class="navHomepageMenu fl"> | |||
| <%= link_to "数据", statistics_path, :class => "c_white f16 db p10", :target => "_blank" %> | |||
| <%= link_to "数据", statistics_path, :class => "color-grey3 f16 db p10", :target => "_blank" %> | |||
| </li> | |||
| <% if hidden_unproject_infos %> | |||
| <li class="navHomepageMenu fl"> | |||
| <%= link_to "竞赛", user_contest_community_path(User.current), :class => "c_white f16 db p10", :target => "_blank" %> | |||
| <%= link_to "竞赛", user_contest_community_path(User.current), :class => "color-grey3 f16 db p10", :target => "_blank" %> | |||
| </li> | |||
| <% end %> | |||
| <li class="navHomepageMenu fl mr20"> | |||
| <%= link_to "问吧", forums_path, :class =>"c_white f16 db p10", :target => "_blank" %> | |||
| <%= link_to "问吧", forums_path, :class =>"color-grey3 f16 db p10", :target => "_blank" %> | |||
| </li> | |||
| </ul> | |||
| @@ -56,17 +56,6 @@ | |||
| } | |||
| } | |||
| </script> | |||
| <div class="fl" id="navHomepageSearch"> | |||
| <!--<form class="navHomepageSearchBox">--> | |||
| <% name = name%> | |||
| <%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %> | |||
| <input type="text" name="q" value="<%= name.nil? ? "" : name %>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索" style="width: 300px" /> | |||
| <input type="hidden" name="search_type" id="type" value="all"/> | |||
| <input type="text" style="display: none;"/> | |||
| <a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a> | |||
| <% end %> | |||
| </div> | |||
| <div class="navHomepageProfile" id="navHomepageProfile"> | |||
| <ul> | |||
| @@ -97,16 +86,30 @@ | |||
| </div> | |||
| <div class="navHomepageNews" id="user_messages"> | |||
| <%= link_to "", user_path(User.current, :click_user_message => true), :class => "homepageNewsIcon", :target => "_Blank", :title => "您的所有消息" %> | |||
| <% new_message_count = User.current.count_new_message.to_i %> | |||
| <a href="<%= user_message_path(User.current,click_user_message: true) %>" class="fl"><i class="iconfont icon-xiaoxilingdang fontGrey4 f22 fl mt7"></i></a> | |||
| <% new_message_count = User.current.count_new_message("all").to_i %> | |||
| <% if new_message_count > 0 %> | |||
| <div ><%= link_to new_message_count, user_path(User.current, :click_user_message => true), :class => "newsActive", :target => "_Blank" %></div> | |||
| <%#= link_to new_message_count, user_path(User.current, :click_user_message => true), :class => "newsActive", :target => "_Blank" %> | |||
| <span class="haveNews"></span> | |||
| <% end %> | |||
| <%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %> | |||
| <div class="shadowbox_news undis" id="user_messages_list"> | |||
| <%= render :partial => 'layouts/message_loading' %> | |||
| </div> | |||
| </div> | |||
| <div class="fr mr20" id="navHomepageSearch"> | |||
| <!--<form class="navHomepageSearchBox">--> | |||
| <% name = name%> | |||
| <%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %> | |||
| <input type="text" name="q" value="<%= name.nil? ? "" : name %>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索" style="width: 300px" /> | |||
| <input type="hidden" name="search_type" id="type" value="all"/> | |||
| <input type="text" style="display: none;"/> | |||
| <a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"> | |||
| <i class="iconfont icon-sousuo f20 ml5 mt4 fl"></i> | |||
| </a> | |||
| <% end %> | |||
| </div> | |||
| </div> | |||
| <script type="text/javascript"> | |||
| @@ -243,11 +243,14 @@ | |||
| <% content = '<span class="shadowbox_news_user">'+ma.author.show_name+' </span>提到了你:'+ma.subject.html_safe %> | |||
| <li><%=link_to content.html_safe, ma.url, :title => ma.author.show_name+' 提到了你:'+ma.subject.html_safe, :target => '_blank' %></li> | |||
| <% end %> | |||
| <% end %> | |||
| <% elsif ma.class == PrivateMessage %> | |||
| <li><a href="<%=private_messages_detail_user_private_messages_path(current_user, target_ids: ma.target_id) %>" target="_blank" ><span class="shadowbox_news_user"><%= ma.target.try(:show_name) %> </span>给您发了私信:<%= ma.content%></a></li> | |||
| <% end %> | |||
| <% end %> | |||
| </ul> | |||
| <!--<a onclick = "show_more();" id = "show_more_messages" style="display: none; cursor: pointer;" class = "shadowbox_news_all">展开更多</a>--> | |||
| <%= link_to '查看全部', user_path(User.current), :id =>'show_all_messages', :class => "shadowbox_news_all", :target =>"_Blank" %> | |||
| <%= link_to '查看全部', user_message_path(User.current), :id =>'show_all_messages', :class => "shadowbox_news_all", :target =>"_Blank" %> | |||
| </div> | |||
| <script type="text/javascript"> | |||
| @@ -1,6 +1,6 @@ | |||
| <div class="navHomepage"> | |||
| <div class="navHomepageLogo fl"> | |||
| <%= link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), home_path %> | |||
| <%= link_to image_tag("../images/logo_blue.png",width:"51px", height: "45px",class: "mt3"), homes_path %> | |||
| </div> | |||
| <div class="fl"> | |||
| <ul> | |||
| @@ -11,12 +11,12 @@ | |||
| <% memo = Memo.where(:id => 1168).first %> | |||
| <% unless memo.nil? %> | |||
| <li class="navHomepageMenu fl mr40"> | |||
| <a href="http://forge.trustie.net/forums/1/memos/1168" target="_blank" class="c_white f16 db p10" >帮助中心</a> | |||
| <a href="http://forge.trustie.net/forums/1/memos/1168" target="_blank" class="color-grey3 f16 db p10" >帮助中心</a> | |||
| </li> | |||
| <% end %> | |||
| <% else %> | |||
| <li class="navHomepageMenu fl mr40"> | |||
| <%= link_to "问吧", forums_path, :class =>"c_white f16 db p10", :target => "_blank" %> | |||
| <%= link_to "问吧", forums_path, :class =>"color-grey3 f16 db p10", :target => "_blank" %> | |||
| </li> | |||
| <% end %> | |||
| </ul> | |||
| @@ -59,41 +59,43 @@ | |||
| } | |||
| } | |||
| </script> | |||
| <div class="fl" id="navHomepageSearch" > | |||
| <div id="loginInButton" class="fr ml20"> | |||
| <a href="<%= signin_url_without_domain %>" class="color-grey3 db">登录</a> | |||
| </div> | |||
| <div id="loginSignButton" class="fr"> | |||
| <a href="<%= register_url_without_domain %>" class="color-grey3 db">注册</a> | |||
| </div> | |||
| <div class="fr mr20" id="navHomepageSearch" > | |||
| <!--<form class="navHomepageSearchBox">--> | |||
| <% name = name%> | |||
| <%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox',:style=>'width:380px;', method: :get) do %> | |||
| <input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的班级、项目、用户、资源以及帖子" onkeypress="search_in_header_I(event,$(this));"/> | |||
| <input type="hidden" name="search_type" id="type" value="all"/> | |||
| <input type="text" style="display: none;"/> | |||
| <a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a> | |||
| <input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的班级、项目、用户、资源以及帖子" onkeypress="search_in_header_I(event,$(this));"/> | |||
| <input type="hidden" name="search_type" id="type" value="all"/> | |||
| <input type="text" style="display: none;"/> | |||
| <a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"> | |||
| <i class="iconfont icon-sousuo f20 ml5 mt4 fl"></i> | |||
| </a> | |||
| <% end %> | |||
| <!--<div class="navSearchTypeBox" id="navHomepageSearchType">--> | |||
| <!--<div class="fl mr15 mt8">--> | |||
| <!--<input type="radio" value="courses" name="search_type" checked/>--> | |||
| <!--课程--> | |||
| <!--</div>--> | |||
| <!--<div class="fl mr15 mt8">--> | |||
| <!--<input type="radio" value="projects" name="search_type" />--> | |||
| <!--项目--> | |||
| <!--</div>--> | |||
| <!--<div class="fl mr15 mt8">--> | |||
| <!--<input type="radio" value="users" name="search_type" />--> | |||
| <!--用户--> | |||
| <!--</div>--> | |||
| <!--<div id="navSearchAlert" class="fr mr10">--> | |||
| <!--<span class="c_red">请选择搜索类型</span>--> | |||
| <!--</div>--> | |||
| <!--<div class="fl mr15 mt8">--> | |||
| <!--<input type="radio" value="courses" name="search_type" checked/>--> | |||
| <!--课程--> | |||
| <!--</div>--> | |||
| <!--<div class="fl mr15 mt8">--> | |||
| <!--<input type="radio" value="projects" name="search_type" />--> | |||
| <!--项目--> | |||
| <!--</div>--> | |||
| <!--<div class="fl mr15 mt8">--> | |||
| <!--<input type="radio" value="users" name="search_type" />--> | |||
| <!--用户--> | |||
| <!--</div>--> | |||
| <!--<div id="navSearchAlert" class="fr mr10">--> | |||
| <!--<span class="c_red">请选择搜索类型</span>--> | |||
| <!--</div>--> | |||
| <!--</div>--> | |||
| </div> | |||
| <div id="loginInButton" class="fr ml20"> | |||
| <a href="<%= signin_url_without_domain %>" class="c_white db">登录</a> | |||
| </div> | |||
| <div id="loginSignButton" class="fr"> | |||
| <a href="<%= register_url_without_domain %>" class="c_white db">注册</a> | |||
| </div> | |||
| </div> | |||
| <script type="text/javascript"> | |||
| @@ -32,7 +32,7 @@ | |||
| </script> | |||
| </head> | |||
| <body class="<%=h body_css_classes %>" onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="cl"></div> | |||
| <div class="navContainer mb10"> | |||
| <% if User.current.logged? %> | |||
| @@ -66,6 +66,7 @@ | |||
| </div> | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| </div> | |||
| <div class="cl"></div> | |||
| <%= call_hook :view_layouts_base_body_bottom %> | |||
| </body> | |||
| @@ -32,7 +32,7 @@ | |||
| <div class="project_header_tag"> | |||
| 标签:项目托管 社交网络 Rails | |||
| </div> | |||
| <%= link_to "主页:www.trustie.net", home_path, :class => 'project_homepage_tag' %> | |||
| <%= link_to "主页:www.trustie.net", homes_path, :class => 'project_homepage_tag' %> | |||
| <h1><%= page_header_title %> | |||
| <% if @project.description.present? %> | |||
| <%= textilizable @project.description %> | |||
| @@ -43,8 +43,8 @@ | |||
| <%= link_to(session[:project_focus_num], {:controller => 'projects', :action => 'focus'}, :class => 'project_infor_tag') +'个关注(' %> | |||
| <%= link_to(session[:project_investor_num], {:controller => 'projects', :action =>'investor'}, :class => 'project_infor_tag') +'个投资者)'+ '|' %> | |||
| <%= link_to(session[:project_issue_num], {:controller => 'projects', :action => 'issue'}, :class => 'project_infor_tag') +'个缺陷'+'|' %> | |||
| <%= link_to(session[:project_mission_num], {:controller =>'projects', :action =>'mission'}, :class => 'project_infor_tag')+'个任务'+'|'%> | |||
| <%= link_to(session[:project_on_num], {:controller =>'projects', :action =>'on'}, :class => 'project_infor_tag')+'个提交'+'|'%> | |||
| <%= link_to(session[:project_mission_num], {:controller =>'projects', :action =>'mission'}, :class => 'project_infor_tag')+'个任务'+'|'%> | |||
| <%= link_to(session[:project_on_num], {:controller =>'projects', :action =>'on'}, :class => 'project_infor_tag')+'个提交'+'|'%> | |||
| <%= link_to(session[:project_file_num], {:controller =>'projects', :action =>'file'}, :class => 'project_infor_tag')+'个文件' %> | |||
| <hr size="5"> | |||
| </div> | |||
| @@ -57,7 +57,7 @@ | |||
| <div style="clear:both;"> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div> | |||
| @@ -22,7 +22,7 @@ | |||
| <div id="wrapper"> | |||
| <div id="wrapper2"> | |||
| <div id="wrapper3"> | |||
| <% if session[:enterprise_college] == 2 %> | |||
| <%=render :partial => 'layouts/base_enterprise_header'%> | |||
| <% elsif session[:enterprise_college] == 1 %> | |||
| @@ -30,7 +30,7 @@ | |||
| <% else %> | |||
| <%=render :partial => 'layouts/base_header'%> | |||
| <% end %> | |||
| <div id="main"> | |||
| <!-- added by bai --> | |||
| <div class="top-content"> | |||
| @@ -62,7 +62,7 @@ | |||
| </a> | |||
| </td> | |||
| <td > | |||
| <%=link_to l(:field_homepage), home_path %> > | |||
| <%=link_to l(:field_homepage), homes_path %> > | |||
| <%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %> > | |||
| <span> | |||
| <%=link_to @bid.name ,bid_path %> | |||
| @@ -71,7 +71,7 @@ | |||
| </tr> | |||
| </table> | |||
| </div> | |||
| <!-- end --> | |||
| <div id="sidebar"> | |||
| <div class="main_context"> | |||
| @@ -137,7 +137,7 @@ | |||
| <%= @bid.budget%> | |||
| <%= l(:label_bids_credit_number) %> | |||
| </td> | |||
| <% end %> | |||
| <% end %> | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| @@ -180,7 +180,7 @@ | |||
| <%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%> | |||
| </div> | |||
| </div> | |||
| <!--tags--> | |||
| <div class="user_fans"> | |||
| <div class="font_title_left"> | |||
| @@ -191,7 +191,7 @@ | |||
| <div class="user_underline"></div> | |||
| <table style="font-family:'微软雅黑'"> | |||
| <tr> | |||
| <td><!-- added by william -for tag --> | |||
| <td><!-- added by william -for tag --> | |||
| <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%> | |||
| </td> | |||
| </tr> | |||
| @@ -217,7 +217,7 @@ | |||
| </p> | |||
| <% end%> | |||
| </td> | |||
| </tr> | |||
| </tr> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| @@ -235,11 +235,11 @@ | |||
| <% for project in @bid.projects%> | |||
| <%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name),project_path(project) %> | |||
| <% end%> | |||
| <% else %> | |||
| <% else %> | |||
| <p class="font_lighter"><%= l(:label_no_bid_project) %></p> | |||
| <% end %> | |||
| </td> | |||
| </tr> | |||
| </tr> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| @@ -7,7 +7,7 @@ | |||
| <meta name="keywords" content="issue,bug,tracker" /> | |||
| <%= csrf_meta_tag %> | |||
| <%= favicon %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user','css/iconfont/iconfont', :media => 'all' %> | |||
| <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> | |||
| <%= javascript_heads %> | |||
| <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify','contest'%> | |||
| @@ -30,6 +30,7 @@ | |||
| </head> | |||
| <body onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="navContainer"> | |||
| <% is_current_user = User.current.logged? && User.current == @user%> | |||
| <% if User.current.logged? %> | |||
| @@ -80,7 +81,7 @@ | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <div id="ajax-modal" style="display:none;"></div> | |||
| <div id="ajax-indicator" style="display:none;"> | |||
| <span><%= l(:label_loading) %></span> | |||
| @@ -12,7 +12,7 @@ | |||
| <%= javascript_heads %> | |||
| <%= heads_for_theme %> | |||
| <%= call_hook :view_layouts_base_html_head %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','css/sy_public','css/syllabus', 'css/moduel','css/contest'%> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify','css/iconfont/iconfont', 'css/courses','css/popup','css/sy_public','css/syllabus', 'css/moduel','css/contest'%> | |||
| <%= javascript_include_tag "course","avatars","header","attachments",'prettify','contest' %> | |||
| <!-- page specific tags --> | |||
| <%= yield :header_tags -%> | |||
| @@ -31,6 +31,7 @@ | |||
| <!--add by huang--> | |||
| <body onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="navContainer mb10"> <%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %></div> | |||
| <div class="cl"></div> | |||
| @@ -97,6 +98,7 @@ | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <% if hidden_unproject_infos %> | |||
| <%= render :partial => 'layouts/new_feedback' %> | |||
| <% end %> | |||
| @@ -7,7 +7,7 @@ | |||
| <meta name="keywords" content="issue,bug,tracker" /> | |||
| <%= csrf_meta_tag %> | |||
| <%= favicon %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public','css/iconfont/iconfont', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %> | |||
| <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> | |||
| <%= javascript_heads %> | |||
| <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%> | |||
| @@ -30,6 +30,7 @@ | |||
| </head> | |||
| <body onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="navContainer"> | |||
| <% is_current_user = User.current.logged? && User.current == @user%> | |||
| <% if User.current.logged? %> | |||
| @@ -104,7 +105,7 @@ | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <div id="ajax-modal" style="display:none;"></div> | |||
| <div id="ajax-indicator" style="display:none;"> | |||
| <span><%= l(:label_loading) %></span> | |||
| @@ -42,6 +42,7 @@ | |||
| </head> | |||
| <!--add by huang--> | |||
| <body onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="navContainer"> | |||
| <% if User.current.logged? %> | |||
| <%= render :partial => 'layouts/logined_header' %> | |||
| @@ -168,7 +169,7 @@ | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <%= render :partial => 'layouts/new_feedback' %> | |||
| <div id="ajax-indicator" style="display:none;"> | |||
| <span><%= l(:label_loading) %></span> | |||
| @@ -162,7 +162,7 @@ | |||
| </script> | |||
| </head> | |||
| <body class="<%= h body_css_classes %>" onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="cl"></div> | |||
| <div class="navContainer"> | |||
| <% if User.current.logged? %> | |||
| @@ -241,12 +241,13 @@ | |||
| <%#= call_hook :view_layouts_base_content %> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div> | |||
| <div id="ajax-modal" style="display:none;"></div> | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <%#= call_hook :view_layouts_base_body_bottom %> | |||
| </body> | |||
| </html> | |||
| @@ -77,7 +77,7 @@ | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <p class="top-content-list-homework"><%= link_to "主页", home_path %> | |||
| <p class="top-content-list-homework"><%= link_to "主页", homes_path %> | |||
| > | |||
| <a href="http://<%= Setting.host_course%>" style="color: #15bccf;"> | |||
| <%=l(:label_course_practice) %> | |||
| @@ -19,15 +19,15 @@ | |||
| </head> | |||
| <!--add by huang--> | |||
| <body onload="prettyPrint();" style="background: #fff;"> | |||
| <div class="pageContainer"> | |||
| <div class=""> | |||
| <%= yield %> | |||
| </div> | |||
| <div class="cl"></div> | |||
| <%#= render :partial => 'layouts/footer' %> | |||
| <p class="tac mb20"><%= l(:label_rights_reserved)%><span class="mr10"></span><a href="http://beian.miit.gov.cn/" class=" f_grey" target="_blank"><%= l(:label_license)%></a></p> | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| </div> | |||
| <%#= render :partial => 'layouts/new_feedback' %> | |||
| <div id="ajax-modal" style="display:none;"></div> | |||
| <%= call_hook :view_layouts_base_body_bottom %> | |||
| @@ -23,7 +23,7 @@ | |||
| <!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示--> | |||
| </head> | |||
| <body class="<%=h body_css_classes %>" onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="cl"></div> | |||
| <div class="navContainer mb10"> | |||
| <% if User.current.logged? %> | |||
| @@ -54,6 +54,7 @@ | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <%= call_hook :view_layouts_base_body_bottom %> | |||
| </body> | |||
| </html> | |||
| @@ -31,7 +31,7 @@ | |||
| </head> | |||
| <!--add by huang--> | |||
| <body class="<%= h body_css_classes %>"> | |||
| <div class="pageContainer"> | |||
| <div class="cl"></div> | |||
| <div class="navContainer mb10"> | |||
| <% if User.current.logged? %> | |||
| @@ -48,7 +48,7 @@ | |||
| <div id="main"> | |||
| <!-- added by bai --> | |||
| <div class="top-content"> | |||
| <div class="top-content"> | |||
| <table> | |||
| <tr> | |||
| <td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td> | |||
| @@ -56,20 +56,20 @@ | |||
| </tr> | |||
| <tr> | |||
| <td style="padding-left: 8px"><a><%= link_to request.host()+"/forums", forums_path %></a></td> | |||
| <td><p class="top-content-list"><%=link_to l(:label_home),home_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %> > <%=link_to @memo.subject, forum_memo_path(@forum, @memo) %></p></td> | |||
| <td><p class="top-content-list"><%=link_to l(:label_home),homes_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %> > <%=link_to @memo.subject, forum_memo_path(@forum, @memo) %></p></td> | |||
| </tr> | |||
| </table> | |||
| </table> | |||
| </div> | |||
| <div id="sidebar"> | |||
| <!--informations--> | |||
| <div class="sidebar-forums"> | |||
| <div class="forums-line"> | |||
| <div class="forums-line"> | |||
| <div class="forums-title"><%= @forum.name %></div> | |||
| <div class="forums-description upload_img"><%= @forum.description.html_safe %></div> | |||
| </div> | |||
| </div> | |||
| <!--informations--> | |||
| <div class="formus-first-title" >创建人信息</div> | |||
| <div class="forums-info"> | |||
| <div class="forums-info"> | |||
| <div style="padding-top: 20px" > | |||
| <span class="forums-avatar-left"><%= image_tag(url_to_avatar(@forum.creator), :class => 'vatar-size') %></span> | |||
| <span class="forums-avatar-right"> | |||
| @@ -83,11 +83,11 @@ | |||
| <% end %> | |||
| </div> | |||
| </div> | |||
| <!--tags--> | |||
| <% if User.current.logged? || User.current.admin? %> | |||
| <!--tags--> | |||
| <% if User.current.logged? || User.current.admin? %> | |||
| <!-- <div class="forums-tags">< %= render :partial => 'tags/tag', :locals => {:obj => @forum.creator,:object_flag => "1"} %></div> --> | |||
| <div class="forums-tags"><%= render :partial => 'tags/tag', :locals => {:obj => @forum,:object_flag => "5"} %></div> | |||
| <% end %> | |||
| <% end %> | |||
| </div> | |||
| </div> | |||
| <div id="content"> | |||
| @@ -108,8 +108,8 @@ | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <%= call_hook :view_layouts_base_body_bottom %> | |||
| </div> | |||
| </body> | |||
| </html> | |||
| @@ -19,6 +19,7 @@ | |||
| <!--add by huang--> | |||
| <body onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="navContainer mb10"> <%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %></div> | |||
| <div class="cl"></div> | |||
| @@ -33,6 +34,7 @@ | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <% if hidden_unproject_infos %> | |||
| <%= render :partial => 'layouts/new_feedback' %> | |||
| <% end %> | |||
| @@ -78,7 +78,7 @@ | |||
| </tr> | |||
| <tr> | |||
| <td> | |||
| <%=link_to l(:field_homepage), home_path %> > | |||
| <%=link_to l(:field_homepage), homes_path %> > | |||
| <a href="http://<%= Setting.host_contest %>" class="link_other_item"> | |||
| <%=l(:label_contests_management_platform)%> | |||
| @@ -40,7 +40,7 @@ | |||
| </tr> | |||
| <tr> | |||
| <td style="padding-left: 8px"><%= link_to request.host()+"/open_source_projects", :controller => 'open_source_projects', :action => 'index' %></td> | |||
| <td ><%= link_to l(:field_homepage), home_path %> > <%= link_to "开源项目社区", :controller => 'open_source_projects', :action => 'index' %> > <%=link_to @open_source_project.name, open_source_project_path(@open_source_project) %></td> | |||
| <td ><%= link_to l(:field_homepage), homes_path %> > <%= link_to "开源项目社区", :controller => 'open_source_projects', :action => 'index' %> > <%=link_to @open_source_project.name, open_source_project_path(@open_source_project) %></td> | |||
| </tr> | |||
| </table> | |||
| </div> | |||
| @@ -158,4 +158,3 @@ | |||
| </div> | |||
| </body> | |||
| </html> | |||
| @@ -12,7 +12,7 @@ | |||
| <%= favicon %> | |||
| <%= javascript_heads %> | |||
| <%= heads_for_theme %> | |||
| <%= stylesheet_link_tag 'prettify','jquery/jquery-ui-1.9.2','css/common','css/structure','css/public','repository','css/courses','css/org','css/project', 'css/popup', 'css/moduel' %> | |||
| <%= stylesheet_link_tag 'prettify','jquery/jquery-ui-1.9.2','css/common','css/structure','css/public','repository','css/iconfont/iconfont','css/courses','css/org','css/project', 'css/popup', 'css/moduel' %> | |||
| <%= javascript_include_tag 'cookie','project',"avatars", 'organization','header','prettify','select_list_move','org'%> | |||
| <%= javascript_include_tag 'attachments' %> | |||
| <%= call_hook :view_layouts_base_html_head %> | |||
| @@ -7,7 +7,7 @@ | |||
| <meta name="keywords" content="issue,bug,tracker" /> | |||
| <%= csrf_meta_tag %> | |||
| <%= favicon %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user','css/magic-check','css/iconfont/iconfont', :media => 'all' %> | |||
| <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> | |||
| <%= javascript_heads %> | |||
| <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%> | |||
| @@ -30,6 +30,7 @@ | |||
| </head> | |||
| <body onload="prettyPrint();"> | |||
| <div class="pageContainer"> | |||
| <div class="navContainer"> | |||
| <% is_current_user = User.current.logged? && User.current == @user%> | |||
| <% if User.current.logged? %> | |||
| @@ -80,9 +81,10 @@ | |||
| </div> | |||
| </div> | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <div id="ajax-modal" style="display:none;"></div> | |||
| <div id="ajax-indicator" style="display:none;"> | |||
| <span><%= l(:label_loading) %></span> | |||
| @@ -9,7 +9,7 @@ | |||
| <%= favicon %> | |||
| <%= javascript_heads %> | |||
| <%= heads_for_theme %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome' %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','css/iconfont/iconfont','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome' %> | |||
| <%= call_hook :view_layouts_base_html_head %> | |||
| <!-- page specific tags --> | |||
| <%= yield :header_tags -%> | |||
| @@ -17,23 +17,23 @@ | |||
| <!--add by huang--> | |||
| <body onload="prettyPrint();"> | |||
| <div class="navContainer mb10"> <%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %></div> | |||
| <div class="cl"></div> | |||
| <div class="pageContainer"> | |||
| <div class="navContainer mb10"> <%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %></div> | |||
| <div class="cl"></div> | |||
| <div id="Container"> | |||
| <div id="content" class="sy_contanier" style=" width:1000px; margin:0 auto;"> | |||
| <%= render :partial => 'layouts/base_project_top' %> | |||
| </div> | |||
| <div id="Container"> | |||
| <div id="content" class="sy_contanier" style=" width:1000px; margin:0 auto;"> | |||
| <%= render :partial => 'layouts/base_project_top' %> | |||
| </div> | |||
| <%= render_flash_messages %> | |||
| <%= yield %> | |||
| <%= call_hook :view_layouts_base_content %> | |||
| <div style="clear:both;"></div> | |||
| <%= render_flash_messages %> | |||
| <%= yield %> | |||
| <%= call_hook :view_layouts_base_content %> | |||
| </div> | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| </div> | |||
| <div class="cl"></div> | |||
| <%= render :partial => 'layouts/footer' %> | |||
| <div class="cl"></div> | |||
| <% if hidden_unproject_infos %> | |||
| <%= render :partial => 'layouts/new_feedback' %> | |||
| <% end %> | |||
| @@ -9,7 +9,7 @@ | |||
| <%= favicon %> | |||
| <%= javascript_heads %> | |||
| <%= heads_for_theme %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome' %> | |||
| <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/iconfont/iconfont','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome' %> | |||
| <%= call_hook :view_layouts_base_html_head %> | |||
| <!-- page specific tags --> | |||
| <%= yield :header_tags -%> | |||