游客身份,进入具体的班级和项目各功能入口的调整
This commit is contained in:
parent
4504308403
commit
984b540a63
|
@ -1360,7 +1360,7 @@ module ApplicationHelper
|
|||
:id => wiki_page_id, :version => nil, :anchor => anchor, :parent => parent)
|
||||
end
|
||||
end
|
||||
link_to(title.present? ? title.html_safe : h(page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new')))
|
||||
link_to(title.present? ? title.html_safe : h(page), User.current.logged? ? url : signin_url_without_domain, :class => ('wiki-page' + (wiki_page ? '' : ' new')))
|
||||
else
|
||||
# project or wiki doesn't exist
|
||||
all
|
||||
|
@ -2881,7 +2881,7 @@ module ApplicationHelper
|
|||
|
||||
def file_preview_eye(file, html_options={})
|
||||
if %w(pdf pptx doc docx xls xlsx).any?{|x| file.filename.downcase.end_with?(x)}
|
||||
link_to '', download_named_attachment_path(file.id, file.filename, preview: true),html_options
|
||||
link_to '', User.current.logged? ? download_named_attachment_path(file.id, file.filename, preview: true) : signin_url_without_domain, html_options
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -803,7 +803,11 @@ module CoursesHelper
|
|||
link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "sy_btn_grey fl")
|
||||
end
|
||||
else
|
||||
link = "<a href='javascript:void(0)' class='sy_btn_grey fl ml10' >#{l(:label_course_join_student)}</a>"
|
||||
if User.current.logged?
|
||||
link = "<a href='javascript:void(0)' class='sy_btn_grey fl ml10' >#{l(:label_course_join_student)}</a>"
|
||||
else
|
||||
link = link_to(l(:label_course_join_student), signin_url_without_domain, :class => "sy_btn_grey fl ml10")
|
||||
end
|
||||
end
|
||||
link.html_safe
|
||||
end
|
||||
|
|
|
@ -35,9 +35,17 @@
|
|||
<% end%>
|
||||
<span title="<%= attachment.filename %>" id = "attachment_">
|
||||
<% if options[:length] %>
|
||||
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%>
|
||||
<% if User.current.logged? %>
|
||||
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%>
|
||||
<% else %>
|
||||
<%= link_to(attachment.filename, signin_url_without_domain, :class => "link_file_board", :length => options[:length]) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to_short_attachment attachment, :length=> 58,:class => 'hidden link_file_a fl newsBlue mw400', :download => true -%>
|
||||
<% if User.current.logged? %>
|
||||
<%= link_to_short_attachment attachment, :length=> 58,:class => 'hidden link_file_a fl newsBlue mw400', :download => true -%>
|
||||
<% else %>
|
||||
<%= link_to(attachment.filename, signin_url_without_domain,:length=> 58, :class => "hidden link_file_a fl newsBlue mw400") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%if is_float%>
|
||||
|
@ -92,7 +100,7 @@
|
|||
<% end %>
|
||||
<% if options[:author] %>
|
||||
<span class="author" title="<%= attachment.author.show_name%>">
|
||||
<%= link_to h(truncate(attachment.author.show_name, length: 10, omission: '...')),user_path(attachment.author),:class => "link-blue" %>,
|
||||
<%= link_to h(truncate(attachment.author.show_name, length: 10, omission: '...')), User.current.logged? ? user_path(attachment.author) : signin_url_without_domain, :class => "link-blue" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
|
|
@ -11,15 +11,15 @@
|
|||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
download_named_attachment_path(file.id, file.filename),
|
||||
User.current.logged? ? download_named_attachment_path(file.id, file.filename) : signin_url_without_domain,
|
||||
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
|
||||
<% else %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'), User.current.logged? ? attachment_history_download_path(file.id) : signin_url_without_domain,
|
||||
:title => file.filename+"\n"+file.description.to_s,
|
||||
:class => "linkGrey3 f_14",
|
||||
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||
<% end %>
|
||||
<%= file_preview_eye(file, class: 'preview') %>
|
||||
<%= file_preview_eye(file, class: 'preview') %>
|
||||
<span id="image_private_<%= file.id%>">
|
||||
<% if file.is_public? == false%>
|
||||
<span class="img_private ml5">私有</span>
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<li id="sy_02" class="sy_icons_boards">
|
||||
<% count = @course.boards.first ? (@course.boards.first.topics.count + Message.where("board_id =? and parent_id is not ?", @course.boards.first.id, nil).count) : 0 %>
|
||||
<a href="<%=course_boards_path(@course) %>">讨论区<span><%=count %></span></a>
|
||||
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
||||
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") if is_teacher %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% unless show_nav?(@course.homework_commons.count) %>
|
||||
|
@ -94,7 +94,7 @@
|
|||
<% unless show_nav?(course_feedback_count) %>
|
||||
<li id="sy_06" class="sy_icons_feedback">
|
||||
<a href="<%=course_feedback_path(@course) %>">留言<span id="course_jour_count"><%=course_feedback_count %></span></a>
|
||||
<%= link_to "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}"%>
|
||||
<%= link_to( "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}") if is_teacher %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% unless show_nav?(course_poll_count) %>
|
||||
|
@ -106,7 +106,7 @@
|
|||
<% count = User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count %>
|
||||
<% unless show_nav?(count) %>
|
||||
<li id="sy_08" class="sy_icons_exercise">
|
||||
<a href="<%=exercise_index_path(:course_id => @course.id) %>">在线测验<span><%=count %></span></a>
|
||||
<a href="<%= User.current.logged? ? exercise_index_path(:course_id => @course.id) : signin_url_without_domain %>">在线测验<span><%=count %></span></a>
|
||||
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'sy_class_add', :title =>"新建试卷") if is_teacher %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
|
|
@ -19,19 +19,19 @@
|
|||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<div class="cl"></div>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<%= link_to activity.title.to_s, news_path(activity), :class => "list-title fl" %>
|
||||
<%= link_to activity.title.to_s, User.current.logged? ? news_path(activity) : signin_url_without_domain, :class => "list-title fl" %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<% u = User.where("id=?", activity.author_id).first %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
||||
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
|
|
Loading…
Reference in New Issue