FIX create project revision

This commit is contained in:
Jasder 2019-11-12 17:23:38 +08:00
parent 69bdb65ec7
commit d37e026d68
6 changed files with 187 additions and 294 deletions

View File

@ -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

View File

@ -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'

View File

@ -4,4 +4,6 @@ class ProjectCategory < ActiveRecord::Base
has_ancestry
has_many :projects
scope :desc_with_position, -> { order('position DESC') }
end

View File

@ -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

View File

@ -1,188 +1,59 @@
<% if false %>
<%= 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>&nbsp;<%= l(:label_projects_new_name)%>&nbsp;&nbsp;:</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>&nbsp;<%#= l(:label_type_project)%>&nbsp;&nbsp;</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">&nbsp;&nbsp;<%= l(:label_tags_project_description) %>&nbsp;&nbsp;:</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 >&nbsp;公开&nbsp;</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)) -%>
<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;
}
}
//提交新建项目
function submit_new_project()
{
project_create_editor.sync();
if(regex_project_name())
{
$("#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>
<% end %>
<%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint", "/codemirror/addon/selection/active-line", "/codemirror/addon/lint/javascript-lint", "/codemirror/addon/lint/css-lint", "/codemirror/addon/lint/lint", "/codemirror/addon/lint/json-lint", "/editormd/lib/codemirror/addon/lint/css-lint" %>
<%= javascript_include_tag "/editormd/lib/codemirror/addon/lint/css-lint" %>
<%= stylesheet_link_tag "/codemirror/lib/codemirror" %>
<%= 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">项目名称</span>
<span class="form_span requiredTag"><%= l(:lable_project_name)%></span>
<div class="flex1">
<input type="text" class="choose_100_35" name="p_name" maxlength="60" placeholder="请输入标题最大限制60字符"/>
<%= 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">项目语言</span>
<span class="form_span requiredTag"><%= l(:lable_project_language)%></span>
<div class="flex1">
<select class="choose_100_35" name="p_language">
<option value="0">请选择项目语言</option>
<option value="1">111</option>
</select>
<%= f.select :project_language_id, (ProjectLanguage.desc_with_position.collect { |pl| [pl.name, pl.id] }),
{: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">添加开源许可证</span>
<span class="form_span requiredTag ml50"><%= l(:lable_project_add_license) %></span>
<div class="flex1">
<select class="choose_100_35" name="p_tag">
<option value="0">请选择开源许可证</option>
<option value="1">111</option>
</select>
<%= f.select :license_id, options_for_select(License.all.collect { |c| [c.name, c.id]}, @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">项目类别</span>
<span class="form_span requiredTag"><%= l(:lable_project_category) %></span>
<div class="flex1">
<select class="choose_100_35" name="p_type">
<option value="0">请选择项目类别</option>
<option value="1">111</option>
</select>
<%= f.select :project_category_id, options_for_select(ProjectCategory.desc_with_position.collect { |c| [c.name, c.id]}, @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">添加.gitignore模板</span>
<span class="form_span requiredTag ml30"><%= l(:lable_project_add_gitignore) %></span>
<div class="flex1">
<select class="choose_100_35" name="p_modal">
<option value="0">请选择.gitignore模板</option>
<option value="1">111</option>
</select>
<%= f.select :ignore_id, options_for_select(Ignore.all.collect { |c| [c.name, c.id]}, @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">项目简介</span>
<span class="form_span"><%= l(:lable_project_description) %></span>
<div class="flex1" id="projects_introduction">
<textarea name="shixun[description]"><%#= @introduction_sample || @shixun.description %></textarea>
<textarea name="project[description]"><%= @project.description %></textarea>
</div>
</li>
<li>
<span class="form_span">公开:</span>
<div class="flex1 pt8">
<input type="checkbox" class="magic-checkbox p_cursor" name="isPublic" id="isPublic"/>
<label for="isPublic" class="fontGrey4 p_cursor">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见)</label>
<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">
@ -192,6 +63,7 @@
</span>
</ul>
</div>
<% end %>
</div>
<script>
/* ------------------------------- 简介md ------------------------------*/
@ -225,11 +97,11 @@
// 确定提交---check
function submit_project_create() {
var name=$("input[name='p_name']").val();
var language=$("select[name='p_language'] option:selected").val();
var tag=$("select[name='p_tag'] option:selected").val();
var type=$("select[name='p_type'] option:selected").val();
var modal=$("select[name='p_modal'] option:selected").val();
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;
@ -260,6 +132,6 @@
}else{
$("#project_modal_notice").addClass("none");
}
$("#new_project").submit();
}
</script>

View File

@ -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: 创建并继续