快捷菜单使用新的样式及链接

This commit is contained in:
ouyangxuhua 2016-01-11 16:44:52 +08:00
parent 3a62db6475
commit 25a24f72e5
11 changed files with 130 additions and 70 deletions

View File

@ -1,25 +1,50 @@
<% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine pr">
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", :title => course.name+""+course.time.to_s+course.term+""%>
<div class="homepagePostSetting mt8 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>
<li><%= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>
<li><%= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
:title => (course.is_public ? "公有课程:":"私有课程:")+course.name+""+course.time.to_s+course.term+""%>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">
<li class="subNavRow">
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'fl fontGrey2', :target => '_blank' %>
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'fr fb', :title => '发布作业',:target => '_blank' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%= link_to "通知", course_news_index_path(course), :class => 'fl',:target => '_blank' %>
<%= link_to "+", course_news_index_path(course), :class => 'fr fb', :title => '发布通知',:target => '_blank' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%= link_to "资源",course_files_path(course), :remote => true, :class => 'fl' %>
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'fr fb', :title => '上传资源' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%= link_to "论坛",course_boards_path(course), :class => 'fl',:target => '_blank' %>
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'fr fb', :title => '发布帖子',:target => '_blank' %>
<div class="cl"></div>
</li>
<% if User.current == @user %>
<li class="subNavRow">
<% if count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true %>
<% end %>
</li>
<% end %>
<% if User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<li class="subNavRow">
<%= link_to course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => course},
:remote=>true,:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
<div class="cl"></div>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</li>
<% end %>

View File

@ -1,24 +1,44 @@
<% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine pr">
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
<div class="homepagePostSetting mt8 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>
<li><%=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">
<li class="subNavRow">
<%=link_to "问题跟踪", new_project_issue_path(project), :class => 'fl fontGrey2', :target => '_blank',:style => "width:48px;" %>
<%=link_to "+", new_project_issue_path(project), :class => 'fr fb', :target => '_blank',:style => "width:48px;", :title => '发布问题',:style =>'width:10px;' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%=link_to "资源", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'fl fontGrey2' %>
<%=link_to "+", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'fr fb',:title => '上传资源'%>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%=link_to "论坛", project_boards_path(project, :flag => true),:remote => true,:class => 'fl fontGrey2', :target => '_blank'%>
<%=link_to "+", project_boards_path(project, :flag => true),:remote => true,:class => 'fr fb', :target => '_blank',:title => '发布帖子'%>
<div class="cl"></div>
</li>
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, project)) && rep_is_gitlab?(project) %>
<li class="subNavRow">
<%= link_to '版本库', url_for(:controller => 'projects', :action => 'settings', :id => project.id, :tab=>'repositories') , :target => '_blank',:class => "fl",:title => '新建版本库' %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current == @user %>
<li class="subNavRow">
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true %>
<% end %>
<div class="cl"></div>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</li>
<% end %>
<% if projects.size == 5%>

View File

@ -52,15 +52,25 @@
})
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
})
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999");
})
$(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080");
$(this).css("z-index", "1");
})
});
//侧导航栏配置设置
$(".homepageLeftMenuCoursesLine").mouseover(function(){
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -82px -399px no-repeat");
$(this).children().css("color","#ffffff");
});
$(".homepageLeftMenuCoursesLine").mouseout(function(){
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -6px -354px no-repeat");
$(this).children().css("color","#808080");
});
$(".subNavRow").mouseover(function(){
$(this).css("background-color","#269ac9");
$(this).children().css("color","#ffffff");
});
$(".subNavRow").mouseout(function(){
$(this).css("background-color","#ffffff");
$(this).children().css("color","#888888");
});
})
</script>
</head>
@ -165,7 +175,7 @@
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<div class="courseMenu" id="courseMenu">
<ul>
<li class="courseMenuIcon" id="courseMenuIcon">
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_course_menu">
<li>
<%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
@ -179,7 +189,7 @@
</ul>
</div>
<% else%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true, :title => "加入课程"%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入课程"%>
<% end%>
<% end%>
</div>
@ -193,7 +203,7 @@
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
<% if is_current_user%>
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :title => "新建项目"%>
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%>
<% end%>
</div>
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>

View File

@ -2,6 +2,7 @@
<li class="orgListUser fb">已有栏目</li>
<li class="orgListStatus fb">状态</li>
<li class="orgListStatus fb">类型</li>
<li class="orgListUser fb">域名目录</li>
<div class="cl"></div>
</ul>
@ -26,6 +27,7 @@
</li>
<li class="orgListStatus">新增</li>
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
<li class="orgListUser hidden">publications</li>
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>

View File

@ -111,20 +111,26 @@
:subfields => @organization.org_subfields.where("field_type != 'default'") } %>
</div>
<div class="fr orgMemContainer">
<div class="orgMemberAdd">
<div class="fr">
<p class="fontBlue fb mb5">新增栏目</p>
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb20" />
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
<div class="mb5">
<p class="fontGrey3"><span class="fb">域名目录</span>用户自定义url可选</p>
<span class="fl">micros.trustie.net/</span><input class="fl personalUrl ml3" type="text">
<div class="cl"></div>
</div>
<ul class="orgAddRole">
<li class="fontGrey3 fb mb10">栏目类型</li>
<li>
<li class="fl mr15">
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
<label for="orgMng">帖子</label>
</li>
<li>
<li class="fl">
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
<li class="cl"></li>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="saveBtn db fl mt10" onclick="add_org_subfield();">确定</a>

View File

@ -1,17 +0,0 @@
class AddLastTermToCourse < ActiveRecord::Migration
def change
add_column :courses, :end_time, :integer
add_column :courses, :end_term, :string
count = Course.all.count / 30 + 2
transaction do
for i in 1 ... count do
Course.page(i).per(30).each do |course|
course.end_time = course.time
course.end_term = course.term
course.save
end
end
end
end
end

View File

@ -982,8 +982,8 @@ ActiveRecord::Schema.define(:version => 20160108093752) do
t.text "notes"
t.integer "status"
t.integer "reply_id"
t.datetime "created_on", :null => false
t.datetime "updated_on", :null => false
t.datetime "created_on", :null => false
t.datetime "updated_on", :null => false
t.string "m_parent_id"
t.boolean "is_readed"
t.integer "m_reply_count"

View File

@ -581,7 +581,7 @@ a.homepageImageNumber:hover {color:#269ac9;}
.homepageLeftMenuCourses {font-size:13px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#269ac9;}
a.coursesLineGrey {padding-left:25px; color:#808080; display:block;}
a.coursesLineGrey {padding-left:25px; padding-right:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#269ac9;}

View File

@ -18,11 +18,11 @@
.orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;}
a.saveBtn {padding:3px 5px; background-color:#269ac9; color:#ffffff;}
a.saveBtn:hover {background-color:#297fb8;}
.orgMemberList {width:410px; float:left;}
.orgMemberList {width:460px; float:left;}
.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;}
.orgListUser {width:119px; float:left;}
.orgListUser {width:85px; float:left;}
.orgListRole {width:180px; float:left;}
.orgMemContainer {width:278px;}
.orgMemContainer {width:228px;}
.orgMemberAdd {float:right; width:240px;}
.orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;}
.undis {display:none;}
@ -73,6 +73,7 @@ a.linkGrey8:hover {color:#585858;}
.org_login_list a {color:#269ac9;}
.orgListStatus {width:55px; float:left;}
.personalUrl {border:1px solid #dddddd; width:75px; outline:none; white-space:nowrap; padding-left:2px;}
.reCon{ margin:5px; width:710px;}
.retop{width:710px; height:40px; background:#eaeaea; padding:5px;}
.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right}

View File

@ -511,7 +511,7 @@ a.homepageImageNumber:hover {color:#15bccf;}
.homepageLeftMenuCourses {font-size:14px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#b3e0ee;}
a.coursesLineGrey {padding-left:25px; color:#15bccf; display:block;}
a.coursesLineGrey {padding-left:25px; padding-right:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#b3e0ee;}

View File

@ -18,6 +18,19 @@ a:hover.userCancel{border:1px solid #888888; }
.userCard {width:208px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px; padding:15px; top:-176px; left:-95px; position:absolute; z-index:999; display:none;}
.userCard font {display:block; border-width:8px; position:absolute; bottom:-16px; left:110px; border-style:solid dashed dashed dashed; border-color:#FFF transparent transparent transparent; font-size:0; line-height:0;}
.userCard em {display:block; border-width:8px; position:absolute; bottom:-17px; left:110px; border-style:solid dashed dashed dashed; border-color:#eaeaea transparent transparent transparent; font-size:0; line-height:0;}
.userCardM {width:201px; height:20px; border:1px solid #dddddd; resize:none;}
.praviteC {background:url(../images/hwork_icon.png) -79px -255px no-repeat;}
.praviteCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;}
.publicC {background:url(../images/hwork_icon.png) -79px -125px no-repeat;}
.publicCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;}
.shild {background:url(../images/hwork_icon.png) -6px -354px no-repeat;}
.shildP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;}
ul.shild:hover li ul {display:block;}
.subNavArrow {background:url(../images/hwork_icon.png) -82px -399px no-repeat; display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;}
ul.subNavArrow:hover li ul {display:block;}
.subNavMenu {line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:20px; top:-10px; padding:5px 0px; display:none; z-index:999;}
.subNavRow {padding:0px 15px; width:70px;}
a.mesIcon {background:url(../images/mes_icon.png) -5px -73px no-repeat; padding-left:23px;}
a.personalIcon {background:url(../images/mes_icon.png) -6px -16px no-repeat; padding-left:23px;}
.mesType {background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 15px; left:-50px; font-size:12px; color:#888888; display:none; line-height:2; z-index:999; white-space:nowrap;}