socialforge/app/views/users/watch_projects.html.erb

51 lines
2.0 KiB
Plaintext
Raw Normal View History

2014-05-29 18:34:34 +08:00
2014-05-15 09:20:36 +08:00
<!--span class="font_lighter" >温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~</span-->
2014-05-29 18:34:34 +08:00
<div class="menu-div">
<div class="menu">
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
<ul><%#链接绑定在页面最下方的jQuery%>
<li mode='take' class="<%= "on" if @state.eql?(0)%>"><%=l :label_project_take%></li>
<li mode='watched' class="<%= "on" if @state.eql?(1)%>"><%=l :label_has_watched_project%></li>
</ul>
</div>
</div>
<%#= watch_projects @state%>
2014-04-04 15:58:25 +08:00
<% if @watch_projects.count > 0 %>
2013-10-24 08:24:56 +08:00
<% for watch_project in @watch_projects %>
2013-10-24 10:13:00 +08:00
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
2013-11-01 15:48:23 +08:00
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(watch_project.project), :class => 'avatar') %></td>
2013-10-24 10:13:00 +08:00
<td>
<table width="580" border="0">
2013-10-24 08:24:56 +08:00
<tr>
2014-04-04 15:58:25 +08:00
<td colspan="2" valign="top"><strong> <%= link_to_user(@user) if watch_project.respond_to?(:user) %></strong><span class="font_lighter"> <%= link_to_project(watch_project.project) %></td>
2013-10-24 08:24:56 +08:00
</tr>
2013-10-24 10:13:00 +08:00
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= watch_project.project.description%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(watch_project.created_on) %></span></td><!-- modified by ming -->
</tr>
</table></td>
</tr>
</table>
</li>
<% end %>
<% else %>
<%= l(:label_watch_no_projects)%>
<% end %>
2014-05-29 18:34:34 +08:00
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$('[mode=take]').click(function(event) {window.location.href='<%=user_projects_user_url%>'; });
$('[mode=watched]').click(function(event) {window.location.href='<%=watch_projects_user_url(type: 1)%>'; });
});
</script>