项目新建页面改版

This commit is contained in:
caishi 2019-11-07 15:48:43 +08:00
parent bfcc9c6b38
commit 97d90bdcd4
10 changed files with 287 additions and 48 deletions

View File

@ -217,8 +217,7 @@ class ProjectsController < ApplicationController
elsif params[:contest_id] elsif params[:contest_id]
@contest = Contest.find params[:contest_id] @contest = Contest.find params[:contest_id]
end end
render :layout => 'base_projects_new'
render :layout => 'new_base'
else else
redirect_to signin_url redirect_to signin_url
end end

View File

@ -86,7 +86,7 @@
</div> </div>
<div class="navHomepageNews" id="user_messages"> <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_message_count = User.current.count_new_message("all").to_i %>
<% if new_message_count > 0 %> <% if new_message_count > 0 %>
<%#= link_to new_message_count, user_path(User.current, :click_user_message => true), :class => "newsActive", :target => "_Blank" %> <%#= link_to new_message_count, user_path(User.current, :click_user_message => true), :class => "newsActive", :target => "_Blank" %>
@ -106,7 +106,7 @@
<input type="hidden" name="search_type" id="type" value="all"/> <input type="hidden" name="search_type" id="type" value="all"/>
<input type="text" style="display: none;"/> <input type="text" style="display: none;"/>
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"> <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> </a>
<% end %> <% end %>
</div> </div>

View File

@ -74,7 +74,7 @@
<input type="hidden" name="search_type" id="type" value="all"/> <input type="hidden" name="search_type" id="type" value="all"/>
<input type="text" style="display: none;"/> <input type="text" style="display: none;"/>
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"> <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> </a>
<% end %> <% end %>
<!--<div class="navSearchTypeBox" id="navHomepageSearchType">--> <!--<div class="navSearchTypeBox" id="navHomepageSearchType">-->

View File

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

View File

@ -13,7 +13,7 @@
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= 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' %> <%= javascript_include_tag "course","header",'prettify','contest' %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
@ -41,24 +41,15 @@
<% end%> <% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div id="Container"> <div id="Container">
<%#= render :partial => 'layouts/new_header' %>
<div class="cl"></div>
<div id="content02" > <div id="content02" >
<%= render_flash_messages %> <%= render_flash_messages %>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_content %>
</div><!--Content end--> </div>
<div class="cl"></div>
<%#= render :partial => 'layouts/new_footer' %>
<div class="cl"></div>
</div><!--Container end-->
<div class="cl"></div> <div class="cl"></div>
</div>
<%= render :partial => 'layouts/footer' %> <%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
</div> </div>
<% if hidden_unproject_infos %> <% if hidden_unproject_infos %>
<%= render :partial => 'layouts/new_feedback' %> <%= render :partial => 'layouts/new_feedback' %>

View File

@ -1,3 +1,4 @@
<% if false %>
<%= content_for(:header_tags) do %> <%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %> <% end %>
@ -120,4 +121,145 @@
}) })
</script> </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" %>
<%= 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>
<div class="back_white padding30 mb50 submitForm">
<li>
<span class="form_span requiredTag">项目名称:</span>
<div class="flex1">
<input type="text" class="choose_100_35" name="p_name" maxlength="60" placeholder="请输入标题最大限制60字符"/>
<p class="notice_form"><span id="project_name_notice" class="none">请输入项目名称</span></p>
</div>
</li>
<li>
<span class="form_span requiredTag">项目语言:</span>
<div class="flex1">
<select class="choose_100_35" name="p_language">
<option value="0">请选择项目语言</option>
<option value="1">111</option>
</select>
<p class="notice_form"><span id="project_language_notice" class="none">请选择项目语言</span></p>
</div>
<span class="form_span requiredTag ml50">添加开源许可证:</span>
<div class="flex1">
<select class="choose_100_35" name="p_tag">
<option value="0">请选择开源许可证</option>
<option value="1">111</option>
</select>
<p class="notice_form"><span id="project_tag_notice" class="none">请选择开源许可证</span></p>
</div>
</li>
<li>
<span class="form_span requiredTag">项目类别:</span>
<div class="flex1">
<select class="choose_100_35" name="p_type">
<option value="0">请选择项目类别</option>
<option value="1">111</option>
</select>
<p class="notice_form"><span id="project_type_notice" class="none">请选择项目语言</span></p>
</div>
<span class="form_span requiredTag ml30">添加.gitignore模板</span>
<div class="flex1">
<select class="choose_100_35" name="p_modal">
<option value="0">请选择.gitignore模板</option>
<option value="1">111</option>
</select>
<p class="notice_form"><span id="project_modal_notice" class="none">请选择开源许可证</span></p>
</div>
</li>
<li>
<span class="form_span">项目简介:</span>
<div class="flex1" id="projects_introduction">
<textarea name="shixun[description]"><%#= @introduction_sample || @shixun.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>
</div>
</li>
<ul class="edu-txt-center mt30">
<span class="inline">
<a href="javascript:void(0)" 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>
</div>
<script>
/* ------------------------------- 简介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"]
},
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='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();
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");
}
}
</script>

View File

@ -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;} .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;} .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;} .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;} .pt10{ padding-top:10px;}.pt30{padding-top: 30px;}
.pt20{ padding-top:20px;} .pt20{ padding-top:20px;}
@ -573,7 +574,9 @@ a:hover.btn_green_64_width{ background: #14ad5a; color: #fff;}
color: #E67E21!important; color: #E67E21!important;
} }
.pink{color:#FF5555 } .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-bottom-greyE{border-bottom: 1px solid #eee;}
.bor-left-greyE { .bor-left-greyE {
border-left: 1px solid #EEEEEE!important; 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;} #intro_content p{word-break:break-word!important;}
.p_cursor{cursor: pointer}
.justify{text-align: justify} .justify{text-align: justify}
input{outline: none;font-size: 14px}
/* Home 首页相关样式*/ /* Home 首页相关样式*/
.floating_color{color: #fff} .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;}

View File

@ -673,7 +673,6 @@ body{
.tac_f_link a:last-child:after{ .tac_f_link a:last-child:after{
display: none; display: none;
} }
.smallPanel{width: 900px;margin:0px auto;}
/*----------------------社区动态----------*/ /*----------------------社区动态----------*/
.partnerList li{ .partnerList li{
width: 102px; width: 102px;

View File

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

View File

@ -837,7 +837,9 @@ a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; tex
.middlePanel{width: 1200px;margin:0px auto;}
.btn_big_default{ .btn_big_default{
width: 100px; width: 100px;
height: 40px; height: 40px;
@ -849,10 +851,11 @@ a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; tex
font-size:16px; font-size:16px;
float: left; float: left;
display: block; display: block;
border-radius: 2px;
} }
.btn_big_blue{ .btn_big_blue{
background: #5091FF; background: #5091FF;
boder:1px solid #5091FF; border:1px solid #5091FF;
color: #fff!important; color: #fff!important;
} }
/*-----------个人主页新版-cs-20191015*/ /*-----------个人主页新版-cs-20191015*/