commit
280bf01912
@ -0,0 +1,5 @@
|
|||||||
|
<% if @is_exist %>
|
||||||
|
$is_exist = true;
|
||||||
|
<% else %>
|
||||||
|
$is_exist = false;
|
||||||
|
<% end %>
|
@ -0,0 +1,12 @@
|
|||||||
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
|
<%= content.to_s.html_safe%>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
var postContent = $("#intro_content_<%= user_activity_id%>").html();
|
||||||
|
postContent = postContent.replace(/ /g," ");
|
||||||
|
$("#intro_content_<%= user_activity_id%>").html(postContent);
|
||||||
|
});
|
||||||
|
</script>
|
@ -0,0 +1,32 @@
|
|||||||
|
class UpdateRepCommits < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
project_count = Project.all.count / 30 + 2
|
||||||
|
transaction do
|
||||||
|
for i in 1 ... project_count do i
|
||||||
|
Project.page(i).per(30).each do |project|
|
||||||
|
puts project.id
|
||||||
|
if ProjectScore.where("project_id=?", project.id).first.nil?
|
||||||
|
puts "create project ==>#{project.id}"
|
||||||
|
ProjectScore.create(:project_id => project.id, :score => false)
|
||||||
|
end
|
||||||
|
unless project.project_score.nil?
|
||||||
|
# update boards
|
||||||
|
unless project.gpid.nil?
|
||||||
|
g = Gitlab.client
|
||||||
|
begin
|
||||||
|
puts project.id
|
||||||
|
count = g.project(project.gpid).commit_count
|
||||||
|
rescue
|
||||||
|
logger.error("The project's rep is not exit!")
|
||||||
|
end
|
||||||
|
project.project_score.update_attribute(:changeset_num, count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue