Merge branch 'szzh' into develop

This commit is contained in:
yanxd 2014-05-20 15:56:51 +08:00
commit c4bd9aaabd
6 changed files with 24 additions and 9 deletions

View File

@ -182,11 +182,27 @@ module ApplicationHelper
end
def thumbnail_tag(attachment)
link_to image_tag(thumbnail_path(attachment)),
named_attachment_path(attachment, attachment.filename),
imagepath = named_attachment_path(attachment, attachment.filename)
link_to image_tag(imagepath),
imagepath ,
:title => attachment.filename
end
# 图片缩略图链接
def thumbnail_small_tag(attachment)
imagesize = attachment.thumbnail(:size => "200*200")
imagepath = named_attachment_path(attachment, attachment.filename)
if imagesize
link_to image_tag(imagesize),
imagepath,
:title => attachment.filename
else
link_to image_tag(imagepath , height: '200', width: '250'),
imagepath,
:title => attachment.filename
end
end
def toggle_link(name, id, options={})
onclick = "$('##{id}').toggle(); "
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")

View File

@ -228,7 +228,6 @@ class Attachment < ActiveRecord::Base
end
size = 100 unless size > 0
target = File.join(self.class.thumbnails_storage_path, "#{id}_#{digest}_#{size}.thumb")
begin
Redmine::Thumbnail.generate(self.diskfile, target, size)
rescue => e

View File

@ -33,7 +33,7 @@
<% if images.any? %>
<div class="thumbnails">
<% images.each do |attachment| %>
<div><%= thumbnail_tag(attachment) %></div>
<div><%= thumbnail_small_tag(attachment) %></div>
<% end %>
</div>
<% end %>

View File

@ -110,8 +110,7 @@
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %>
</td>
<td class="comments">
<div class="reply_content" ><%=h reply.content.html_safe %></div>
<!-- <div class="wiki">< %=h reply.content.html_safe %></div> -->
<div class="reply_content" ><%=h sanitize(reply.content.html_safe) %></div>
<p>
<% if reply.attachments.any?%>
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
@ -144,6 +143,7 @@
<script type="text/javascript">
jQuery(document).ready(function($) {
transpotUrl('#main');
transpotUrl('.lz');
transpotUrl('.replies');
});
</script>

View File

@ -45,7 +45,7 @@
<%= content_tag('span', l(:label_x_data,:count => files_count)) %>
</p>
<p class="stats">
<%= content_tag('span', link_to("#{@project.members.count}", member_project_path(@project)), :class => "info") %>
<%= content_tag('span', "#{@project.members.count}", :class => "info") %>
<%= content_tag('span', l(:label_x_member, :count => @project.members.count)) %>
</p>

View File

@ -12,7 +12,7 @@
<% end %>
<% else %>
<p>
<span><%=l(:label_course_doing)%>(<%=@memberships_doing.count%>)</span>
<span><%=l(:label_course_doing)%>(<%=@memberships_doing.count%>)</span>
<%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1, :project_type => 1}, :class => 'icon icon-add' if @user == User.current %>
</p>
<p>