Conflicts: app/views/organizations/_org_course_homework.html.erb app/views/users/_user_homework_detail.html.erbcxt_course
commit
c49a290d56
@ -0,0 +1,3 @@
|
|||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the subfield_subdomain_dirs controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,10 @@
|
|||||||
|
class SubfieldSubdomainDirsController < ApplicationController
|
||||||
|
def update
|
||||||
|
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||||
|
if @org_subfield.subfield_subdomain_dir
|
||||||
|
@org_subfield.subfield_subdomain_dir.update_attribute(:name, :params[:sub_dir_name])
|
||||||
|
else
|
||||||
|
SubfieldSubdomainDir.create(:org_subfield_id => @org_subfield.id, :name => params[:sub_dir_name])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module SubfieldSubdomainDirsHelper
|
||||||
|
end
|
@ -0,0 +1,4 @@
|
|||||||
|
class SubfieldSubdomainDir < ActiveRecord::Base
|
||||||
|
# attr_accessible :title, :body
|
||||||
|
belongs_to :org_subfield
|
||||||
|
end
|
@ -1,59 +1,78 @@
|
|||||||
<% delete_allowed = User.current.admin? %>
|
<% delete_allowed = User.current.admin? %>
|
||||||
<div class="re_con_top">
|
|
||||||
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
|
||||||
<p class="f_r" style="color: #808080">
|
|
||||||
<% if order == "asc" %>
|
|
||||||
按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
|
||||||
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
|
||||||
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
|
||||||
<% else %>
|
|
||||||
按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
|
||||||
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
|
||||||
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
|
||||||
<% end %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<div class="files_tag" id="files_tag">
|
|
||||||
<%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
|
|
||||||
<div class="for_img_thumbnails">
|
<% org_subfield_attachments.each do |file| %>
|
||||||
<% org_subfield_attachments.each do |file| %>
|
<div class="resources mt10" id="container_files_<%= file.id %>">
|
||||||
<% if 1 %>
|
<div class="homepagePostBrief">
|
||||||
<div class="re_con_box" id="container_files_<%= file.id %>">
|
<div class="homepagePostPortrait">
|
||||||
<div class="">
|
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
</div>
|
||||||
download_named_attachment_path(file.id, file.filename),
|
<div class="homepagePostDes">
|
||||||
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
<div class="homepagePostTitle break_word mt-4">
|
||||||
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||||
|
download_named_attachment_path(file.id, file.filename),
|
||||||
|
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
||||||
|
<%= file_preview_eye(file, class: 'preview') %>
|
||||||
|
<span id="image_private_<%= file.id%>">
|
||||||
|
<% if file.is_public? == false%>
|
||||||
|
<span class="img_private ml5">私有</span>
|
||||||
|
<%end %>
|
||||||
|
</span>
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
|
<div class="mt5">
|
||||||
|
<span class="fontGrey2 mr15 fl">上传时间:<%= format_date(file.created_on)%></span>
|
||||||
|
<% if file.tag_list.length > 0%>
|
||||||
|
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
||||||
|
<% end %>
|
||||||
|
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||||
|
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="tag_h">
|
||||||
|
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
|
||||||
|
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostSetting">
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<% if !@org_subfield.attachments.all.include?file %>
|
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
|
||||||
<%= link_to("选入栏目",quote_resource_show_org_subfield_org_subfield_file_path(:org_subfield_id => @org_subfield.id, :id => file.id),:class => "f_l re_select c_lorange",:remote => true) %>
|
<ul class="homepagePostSettiongText">
|
||||||
<% elsif @org_subfield.organization.org_subfields.where("field_type='Resource'").count > 1 %>
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %></li>
|
||||||
<%= link_to("选入组织其他栏目",quote_resource_show_org_subfield_org_subfield_file_path(:org_subfield_id => @org_subfield.id, :id => file.id),:class => "f_l re_select c_lorange",:remote => true) %>
|
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
||||||
|
<li>
|
||||||
|
<span id="is_public_<%= file.id %>">
|
||||||
|
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to( '删除资源', attachment_path(file),
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" && file.destroyable %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<%else%>
|
||||||
|
<ul class="resourceSendO">
|
||||||
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %></li>
|
||||||
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= file_preview_tag(file, class: 'f_l re_open', style:'text-align: center;') %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</li>
|
||||||
<div class="cl"></div>
|
</ul>
|
||||||
<div class="mt5">
|
|
||||||
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
</div>
|
||||||
<%= link_to( l(:button_delete), attachment_path(file),
|
</div>
|
||||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @org_subfield.id && file.container_type == "OrgSubfield"%>
|
<div class="cl"></div>
|
||||||
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
</div><!---re_con_box end-->
|
||||||
<div class="tag_h">
|
<% end %>
|
||||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
|
|
||||||
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
|
<% if org_subfield_attachments.count == 10 %>
|
||||||
</div>
|
<% if params[:action] == 'search_files_in_subfield' %>
|
||||||
<div class="cl"></div>
|
<%=link_to "点击展开更多", search_files_in_subfield_org_subfield_files_path(:org_subfield_id => org_subfield.id,:page => @page.to_i + 1, :name => params[:name],:insite => params[:insite]),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||||
</div><!---re_con_box end-->
|
<% else %>
|
||||||
<% end %>
|
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
|
||||||
<% end %>
|
<%=link_to "点击展开更多", org_subfield_files_path(:org_subfield_id => org_subfield.id, :page => @page.nil? ? 2 :(@page + 1)), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
|
||||||
</div>
|
<%end%>
|
||||||
<ul class="wlist">
|
<% end%>
|
||||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
|
||||||
</ul>
|
|
||||||
<div class="cl"></div>
|
|
||||||
|
@ -1,2 +1,8 @@
|
|||||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
|
<% if (@obj_pages &&( @obj_pages.page > 1)) || (@feedback_pages && (@feedback_pages.page > 1)) %>
|
||||||
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
|
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/org_subfield_list',
|
||||||
|
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach} )%>");
|
||||||
|
<% else %>
|
||||||
|
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
|
||||||
|
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
|
||||||
|
$("#attachment_count").html("<%= @result.count %>");
|
||||||
|
<% end %>
|
@ -0,0 +1,80 @@
|
|||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("#relateProject,.relatePInfo").mouseover(function(){
|
||||||
|
$(".relatePInfo").css("display","block");
|
||||||
|
})
|
||||||
|
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||||
|
$(".relatePInfo").css("display","none");
|
||||||
|
})
|
||||||
|
$(".homepagePostPortrait").mouseover(function(){
|
||||||
|
$(this).children(".userCard").css("display","block");
|
||||||
|
})
|
||||||
|
$(".homepagePostPortrait").mouseout(function(){
|
||||||
|
$(this).children(".userCard").css("display","none");
|
||||||
|
})
|
||||||
|
$(".userCard").mouseover(function(){
|
||||||
|
$(this).css("display","block");
|
||||||
|
})
|
||||||
|
$(".userCard").mouseout(function(){
|
||||||
|
$(this).css("display","none");
|
||||||
|
})
|
||||||
|
$(".coursesLineGrey").mouseover(function(){
|
||||||
|
$(this).css("color","#ffffff");
|
||||||
|
})
|
||||||
|
$(".coursesLineGrey").mouseout(function(){
|
||||||
|
$(this).css("color","#808080");
|
||||||
|
})
|
||||||
|
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
|
||||||
|
$(this).prev().css("color","#ffffff");
|
||||||
|
$(this).css("z-index", "9999");
|
||||||
|
})
|
||||||
|
$(".homepagePostSetting").mouseout(function(){
|
||||||
|
$(this).prev().css("color","#808080");
|
||||||
|
$(this).css("z-index", "1");
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<% unless org_activities.nil? %>
|
||||||
|
<% org_activities.each do |act| %>
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
init_activity_KindEditor_data(<%= act.id%>, null, "87%", "<%=act.class.to_s%>");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<% if act.container_type == 'Organization' %>
|
||||||
|
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
|
||||||
|
<%= render :partial => 'organizations/show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if act.container_type == 'Project' %>
|
||||||
|
<% case act.org_act_type.to_s %>
|
||||||
|
<% when 'Message' %>
|
||||||
|
<%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if act.container_type == 'Course' %>
|
||||||
|
<% case act.org_act_type.to_s %>
|
||||||
|
<% when 'Message'%>
|
||||||
|
<%= render :partial => 'organizations/org_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if act.container_type == 'OrgSubfield' %>
|
||||||
|
<% if act.org_act_type == 'Message' and act.org_act_id and Message.where("id=#{act.org_act_id}").count > 0 %>
|
||||||
|
<% message = Message.find(act.org_act_id) %>
|
||||||
|
<% if !message.board.course_id.nil? %>
|
||||||
|
<%= render :partial => 'organizations/org_course_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
|
||||||
|
<% elsif message.board.project_id != -1 %>
|
||||||
|
<%= render :partial => 'organizations/project_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
|
||||||
|
<% elsif message.board.org_subfield_id %>
|
||||||
|
<%= render :partial => 'organizations/org_subfield_message', :locals => {:activity => message, :user_activity_id => act.id} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if org_act_count == 10 %>
|
||||||
|
<%= link_to "点击展开更多",show_org_subfield_organization_path(:id => @organization.id,:page => @page.to_i + 1,:sub_dir_name => params[:sub_dir_name]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||||
|
<% end%>
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
||||||
|
|
||||||
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
/*回复框*/
|
||||||
|
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
|
||||||
|
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-outline {border: none;}
|
||||||
|
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
|
||||||
|
.homepagePostReplyInputContainer .ke-container {float: left;}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="homepageRightBanner">
|
||||||
|
<div class="NewsBannerName"><%= @org_subfield.name %></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% if @org_activities %>
|
||||||
|
<%= render :partial => 'org_subfields/show_details',
|
||||||
|
:locals => {:org_activities => @org_activities,
|
||||||
|
:page=> @page,
|
||||||
|
:org => @organization,
|
||||||
|
:org_act_count=> @org_activities.count} %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
|||||||
$("#org_subfield_list").html("");
|
<% if @res %>
|
||||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
|
$("#org_subfield_list").html("");
|
||||||
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
|
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
|
||||||
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
|
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
|
||||||
$("#sub_field_left_lists").html("");
|
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
|
||||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
$("#sub_field_left_lists").html("");
|
||||||
$("#subfield_name").val("");
|
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
||||||
|
$("#subfield_name").val("");
|
||||||
|
<% else %>
|
||||||
|
$("#subfield_name").val("");
|
||||||
|
<% end %>
|
@ -0,0 +1,5 @@
|
|||||||
|
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'org_subfields/show_details',
|
||||||
|
:locals => {:org_activities =>@org_activities,
|
||||||
|
:page=>@page,
|
||||||
|
:org => @organization,
|
||||||
|
:org_act_count=>@org_activities.count} )%>");
|
@ -0,0 +1,11 @@
|
|||||||
|
<% if @exist == false %>
|
||||||
|
$('#sub_dir_show_<%= @org_subfield.id %>').html('<%= @sub_dir.name %>');
|
||||||
|
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @sub_dir.name %>');
|
||||||
|
// $('#sub_dir_show_<%= @org_subfield.id %>').show();
|
||||||
|
// $('#sub_dir_edit_<%= @org_subfield.id %>').hide();
|
||||||
|
<% else %>
|
||||||
|
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @org_subfield.subfield_subdomain_dir.nil? ? '': @org_subfield.subfield_subdomain_dir.name %>');
|
||||||
|
// alert("该目录已存在,请重新输入");
|
||||||
|
// $('#sub_dir_edit_<%#= @org_subfield.id %>').find('input').val('<%#= @org_subfield.subfield_subdomain_dir.nil? ? "未设置":@org_subfield.subfield_subdomain_dir.name %>');
|
||||||
|
// $('#sub_dir_edit_<%#= @org_subfield.id %>').focus();
|
||||||
|
<% end %>
|
@ -1,4 +1,4 @@
|
|||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<div><%= l(:label_code_submit_number) %> * 4 = <%= changesets_num(@project) %> * 4 = <%= format("%.2f" , changesets_score(@project)).to_i %></div>
|
<div><%= l(:label_code_submit_number) %> * 4 = <%= project.project_score.changeset_num %> * 4 = <%= project.project_score.changeset_num * 4 %></div>
|
||||||
<div><%= l(:label_code_submit_score) %> = <%= format("%.2f" , changesets_score(@project)).to_i %></div>
|
<div><%= l(:label_code_submit_score) %> = <%= project.project_score.changeset_num * 4 %></div>
|
||||||
<!-- end -->
|
<!-- end -->
|
@ -1,4 +1,2 @@
|
|||||||
<!-- added by bai -->
|
<div><%= l(:lable_file_attachment_number) %> * 5 = <%= project.project_score.attach_num %> * 5 = <%= project.project_score.attach_num * 5 %></div>
|
||||||
<div><%= l(:label_file_number) %> * 4 = <%= documents_num(@project) %> * 4 = <%= format("%.2f" , documents_score(@project)).to_i %></div>
|
<div><%= l(:label_file_attachment_score) %> = <%= project.project_score.attach_num * 5 %></div>
|
||||||
<div><%= l(:label_file_score) %> = <%= format("%.2f" , documents_score(@project)).to_i %></div>
|
|
||||||
<!-- end -->
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(project) %> * 4 = <%= format("%.2f" , issue_num(project) * 4).to_i %></div>
|
<div><%= l(:label_issue_number) %> * 4 = <%= issue_num(project) %> * 4 = <%= project.project_score.issue_num * 4 %></div>
|
||||||
<div><%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(project) %> * 1 = <%= format("%.2f" , issue_journal_num(project)).to_i %></div>
|
<div><%= l(:label_issue_journal_number) %> * 1 = <%= project.project_score.issue_journal_num %> * 1 = <%= project.project_score.issue_journal_num * 1 %></div>
|
||||||
<div><%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(project)).to_i %>
|
<div><%= l(:label_issue_score) %> = <%= project.project_score.issue_num * 4 %> + <%= project.project_score.issue_journal_num * 1 %>
|
||||||
= <%= format("%.2f" , issue_score(project)).to_i %></div>
|
= <%= @project.project_score.issue_num * 4 + @project.project_score.issue_journal_num %></div>
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
<div><%= l(:label_new_number) %> * 1 = <%= news_num(@project) %> * 1 = <%= format("%.2f" , news_score(@project)).to_i %></div>
|
<div><%= l(:label_new_number) %> * 1 = <%= project.project_score.news_num %> * 1 = <%= project.project_score.news_num * 1 %></div>
|
||||||
<div><%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %></div>
|
<div><%= l(:label_news_score) %> = <%= project.project_score.news_num * 1 %></div>
|
@ -1,10 +1,9 @@
|
|||||||
<!-- added by bai -->
|
|
||||||
|
|
||||||
<div style="color: #64BDD9;font-size: 14px;font-weight: bold"><%= l(:label_projects_score) %></div>
|
<div style="color: #64BDD9;font-size: 14px;font-weight: bold"><%= l(:label_projects_score) %></div>
|
||||||
<div> = <%= l(:label_issue_score) %> + <%= l(:label_news_score) %> + <%= l(:label_file_score) %> +
|
<div> = <%= l(:label_code_submit_score) %> + <%= l(:label_issue_score) %> + <%= l(:label_file_attachment_score) %> + <%= l(:label_topic_score) %> + <%= l(:label_news_score) %></div>
|
||||||
<%= l(:label_code_submit_score) %> + <%= l(:label_topic_score) %></div>
|
<div> = <%= @project.project_score.changeset_num * 4 %> +
|
||||||
<div> = <%= format("%.2f" , issue_score(project)).to_i %> + <%= format("%.2f" , news_score(project)).to_i %> +
|
<%= @project.project_score.issue_num * 4 + @project.project_score.issue_journal_num %> +
|
||||||
<%= format("%.2f" , documents_score(project)).to_i %> + <%= format("%.2f" , changesets_score(project)).to_i %> +
|
<%= @project.project_score.attach_num * 5 %> +
|
||||||
<%= format("%.2f" , board_message_score(project)).to_i %></div>
|
<%= @project.project_score.board_num * 2 + @project.project_score.board_message_num %> +
|
||||||
<div> = <%= format("%.2f" , project_scores(project)).to_i %></div>
|
<%= @project.project_score.news_num %>
|
||||||
<!-- end -->
|
</div>
|
||||||
|
<div> = <%= static_project_score(@project.project_score) %></div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- added by bai -->
|
<div><%= l(:label_topic_number) %> * 2 = <%= project.project_score.board_num %> * 2 = <%= project.project_score.board_num * 2 %></div>
|
||||||
<div><%= l(:label_topic_number) %> * 2 = <%= board_message_num(@project) %> * 2 = <%= board_message_score(@project) %></div>
|
<div><%= l(:label_topic_reply_score) %> * 1 = <%= project.project_score.board_message_num %> * 1 = <%= project.project_score.board_message_num * 1 %></div>
|
||||||
<div><%= l(:label_topic_score) %> = <%= format("%.2f" , board_message_score(@project)).to_i %></div>
|
<div><%= l(:label_topic_score) %> = <%= project.project_score.board_num * 2 %> + <%= project.project_score.board_message_num * 1 %>
|
||||||
<!-- end -->
|
= <%= project.project_score.board_num * 2 + project.project_score.board_message_num * 1 %></div>
|
@ -0,0 +1,7 @@
|
|||||||
|
<% if @project.is_public? %>
|
||||||
|
$("#set_project_public_<%= @project.id %>").text("设为私有");
|
||||||
|
$("#show_project_<%= @project.id %>").attr("title","公开项目:<%= @project.name %>");
|
||||||
|
<% else %>
|
||||||
|
$("#set_project_public_<%= @project.id %>").text("设为公开");
|
||||||
|
$("#show_project_<%= @project.id %>").attr("title","私有项目:<%= @project.name %>");
|
||||||
|
<% end %>
|
@ -0,0 +1 @@
|
|||||||
|
$("#sub_dir_show_<%= @org_subfield.id %>").html("<%= @org_subfield.subfield_subdomain_dir.name %>");
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddStatusToOrgMessages < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :org_messages, :status, :integer, :default => 0
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddIssuesCountToProject < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :issues_count, :integer, :default => false
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddAttachmentsCountToProject < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :attachments_count, :integer, :default => false
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddBoardsCountToProject < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :boards_count, :integer, :default => false
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddNewsCountToProject < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :news_count, :integer, :default => false
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,14 @@
|
|||||||
|
class StaticProjectBoards < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Project.all.each do |project|
|
||||||
|
puts project.id
|
||||||
|
unless project.boards.first.nil?
|
||||||
|
boards_count = project.boards.first.topics.count
|
||||||
|
project.update_attribute(:boards_count, boards_count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,13 @@
|
|||||||
|
class StaticProjectIssues < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Project.all.each do |project|
|
||||||
|
unless project.issues.nil?
|
||||||
|
issues_count = project.issues.count
|
||||||
|
project.update_attribute(:issues_count, issues_count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,13 @@
|
|||||||
|
class StaticProjectNews < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Project.all.each do |project|
|
||||||
|
unless project.news.nil?
|
||||||
|
news_count = project.news.count
|
||||||
|
project.update_attribute(:news_count, news_count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,13 @@
|
|||||||
|
class StaticProjectAttachments < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Project.all.each do |project|
|
||||||
|
unless project.attachments.nil?
|
||||||
|
attachments_count = project.attachments.count
|
||||||
|
project.update_attribute(:attachments_count, attachments_count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddActsCountToProject < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :acts_count, :integer, :default => false
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,16 @@
|
|||||||
|
class StaticProjectActs < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Project.all.each do |project|
|
||||||
|
acts = ForgeActivity.where("project_id = ?", project.id)
|
||||||
|
unless acts.blank?
|
||||||
|
count = acts.count
|
||||||
|
puts project.id
|
||||||
|
puts "acts_count is #{count}"
|
||||||
|
project.update_attribute(:acts_count, count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
class CreateSubfieldSubdomainDirs < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :subfield_subdomain_dirs do |t|
|
||||||
|
t.integer :org_subfield_id
|
||||||
|
t.string :name
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddJournalsCountToProject < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :journals_count, :integer, :default => false
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,12 @@
|
|||||||
|
class StaticsIssueJournal < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Project.all.each do |project|
|
||||||
|
if !project.project_score.nil? && !project.project_score.issue_journal_num.nil?
|
||||||
|
project.update_attribute(:journals_count, project.project_score.issue_journal_num)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue