Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/views/welcome/index.html.erbcourse_group
commit
3ef05e64b8
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,21 +1,21 @@
|
||||
class ProjectStatus < ActiveRecord::Base
|
||||
attr_accessible :changesets_count, :watchers_count, :project_id, :project_type,:grade
|
||||
belongs_to :project
|
||||
belongs_to :watchers
|
||||
belongs_to :changesets
|
||||
validates_presence_of :project_id
|
||||
validates_uniqueness_of :project_id
|
||||
|
||||
scope :visible, lambda {|*args| nil }
|
||||
# 更新字段 watchers_count 加1 这里没有做用户是否存在的匹配
|
||||
# 负责这个表的聂同学 是在新建用户时就新建了该表的记录
|
||||
# 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点
|
||||
# 删除用户时 此表创建人员未作相应删除动作
|
||||
def update_watchers_count(num)
|
||||
if self.watchers_count||0 >= 0
|
||||
self.update_attribute(:watchers_count, self.watchers_count.to_i + num)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
class ProjectStatus < ActiveRecord::Base
|
||||
attr_accessible :changesets_count, :watchers_count, :project_id, :project_type,:grade
|
||||
belongs_to :project
|
||||
belongs_to :watchers
|
||||
belongs_to :changesets
|
||||
validates_presence_of :project_id
|
||||
validates_uniqueness_of :project_id
|
||||
|
||||
scope :visible, lambda {|*args| nil }
|
||||
# 更新字段 watchers_count 加1 这里没有做用户是否存在的匹配
|
||||
# 负责这个表的聂同学 是在新建用户时就新建了该表的记录
|
||||
# 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点
|
||||
# 删除用户时 此表创建人员未作相应删除动作
|
||||
def update_watchers_count(num)
|
||||
if self.watchers_count||0 >= 0
|
||||
self.update_attribute(:watchers_count, self.watchers_count.to_i + num)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
@ -1,52 +1,52 @@
|
||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>" class="attachment">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
|
||||
if attachment.id.nil?
|
||||
else
|
||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||
end
|
||||
%>
|
||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<script type='text/javascript'>
|
||||
// function CompatibleSend()
|
||||
// {
|
||||
// var obj=document.getElementById("_file");
|
||||
// var file= $(obj).clone();
|
||||
// file.click();
|
||||
// }
|
||||
</script>
|
||||
<span class="add_attachment">
|
||||
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
||||
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
||||
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()' %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:style => 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js'),
|
||||
:description_placeholder => l(:label_optional_description)
|
||||
} %>
|
||||
<span id="upload_file_count"><%= l(:label_no_file_uploaded)%></span>
|
||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>" class="attachment">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") +
|
||||
if attachment.id.nil?
|
||||
else
|
||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||
end
|
||||
%>
|
||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<script type='text/javascript'>
|
||||
// function CompatibleSend()
|
||||
// {
|
||||
// var obj=document.getElementById("_file");
|
||||
// var file= $(obj).clone();
|
||||
// file.click();
|
||||
// }
|
||||
</script>
|
||||
<span class="add_attachment">
|
||||
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
||||
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
||||
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()' %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:style => 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js'),
|
||||
:description_placeholder => l(:label_optional_description)
|
||||
} %>
|
||||
<span id="upload_file_count"><%= l(:label_no_file_uploaded)%></span>
|
||||
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
@ -1,26 +1,26 @@
|
||||
<h3><%=h @attachment.filename %></h3>
|
||||
|
||||
<div class="attachments">
|
||||
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
|
||||
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
|
||||
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
|
||||
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>   
|
||||
<span class="size">
|
||||
<% if @attachment!=nil &&(@attachment.container_type == 'Document' || @attachment.container_type == 'WikiPage') &&
|
||||
User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, @attachment.project) %>
|
||||
<%= l(:review_assignments)+":" %><%= link = link_to(l(:button_add), {:controller => 'code_review',
|
||||
:action => 'assign', :action_type => 'attachment',
|
||||
:id=>@attachment.project,
|
||||
:change_id => '', :attachment_id => @attachment.id,
|
||||
}, :class => 'icon icon-add') %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>
|
||||
|
||||
<% html_title @attachment.filename %>
|
||||
|
||||
<% content_for :header_tags do -%>
|
||||
<%= stylesheet_link_tag "scm" -%>
|
||||
<% end -%>
|
||||
<h3><%=h @attachment.filename %></h3>
|
||||
|
||||
<div class="attachments">
|
||||
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
|
||||
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
|
||||
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
|
||||
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>   
|
||||
<span class="size">
|
||||
<% if @attachment!=nil &&(@attachment.container_type == 'Document' || @attachment.container_type == 'WikiPage') &&
|
||||
User.current.allowed_to?({:controller => 'code_review', :action => 'update_diff_view'}, @attachment.project) %>
|
||||
<%= l(:review_assignments)+":" %><%= link = link_to(l(:button_add), {:controller => 'code_review',
|
||||
:action => 'assign', :action_type => 'attachment',
|
||||
:id=>@attachment.project,
|
||||
:change_id => '', :attachment_id => @attachment.id,
|
||||
}, :class => 'icon icon-add') %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %>
|
||||
|
||||
<% html_title @attachment.filename %>
|
||||
|
||||
<% content_for :header_tags do -%>
|
||||
<%= stylesheet_link_tag "scm" -%>
|
||||
<% end -%>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue