remove nyan css & move another file

This commit is contained in:
yanxd 2013-10-15 11:06:19 +08:00
parent 8335c111c7
commit e1d8c8a992
5 changed files with 69 additions and 66 deletions

View File

@ -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

View File

@ -2,11 +2,11 @@
<div class="project-block">
<div class="img-tag">
<% 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) %>
</div>
@ -39,12 +39,12 @@
</p>
</div>
<div class="information">
<p class="stats">
<div class="information"><!-- nyan -->
<!-- p class="stats">
<%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
</p>
</p -->
<p class="stats">
<%= 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)) %>
</p>
<p class="stats">
<%= 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)) %>
</div>
<!-- added by liuping -->
<!-- <% unless User.current.member_of?(@project) %>
<%= watcher_link(@project, User.current) %>
@ -96,6 +97,7 @@
<%= join_in_course(@project, User.current)%>
<% end %>
<% end %> -->
</span>
</div>

View File

@ -40,6 +40,7 @@
<div id="projects-index">
<%= stylesheet_link_tag 'nyan_css', :media => 'all' %><!-- nyan -->
<%= render_project_hierarchy(@projects)%>
</div>

View File

@ -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;
}

View File

@ -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;
}