From a84af9d13865bc556e878648f9b9a7551e15209b Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 30 Mar 2015 17:44:40 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=A7=81=E6=9C=89?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=9C=A8=E6=B2=A1?=
=?UTF-8?q?=E6=9C=89=E6=9D=83=E9=99=90=E6=9F=A5=E7=9C=8B=E7=9A=84=E7=94=A8?=
=?UTF-8?q?=E6=88=B7=E4=B8=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/courses_helper.rb | 10 ++++++++++
app/helpers/files_helper.rb | 10 ----------
app/views/layouts/base_courses.html.erb | 7 +++++--
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 408783934..f4ba5040e 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -736,4 +736,14 @@ module CoursesHelper
"未启用匿评".html_safe
end
end
+
+ def visable_attachemnts_incourse course
+ result = []
+ course.attachments.each do |attachment|
+ if attachment.is_public? || User.current.member_of_course?(course)
+ result << attachment
+ end
+ end
+ result
+ end
end
diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb
index 884ebc2eb..749e7e437 100644
--- a/app/helpers/files_helper.rb
+++ b/app/helpers/files_helper.rb
@@ -97,16 +97,6 @@ module FilesHelper
result
end
- def visable_attachemnts_incourse attachments
- result = []
- attachments.each do |attachment|
- if attachment.is_public? || (attachment.author.member_of_course?(Course.find(attachment.container_id)))|| attachment.author_id == User.current.id
- result << attachment
- end
- end
- result
- end
-
def visable_attachemnts_insite attachments,course
result = []
attachments.each do |attachment|
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index e787cfa54..25b08ce7d 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -1,6 +1,7 @@
<% course_model %>
<% teacher_num = teacherCount(@course) %>
<% student_num = studentCount(@course) %>
+<% course_file_num = visable_attachemnts_incourse(@course).count%>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
@@ -94,7 +95,7 @@
|
<%= l(:label_account_identity_student)%>(<%= course_student_link student_num %>)
|
- <%= l(:project_module_attachments)%>(<%= link_to @course.attachments.count, course_files_path(@course), :class => 'info_foot_num c_blue' %>)
+ <%= l(:project_module_attachments)%>(<%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue' %>)
@@ -125,7 +126,9 @@
<%= link_to( "+#{l(:label_course_news_new)}", new_course_news_path(@course), :class => 'subnav_green c_white') if is_teacher %>
- <%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %><%= link_to "(#{@course.attachments.count})", course_files_path(@course), :class => "subnav_num c_orange" %><%= link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white') if is_teacher %>
+ <%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %>
+ <%= link_to "(#{course_file_num})", course_files_path(@course), :class => "subnav_num c_orange" %>
+ <%= link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white') if is_teacher %>
<%= link_to l(:label_course_board), course_boards_path(@course), :class => "f14 c_blue02" %>
From b344bf3ea6679141b7c4d55091c672f0dbbacfa6 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 30 Mar 2015 18:04:52 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=86=E9=A1=B5=E7=A9=BA=E9=97=B4?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/application.css | 8 +++++---
public/stylesheets/css.css | 4 +++-
public/stylesheets/polls.css | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index b4bd12d34..fc2f55086 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -9,11 +9,13 @@ h4, .wiki h3 {font-size: 13px;}
h4 {border-bottom: 1px dotted #bbb;}
/****翻页***/
-ul.wlist{ margin-left: -40px; border-bottom:none; }
+ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}
-ul.wlist li a{ border:1px solid #15bccf; padding:4px; margin-left:3px;}
+ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3px;}
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
-.wlist_select { background-color:#64bdd9; color:#fff; padding: 5px 3px 3px 3px; margin-left:3px;margin-top: 0px; border:1px solid #64bdd9;}
+/*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}*/
+.wlist_select a{background-color: #64bdd9;cursor: default;color:#fff;}
+/*a.c_white{ color:#fff; !important;}*/
/*20150203项目界面优化样式 By: huangjignquan*/
.project_new{font-size: 15px; padding: 5px;}
diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css
index 9829d286e..f311d3100 100644
--- a/public/stylesheets/css.css
+++ b/public/stylesheets/css.css
@@ -49,7 +49,9 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}
ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3px;}
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
-.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}
+/*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}*/
+.wlist_select a{background-color: #64bdd9;cursor: default;color:#fff !important;}
+/*a.c_white{ color:#fff; !important;}*/
.code_list{ float:right; font-size:12px; color:#484848; padding:5px 3px; border-bottom:2px solid #15bccf; width:687px; }
.code_list a{ color:#787878;}
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index ff0697119..84b026eda 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -20,7 +20,7 @@ a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
.polls_date{ color:#666666;margin-top:3px; }
.polls_de{ color:#6883b6; margin-top:3px;}
/****翻页***/
-.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px; border:1px solid #64bdd9;}
+/*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px; border:1px solid #64bdd9;}*/
/*问卷页面*/
.polls_box{ border:1px solid #dcdcdc; padding:15px 30px;}