主页 文件上传bug

This commit is contained in:
yanxd 2014-03-12 17:09:26 +08:00
parent aa3f0e1662
commit 592d704a6d
5 changed files with 55 additions and 29 deletions

View File

@ -22,6 +22,28 @@ module WelcomeHelper
include CoursesHelper
include ProjectsHelper
def get_course_term project
str = ( project.try(:course_extra).try(:time).to_s << '.' << project.try(:course_extra).try(:term).to_s )
str[0..-4]
end
def welcome_join_in_course(project, user)
if(user.logged? &&
!(course_timeout? project) &&
(project.course_extra.teacher.id != user.id)
)
join_in_course(project, user)
end
end
def get_course_avatar project
if get_avatar?(project)
url_to_avatar(project)
else
'../images/avatars/Project/course.jpg'
end
end
# 前略·天国の首页君/Earth has been unable stop to welcomePage's.
# sum - 要搜索的项目数量
# max_rate - 新项目所占所有项目的比重10分制

View File

@ -106,8 +106,14 @@ div.pagination{
margin: 0px 25px;
}
.relation_file_div fieldset{
margin: 0px 25px;
margin: 0px 0px;
padding: 10px;
border-radius: 5px;
transition: all 2s linear 1s;
}
.relation_file_div input:focus{
border: 1px solid #1B95C6;
box-shadow: 0px 0px 4px #1B95C6;
}
</style>

View File

@ -111,34 +111,25 @@
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_miracle_course(10, 7).map do |project| %>
<li style="background-image:none;">
<li style="position:relative;height:5em;" class='<%= cycle("odd", "even") %>'>
<div style="float: left;">
<% if get_avatar?(project)%>
<%= image_tag(url_to_avatar(project), :class => "avatar-4") %>
<% else %>
<%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar-4") %>
<% end %>
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %>
</div>
<div style="float: left; margin-left: 10px; width: 360px;">
<p class="layout">
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}", :target => "_blank" )%>
<span style="cursor: pointer; display: inline-block; float: right; color: #ec6300; white-space: nowrap;">学生人数:<%= link_to "#{studentCount(project)}", project_member_path(project, :role => 2) ,:course =>'1', :target => "_blank" %></span>
<div id='join_in_course' style='margin: 0px 4px;display:inline-block;float:right;color:#ff4800;'>
<%if User.current.logged? && !(course_timeout? project)%>
<%= join_in_course(project, User.current) unless project.course_extra.teacher.id == User.current.id %>
<% end %>
<!-- 上左下右 -->
<div style="float: left; margin-left: 10px; width: 380px;">
<span>[<%= get_course_term project %>]</span>
<%#= join_in_course(project, User.current) %>
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
(<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>)
</div>
</p>
<p class="layout-1" >
<%= content_tag "div", "&nbsp;".html_safe<<project.course_extra.time.to_s<<project.course_extra.term.to_s, :class => "d-p-project-intro", :style => 'display:inline-block; position:relative;float:right;color:#ff4800;' %>
<%= content_tag "span", "&nbsp;".html_safe+project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description.to_s %>
</p>
<div style="float: left;margin:5px; margin-left: 10px; width: 380px;">
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description.truncate(25, omission: '...')%></span>
</div>
<div style="position:absolute; bottom:0;right:0;margin:5px 10px 5px 5px ;">
<%= join_in_course(project, User.current)%>
</div>
</li>
<% end %>
<% end; reset_cycle %>
</ul>
</div>
</div>

View File

@ -2060,7 +2060,7 @@ button.tab-right {
/***** Settings Tabs *****/
/*modified by huang*/
#content .tabs_new {height: 2.6em; margin-bottom:1.2em; margin-top: 0.8em; position:relative; overflow:hidden;}
#content .tabs_new ul {margin:0; position:absolute; bottom:0; padding-left: 0.5em; width: 2000px; border-bottom: 1px solid #15BCCF;font-size:14px;}
#content .tabs_new ul {margin:0; position:absolute; bottom:0; padding-left: 0.5em; width: 100%; border-bottom: 1px solid #15BCCF;font-size:14px;}
#content .tabs_new ul li {
width:80px; /*modified by linchun*/
float:left;

View File

@ -176,7 +176,7 @@ li {
}
.d-p-index-newsource li,.d-p-index-hotproject ul.d-p-projectlist li{
color: rgb(102, 102, 102);
background: center -1px no-repeat;
/*background: center -1px no-repeat;*/
line-height: 20px;
padding: 5px 5px 0px 9px;
width: 440px;
@ -188,6 +188,12 @@ li {
margin-top: 0px;
border-bottom: 1px solid rgb(245,245,245);
}
ul.odd{
background-color: #F5F5F5;
}
ul.even{
background-color: #F6F7F8;
}
.d-g-blue{
color: rgb(17, 102, 173) !important;
@ -198,6 +204,7 @@ ul.d-p-projectlist{
margin-top: 0px;
}
/*
p.layout-1 {
margin-top: -8px;