项目首页增加新建项目按钮

This commit is contained in:
sw 2014-09-16 11:52:05 +08:00
parent 6a2e269395
commit c10eeb1c01
2 changed files with 25 additions and 22 deletions

View File

@ -152,9 +152,9 @@ module ProjectsHelper
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)} tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end end
# Ended by young # Ended by young
def parent_project_select_tag(project) def parent_project_select_tag(project)
selected = project.parent selected = project.parent
@ -175,18 +175,15 @@ module ProjectsHelper
render_project_nested_lists(projects) do |project| render_project_nested_lists(projects) do |project|
#Modified by young #Modified by young
if project.try(:project_type) == Project::ProjectType_course if project.try(:project_type) == Project::ProjectType_course
# modified by longjun # modified by longjun
# never use unless and else # never use unless and else
# unless project.is_public == 1 # unless project.is_public == 1
if project.is_public != 1 if project.is_public != 1
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe
else else
s = "".html_safe s = "".html_safe
end end
# end longjun # end longjun
# modified by Longjun # modified by Longjun
s += link_to_project(project, {}, s += link_to_project(project, {},
:class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
@ -194,7 +191,6 @@ module ProjectsHelper
else else
# modified by longjun # modified by longjun
# unless project.is_public # unless project.is_public
if !project.is_public if !project.is_public
# end longjun # end longjun
s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe s = "<span class='private_project'>#{l(:lable_private)}</span>".html_safe

View File

@ -56,8 +56,15 @@
<div style="clear:both"></div> <div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3> <h3 style="margin-left: 5px; color: #e8770d;">
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span> <strong>热门项目</strong>
</h3>
<span style="margin-top: -20px;float: right; display: block;">
<% if User.current.logged? %>
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type =>( @project_type||=0)}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<% end %>
&nbsp;&nbsp;
<%= link_to l(:label_more), { :controller => 'projects', :action => 'index', :project_type => 0, :host => Setting.project_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box"> <div class="d-p-projectlist-box">
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% #projects = find_miracle_project(10, 3) %> <% #projects = find_miracle_project(10, 3) %>
@ -98,20 +105,20 @@
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span> <span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
<div class="user-message-box-list" style="margin-top: 10px;"> <div class="user-message-box-list" style="margin-top: 10px;">
<%activities = find_all_activities%> <%activities = find_all_activities%>
<% activities.each do |event| %> <% activities.each do |event| %>
<!--<%# cache cache_key_for_event(event) do %> --> <!--<%# cache cache_key_for_event(event) do %> -->
<li style="display: block;height:60px; padding-bottom: 4px;"> <li style="display: block;height:60px; padding-bottom: 4px;">
<div class="inner-right" style="float: left; height: 100%; "> <div class="inner-right" style="float: left; height: 100%; ">
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
</div> </div>
<div class="inner-right" style="float: right; width:86%; height: 100%; "> <div class="inner-right" style="float: right; width:86%; height: 100%; ">
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %> <span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %>
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p> <p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
</div> </div>
</li> </li>
<!--<%#end %> --><!-- cache --> <!--<%#end %> --><!-- cache -->
<% end %> <% end %>
</div> </div>
</ul> </ul>
</div> </div>