diff --git a/.gitignore b/.gitignore index 0727a920a..c03e98428 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ vendor/cache /tags /config/initializers/gitlab_config.rb 1234567 +public/javascripts/wechat/node_modules/ diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index c938a2d4b..43e95a0e9 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -1,6 +1,6 @@ class OrgDocumentCommentsController < ApplicationController before_filter :find_organization, :only => [:new, :create, :show, :index] - before_filter :authorize_allowed, :only => [:create] + before_filter :authorize_allowed, :only => [:create, :add_reply] helper :attachments,:organizations layout 'base_org' @@ -38,6 +38,11 @@ class OrgDocumentCommentsController < ApplicationController def show @document = OrgDocumentComment.find(params[:id]) + @org_subfield = OrgSubfield.where(:id => @document.org_subfield_id).first + @subfield_content = @organization.org_subfields.order("priority") + respond_to do |format| + format.html {render :layout => @organization.switch_type ? 'base_org_custom' : 'base_org'} + end end def index @@ -91,7 +96,7 @@ class OrgDocumentCommentsController < ApplicationController def add_reply_in_doc @document = OrgDocumentComment.find(params[:id]).root @comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id]) - @comment.content = params[:org_comment][:org_content] + @comment.content = params[:org_content] @document.children << @comment @document.save respond_to do |format| diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index a0ef84798..ae1119609 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -28,8 +28,9 @@ class OrganizationsController < ApplicationController helper :project_score helper :issues include UsersHelper + include OrganizationsHelper before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout, :teachers, :students, :projects, :courses] - before_filter :allow_as_admin, :only => [:students, :teachers, :projects, :courses, :acts] + # before_filter :allow_as_admin, :only => [:students, :teachers, :projects, :courses, :acts] layout 'base_org' def index @@ -77,8 +78,12 @@ class OrganizationsController < ApplicationController def show # 组织新类型 show_mode:判断标准 1为新类型,0为旧 - if @organization.switch_type && params[:org_subfield_id].nil? && params[:list] .nil? + if @organization.switch_type && params[:list] .nil? if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) + unless params[:org_subfield_id].nil? + @org_subfield = OrgSubfield.where(:id => params[:org_subfield_id]).first + @subfield_acts = get_subfield_acts(@org_subfield) + end @subfield_content = @organization.org_subfields.order("priority") shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) @@ -102,7 +107,7 @@ class OrganizationsController < ApplicationController if @organization.org_subfields.where(:field_type => "Compact", :hide => 0).count > 0 @acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and ((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')}))) - order by created_at desc limit 6;") + order by updated_at desc limit 6;") end render :layout => 'base_org_custom' else @@ -175,7 +180,7 @@ class OrganizationsController < ApplicationController q = params[:search].nil? ? "" : "#{params[:search].strip}" @field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comptec").first : OrgSubfield.find(params[:org_subfield_id]) @type = params[:type] - if @type == "courses" || @type.nil? + if @type.blank? @org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc") elsif @type == "famous" @@ -199,7 +204,7 @@ class OrganizationsController < ApplicationController q = params[:search].nil? ? "" : "#{params[:search].strip}" @field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Compstu").first : OrgSubfield.find(params[:org_subfield_id]) @type = params[:type] - if @type == "courses" || @type.nil? + if @type.blank? @org_students = User.find_by_sql("select u.*, ue.student_id, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count from users u, user_extensions ue where u.id = ue.user_id and ue.identity= 1 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc") elsif @type == "famous" @@ -235,7 +240,7 @@ class OrganizationsController < ApplicationController q = params[:search].nil? ? "" : "#{params[:search].strip}" @field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comppro").first : OrgSubfield.find(params[:org_subfield_id]) @type = params[:type] - if @type.nil? + if @type.blank? @containers = Project.find_by_sql("select p.*, (select count(*) from forge_activities where forge_activities.project_id = p.id) as project_count from projects p where p.status =1 and p.is_public =1 and name like '%#{q}%' order by project_count desc;") elsif @type == "famous" @@ -249,7 +254,7 @@ class OrganizationsController < ApplicationController q = params[:search].nil? ? "" : "#{params[:search].strip}" @field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Compstu").first : OrgSubfield.find(params[:org_subfield_id]) @type = params[:type] - if @type.nil? + if @type.blank? @containers = Course.find_by_sql("select c.*, (select count(*) from course_activities where course_activities.course_id = c.id) as course_count from courses c where c.is_delete =0 and c.is_public =1 and name like '%#{q}%' order by course_count desc;") elsif @type == "famous" diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 531f0cb90..857f98afc 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -325,13 +325,10 @@ update def show ## TODO: the below will move to filter, done. - if !User.current.member_of?(@project) - if @project.hidden_repo - render_403 - return -1 - end + if !User.current.member_of?(@project) && @project.hidden_repo + render_403 + return end - @entries = @repository.entries(@path, @rev) @changeset = @repository.find_changeset_by_name(@rev) if request.xhr? diff --git a/app/controllers/sub_document_comments_controller.rb b/app/controllers/sub_document_comments_controller.rb index d6b335006..2e0890e27 100644 --- a/app/controllers/sub_document_comments_controller.rb +++ b/app/controllers/sub_document_comments_controller.rb @@ -1,9 +1,9 @@ class SubDocumentCommentsController < ApplicationController before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy, :edit] before_filter :find_subfield_content, :only => [:show, :index] - before_filter :authorize_allowed, :only => [:create] + before_filter :authorize_allowed, :only => [:create, :add_reply] helper :attachments,:organizations - layout 'base_sub_domain' + layout 'base_org_custom' def new @sub_document_comment = SubDocumentComment.new @@ -41,7 +41,7 @@ class SubDocumentCommentsController < ApplicationController if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @document = SubDocumentComment.find(params[:id]) respond_to do |format| - format.html {render :layout => @organization.switch_type ? 'base_sub_domain' : 'base_org'} + format.html {render :layout => @organization.switch_type ? 'base_org_custom' : 'base_org'} end else render_403 @@ -58,7 +58,7 @@ class SubDocumentCommentsController < ApplicationController @offset ||= @atta_pages.offset @documents = paginateHelper @documents,20 respond_to do |format| - format.html {render :layout => @organization.switch_type ? 'base_sub_domain' : 'base_org'} + format.html {render :layout => @organization.switch_type ? 'base_org_custom' : 'base_org'} end else render_403 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f5689ef64..88a524d1e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -123,6 +123,20 @@ class UsersController < ApplicationController end + #未读消息弹窗 + def user_messages_unviewed + @message_alls = [] + messages = MessageAll.where("user_id =?", User.current.id).includes(:message).order("created_at desc") + onclick_time = User.current.onclick_time.onclick_time + messages.each do |message_all| + # 未读的消息存放在数组 + if (message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0) || (message_all.message_type == "SystemMessage"&& !message_all.message.nil? && message_all.message.created_at > onclick_time) + @message_alls << message_all.message + break if @message_alls.length == 5 + end + end + end + # 用户消息 # 说明: homework 发布作业;message:讨论区; news:新闻; poll:问卷;works_reviewers:作品评阅;works_reply:作品回复,exercise:课程测验 # issue:问题;journal:缺陷状态更新; forum:公共贴吧: user_feedback: 用户留言; new_reply:新闻回复(comment) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index ef59e0ed4..3ccdc3257 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -121,7 +121,7 @@ class WechatsController < ActionController::Base on :fallback, respond: 'fallback message' on :click, with: 'FEEDBACK' do |request, key| - request.reply.text "如有反馈问题,请直接切入至输入框,发微信给我们即可" + request.reply.text "如有反馈问题,请直接切换至输入框,发微信给我们即可" end on :click, with: 'MY_NEWS' do |request, key| diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3aa7d8a4a..46fdb02f3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1080,7 +1080,7 @@ module ApplicationHelper elsif @user title << @user.try(:realname) else - title << User.current.try(:realname) + title << (User.current.id == 2 ? "未登录" : User.current.try(:realname)) end if first_page.nil? || first_page.web_title.nil? title << Setting.app_title unless Setting.app_title == title.last diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index fa0d33f6e..60714f597 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -66,52 +66,87 @@ module OrganizationsHelper def org_user_by_type obj case obj.act_type when "Message" - user = obj.act.author + obj.act.author when "News" - user = obj.act.author + obj.act.author when "HomeworkCommon" - user = obj.act.user + obj.act.user when "Issue" - user = obj.act.author + obj.act.author end end def org_title_by_type obj case obj.act_type when "Message" - user = obj.act.parent_id.nil? ? obj.act.subject : obj.act.parent.subject + obj.act.parent_id.nil? ? obj.act.subject : obj.act.parent.subject when "News" - user = obj.act.title + obj.act.title when "HomeworkCommon" - user = obj.act.name + obj.act.name when "Issue" - user = obj.act.subject + obj.act.subject end end def org_content_by_type obj case obj.act_type when "Message" - user = obj.act.parent_id.nil? ? obj.act.content : obj.act.parent.content + obj.act.parent_id.nil? ? obj.act.content : obj.act.parent.content when "News" - user = obj.act.description + obj.act.description when "HomeworkCommon" - user = obj.act.description + obj.act.description when "Issue" - user = obj.act.description + obj.act.description end end def org_time_by_type obj case obj.act_type when "Message" - time = obj.act.updated_on + obj.act.updated_on when "News" - user = obj.act.created_on + obj.act.created_on when "HomeworkCommon" - user = obj.act.updated_at + obj.act.updated_at when "Issue" - user = obj.act.updated_on + obj.act.updated_on + end + end + + # 组织的栏目类型标题 + def subfield_title_type obj + case obj.org_act_type + when "OrgDocumentComment" + obj.org_act.title + when "Message" + obj.org_act.parent_id.nil? ? obj.org_act.subject : obj.org_act.parent.subject + when "News" + obj.org_act.title + end + end + + # 组织的栏目类型时间 + def subfield_time_type obj + case obj.org_act_type + when "OrgDocumentComment" + obj.org_act.updated_at + when "Message" + obj.org_act.updated_on + when "News" + obj.org_act.created_on + end + end + + def subfield_reply_count_type obj + case obj.org_act_type + when "OrgDocumentComment" + obj.org_act.children.count + when "Message" + obj.org_act.children.count + when "News" + obj.org_act.comments_count end end @@ -178,17 +213,19 @@ module OrganizationsHelper # 系统栏目只有管理员才能看到 def subfield_to_addmin?(org) - if User.current.admin? - @organization.org_subfields.order("priority") - else - @organization.org_subfields.select { |os| (os.field_type != "Comptec" && os.field_type != "Compstu" && os.field_type != "Comppro" && os.field_type != "Compcou" && os.field_type != "Compact") }.sort_by {|os| os.priority} - end + # if User.current.admin? + @organization.org_subfields.order("priority") + # else + # @organization.org_subfields.select { |os| (os.field_type != "Comptec" && os.field_type != "Compstu" && os.field_type != "Comppro" && os.field_type != "Compcou" && os.field_type != "Compact") }.sort_by {|os| os.priority} + # end end def get_subfield_acts field - org_subfield = OrgSubfield.find(field.id) - org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0 - org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc') + unless field.nil? + org_subfield = OrgSubfield.find(field.id) + org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0 + org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc') + end end def allow_to_create?(org, type) diff --git a/app/views/attachments/_attachment_history_download.html.erb b/app/views/attachments/_attachment_history_download.html.erb index c805960f0..c3e586fb1 100644 --- a/app/views/attachments/_attachment_history_download.html.erb +++ b/app/views/attachments/_attachment_history_download.html.erb @@ -13,7 +13,7 @@ <%= link_to truncate(@attachment.filename,length: 35, omission: '...'), download_named_attachment_path(@attachment.id, @attachment.filename), - :title => @attachment.filename+"\n"+@attachment.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f14 fb link_file_a2 fl" %> + :title => @attachment.filename+"\n"+@attachment.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:280px;",:class => "linkBlue f14 fb link_file_a2 fl" %> 版本号:当前
diff --git a/app/views/layouts/_base_footer_public.html.erb b/app/views/layouts/_base_footer_public.html.erb index eb2e83ba2..7c5ab571e 100644 --- a/app/views/layouts/_base_footer_public.html.erb +++ b/app/views/layouts/_base_footer_public.html.erb @@ -4,7 +4,7 @@
  • <%= l(:label_about_us)%>|
  • <%= l(:label_contact_us)%>|
  • <%= l(:label_recruitment_information)%>|
  • -
  • <%= link_to l(:label_surpport_group), "https://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|
  • +
  • <%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|
  • <%= l(:label_forums)%>|
  • <%= l(:label_language)%> -
    - - + <% if User.current.logged? %> +
    + <%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> + +
    + + -
    -

    - <% end %> -
    +
    +

    + <% end %> + + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %>
    diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index 946043a62..aa1084304 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -89,7 +89,11 @@
  • <%= field.hide==0?"隐藏":"可见" %> | - <%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %> + <% if (field.field_type == "Comptec" || field.field_type == "Compstu" || field.field_type == "Comppro" || field.field_type == "Compcou" || field.field_type == "Compact") && !User.current.admin? %> + 默认 + <% else %> + <%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %> + <% end %> | 编辑 <% unless field.field_type == "Resource" || field.field_type == "Comptec" || field.field_type == "Compstu" || field.field_type == "Comppro" || field.field_type == "Compcou" || field.field_type == "Compact" %> diff --git a/app/views/organizations/courses.js.erb b/app/views/organizations/courses.js.erb index dc42c115c..48868be39 100644 --- a/app/views/organizations/courses.js.erb +++ b/app/views/organizations/courses.js.erb @@ -1,3 +1,3 @@ $("#org_container_list").html('<%= escape_javascript( render :partial => 'organizations/org_container', :locals => {:containers => @containers})%>'); -$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#org_student_search").attr('href','<%= courses_organization_path(@organization, :type => @type) %>'); \ No newline at end of file +$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => true, :flag => true %>'); +//$("#org_student_search").attr('href','<%#= courses_organization_path(@organization, :type => @type) %>'); \ No newline at end of file diff --git a/app/views/organizations/projects.js.erb b/app/views/organizations/projects.js.erb index e8d4f244a..cf3216fdf 100644 --- a/app/views/organizations/projects.js.erb +++ b/app/views/organizations/projects.js.erb @@ -1,3 +1,2 @@ $("#org_container_list").html('<%= escape_javascript( render :partial => 'organizations/org_container', :locals => {:containers => @containers})%>'); -$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#org_student_search").attr('href','<%= projects_organization_path(@organization, :type => @type) %>'); \ No newline at end of file +$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => true, :flag => true %>'); diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index 72e95ded9..ab3120a5d 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -1,6 +1,11 @@ <%# 区分两种模式 params[:org_subfield_id] 不为空的时候则跳到栏目%> -<% if @organization.switch_type && params[:org_subfield_id].nil? %> - <%= render :partial => 'show_custom' %> +<% if @organization.switch_type %> + <% if params[:org_subfield_id].nil? %> + <%= render :partial => 'show_custom' %> + <% else %> + <%#= 单个栏目模式二中显示 %> + <%= render :partial => 'show_custom_org_subfield' %> + <% end %> <% else %> <%= javascript_include_tag "jquery.infinitescroll.js" %> diff --git a/app/views/organizations/students.js.erb b/app/views/organizations/students.js.erb index c65f8f861..7a427c1ac 100644 --- a/app/views/organizations/students.js.erb +++ b/app/views/organizations/students.js.erb @@ -1,3 +1,2 @@ $("#org_students_list").html('<%= escape_javascript( render :partial => 'organizations/org_students_list', :locals => {:org_students => @org_students})%>'); -$("#pages").html('<%= pagination_links_full @atta_pages, @students_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#org_student_search").attr('href','<%= students_organization_path(@organization, :type => @type) %>'); \ No newline at end of file +$("#pages").html('<%= pagination_links_full @atta_pages, @students_count, :per_page_links => false, :remote => true, :flag => true %>'); diff --git a/app/views/organizations/teachers.js.erb b/app/views/organizations/teachers.js.erb index cd7323a4a..04eecb810 100644 --- a/app/views/organizations/teachers.js.erb +++ b/app/views/organizations/teachers.js.erb @@ -1,3 +1,2 @@ $("#org_teachers_list").html('<%= escape_javascript( render :partial => 'organizations/org_teachers_list', :locals => {:org_teachers => @org_teachers})%>'); -$("#pages").html('<%= pagination_links_full @atta_pages, @teachers_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#org_teacher_search").attr('href','<%= teachers_organization_path(@organization, :type => @type) %>'); \ No newline at end of file +$("#pages").html('<%= pagination_links_full @atta_pages, @teachers_count, :per_page_links => false, :remote => true, :flag => true %>'); \ No newline at end of file diff --git a/app/views/sub_document_comments/_show_sub_document.html.erb b/app/views/sub_document_comments/_show_sub_document.html.erb index 135a48268..2eec92209 100644 --- a/app/views/sub_document_comments/_show_sub_document.html.erb +++ b/app/views/sub_document_comments/_show_sub_document.html.erb @@ -123,17 +123,20 @@ <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
    -
    - <%= form_for('new_form', :url => add_reply_org_subfield_sub_domain_sub_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> - -
    - - - -
    -

    - <% end %> -
    + <% if User.current.logged? %> +
    + <%= form_for('new_form', :url => add_reply_org_subfield_sub_domain_sub_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %> + +
    + + +
    +

    + <% end %> +
    + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %>
    diff --git a/app/views/users/_show_unlogged.html.erb b/app/views/users/_show_unlogged.html.erb new file mode 100644 index 000000000..258ebe7af --- /dev/null +++ b/app/views/users/_show_unlogged.html.erb @@ -0,0 +1,3 @@ +
    + <%= link_to "登录", signin_path, :class => "linkBlue", :target => "_blank" %>后可添加回复 +
    \ No newline at end of file diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 60d5b6ed8..0c18dbcc3 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -259,7 +259,7 @@ '您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请已通过' : '您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请被拒绝' %> - <% if User.current.member_of_course?(ma.course_message.course) || User.current.admin? || ma.course_message.is_open == 1 %> + <% if User.current.member_of_course?(ma.course_message.course) || User.current.admin? || (ma.course_message.is_open == 1 && ma.course_message.course.is_public == 1) %> <%= link_to link_str, student_work_index_path(:homework => ma.course_message.id), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}", :target => '_blank' %> <% else %> <%=link_str %> @@ -399,7 +399,7 @@
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> - <% elsif ma.course_message.jour_type == 'HomeworkCommon' %> + <% elsif ma.course_message.jour_type == 'HomeworkCommon' %>