From e1d8c8a9926b22dff88cf01ae14af303555c7161 Mon Sep 17 00:00:00 2001 From: yanxd Date: Tue, 15 Oct 2013 11:06:19 +0800 Subject: [PATCH] remove nyan css & move another file --- app/helpers/watchers_helper.rb | 14 ++++---- app/views/projects/_project.html.erb | 20 ++++++----- app/views/projects/course.html.erb | 1 + public/stylesheets/application.css | 50 ---------------------------- public/stylesheets/nyan_css.css | 50 ++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 66 deletions(-) create mode 100644 public/stylesheets/nyan_css.css diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index b21b2584..c0468e06 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -24,15 +24,15 @@ module WatchersHelper watcher_link(object, user) end - ###################modified by liuping - def watcher_link(objects, user) + ###################modified by liuping, nyan + def watcher_link(objects, user, options=[]) return '' unless user && user.logged? objects = Array.wrap(objects) watched = objects.any? {|object| object.watched_by?(user)} @watch_flag = (objects.first.instance_of?(User) or objects.first.instance_of?(Project) or (objects.first.instance_of?(Bid))) - css = @watch_flag ? ([watcher_css(objects), watched ? 'icon joinButton' : 'icon joinButton'].join(' ')) : - ([watcher_css(objects), watched ? 'icon icon-fav joinButton' : 'icon icon-fav-off joinButton'].join(' ')) + css = @watch_flag ? ([watcher_css(objects), watched ? 'icon ' : 'icon '].join(' ') << options[0].to_s) : + ([watcher_css(objects), watched ? 'icon icon-fav ' : 'icon icon-fav-off '].join(' ') << options[0].to_s) text = @watch_flag ? (watched ? l(:button_unfollow) : l(:button_follow)) : (watched ? l(:button_unwatch) : l(:button_watch)) @@ -47,7 +47,7 @@ module WatchersHelper end # added by fq, modify nyan - def join_in_course(course, user) + def join_in_course(course, user, options=[]) return '' unless user && user.logged? joined = user.member_of?(course) text = joined ? l(:label_exit_course) : l(:label_join_course) @@ -55,9 +55,9 @@ module WatchersHelper url_f = try_join_path(:object_id => course.id) method = joined ? 'delete' : 'post' if joined - link_to text, url_t, :remote => true, :method => method, :id => 'join', :confirm => l(:text_are_you_sure), :class => 'joinButton' + link_to text, url_t, :remote => true, :method => method, :id => 'join', :confirm => l(:text_are_you_sure), :class => []+options else - link_to text, url_f, :remote => true, :method => method, :id => 'join', :class => 'joinButton' + link_to text, url_f, :remote => true, :method => method, :id => 'join', :class => []+options end end diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 69e9776f..3c9c88e0 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -2,11 +2,11 @@
<% if(@project.project_type==1)%> - <% if get_avatar?(project)%> - <%= link_to image_tag(url_to_avatar(project), :class => "avatar2"), project_path(project) %> - <% else %> - <%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(project)%> - <% end %> + <% if get_avatar?(project)%> + <%= link_to image_tag(url_to_avatar(project), :class => "avatar2"), project_path(project) %> + <% else %> + <%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(project)%> + <% end %> <% else %> <%= link_to image_tag(url_to_avatar(project), :class => "avatar2"), project_path(project) %>
@@ -39,12 +39,12 @@

-
-

+

+

- <%= content_tag('span', "#{@project.homeworks.count}", :class => "info") %><%= content_tag('span', l(:label_x_task, :count => @project.homeworks.count)) %> + <%= content_tag('span', link_to("#{@project.homeworks.count}", "\#"), :class => "info") %><%= content_tag('span', l(:label_x_task, :count => @project.homeworks.count)) %>

<%= content_tag('span', "#{@project.members.count}", :class => "info") %><%= content_tag('span', l(:label_x_member, :count => @project.members.count)) %> @@ -86,6 +86,7 @@ <%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %>

+ +
diff --git a/app/views/projects/course.html.erb b/app/views/projects/course.html.erb index 30af2849..b11d0226 100644 --- a/app/views/projects/course.html.erb +++ b/app/views/projects/course.html.erb @@ -40,6 +40,7 @@
+ <%= stylesheet_link_tag 'nyan_css', :media => 'all' %> <%= render_project_hierarchy(@projects)%>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index dc39a90e..bf8d3988 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2172,53 +2172,3 @@ h2 img { vertical-align:middle; } text-decoration: none; cursor: pointer; } -/*add by nyan*/ -.joinButton { - - -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; - -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; - box-shadow:inset 0px 1px 0px 0px #ffffff; - - background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #f6f6f6)); - background:-moz-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); - background:-webkit-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); - background:-o-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); - background:-ms-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); - background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%); - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0); - - background-color:#ffffff; - - -moz-border-radius:6px; - -webkit-border-radius:6px; - border-radius:6px; - - border:1px solid #dcdcdc; - - display:inline-block; - color:#666666; - font-family:arial; - font-size:15px; - font-weight:bold; - padding:6px 24px; - text-decoration:none; - - text-shadow:0px 1px 0px #ffffff; - -} -.joinButton:hover { - - background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f6f6f6), color-stop(1, #ffffff)); - background:-moz-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); - background:-webkit-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); - background:-o-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); - background:-ms-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); - background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%); - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff',GradientType=0); - - background-color:#f6f6f6; -} -.joinButton:active { - position:relative; - top:1px; -} diff --git a/public/stylesheets/nyan_css.css b/public/stylesheets/nyan_css.css new file mode 100644 index 00000000..3511d072 --- /dev/null +++ b/public/stylesheets/nyan_css.css @@ -0,0 +1,50 @@ +/*add by nyan*/ +.joinButton { + + -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; + -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; + box-shadow:inset 0px 1px 0px 0px #ffffff; + + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #f6f6f6)); + background:-moz-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); + background:-webkit-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); + background:-o-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); + background:-ms-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); + background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0); + + background-color:#ffffff; + + -moz-border-radius:6px; + -webkit-border-radius:6px; + border-radius:6px; + + border:1px solid #dcdcdc; + + display:inline-block; + color:#666666; + font-family:arial; + font-size:15px; + font-weight:bold; + padding:6px 24px; + text-decoration:none; + + text-shadow:0px 1px 0px #ffffff; + +} +.joinButton:hover { + + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f6f6f6), color-stop(1, #ffffff)); + background:-moz-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); + background:-webkit-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); + background:-o-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); + background:-ms-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); + background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff',GradientType=0); + + background-color:#f6f6f6; +} +.joinButton:active { + position:relative; + top:1px; +}