Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
a1e06991d5
|
@ -54,13 +54,13 @@ class AttachmentsController < ApplicationController
|
|||
# modify by nwb
|
||||
# 下载添加权限设置
|
||||
candown = false
|
||||
if @attachment.container.has_attribute?(:project) && @attachment.container.project
|
||||
if (@attachment.container.has_attribute?(:project) || @attachment.container.has_attribute?(:project_id)) && @attachment.container.project
|
||||
project = @attachment.container.project
|
||||
candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
|
||||
elsif @attachment.container.is_a?(Project)
|
||||
project = @attachment.container
|
||||
candown= User.current.member_of?(project) || (project.is_public && @attachment.is_public == 1)
|
||||
elsif @attachment.container.has_attribute?(:course) && @attachment.container.course
|
||||
elsif (@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course
|
||||
course = @attachment.container.course
|
||||
candown= User.current.member_of_course?(course) || (course.is_public==1 && @attachment.is_public == 1)
|
||||
elsif @attachment.container.is_a?(Course)
|
||||
|
@ -173,7 +173,7 @@ class AttachmentsController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
# modify by nwb
|
||||
if @attachment.container.is_a?(Course) || @attachment.container.course
|
||||
if !@attachment.container.nil? && (@attachment.container.is_a?(Course) || @attachment.container.course)
|
||||
if @course.nil?
|
||||
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
||||
else
|
||||
|
@ -286,7 +286,7 @@ private
|
|||
raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename
|
||||
if @attachment.container_type == 'Course'
|
||||
@course = @attachment.course
|
||||
elsif @attachment.container.has_attribute?(:course) && @attachment.container.course
|
||||
elsif !@attachment.container.nil? && (@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course)) && @attachment.container.course
|
||||
@course = @attachment.container.course
|
||||
else
|
||||
unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication'
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
</p>
|
||||
<% end %>
|
||||
<% unless @user.user_extensions.nil? %>
|
||||
<p>
|
||||
<p style="width: 100%;word-break: break-all">
|
||||
<%= @user.user_extensions.brief_introduction %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
@ -18,37 +18,37 @@
|
|||
|
||||
<div class="information">
|
||||
<p class="stats">
|
||||
<table style="padding-left: 100px">
|
||||
<table style="width: 400px;">
|
||||
<tr>
|
||||
<td style="width: 40%;text-align: right;font-size: 17px;">
|
||||
<td style="width: 50%;text-align: right;font-size: 17px;">
|
||||
<strong><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></strong>
|
||||
</td>
|
||||
<td style="width: 60%;text-align: left">
|
||||
<td style="width: 50%;text-align: left">
|
||||
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 40%;text-align: right;font-size: 17px;">
|
||||
<td style="width: 50%;text-align: right;font-size: 17px;">
|
||||
<strong><%= link_to "#{@project.members.count}", project_member_path(@project)%></strong>
|
||||
</td>
|
||||
<td style="width: 60%;text-align: left">
|
||||
<td style="width: 50%;text-align: left">
|
||||
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||
<td style="width: 50%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||
<strong><%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %></strong>
|
||||
</td>
|
||||
<td style="width: 60%;text-align: left">
|
||||
<td style="width: 50%;text-align: left">
|
||||
<%= content_tag('span', l(:label_since_last_commits)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||
<td style="width: 50%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
|
||||
<% find_project_repository @project %>
|
||||
<strong><%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %></strong>
|
||||
</td>
|
||||
<td style="width: 60%;text-align: left">
|
||||
<td style="width: 50%;text-align: left">
|
||||
<%= content_tag('span', l(:label_commit_on)) %>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
class InsertToSetting < ActiveRecord::Migration
|
||||
def up
|
||||
ss = Setting.find_all_by_name("plugin_redmine_ckeditor")
|
||||
if ss.nil?
|
||||
sett = Setting.new
|
||||
sett.name = "plugin_redmine_ckeditor"
|
||||
sett.value = "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
|
||||
skin: kama
|
||||
ui_color: ! '#f4f4f4'
|
||||
width: ''
|
||||
height: '400'
|
||||
enter_mode: '1'
|
||||
show_blocks: '1'
|
||||
toolbar_can_collapse: '0'
|
||||
toolbar_location: top
|
||||
toolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor,Cut,Copy,Paste,BidiLtr,BidiRtl,PasteText,PasteFromWord,RemoveFormat,SelectAll"
|
||||
sett.save
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
ss = Setting.find_all_by_name("plugin_redmine_ckeditor")
|
||||
if ss.nil?
|
||||
else
|
||||
ss.destroy
|
||||
end
|
||||
end
|
||||
end
|
20
db/schema.rb
20
db/schema.rb
|
@ -845,18 +845,18 @@ ActiveRecord::Schema.define(:version => 20140725062302) do
|
|||
create_table "relative_memos", :force => true do |t|
|
||||
t.integer "osp_id"
|
||||
t.integer "parent_id"
|
||||
t.string "subject", :null => false
|
||||
t.text "content", :null => false
|
||||
t.string "subject", :null => false
|
||||
t.text "content", :limit => 16777215, :null => false
|
||||
t.integer "author_id"
|
||||
t.integer "replies_count", :default => 0
|
||||
t.integer "replies_count", :default => 0
|
||||
t.integer "last_reply_id"
|
||||
t.boolean "lock", :default => false
|
||||
t.boolean "sticky", :default => false
|
||||
t.boolean "is_quote", :default => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "viewed_count_crawl", :default => 0
|
||||
t.integer "viewed_count_local", :default => 0
|
||||
t.boolean "lock", :default => false
|
||||
t.boolean "sticky", :default => false
|
||||
t.boolean "is_quote", :default => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "viewed_count_crawl", :default => 0
|
||||
t.integer "viewed_count_local", :default => 0
|
||||
t.string "url"
|
||||
t.string "username"
|
||||
t.string "userhomeurl"
|
||||
|
|
Loading…
Reference in New Issue