fix
This commit is contained in:
commit
88172dbe1e
87
ReadMe.txt
87
ReadMe.txt
|
@ -1,7 +1,7 @@
|
|||
===================================[2014-04-09]=================================
|
||||
kw: 域名, 二级域名, subdomain, forge, course, contest
|
||||
域名跳转(forge/course/contest)这几个设置在settings.yml中
|
||||
但是跳转在development模式下会导致无法开发
|
||||
kw: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, subdomain, forge, course, contest
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>forge/course/contest<73><74><EFBFBD>⼸<EFBFBD><E2BCB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>settings.yml<6D><6C>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>developmentģʽ<EFBFBD>»ᵼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
app/models/setting.rb :165
|
||||
# fixed domain url in development. tantantan's bug
|
||||
|
@ -10,90 +10,95 @@ app/models/setting.rb :165
|
|||
define_singleton_method m do; nil; end if m.to_s =~ /([a-zA-Z]+_domain)$/
|
||||
end
|
||||
end
|
||||
程序部分链接中制定了subdomain参数,使链接在二级域名中来回跳转。
|
||||
为了开发方便,使之功能在development模式下失效。
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><EFBFBD><EFBFBD>subdomain<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>
|
||||
Ϊ<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣬ʹ֮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>developmentģʽ<EFBFBD><EFBFBD>ʧЧ<EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
===================================[2014-04-09]=================================
|
||||
kw: 菜单, 导航栏, layout
|
||||
网页上方的导航条没有用Redmine::MenuManager
|
||||
MenuManager的样式无法定制,菜单显示条件if中的proc执行行为没有了解
|
||||
kw: <EFBFBD>˵<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, layout
|
||||
<EFBFBD><EFBFBD>ҳ<EFBFBD>Ϸ<EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Redmine::MenuManager
|
||||
MenuManager<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>if<EFBFBD>е<EFBFBD>procִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊû<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD>
|
||||
|
||||
#导航栏匹配域名显示和改变
|
||||
#<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ı<EFBFBD>
|
||||
app\helper\application_helper.rb
|
||||
render_dynamic_nav 方法中,利用变量,可以设置在layout中具体显示哪些条目
|
||||
render_dynamic_nav <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>layout<EFBFBD>о<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD>Ŀ
|
||||
|
||||
app\views\layouts\_base_header.html.erb
|
||||
需要显示的条目,由具体的实例变量设置(在各个layout中)
|
||||
<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD>ڸ<EFBFBD><EFBFBD><EFBFBD>layout<EFBFBD>У<EFBFBD>
|
||||
|
||||
|
||||
===================================[2014-04-09]=================================
|
||||
kw: home_path, 首页, 跳转, 二级域名, welcome
|
||||
#首页根据域名匹配进入不同的页面
|
||||
kw: home_path, <EFBFBD><EFBFBD>ҳ, <20><>ת, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, welcome
|
||||
#<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻ͬ<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD>
|
||||
app\controller\welcome_controller.rb
|
||||
#entry_select 放射设置二级域名所显示的首页
|
||||
#entry_select <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
|
||||
|
||||
|
||||
|
||||
===================================[2014-06-06]=================================
|
||||
kw: user_scores
|
||||
user_scores表结构有问题,需要运行
|
||||
user_scores<EFBFBD><EFBFBD><EFBFBD>ṹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⣬<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bundle exec rake db:migrate:down VERSION=20140410021724
|
||||
bundle exec rake db:migrate:up VERSION=20140410021724
|
||||
|
||||
|
||||
|
||||
===================================[2014-07-08]=================================
|
||||
kw: CKEditor, 富文本, 编辑器
|
||||
CKEditor插件加载方法
|
||||
1.把插件文件夹拷入plugins文件夹,确保文件夹名为redmine_ckeditor
|
||||
2.运行 bundle install --without development test
|
||||
3.运行 rake redmine:plugins:migrate RAILS_ENV=production
|
||||
4.启动服务器
|
||||
5.配置CKEditor插件(Administration > Plugins > Configure)
|
||||
6.把文本格式 (Administration > Settings > General > Text formatting)改为CKEditor
|
||||
注意:一定要先配置CKEditor插件再见文本格式更改,不然,数据库不会生成对应记录,会报错。。
|
||||
kw: CKEditor, <EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>, <20>༭<EFBFBD><E0BCAD>
|
||||
CKEditor<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><EFBFBD><EFBFBD>
|
||||
1.<EFBFBD>Ѳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>п<EFBFBD><EFBFBD><EFBFBD>plugins<EFBFBD>ļ<EFBFBD><EFBFBD>У<EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊredmine_ckeditor
|
||||
2.<EFBFBD><EFBFBD><EFBFBD><EFBFBD> bundle install --without development test
|
||||
3.<EFBFBD><EFBFBD><EFBFBD><EFBFBD> rake redmine:plugins:migrate RAILS_ENV=production
|
||||
4.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
5.<EFBFBD><EFBFBD><EFBFBD><EFBFBD>CKEditor<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(Administration > Plugins > Configure)
|
||||
6.<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ʽ (Administration > Settings > General > Text formatting)<29><>ΪCKEditor
|
||||
ע<EFBFBD>⣺һ<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CKEditor<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ټ<EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿⲻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɶ<EFBFBD>Ӧ<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD>ᱨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
|
||||
===================================[2014-07-19]=================================
|
||||
kw: 首页, 定制, forge, course, contest, 排序
|
||||
若遇到首页定制报错问题请尝试如下操作
|
||||
如果运行迁移文件有报错与‘sort_type’相关
|
||||
先运行 bundle exec rake db:migrate:down version=20140716021202 bundle exec rake db:migrate:up version=20140716021202
|
||||
在按如下步骤执行,未报与之相关的则直接按如下步骤执行
|
||||
1.运行 bundle exec rake db:migrate:down version=20140719080032
|
||||
2.运行 bundle exec rake db:migrate:up version=20140719080032
|
||||
kw: <EFBFBD><EFBFBD>ҳ, <20><><EFBFBD><EFBFBD>, forge, course, contest, <20><><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>볢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǩ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD>롮sort_type<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> bundle exec rake db:migrate:down version=20140716021202 bundle exec rake db:migrate:up version=20140716021202
|
||||
<EFBFBD>ڰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>У<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>Ӱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>
|
||||
1.<EFBFBD><EFBFBD><EFBFBD><EFBFBD> bundle exec rake db:migrate:down version=20140719080032
|
||||
2.<EFBFBD><EFBFBD><EFBFBD><EFBFBD> bundle exec rake db:migrate:up version=20140719080032
|
||||
===================================[2014-07-30]=================================
|
||||
kw: 首页, 定制, forge, course, contest, 排序,image_width
|
||||
kw: <EFBFBD><EFBFBD>ҳ, <20><><EFBFBD><EFBFBD>, forge, course, contest, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>image_width
|
||||
|
||||
undefined image_width 问题
|
||||
undefined image_width <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bundle exec rake db:migrate:down version=20140725062302
|
||||
bundle exec rake db:migrate:up version=20140725062302
|
||||
|
||||
=================================[2014-07-19]=====================================
|
||||
kw: Mysql2::Error,存储过程,CALL sp_project_status_cursor();
|
||||
kw: Mysql2::Error,<EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,CALL sp_project_status_cursor();
|
||||
bundle exec rake db:migrate:down version=20130828004955
|
||||
bundle exec rake db:migrate:up version=20130828004955
|
||||
|
||||
=================================[2014-08-13]====================================
|
||||
kw:配置支持的图片格式
|
||||
默认支持如下格式:"bmp,jpeg,jpg,png,gif"
|
||||
可在configuration.yml中修改,格式:pic_types: "bmp,jpeg,jpg,png,gif"(注意:pic_types若前面有#号需去掉)
|
||||
配置完成后重启服务
|
||||
kw:<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD>ͼƬ<EFBFBD><EFBFBD>ʽ
|
||||
Ĭ<EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ʽ<EFBFBD><EFBFBD>"bmp,jpeg,jpg,png,gif"
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>configuration.yml<6D><6C><EFBFBD>ģ<DEB8><C4A3><EFBFBD>ʽ<EFBFBD><CABD>pic_types: "bmp,jpeg,jpg,png,gif"(ע<>⣺pic_types<65><73>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>#<23><><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5>)
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
=================================[2014-08-16]====================================
|
||||
kw:数据迁移,project_scores表已存在
|
||||
kw:<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǩ<EFBFBD>ƣ<EFBFBD>project_scores<EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD><EFBFBD>
|
||||
bundle exec rake db:migrate:down VERSION=20140811022947
|
||||
bundle exec rake db:migrate:up VERSION=20140811022947
|
||||
bundle exec rake db:migrate
|
||||
bundle exec rake project_score:calculate
|
||||
=================================[2014-10-17]====================================
|
||||
kw:数据迁移,web_footer_oranizers表已存在
|
||||
kw:<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǩ<EFBFBD>ƣ<EFBFBD>web_footer_oranizers<EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD><EFBFBD>
|
||||
bundle exec rake db:migrate:down VERSION=20141013014908
|
||||
bundle exec rake db:migrate:up VERSION=20141013014908
|
||||
bundle exec rake db:migrate
|
||||
kw:数据迁移,web_footer_companies表已存在
|
||||
kw:<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǩ<EFBFBD>ƣ<EFBFBD>web_footer_companies<EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD><EFBFBD>
|
||||
bundle exec rake db:migrate:down VERSION=20141013023400
|
||||
bundle exec rake db:migrate:up VERSION=20141013023400
|
||||
bundle exec rake db:migrate
|
||||
|
||||
=================================[2019-11-12]====================================
|
||||
初始化开源项目相关的licenses和ignores
|
||||
bundle exec rake licenses:init
|
||||
bundle exec rake ignores:init
|
||||
|
|
|
@ -527,6 +527,27 @@ class AdminController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def home
|
||||
if request.get?
|
||||
@home = Home.first
|
||||
elsif request.post?
|
||||
@home = Home.first || Home.new
|
||||
@home.name = params[:home][:name]
|
||||
@home.content = params[:home][:content]
|
||||
if @home.save
|
||||
respond_to do |format|
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
format.html { redirect_to admin_home_path }
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
flash.now[:error] = "#{l :label_first_page_create_fail}: #{@home.errors.full_messages[0]}"
|
||||
format.html { render :action => 'home' }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def course_page_made
|
||||
if request.get?
|
||||
@course_page = FirstPage.find_by_page_type('course')
|
||||
|
|
|
@ -217,8 +217,7 @@ class ProjectsController < ApplicationController
|
|||
elsif params[:contest_id]
|
||||
@contest = Contest.find params[:contest_id]
|
||||
end
|
||||
|
||||
render :layout => 'new_base'
|
||||
render :layout => 'base_projects_new'
|
||||
else
|
||||
redirect_to signin_url
|
||||
end
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
module HomesHelper
|
||||
|
||||
def home_cover_tag(home)
|
||||
file_path = home&.cover&.file.nil? ? "/images/introduce/activeBanner.jpg": local_path(home.cover.file)
|
||||
file_path =
|
||||
if File.exists?(Rails.root.join('/public/images', url_to_avatar(home)))
|
||||
url_to_avatar(home)
|
||||
else
|
||||
"/images/introduce/activeBanner.jpg"
|
||||
end
|
||||
image_tag(file_path, class: 'mb30', width: '592px')
|
||||
end
|
||||
|
||||
|
|
|
@ -674,4 +674,20 @@ module ProjectsHelper
|
|||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
def select_project_categories
|
||||
ProjectCategory.desc_with_position.collect { |c| [c.name, c.id]}
|
||||
end
|
||||
|
||||
def select_project_languages
|
||||
ProjectLanguage.desc_with_position.collect { |pl| [pl.name, pl.id] }
|
||||
end
|
||||
|
||||
def select_project_licenses
|
||||
License.all.collect { |c| [c.name, c.id]}
|
||||
end
|
||||
|
||||
def select_project_ignores
|
||||
Ignore.all.collect { |c| [c.name, c.id]}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
class Ignore < ActiveRecord::Base
|
||||
attr_accessible :content, :name
|
||||
end
|
|
@ -0,0 +1,3 @@
|
|||
class License < ActiveRecord::Base
|
||||
attr_accessible :key, :name
|
||||
end
|
|
@ -43,6 +43,8 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
belongs_to :ignore
|
||||
belongs_to :license
|
||||
belongs_to :project_category , :counter_cache => true
|
||||
belongs_to :project_language , :counter_cache => true
|
||||
belongs_to :owner, :class_name => 'User', :foreign_key => :user_id
|
||||
|
@ -852,7 +854,11 @@ class Project < ActiveRecord::Base
|
|||
'dts_test',
|
||||
'attachmenttype',
|
||||
'enterprise_name',
|
||||
'gpid'
|
||||
'gpid',
|
||||
'project_category_id',
|
||||
'project_language_id',
|
||||
'license_id',
|
||||
'ignore_id'
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# 项目类别
|
||||
class ProjectCategory < ActiveRecord::Base
|
||||
attr_accessible :name, :position, :projects_count
|
||||
has_ancestry
|
||||
# has_ancestry
|
||||
|
||||
has_many :projects
|
||||
|
||||
scope :desc_with_position, -> { order('position DESC') }
|
||||
end
|
||||
|
|
|
@ -3,4 +3,6 @@ class ProjectLanguage < ActiveRecord::Base
|
|||
attr_accessible :name, :position, :projects_count
|
||||
|
||||
has_many :projects
|
||||
|
||||
scope :desc_with_position, -> { order('position DESC') }
|
||||
end
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<h3>trustie首页</h3>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to "首页定制", admin_home_path, class: "#{current_page?(admin_home_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to "动态新闻", admin_dynamic_news_path, class: "#{current_page?(admin_dynamic_news_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to "开源生态", web_footer_companies_path, class: "#{current_page?(web_footer_companies_path)? 'selected' : nil }" %></li>
|
||||
</div>
|
||||
<%= form_tag(:controller => 'admin', :action => 'home') do %>
|
||||
<h4>首页定制</h4>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='attachments_fields'> 封面:</label>
|
||||
</p>
|
||||
<div style="margin-left: 82px;" id="avatar">
|
||||
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source: @home} %>
|
||||
</div>
|
||||
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_height' style="vertical-align: top"> 标题:</label>
|
||||
<%= text_field_tag 'home[name]', params[:name], :value => @home&.name, :style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='content' style="vertical-align: top"> 介绍:</label>
|
||||
<!-- <#%= text_area_tag 'content',@first_page.content,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %> -->
|
||||
<%= text_area 'home', 'content', :value => @home.content,:cols => 80, :rows => 15, :class => 'wiki-edit' %>
|
||||
<%= wikitoolbar_for 'home_content' %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||
<% end %>
|
|
@ -3,7 +3,7 @@
|
|||
<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>
|
||||
<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>
|
||||
|
@ -20,19 +20,19 @@
|
|||
</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/content2.png" style="margin-top: 45px"/>
|
||||
</div>
|
||||
<div class="c_p_right_item">
|
||||
<div class="c_r_title">
|
||||
<p class="f22 mb20">竞赛活动</p>
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
<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 %>
|
||||
<a href="<%= User.current.logged? ? user_path(User.current) : signin_url() %>" target="_blank" class="rightline">开源托管平台</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://www.educoder.net/" target="_blank">智能学习平台</a>
|
||||
|
@ -12,5 +8,5 @@
|
|||
<a href="http://ossean.trustie.net/" target="_blank">资源共享平台</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://codepedia.trustie.net/" target="_blank">众包学习平台</a>
|
||||
<a href="http://codepedia.trustie.net/" target="_blank">众包标注平台</a>
|
||||
</li>
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
</div>
|
||||
|
||||
<div class="navHomepageNews" id="user_messages">
|
||||
<a href="<%= user_message_path(User.current,click_user_message: true) %>" class="fl"><i class="iconfont icon-xiaoxilingdang fontGrey4 f22 fl mt7"></i></a>
|
||||
<a href="<%= user_message_path(User.current,click_user_message: true) %>" class="fl"><i class="iconfont icon-xiaoxilingdang fontGrey4 f22 fl mt4"></i></a>
|
||||
<% new_message_count = User.current.count_new_message("all").to_i %>
|
||||
<% new_private_message_count = User.current.unread_private_messages %>
|
||||
<% if new_message_count > 0 || new_private_message_count > 0 %>
|
||||
|
@ -107,7 +107,7 @@
|
|||
<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>
|
||||
<i class="iconfont icon-sousuo f20 ml5 mt2 fl"></i>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
<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>
|
||||
<i class="iconfont icon-sousuo f20 ml5 mt2 fl"></i>
|
||||
</a>
|
||||
<% end %>
|
||||
<!--<div class="navSearchTypeBox" id="navHomepageSearchType">-->
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<% course_model %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
<%= h html_title %>
|
||||
</title>
|
||||
<meta name="description" content="<%= Redmine::Info.app_name %>"/>
|
||||
<meta name="keywords" content="issue,bug,tracker"/>
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= stylesheet_link_tag 'css/common','css/project','css/iconfont/iconfont' ,'css/structure' %>
|
||||
<%= javascript_include_tag "course","header",'prettify','contest' %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<!--add by huang-->
|
||||
<body onload="prettyPrint();">
|
||||
<div class="pageContainer">
|
||||
<div class="navContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<%= render :partial => 'layouts/logined_header' %>
|
||||
<% else%>
|
||||
<%= render :partial => 'layouts/unlogin_header' %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'layouts/footer' %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if hidden_unproject_infos %>
|
||||
<%= render :partial => 'layouts/new_feedback' %>
|
||||
<% end %>
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -13,7 +13,7 @@
|
|||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= stylesheet_link_tag 'css/common','css/structure', 'css/public', 'css/courses','prettify', 'css/org', 'css/syllabus'%>
|
||||
<%= stylesheet_link_tag 'css/common','css/structure', 'css/public', 'css/courses','prettify', 'css/org', 'css/syllabus' , 'css/iconfont/iconfont' %>
|
||||
<%= javascript_include_tag "course","header",'prettify','contest' %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
|
@ -41,24 +41,15 @@
|
|||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="Container">
|
||||
<%#= render :partial => 'layouts/new_header' %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="content02" >
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
</div><!--Content end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<%#= render :partial => 'layouts/new_footer' %>
|
||||
<div class="cl"></div>
|
||||
</div><!--Container end-->
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%= render :partial => 'layouts/footer' %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if hidden_unproject_infos %>
|
||||
<%= render :partial => 'layouts/new_feedback' %>
|
||||
|
|
|
@ -1,123 +1,136 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<% end %>
|
||||
<%= error_messages_for 'project' %>
|
||||
<div class="project_r_h02">
|
||||
<h2 class="project_h2"><%= l(:label_project_new)%></h2>
|
||||
</div>
|
||||
<div class="hwork_new">
|
||||
<ul>
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<li class="ml45 mb10">
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label><span class="c_red">*</span> <%= l(:label_projects_new_name)%> :</label>
|
||||
<input type="text" name="project[name]" id="project_name" class="project_new_input project_new_input_project_new" maxlength="100" placeholder="例如:团队协作方法与机制研究" onkeyup="regex_project_name();">
|
||||
<p class="c_orange ml70" id="project_name_notice" style="display: none;">项目名称不能为空</p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<!-- <li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%#= l(:label_type_project)%> :</label>
|
||||
<%#= select_tag :project_new_type, options_for_select([["开发模式", "1"], ["研讨模式", "2"], ["圈子模式", "3"]]) %>
|
||||
<span class=" ml15 c_orange" id = "project_newtype_select"><%#= l(:label_type_des_development) %></span>
|
||||
</li>
|
||||
<div class="cl"></div>-->
|
||||
<li class="ml45 mb10">
|
||||
<label class="fl mr5"> <%= l(:label_tags_project_description) %> :</label>
|
||||
<%= f.kindeditor :description, :editor_id => 'project_create_editor',
|
||||
:owner_id => @project.nil? ? 0: @project.id,
|
||||
:owner_type => OwnerTypeHelper::PROJECT,
|
||||
:width => '86%',
|
||||
:height => 300,
|
||||
:minHeight=> 300,
|
||||
:class => 'courses_text ml5 fl',
|
||||
:input_html => { :id => 'description',
|
||||
:class => 'courses_text fl',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<!--<textarea name="project[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>-->
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<p style="display: none" >
|
||||
<%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH,
|
||||
value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
|
||||
<% unless @project.identifier_frozen? %>
|
||||
<em class="info">
|
||||
<%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %>
|
||||
<%= l(:text_project_identifier_info).html_safe %>
|
||||
</em>
|
||||
<% end %></p>
|
||||
</li>
|
||||
<li class="mb5 ml70">
|
||||
<label > 公开 :</label>
|
||||
<input id="project_is_public" name="project[is_public]" type="checkbox" value="1" checked="checked">
|
||||
<span class="c_grey">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_project();" >提交</a>
|
||||
<% if @course %>
|
||||
<%= link_to "取消",homework_common_index_path(:course => @course.id),:class => "grey_btn fl c_white ml10"%>
|
||||
<% elsif @contest %>
|
||||
<%= link_to "取消",works_path(:contest => @contest.id),:class => "grey_btn fl c_white ml10"%>
|
||||
<% else %>
|
||||
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end%>
|
||||
</ul>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<% html_title(l(:label_project_new)) -%>
|
||||
|
||||
<%= javascript_include_tag "/editormd/lib/codemirror/addon/lint/css-lint" %>
|
||||
<%= stylesheet_link_tag '/editormd/css/editormd' %>
|
||||
<%= javascript_include_tag '/editormd/editormd' %>
|
||||
<div class="s_m_Panel">
|
||||
<p class="f22 color-grey3 mt20 mb10"><%= l(:label_project_new)%></p>
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<div class="back_white padding30 mb50 submitForm">
|
||||
<li>
|
||||
<span class="form_span requiredTag"><%= l(:lable_project_name)%>:</span>
|
||||
<div class="flex1">
|
||||
<%= f.text_field :name, :class=>"choose_100_35" ,:placeholder=>"请输入标题,最大限制60字符", :maxlength => "60", :no_label => true %>
|
||||
<p class="notice_form"><span id="project_name_notice" class="none">请输入项目名称</span></p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<span class="form_span requiredTag"><%= l(:lable_project_language)%>:</span>
|
||||
<div class="flex1">
|
||||
<%= f.select :project_language_id, select_project_categories,
|
||||
{:no_label => true, :required => true}, :class => "choose_100_35" %>
|
||||
<p class="notice_form"><span id="project_language_notice" class="none">请选择项目语言</span></p>
|
||||
</div>
|
||||
<span class="form_span requiredTag ml50"><%= l(:lable_project_add_license) %>:</span>
|
||||
<div class="flex1">
|
||||
<%= f.select :license_id, options_for_select(select_project_licenses, @project.license_id),
|
||||
{:required => true, :no_label => true}, multi: false, :class => "choose_100_35" %>
|
||||
<p class="notice_form"><span id="project_tag_notice" class="none">请选择开源许可证</span></p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<span class="form_span requiredTag"><%= l(:lable_project_category) %>:</span>
|
||||
<div class="flex1">
|
||||
<%= f.select :project_category_id, options_for_select(select_project_languages, @project.project_category_id),
|
||||
{:required => true, :no_label => true}, multi: false, :class => "choose_100_35" %>
|
||||
<p class="notice_form"><span id="project_type_notice" class="none">请选择项目类别</span></p>
|
||||
</div>
|
||||
<span class="form_span requiredTag ml30"><%= l(:lable_project_add_gitignore) %>:</span>
|
||||
<div class="flex1">
|
||||
<%= f.select :ignore_id, options_for_select(select_project_ignores, @project.ignore_id),
|
||||
{:required => true, :no_label => true}, multi: false, :class => "choose_100_35" %>
|
||||
<p class="notice_form"><span id="project_modal_notice" class="none">请选择开源许可证</span></p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<span class="form_span"><%= l(:lable_project_description) %>:</span>
|
||||
<div class="flex1" id="projects_introduction">
|
||||
<textarea name="project[description]"><%= @project.description %></textarea>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<span class="form_span">公开:</span>
|
||||
<div class="flex1 pt8">
|
||||
<input type="checkbox" checked name="project[is_public]" value="1" id="project_is_public" class="magic-checkbox p_cursor" >
|
||||
<label for="project_is_public" class="fontGrey4 p_cursor">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见)</label>
|
||||
</div>
|
||||
</li>
|
||||
<ul class="edu-txt-center mt30">
|
||||
<span class="inline">
|
||||
<a href="<%= user_activities_user_path(User.current) %>" class="btn_big_default mr30">取消</a>
|
||||
<a href="javascript:void(0)" type="submit" class="btn_big_default btn_big_blue" onclick="submit_project_create();">确定</a>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<script>
|
||||
//////////////////////////////////////////////////////////////
|
||||
//新建项目
|
||||
//验证项目名称
|
||||
function regex_project_name()
|
||||
{
|
||||
var name = $.trim($("#project_name").val());
|
||||
if(name.length == 0)
|
||||
{
|
||||
$("#project_name_notice").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#project_name_notice").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* ------------------------------- 简介md ------------------------------*/
|
||||
var shixun_editormd = editormd("projects_introduction", {
|
||||
width: "100%",
|
||||
height: 240,
|
||||
syncScrolling: "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path: "/editormd/lib/",
|
||||
tex: true,
|
||||
toolbarIcons: function () {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
|
||||
},
|
||||
|
||||
//提交新建项目
|
||||
function submit_new_project()
|
||||
{
|
||||
project_create_editor.sync();
|
||||
if(regex_project_name())
|
||||
{
|
||||
toolbarCustomIcons: {
|
||||
testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea: true,
|
||||
autoFocus: false,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity: 0.6,
|
||||
placeholder: "请输入项目简介内容",
|
||||
imageUpload: true,
|
||||
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL: "<%#= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>" //url
|
||||
});
|
||||
|
||||
// 确定提交---check
|
||||
function submit_project_create() {
|
||||
var name=$("input[name='project[name]']").val();
|
||||
var language=$("select[name='project[project_language_id]'] option:selected").val();
|
||||
var tag=$("select[name='project[license_id]'] option:selected").val();
|
||||
var type=$("select[name='project[project_category_id]'] option:selected").val();
|
||||
var modal=$("select[name='project[ignore_id]'] option:selected").val();
|
||||
if(!name){
|
||||
$("#project_name_notice").removeClass("none");
|
||||
return;
|
||||
}else{
|
||||
$("#project_name_notice").addClass("none");
|
||||
}
|
||||
if(language == "0"){
|
||||
$("#project_language_notice").removeClass("none");
|
||||
return;
|
||||
}else{
|
||||
$("#project_language_notice").addClass("none");
|
||||
}
|
||||
if(tag == "0"){
|
||||
$("#project_tag_notice").removeClass("none");
|
||||
return;
|
||||
}else{
|
||||
$("#project_tag_notice").addClass("none");
|
||||
}
|
||||
if(type == "0"){
|
||||
$("#project_type_notice").removeClass("none");
|
||||
return;
|
||||
}else{
|
||||
$("#project_type_notice").addClass("none");
|
||||
}
|
||||
if(modal == "0"){
|
||||
$("#project_modal_notice").removeClass("none");
|
||||
return;
|
||||
}else{
|
||||
$("#project_modal_notice").addClass("none");
|
||||
}
|
||||
$("#new_project").submit();
|
||||
}
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$('#project_new_type').change(function(){
|
||||
var type = $('#project_new_type').val();
|
||||
if(type == '1'){
|
||||
$(this).next().html("<%= l(:label_type_des_development)%>");
|
||||
}
|
||||
else if(type == '2'){
|
||||
$(this).next().html("<%= l(:label_type_des_research)%>");
|
||||
}
|
||||
else if(type == '3'){
|
||||
$(this).next().html("<%= l(:label_type_des_friend)%>");
|
||||
}
|
||||
// var p1=$(this).children('option:selected').val("研讨模式:面向小组研究,支持任务分工、论坛交流、资源分享等。");//这就是selected的值
|
||||
// var p2=$('#param2').val();//获取本页面其他标签的值
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -39,7 +39,11 @@
|
|||
<% end %>
|
||||
<li class="clear">
|
||||
<label class="fl"> 语言 :</label>
|
||||
<%= select_tag :language, options_for_select(["","java","python","c#"], :selected => "#{@project.language}"), :id => 'language', :class => "ml5", :style => "height: 28px;" %>
|
||||
<%= select_tag 'project[project_language_id]', options_for_select(select_project_languages, :selected => "#{@project.project_language_id}"), :id => 'project_language', :class => "ml5", :style => "height: 28px;" %>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<label class="fl"> 类别 :</label>
|
||||
<%= select_tag 'project[project_category_id]', options_for_select(select_project_categories, :selected => "#{@project.project_category_id}"), :id => 'project_category', :class => "ml5", :style => "height: 28px;" %>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<label class="fl">公开 :</label>
|
||||
|
|
|
@ -1,120 +0,0 @@
|
|||
|
||||
<p class="t_project_banner"></p>
|
||||
<div class="middlePanel">
|
||||
<div class="clearfix mt15 mb15">
|
||||
<div class="t_search">
|
||||
<input type="text" placeholder="请输入您要搜索的内容" />
|
||||
<a href="javascript:void(0)">搜索</a>
|
||||
</div>
|
||||
<span class="fr">
|
||||
<a href="javascript:void(0)" class="btn_big_default mr30">+加入项目</a>
|
||||
<a href="javascript:void(0)" class="btn_big_default btn_big_blue">+新建项目</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="df mb20">
|
||||
<div class="pagePanel_left">
|
||||
<div class="l_project_status mb15">
|
||||
<li class="active">
|
||||
<a href="javascript:void(0)" class="clearfix">
|
||||
<span class="fl">全部</span>
|
||||
<span class="fr">78</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0)" class="clearfix">
|
||||
<span class="fl">公开</span>
|
||||
<span class="fr">78</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0)" class="clearfix">
|
||||
<span class="fl">私有</span>
|
||||
<span class="fr">78</span>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div class="l_project_type">
|
||||
<li class="clearfix active">
|
||||
<span class="fl">visual</span>
|
||||
<span class="fr">29</span>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<span class="fl">javascript</span>
|
||||
<span class="fr">29</span>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<span class="fl">python</span>
|
||||
<span class="fr">29</span>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pagePanel_right">
|
||||
<div class="clearfix r_list_search">
|
||||
<span class="fl r_list_action">
|
||||
<a href="javascript:void(0)" class="active">最新</a>
|
||||
<a href="javascript:void(0)">最热</a>
|
||||
</span>
|
||||
<p class="ml30 fl c_grey02 mt8">共<span class="c_blue">291</span>个项目结果</p>
|
||||
</div>
|
||||
<ul class="p_list_ul">
|
||||
<li>
|
||||
<img src="https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3276179142,1686381254&fm=26&gp=0.jpg" class="r_list_img" />
|
||||
<div>
|
||||
<p class="lh25 mb10 clearfix">
|
||||
<span class="mr20 f16 color-grey3">阿黄</span>
|
||||
<span class="fontGrey4 f12">1个月前</span>
|
||||
<span class="fr">
|
||||
<span class="mr30 fontGrey4 fl mt7">浏览量:7211</span>
|
||||
<span class="typeTag">Pyhon</span>
|
||||
</span>
|
||||
</p>
|
||||
<p class="c_grey02 f14">更新了issue: 首次创建实训后没有默认脚本</p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<img src="https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3276179142,1686381254&fm=26&gp=0.jpg" class="r_list_img" />
|
||||
<div>
|
||||
<p class="lh25 mb10 clearfix">
|
||||
<span class="mr20 f16 color-grey3">阿黄</span>
|
||||
<span class="fontGrey4 f12">1个月前</span>
|
||||
<span class="fr">
|
||||
<span class="mr30 fontGrey4 fl mt7">浏览量:7211</span>
|
||||
<span class="typeTag">Pyhon</span>
|
||||
</span>
|
||||
</p>
|
||||
<p class="c_grey02 f14">更新了issue: 首次创建实训后没有默认脚本</p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<img src="https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3276179142,1686381254&fm=26&gp=0.jpg" class="r_list_img" />
|
||||
<div>
|
||||
<p class="lh25 mb10 clearfix">
|
||||
<span class="mr20 f16 color-grey3">阿黄</span>
|
||||
<span class="fontGrey4 f12">1个月前</span>
|
||||
<span class="fr">
|
||||
<span class="mr30 fontGrey4 fl mt7">浏览量:7211</span>
|
||||
<span class="typeTag">Pyhon</span>
|
||||
</span>
|
||||
</p>
|
||||
<p class="c_grey02 f14">更新了issue: 首次创建实训后没有默认脚本</p>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<img src="https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3276179142,1686381254&fm=26&gp=0.jpg" class="r_list_img" />
|
||||
<div>
|
||||
<p class="lh25 mb10 clearfix">
|
||||
<span class="mr20 f16 color-grey3">阿黄</span>
|
||||
<span class="fontGrey4 f12">1个月前</span>
|
||||
<span class="fr">
|
||||
<span class="mr30 fontGrey4 fl mt7">浏览量:7211</span>
|
||||
<span class="typeTag">Pyhon</span>
|
||||
</span>
|
||||
</p>
|
||||
<p class="c_grey02 f14">更新了issue: 首次创建实训后没有默认脚本</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -1,6 +1,6 @@
|
|||
<% projects.each do |project| %>
|
||||
<li>
|
||||
<%= link_to image_tag(url_to_avatar(project.owner)), user_path(project.user_id), :class => "r_list_img", :alt => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(project.owner), :class => "r_list_img"), user_path(project.user_id), :alt => "用户头像" %>
|
||||
<div>
|
||||
<p class="lh25 mb10 clearfix">
|
||||
<span class="mr20 f16 color-grey3"><%= link_to project.name, project_path(project) %></span>
|
||||
|
|
|
@ -918,6 +918,12 @@ zh:
|
|||
label_user_search: "搜索用户:"
|
||||
label_mobile_version: "移动端版本管理"
|
||||
|
||||
lable_project_name: "项目名称"
|
||||
lable_project_description: "项目简介"
|
||||
lable_project_category: "项目类别"
|
||||
lable_project_language: "项目语言"
|
||||
lable_project_add_gitignore: "添加.gitignore模板"
|
||||
lable_project_add_license: "添加开源许可证"
|
||||
|
||||
|
||||
button_create_and_continue: 创建并继续
|
||||
|
@ -2204,6 +2210,7 @@ zh:
|
|||
# 动态消息
|
||||
label_dynamic_new: 新建动态新闻
|
||||
label_dynamic_new_plural: 首页动态新闻列表
|
||||
label_trustie_home: trustie首页
|
||||
label_dynamic_new_title: 标题
|
||||
label_dynamic_new_synopsis: 简介
|
||||
label_new_dynamic_new: '动态新闻'
|
||||
|
|
|
@ -1380,6 +1380,7 @@ RedmineApp::Application.routes.draw do
|
|||
post 'admin/select_course_syllabus'
|
||||
post 'admin/create_syllabus'
|
||||
match 'admin/dynamic_news', :via => [:get, :post]
|
||||
match 'admin/home', :via => [:get, :post]
|
||||
|
||||
resources :auth_sources do
|
||||
member do
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
class CreateLicenses < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :licenses do |t|
|
||||
t.string "key"
|
||||
t.string "name"
|
||||
t.string "nickname"
|
||||
t.boolean "featured"
|
||||
t.string "html_url"
|
||||
t.string "source_url"
|
||||
t.text "description"
|
||||
t.string "conditions"
|
||||
t.string "permissions"
|
||||
t.string "limitations"
|
||||
t.text "content"
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,10 @@
|
|||
class CreateIgnores < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :ignores do |t|
|
||||
t.string "name"
|
||||
t.text "content"
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
class AddLicenseIdAndIgnoreIdToProjects < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :license_id, :integer
|
||||
add_column :projects, :ignore_id, :integer
|
||||
end
|
||||
end
|
27
db/schema.rb
27
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20191107034328) do
|
||||
ActiveRecord::Schema.define(:version => 20191112073250) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -1329,6 +1329,13 @@ ActiveRecord::Schema.define(:version => 20191107034328) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "ignores", :force => true do |t|
|
||||
t.string "name"
|
||||
t.text "content"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "innodb_monitor", :id => false, :force => true do |t|
|
||||
t.integer "a"
|
||||
end
|
||||
|
@ -1493,6 +1500,22 @@ ActiveRecord::Schema.define(:version => 20191107034328) do
|
|||
t.integer "owner_type", :default => 0
|
||||
end
|
||||
|
||||
create_table "licenses", :force => true do |t|
|
||||
t.string "key"
|
||||
t.string "name"
|
||||
t.string "nickname"
|
||||
t.boolean "featured"
|
||||
t.string "html_url"
|
||||
t.string "source_url"
|
||||
t.text "description"
|
||||
t.string "conditions"
|
||||
t.string "permissions"
|
||||
t.string "limitations"
|
||||
t.text "content"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "main_categories", :force => true do |t|
|
||||
t.string "name"
|
||||
t.datetime "created_at", :null => false
|
||||
|
@ -2071,6 +2094,8 @@ ActiveRecord::Schema.define(:version => 20191107034328) do
|
|||
t.string "language"
|
||||
t.integer "project_category_id"
|
||||
t.integer "project_language_id"
|
||||
t.integer "license_id"
|
||||
t.integer "ignore_id"
|
||||
end
|
||||
|
||||
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
||||
|
|
|
@ -376,6 +376,7 @@ Redmine::MenuManager.map :homework_menu do |menu|
|
|||
end
|
||||
########end
|
||||
Redmine::MenuManager.map :admin_menu do |menu|
|
||||
menu.push :home, {:controller => 'admin',:action => 'home'}, :caption => :label_trustie_home
|
||||
menu.push :organization, {:controller => 'admin', :action => 'organization'}, :caption => :label_organization_list
|
||||
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
|
||||
menu.push :syllabuses, {:controller => 'admin', :action => 'syllabuses'}, :caption => :label_course_all
|
||||
|
@ -387,7 +388,6 @@ Redmine::MenuManager.map :admin_menu do |menu|
|
|||
menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural
|
||||
menu.push :applied_schools, {:controller => 'admin', :action => 'applied_schools'}, :caption => :label_applied_shcools
|
||||
menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made
|
||||
menu.push :dynamic_news, {:controller => 'admin',:action => 'dynamic_news'},:caption => :label_dynamic_new_plural
|
||||
menu.push :mobile_version, {:controller => 'admin',:action => 'mobile_version'},:caption => :label_mobile_version
|
||||
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural
|
||||
menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
require "json"
|
||||
|
||||
desc 'init ignores'
|
||||
namespace :ignores do
|
||||
task :init => :environment do
|
||||
puts "------ init ignores start -----"
|
||||
begin
|
||||
file = File.read("public/ignore.json")
|
||||
ignores = JSON.parse(file)
|
||||
ignores.each do |json|
|
||||
next if json['name'].blank?
|
||||
Ignore.where(:name => json['name']).first_or_create(content: json["content"])
|
||||
end
|
||||
puts "------ init ignores success -----"
|
||||
rescue Exception => e
|
||||
puts(e.message)
|
||||
puts "------ init ignores fail -----"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,31 @@
|
|||
require "json"
|
||||
|
||||
desc 'init licenses '
|
||||
namespace :licenses do
|
||||
task :init => :environment do
|
||||
puts "------ init licenses start -----"
|
||||
begin
|
||||
file = File.read("public/licenses.json")
|
||||
licenses = JSON.parse(file)
|
||||
licenses.each do |json|
|
||||
next if json['name'].blank?
|
||||
License.where(:name => json['name']).first_or_create do |license|
|
||||
license.key = json["key"]
|
||||
license.nickname = json["nickname"]
|
||||
license.featured = json["featured"]
|
||||
license.html_url = json["html_url"]
|
||||
license.source_url = json["source_url"]
|
||||
license.description = json["description"]
|
||||
license.conditions = json["conditions"].join(",")
|
||||
license.permissions = json["permissions"].join(",")
|
||||
license.limitations = json["limitations"].join(",")
|
||||
license.content = json["content"]
|
||||
end
|
||||
end
|
||||
puts "------ init licenses success -----"
|
||||
rescue Exception => e
|
||||
puts(e.message)
|
||||
puts "------ init licenses fail -----"
|
||||
end
|
||||
end
|
||||
end
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -126,6 +126,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
|||
.mb15{margin-bottom: 15px;}.mb20{ margin-bottom:20px;}.mb25{ margin-bottom:25px;}.mb30 {margin-bottom:30px;}.mb40 {margin-bottom:40px;}.pl5{ padding-left:5px;}
|
||||
.mb70{ margin-bottom:70px;}.mb60{ margin-bottom:60px;}.mb90{ margin-bottom:90px;}.mb80{ margin-bottom:80px;}.mb100{ margin-bottom:100px;}
|
||||
.pl10 {padding-left:10px;}.pl30 {padding-left:30px;}.pr5 {padding-right:5px;}.pr10{padding-right: 10px;}.pl62 {padding-left: 62px;}.pl15{ padding-left:15px;}.pt5{ padding-top:5px;}
|
||||
.pt8{ padding-top:8px;}
|
||||
.pt10{ padding-top:10px;}.pt30{padding-top: 30px;}
|
||||
.pt20{ padding-top:20px;}
|
||||
|
||||
|
@ -573,7 +574,9 @@ a:hover.btn_green_64_width{ background: #14ad5a; color: #fff;}
|
|||
color: #E67E21!important;
|
||||
}
|
||||
.pink{color:#FF5555 }
|
||||
.padding30-20{padding:30px 20px;}
|
||||
|
||||
|
||||
.padding30-20{padding:30px 20px;}.padding30{padding:30px;}
|
||||
.bor-bottom-greyE{border-bottom: 1px solid #eee;}
|
||||
.bor-left-greyE {
|
||||
border-left: 1px solid #EEEEEE!important;
|
||||
|
@ -582,12 +585,19 @@ a:hover.btn_green_64_width{ background: #14ad5a; color: #fff;}
|
|||
|
||||
#intro_content p{word-break:break-word!important;}
|
||||
|
||||
|
||||
.p_cursor{cursor: pointer}
|
||||
.justify{text-align: justify}
|
||||
|
||||
input{outline: none;font-size: 14px}
|
||||
/* Home 首页相关样式*/
|
||||
.floating_color{color: #fff}
|
||||
|
||||
|
||||
.smallPanel{width: 900px;margin:0px auto;}
|
||||
.s_m_Panel{width: 960px;margin:0px auto;}
|
||||
.middlePanel{width: 1200px;margin:0px auto;}
|
||||
.back_white{background: #fff;}
|
||||
|
||||
/*输入框和下拉框*/
|
||||
.choose_100_35{width: 100%;height: 35px;line-height: 35px;padding:5px;box-sizing: border-box;border-radius: 3px;}
|
||||
|
||||
|
||||
|
|
|
@ -673,7 +673,6 @@ body{
|
|||
.tac_f_link a:last-child:after{
|
||||
display: none;
|
||||
}
|
||||
.smallPanel{width: 900px;margin:0px auto;}
|
||||
/*----------------------社区动态----------*/
|
||||
.partnerList li{
|
||||
width: 102px;
|
||||
|
|
|
@ -681,3 +681,37 @@ span.task-step{ color:#ee4a20;font-style: italic; font-weight:bold; font-size:14
|
|||
a.task-list-title{ max-width: 700px;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------新版2019-cs*/
|
||||
.submitForm li{
|
||||
display: flex;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.form_span{
|
||||
min-width: 80px;
|
||||
max-width: 168px;
|
||||
text-align: right;
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
color: #999;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
position: relative;
|
||||
}
|
||||
.requiredTag:before{
|
||||
position: absolute;
|
||||
left: -10px;
|
||||
color: #FF5555;
|
||||
content: '*';
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
}
|
||||
.notice_form{
|
||||
color: #FF5555;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
|
|
|
@ -871,7 +871,9 @@ a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; tex
|
|||
|
||||
|
||||
|
||||
.middlePanel{width: 1200px;margin:0px auto;}
|
||||
|
||||
|
||||
|
||||
.btn_big_default{
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
|
@ -883,10 +885,11 @@ a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; tex
|
|||
font-size:16px;
|
||||
float: left;
|
||||
display: block;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.btn_big_blue{
|
||||
background: #5091FF;
|
||||
boder:1px solid #5091FF;
|
||||
border:1px solid #5091FF;
|
||||
color: #fff!important;
|
||||
}
|
||||
/*-----------个人主页新版-cs-20191015*/
|
||||
|
|
Loading…
Reference in New Issue