From b88fdcefd8a9aa88e4b04863cb8a8d54ed1d1ec6 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 11 Sep 2014 14:55:40 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=A6=96=E9=A1=B5=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E6=96=B0=E5=A2=9E=E8=AF=BE=E7=A8=8B=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/contest_notification/show.html.erb | 2 +-
app/views/praise_tread/_praise_tread.html.erb | 1 -
app/views/welcome/_more_course.html.erb | 8 ++++++++
app/views/welcome/course.html.erb | 6 +++---
4 files changed, 12 insertions(+), 5 deletions(-)
create mode 100644 app/views/welcome/_more_course.html.erb
diff --git a/app/views/contest_notification/show.html.erb b/app/views/contest_notification/show.html.erb
index 93fa1f4af..a01201a67 100644
--- a/app/views/contest_notification/show.html.erb
+++ b/app/views/contest_notification/show.html.erb
@@ -9,7 +9,7 @@
- contest.trustie.net |
+ contest.trustie.net |
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> > 详情 |
diff --git a/app/views/praise_tread/_praise_tread.html.erb b/app/views/praise_tread/_praise_tread.html.erb
index 696b204f9..49c3f1d5c 100644
--- a/app/views/praise_tread/_praise_tread.html.erb
+++ b/app/views/praise_tread/_praise_tread.html.erb
@@ -69,7 +69,6 @@
<% else %>
-
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
<% if @is_valuate.size > 0 %>
<% @flag = @is_valuate.first.praise_or_tread %>
diff --git a/app/views/welcome/_more_course.html.erb b/app/views/welcome/_more_course.html.erb
new file mode 100644
index 000000000..41934a1ad
--- /dev/null
+++ b/app/views/welcome/_more_course.html.erb
@@ -0,0 +1,8 @@
+<% if User.current.logged?%>
+ <% if User.current.user_extensions.identity == 0 %>
+ <%= link_to(l(:label_course_new), {:controller => 'courses', :action => 'new'},
+ :class => 'icon icon-add') if User.current.allowed_to?(:add_course,nil, :global => true) %>
+ <% end %>
+<% end %>
+
+<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => school_id} %>
\ No newline at end of file
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index e25ef5665..9ec745f87 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -85,7 +85,7 @@
<%school_course=[]%>
<% end %>
<% if (school_course.count == 0) %>
-
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %>
+
<%= render :partial => 'more_course', :locals => {:school_id => nil}%>
@@ -103,11 +103,11 @@
<% else %>
<% if school_course.count < 10 %>
- <%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %>
+ <%= render :partial => 'more_course', :locals => {:school_id => nil}%>
<% else %>
- <%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => @school_id} %>
+ <%= render :partial => 'more_course', :locals => {:school_id => @school_id}%>
<% end %>