#1297修复学生能看到发布通知按钮的BUG

2.增加课程是否对学生开发的数据迁移
 3.页面代码整理
 解决方案:增加当前登录用户是否在课程有发布通知权限的判断
course_group
sw 11 years ago
parent f6561395a4
commit b6551f8955

@ -62,8 +62,14 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %></td> <td style="padding-left: 8px">
<!-- modified by bai --> <td><%=link_to "主页", home_path %> > <%=link_to "软件创客", :controller => 'users', :action => 'index' %> > <span><%=link_to @user.name, user_path %></span></td> <%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %>
</td>
<td>
<%=link_to "主页", home_path %> >
<%=link_to "软件创客", :controller => 'users', :action => 'index' %> >
<span><%=link_to @user.name, user_path %></span>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -92,7 +98,8 @@
<% end %></td> <% end %></td>
</tr> </tr>
<tr><td class="score"> <tr>
<td class="score">
<div id="score_div"> <div id="score_div">
<%= render :partial => 'users/user_score', :locals => {:user => @user}%> <%= render :partial => 'users/user_score', :locals => {:user => @user}%>
</div> </div>
@ -104,12 +111,13 @@
</tr> </tr>
</table> </table>
<div> <div>
<strong class="font_small_watch"><%= link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%></strong> &nbsp; <strong class="font_small_watch">
<%= link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%>
<strong class="font_small_watch"><%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %></strong>&nbsp; </strong> &nbsp;
<!-- <strong class="font_small_watch"><%= link_to l(:label_requirement_focus)+"("+Bid.watched_by(@user).where('reward_type = ?', 1).count.to_s+")" ,:controller=>"users", :action=>"watch_bids"%></strong>--> &nbsp; <!-- added by huang --> <strong class="font_small_watch">
<!-- added by bai 个人签名--> <%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %>
</strong>&nbsp;&nbsp;
<% if @user.id == User.current.id %> <% if @user.id == User.current.id %>
<p> <p>
<%= toggle_link l(:label_brief_introduction), 'introduction', {:focus => 'new_form_user_introduction'} %> <%= toggle_link l(:label_brief_introduction), 'introduction', {:focus => 'new_form_user_introduction'} %>
@ -125,17 +133,21 @@
:url => {:controller => 'words', :action => 'add_brief_introdution'}) do |f|%> :url => {:controller => 'words', :action => 'add_brief_introdution'}) do |f|%>
<table border="0" width="100%" align="center" > <table border="0" width="100%" align="center" >
<tr> <tr>
<td><%= f.text_area 'user_introduction', :rows => 3, <td>
<%= f.text_area 'user_introduction', :rows => 3,
:cols => 65, :cols => 65,
:placeholder => "#{l(:label_my_brief_introduction)}", :placeholder => "#{l(:label_my_brief_introduction)}",
:style => "resize: none;", :style => "resize: none;",
:class => 'noline'%></td> :class => 'noline'%>
</td>
</tr> </tr>
</table> </table>
<table border="0" width="200px" align="center"> <table border="0" width="200px" align="center">
<tr> <tr>
<td align="right"> <%= submit_tag l(:button_submit), :name => nil , <td align="right">
:class => "bid_btn" %></td> <%= submit_tag l(:button_submit), :name => nil ,
:class => "bid_btn" %>
</td>
</tr> </tr>
</table> </table>
<% end %> <% end %>
@ -148,20 +160,21 @@
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:'微软雅黑'" width="240"> <table style="font-family:'微软雅黑'" width="240">
<tr> <tr>
<td style="padding-left: 5px" width="70px"><%= l(:label_user_joinin) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= format_time(@user.created_on) %></td> <td style="padding-left: 5px" width="70px">
</tr> <%= l(:label_user_joinin) %>
<tr> </td>
<td style="padding-left: 5px"><%= l(:label_user_login) %></td><td class="font_lighter_sidebar" style="padding-left: 0px"><%= format_time(@user.last_login_on) %></td> <td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= format_time(@user.created_on) %>
</td>
</tr> </tr>
<!--
<tr> <tr>
<td valign="top" style="padding-left: 5px;"><%#= l(:label_user_mail) %></td><td class="font_lighter_sidebar" style="padding-left: 0px; word-wrap: break-word; word-break: break-all"><%#= mail_to(h(@user.mail), nil, :encode => 'javascript') %></td> <td style="padding-left: 5px">
<%= l(:label_user_login) %>
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px">
<%= format_time(@user.last_login_on) %>
</td>
</tr> </tr>
-->
<!-- added by bai 在个人主页里显示“工作单位”“地区”"教师的职称"-->
<!-- modified by linchun 在个人主页里显示“加入时间”,“最后登录”,“邮件地址”后面添加冒号-->
<!-- modified by zjc 高校添加超链接 -->
<% unless @user.user_extensions.nil? %> <% unless @user.user_extensions.nil? %>
<% unless @user.user_extensions.identity == 2 %> <% unless @user.user_extensions.identity == 2 %>
<tr> <tr>
@ -178,12 +191,21 @@
<tr> <tr>
<% if @user.user_extensions.identity == 0 %> <% if @user.user_extensions.identity == 0 %>
<td style="padding-left: 5px" width="76px"> <td style="padding-left: 5px" width="76px">
<%= l(:label_technical_title) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.technical_title %></td> <%= l(:label_technical_title) %>:
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.technical_title %>
</td>
<% end %> <% end %>
</tr> </tr>
<% if( (@user.user_extensions.identity == 1) && (is_watching?(@user) ) )%> <% if( (@user.user_extensions.identity == 1) && (is_watching?(@user) ) )%>
<tr> <tr>
<td style="padding-left: 8px" width="70px"><%= l(:label_bidding_user_studentcode)%>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.student_id %></td> <td style="padding-left: 8px" width="70px">
<%= l(:label_bidding_user_studentcode)%>:
</td>
<td class="font_lighter_sidebar" style="padding-left: 0px" width="170px">
<%= @user.user_extensions.student_id %>
</td>
</tr> </tr>
<% end %> <% end %>
<% else%> <% else%>
@ -196,7 +218,6 @@
<% end %> <% end %>
<!-- end --> <!-- end -->
</table> </table>
</div> </div>
<!--Modified by nie--> <!--Modified by nie-->
<div class="user_underline"></div> <div class="user_underline"></div>

@ -64,12 +64,12 @@
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;"> <span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
<%= label_tips %> <%= label_tips %>
</span> </span>
<%= link_to(btn_tips,
new_course_news_path(@course), <% if @course && User.current.allowed_to?(:manage_news, @course) %>
<%= link_to(btn_tips, new_course_news_path(@course),
:class => 'icon icon-add', :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %> :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
<% if @course && User.current.allowed_to?(:manage_news, @course) %>
<div id="add-news" class="add_frame" style="display:none;"> <div id="add-news" class="add_frame" style="display:none;">
<%= labelled_form_for @news, :url => course_news_index_path(@course), <%= labelled_form_for @news, :url => course_news_index_path(@course),
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>

@ -0,0 +1,5 @@
class AddOpenStudentToCourse < ActiveRecord::Migration
def change
add_column :courses, :open_student, :integer, :default => 0
end
end
Loading…
Cancel
Save