Merge branch 'dev-homepage-revision' into dev_project_new

This commit is contained in:
Jasder 2019-11-12 10:32:37 +08:00
commit 4f8e992fb1
12 changed files with 83 additions and 139 deletions

View File

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

View File

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

View File

@ -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'>&nbsp;&nbsp;&nbsp;封面:</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">&nbsp;&nbsp;&nbsp;标题:</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">&nbsp;&nbsp;&nbsp;介绍:</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 %>

View File

@ -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>
@ -19,13 +19,6 @@
</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>
@ -33,6 +26,13 @@
</div>
<img src="/images/introduce/content1.png" style="margin-top: 45px"/>
</div>
<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>

View File

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

View File

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

View File

@ -15,7 +15,7 @@
</li>
<% end %>
<div class="educontent edu-txt-center mb80">
<div class="educontent edu-txt-center mt30 mb50">
<div class="inline pages_user_show newpagemargin" >
<ul>
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>

View File

@ -28,7 +28,7 @@
<ul class="l_backlog">
<li class="l_backlog_title clearfix">
<%= link_to "<p class='color-orange f24 fr'>#{@atta_count}</p><p class='f18 fontGrey4 fl mt4'><i class='iconfont icon-bokeyuan f18 mr8'></i>#{@user.check_user_him(User.current.id)}的博客</p>".html_safe, user_blogs_path(@user), target: "_blank" %>
<%= link_to "<p class='color-orange f24 fr'raia>#{@atta_count}</p><p class='f18 fontGrey4 fl mt4'><i class='iconfont icon-bokeyuan f18 mr8'></i>#{@user.check_user_him(User.current.id)}的博客</p>".html_safe, user_blogs_path(@user), target: "_blank" %>
</li>
</ul>

View File

@ -2204,6 +2204,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: '动态新闻'

View File

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

View File

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

View File

@ -1117,10 +1117,18 @@ a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; tex
.tips_issue_5{background:#E74C3B }
.text-red{color: #E74C3B}
/* 个人主页翻页 */
.pages_user_show a:hover,.pages_user_show li a.active{ background-color:#4CACFF; color:#fff;border: 1px solid #4CACFF;}
.pages_user_show a{border-radius: 2px; display: inline-block;border:1px solid #d1d1d1;background-color:#fff; color:#888; float:left;text-align:center; padding:2px 10px; line-height:1.9; margin: 0 5px;}
.pages_user_show li{float: left; list-style-type: none;}
.pages_user_show ul li{list-style-type: none !important;}
.pages_user_show ul li a{color:#888}
/*---------------------------------------项目主页改版-cs--20191016*/
.t_project_banner{
background: url("/images/project.jpg") no-repeat top center;
height: 192px;
height: 260px;
}
.t_search{
display: flex;