Merge branch 'szzh' of http://git.trustie.net/jacknudt/trustieforge into szzh
commit
ea6a78893f
@ -1,8 +1,16 @@
|
||||
<% attachments.each_with_index do |attachment,i| %>
|
||||
<div id="attachment_<%= attachment.id%>">
|
||||
<%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
|
||||
<span class="fl">
|
||||
<span title="<%= attachment.filename %>">
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%>
|
||||
</span>
|
||||
</span>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 %>
|
||||
<span class="ml5 fl">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<span class="postAttSize">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end -%>
|
@ -0,0 +1,27 @@
|
||||
class AddCommitTime < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :project_scores, :commit_time, :datetime, :default => nil
|
||||
count = ProjectScore.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
ProjectScore.page(i).per(30).each do |ps|
|
||||
unless ps.project.nil?
|
||||
unless ps.project.gpid.nil?
|
||||
g = Gitlab.client
|
||||
begin
|
||||
changesets = g.commits(ps.project.gpid)
|
||||
ps.commit_time = changesets[0].created_at
|
||||
ps.save
|
||||
rescue
|
||||
logger.error("The project's rep is not exit!")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in new issue