commit
b127eadb9d
@ -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 organizations controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -1,55 +0,0 @@
|
|||||||
class OrganizationController < ApplicationController
|
|
||||||
# layout 'base_projects'
|
|
||||||
before_filter :require_admin, :except => [:index]
|
|
||||||
|
|
||||||
def index
|
|
||||||
#@projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)")
|
|
||||||
@organizations = Organization.all
|
|
||||||
respond_to do |format|
|
|
||||||
format.html
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def new
|
|
||||||
@organizations = Organization.new
|
|
||||||
respond_to do |format|
|
|
||||||
format.html
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
@organizations = Organization.new
|
|
||||||
@organizations.name = params[:organization][:name]
|
|
||||||
if @organizations.save
|
|
||||||
redirect_to admin_organization_url
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def edit
|
|
||||||
@organization = Organization.find params[:id]
|
|
||||||
respond_to do |format|
|
|
||||||
format.html
|
|
||||||
end
|
|
||||||
rescue Exception => e
|
|
||||||
render_404
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
@organization = Organization.find params[:id]
|
|
||||||
@organization.name = params[:organization][:name]
|
|
||||||
if @organization.save
|
|
||||||
redirect_to admin_organization_url
|
|
||||||
end
|
|
||||||
rescue Exception => e
|
|
||||||
render_404
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
@organization = Organization.find params[:id]
|
|
||||||
if @organization.destroy
|
|
||||||
redirect_to admin_organization_url
|
|
||||||
end
|
|
||||||
rescue Exception => e
|
|
||||||
render_404
|
|
||||||
end
|
|
||||||
end
|
|
@ -0,0 +1,27 @@
|
|||||||
|
class OrganizationsController < ApplicationController
|
||||||
|
layout 'base_org'
|
||||||
|
def new
|
||||||
|
@organization = Organization.new
|
||||||
|
render :layout => 'new_base'
|
||||||
|
end
|
||||||
|
def create
|
||||||
|
@organization = Organization.new
|
||||||
|
@organization.name = params[:organization][:name]
|
||||||
|
@organization.description = params[:organization][:description]
|
||||||
|
@organization.is_public = params[:organization][:is_public]
|
||||||
|
@organization.creator_id = User.current.id
|
||||||
|
member = OrgMember.new(:user_id => User.current.id, :role => 'Manager')
|
||||||
|
@organization.org_members << member
|
||||||
|
if @organization.save
|
||||||
|
redirect_to organization_path(@organization)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module BlogCommentsHelper
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module BlogsHelper
|
||||||
|
end
|
@ -1,2 +1,2 @@
|
|||||||
module EnterprisesHelper
|
module OrganizationsHelper
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
class Blog < ActiveRecord::Base
|
||||||
|
# attr_accessible :title, :body
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
belongs_to :user
|
||||||
|
has_many :articles, :class_name => 'BlogComment', :conditions => "#{BlogComment.table_name}.parent_id IS NULL ", :order => "#{BlogComment.table_name}.created_on DESC"
|
||||||
|
has_many :blog_comments, :dependent => :destroy, :order => "#{BlogComment.table_name}.created_on DESC"
|
||||||
|
belongs_to :last_comment, :class_name => 'BlogComment', :foreign_key => :last_comment_id
|
||||||
|
acts_as_tree :dependent => :nullify
|
||||||
|
#acts_as_list :scope => '(user_id = #{user_id} AND parent_id #{user_id ? = "#{parent_id}" : "IS NULL"})'
|
||||||
|
acts_as_watchable
|
||||||
|
|
||||||
|
validates :name, presence: true, length: {maximum: 30}
|
||||||
|
validates :description, length: {maximum: 255}
|
||||||
|
|
||||||
|
safe_attributes 'name', 'description'
|
||||||
|
end
|
@ -0,0 +1,59 @@
|
|||||||
|
class BlogComment < ActiveRecord::Base
|
||||||
|
# attr_accessible :title, :body
|
||||||
|
include Redmine::SafeAttributes
|
||||||
|
belongs_to :blog
|
||||||
|
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
||||||
|
|
||||||
|
acts_as_tree :counter_cache => :comments_count, :order => "#{BlogComment.table_name}.sticky desc ,#{BlogComment.table_name}.created_on ASC"
|
||||||
|
acts_as_attachable
|
||||||
|
belongs_to :last_reply, :class_name => 'BlogComment', :foreign_key => 'last_comment_id'
|
||||||
|
# 虚拟关联
|
||||||
|
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
|
||||||
|
acts_as_watchable
|
||||||
|
|
||||||
|
validates_presence_of :title, :content
|
||||||
|
validates_length_of :title, :maximum => 255
|
||||||
|
#validate :cannot_reply_to_locked_comment, :on => :create
|
||||||
|
safe_attributes 'title', 'content',"sticky", "locked"
|
||||||
|
|
||||||
|
after_save :add_user_activity
|
||||||
|
before_destroy :destroy_user_activity
|
||||||
|
|
||||||
|
scope :like, lambda {|arg|
|
||||||
|
if arg.blank?
|
||||||
|
where(nil)
|
||||||
|
else
|
||||||
|
pattern = "%#{arg.to_s.strip.downcase}%"
|
||||||
|
where(" LOWER(title) LIKE :p ", :p => pattern)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
#在个人动态里面增加当前动态
|
||||||
|
def add_user_activity
|
||||||
|
if self.parent_id.nil? #只有发博文才插入动态
|
||||||
|
user_activity = UserActivity.where("act_type = '#{self.class.to_s}' and act_id = '#{self.id}'").first
|
||||||
|
if user_activity
|
||||||
|
user_activity.save
|
||||||
|
else
|
||||||
|
user_activity = UserActivity.new
|
||||||
|
user_activity.act_id = self.id
|
||||||
|
user_activity.act_type = self.class.to_s
|
||||||
|
user_activity.container_type = "Blog"
|
||||||
|
user_activity.container_id = self.blog_id
|
||||||
|
user_activity.user_id = self.author_id
|
||||||
|
user_activity.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy_user_activity
|
||||||
|
user_activity = UserActivity.where("act_type = '#{self.class.to_s}' and act_id = '#{self.id}'")
|
||||||
|
user_activity.destroy_all
|
||||||
|
end
|
||||||
|
def deleted_attach_able_by? user
|
||||||
|
(user && user.logged? && (self.author == user) ) || user.admin?
|
||||||
|
end
|
||||||
|
|
||||||
|
def project
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,4 @@
|
|||||||
|
class OrgMember < ActiveRecord::Base
|
||||||
|
attr_accessible :organization_id, :role, :user_id
|
||||||
|
belongs_to :organization
|
||||||
|
end
|
@ -1,5 +1,5 @@
|
|||||||
class Organization < ActiveRecord::Base
|
class Organization < ActiveRecord::Base
|
||||||
attr_accessible :logo_link, :name
|
attr_accessible :name, :description, :creator_id, :home_id, :domain, :is_public
|
||||||
|
has_many :org_members, :dependent => :destroy
|
||||||
has_many :projects
|
has_many :projects
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,259 @@
|
|||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
require 'redmine/scm/adapters/git_adapter'
|
||||||
|
|
||||||
|
class Repository::Gitlab < Repository
|
||||||
|
|
||||||
|
attr_protected :root_url
|
||||||
|
validates_presence_of :url
|
||||||
|
|
||||||
|
def self.human_attribute_name(attribute_key_name, *args)
|
||||||
|
attr_name = attribute_key_name.to_s
|
||||||
|
if attr_name == "url"
|
||||||
|
attr_name = "path_to_repository"
|
||||||
|
end
|
||||||
|
super(attr_name, *args)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.scm_adapter_class
|
||||||
|
Redmine::Scm::Adapters::GitlabAdapter
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.scm_name
|
||||||
|
'Gitlab'
|
||||||
|
end
|
||||||
|
|
||||||
|
def commits(authors, start_date, end_date, branch='master')
|
||||||
|
scm.commits(authors, start_date, end_date,branch).map {|commit|
|
||||||
|
[commit[:author], commit[:num]]
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def report_last_commit
|
||||||
|
extra_report_last_commit
|
||||||
|
end
|
||||||
|
|
||||||
|
def extra_report_last_commit
|
||||||
|
return false if extra_info.nil?
|
||||||
|
v = extra_info["extra_report_last_commit"]
|
||||||
|
return false if v.nil?
|
||||||
|
v.to_s != '0'
|
||||||
|
end
|
||||||
|
|
||||||
|
def supports_directory_revisions?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def supports_revision_graph?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def repo_log_encoding
|
||||||
|
'UTF-8'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns the identifier for the given git changeset
|
||||||
|
def self.changeset_identifier(changeset)
|
||||||
|
changeset.scmid
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns the readable identifier for the given git changeset
|
||||||
|
def self.format_changeset_identifier(changeset)
|
||||||
|
changeset.revision[0, 8]
|
||||||
|
end
|
||||||
|
|
||||||
|
def branches
|
||||||
|
scm.branches
|
||||||
|
end
|
||||||
|
|
||||||
|
def tags
|
||||||
|
scm.tags
|
||||||
|
end
|
||||||
|
|
||||||
|
def default_branch
|
||||||
|
scm.default_branch
|
||||||
|
rescue Exception => e
|
||||||
|
logger.error "git: error during get default branch: #{e.message}"
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_changeset_by_name(name)
|
||||||
|
if name.present?
|
||||||
|
changesets.where(:revision => name.to_s).first ||
|
||||||
|
changesets.where('scmid LIKE ?', "#{name}%").first
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def entries(path=nil, identifier=nil)
|
||||||
|
entries = scm.entries(path, identifier, :report_last_commit => extra_report_last_commit)
|
||||||
|
load_entries_changesets(entries)
|
||||||
|
entries
|
||||||
|
end
|
||||||
|
|
||||||
|
# With SCMs that have a sequential commit numbering,
|
||||||
|
# such as Subversion and Mercurial,
|
||||||
|
# Redmine is able to be clever and only fetch changesets
|
||||||
|
# going forward from the most recent one it knows about.
|
||||||
|
#
|
||||||
|
# However, Git does not have a sequential commit numbering.
|
||||||
|
#
|
||||||
|
# In order to fetch only new adding revisions,
|
||||||
|
# Redmine needs to save "heads".
|
||||||
|
#
|
||||||
|
# In Git and Mercurial, revisions are not in date order.
|
||||||
|
# Redmine Mercurial fixed issues.
|
||||||
|
# * Redmine Takes Too Long On Large Mercurial Repository
|
||||||
|
# http://www.redmine.org/issues/3449
|
||||||
|
# * Sorting for changesets might go wrong on Mercurial repos
|
||||||
|
# http://www.redmine.org/issues/3567
|
||||||
|
#
|
||||||
|
# Database revision column is text, so Redmine can not sort by revision.
|
||||||
|
# Mercurial has revision number, and revision number guarantees revision order.
|
||||||
|
# Redmine Mercurial model stored revisions ordered by database id to database.
|
||||||
|
# So, Redmine Mercurial model can use correct ordering revisions.
|
||||||
|
#
|
||||||
|
# Redmine Mercurial adapter uses "hg log -r 0:tip --limit 10"
|
||||||
|
# to get limited revisions from old to new.
|
||||||
|
# But, Git 1.7.3.4 does not support --reverse with -n or --skip.
|
||||||
|
#
|
||||||
|
# The repository can still be fully reloaded by calling #clear_changesets
|
||||||
|
# before fetching changesets (eg. for offline resync)
|
||||||
|
def fetch_changesets
|
||||||
|
scm_brs = branches
|
||||||
|
return if scm_brs.nil? || scm_brs.empty?
|
||||||
|
|
||||||
|
h1 = extra_info || {}
|
||||||
|
h = h1.dup
|
||||||
|
repo_heads = scm_brs.map{ |br| br.scmid }
|
||||||
|
h["heads"] ||= []
|
||||||
|
prev_db_heads = h["heads"].dup
|
||||||
|
if prev_db_heads.empty?
|
||||||
|
prev_db_heads += heads_from_branches_hash
|
||||||
|
end
|
||||||
|
return if prev_db_heads.sort == repo_heads.sort
|
||||||
|
|
||||||
|
h["db_consistent"] ||= {}
|
||||||
|
if changesets.count == 0
|
||||||
|
h["db_consistent"]["ordering"] = 1
|
||||||
|
merge_extra_info(h)
|
||||||
|
self.save
|
||||||
|
elsif ! h["db_consistent"].has_key?("ordering")
|
||||||
|
h["db_consistent"]["ordering"] = 0
|
||||||
|
merge_extra_info(h)
|
||||||
|
self.save
|
||||||
|
end
|
||||||
|
save_revisions(prev_db_heads, repo_heads)
|
||||||
|
end
|
||||||
|
|
||||||
|
def save_revisions(prev_db_heads, repo_heads)
|
||||||
|
h = {}
|
||||||
|
opts = {}
|
||||||
|
opts[:reverse] = true
|
||||||
|
opts[:excludes] = prev_db_heads
|
||||||
|
opts[:includes] = repo_heads
|
||||||
|
|
||||||
|
revisions = scm.revisions('', nil, nil, opts)
|
||||||
|
return if revisions.blank?
|
||||||
|
|
||||||
|
# Make the search for existing revisions in the database in a more sufficient manner
|
||||||
|
#
|
||||||
|
# Git branch is the reference to the specific revision.
|
||||||
|
# Git can *delete* remote branch and *re-push* branch.
|
||||||
|
#
|
||||||
|
# $ git push remote :branch
|
||||||
|
# $ git push remote branch
|
||||||
|
#
|
||||||
|
# After deleting branch, revisions remain in repository until "git gc".
|
||||||
|
# On git 1.7.2.3, default pruning date is 2 weeks.
|
||||||
|
# So, "git log --not deleted_branch_head_revision" return code is 0.
|
||||||
|
#
|
||||||
|
# After re-pushing branch, "git log" returns revisions which are saved in database.
|
||||||
|
# So, Redmine needs to scan revisions and database every time.
|
||||||
|
#
|
||||||
|
# This is replacing the one-after-one queries.
|
||||||
|
# Find all revisions, that are in the database, and then remove them from the revision array.
|
||||||
|
# Then later we won't need any conditions for db existence.
|
||||||
|
# Query for several revisions at once, and remove them from the revisions array, if they are there.
|
||||||
|
# Do this in chunks, to avoid eventual memory problems (in case of tens of thousands of commits).
|
||||||
|
# If there are no revisions (because the original code's algorithm filtered them),
|
||||||
|
# then this part will be stepped over.
|
||||||
|
# We make queries, just if there is any revision.
|
||||||
|
limit = 100
|
||||||
|
offset = 0
|
||||||
|
revisions_copy = revisions.clone # revisions will change
|
||||||
|
while offset < revisions_copy.size
|
||||||
|
recent_changesets_slice = changesets.find(
|
||||||
|
:all,
|
||||||
|
:conditions => [
|
||||||
|
'scmid IN (?)',
|
||||||
|
revisions_copy.slice(offset, limit).map{|x| x.scmid}
|
||||||
|
]
|
||||||
|
)
|
||||||
|
# Subtract revisions that redmine already knows about
|
||||||
|
recent_revisions = recent_changesets_slice.map{|c| c.scmid}
|
||||||
|
revisions.reject!{|r| recent_revisions.include?(r.scmid)}
|
||||||
|
offset += limit
|
||||||
|
end
|
||||||
|
|
||||||
|
revisions.each do |rev|
|
||||||
|
transaction do
|
||||||
|
# There is no search in the db for this revision, because above we ensured,
|
||||||
|
# that it's not in the db.
|
||||||
|
save_revision(rev)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
h["heads"] = repo_heads.dup
|
||||||
|
merge_extra_info(h)
|
||||||
|
self.save
|
||||||
|
end
|
||||||
|
private :save_revisions
|
||||||
|
|
||||||
|
def save_revision(rev)
|
||||||
|
parents = (rev.parents || []).collect{|rp| find_changeset_by_name(rp)}.compact
|
||||||
|
changeset = Changeset.create(
|
||||||
|
:repository => self,
|
||||||
|
:revision => rev.identifier,
|
||||||
|
:scmid => rev.scmid,
|
||||||
|
:committer => rev.author,
|
||||||
|
:committed_on => rev.time,
|
||||||
|
:comments => rev.message,
|
||||||
|
:parents => parents
|
||||||
|
)
|
||||||
|
unless changeset.new_record?
|
||||||
|
rev.paths.each { |change| changeset.create_change(change) }
|
||||||
|
end
|
||||||
|
changeset
|
||||||
|
end
|
||||||
|
private :save_revision
|
||||||
|
|
||||||
|
def heads_from_branches_hash
|
||||||
|
h1 = extra_info || {}
|
||||||
|
h = h1.dup
|
||||||
|
h["branches"] ||= {}
|
||||||
|
h['branches'].map{|br, hs| hs['last_scmid']}
|
||||||
|
end
|
||||||
|
|
||||||
|
def latest_changesets(path,rev,limit=10)
|
||||||
|
revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false)
|
||||||
|
return [] if revisions.nil? || revisions.empty?
|
||||||
|
|
||||||
|
changesets.find(
|
||||||
|
:all,
|
||||||
|
:conditions => [
|
||||||
|
"scmid IN (?)",
|
||||||
|
revisions.map!{|c| c.scmid}
|
||||||
|
]
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
def clear_extra_info_of_changesets
|
||||||
|
return if extra_info.nil?
|
||||||
|
v = extra_info["extra_report_last_commit"]
|
||||||
|
write_attribute(:extra_info, nil)
|
||||||
|
h = {}
|
||||||
|
h["extra_report_last_commit"] = v
|
||||||
|
merge_extra_info(h)
|
||||||
|
self.save
|
||||||
|
end
|
||||||
|
private :clear_extra_info_of_changesets
|
||||||
|
end
|
@ -0,0 +1,41 @@
|
|||||||
|
<div class="mt10 fl" style="width: 600px">
|
||||||
|
<% for attachment in attachments %>
|
||||||
|
<!--<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">-->
|
||||||
|
<!--<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">-->
|
||||||
|
<!--<span title="<%#= attachment.filename%>" id = "attachment_">-->
|
||||||
|
<% if options[:length] %>
|
||||||
|
<span class="pic_files fl "></span>
|
||||||
|
<%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true,:length => options[:length] -%>
|
||||||
|
<a class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a>
|
||||||
|
<% if options[:deletable] %>
|
||||||
|
<%#= link_to image_tag('delete.png'), attachment_path(attachment),
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:method => :delete,
|
||||||
|
:class => 'delete',
|
||||||
|
#:remote => true,
|
||||||
|
#:id => "attachments_" + attachment.id.to_s,
|
||||||
|
:title => l(:button_delete) %>
|
||||||
|
<span class="pic_del fl "> <a href="<%=attachment_path(attachment) %>" onclick="confirm(<%=l(:text_are_you_sure) %>)" data-method="delete"> </a></span>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% else %>
|
||||||
|
<span class="pic_files fl "></span>
|
||||||
|
<%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 45 -%>
|
||||||
|
<a href="javascript:void(0);" class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a>
|
||||||
|
<% if options[:deletable] %>
|
||||||
|
<a href="<%=attachment_path(attachment) %>" onclick="confirm(<%=l(:text_are_you_sure) %>)" data-method="delete"> <span class="pic_del fl "></span> </a>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% if defined?(thumbnails) && thumbnails %>
|
||||||
|
<% images = attachments.select(&:thumbnailable?) %>
|
||||||
|
<% if images.any? %>
|
||||||
|
<div class="pro_pic mb10" width="100" height="73">
|
||||||
|
<% images.each do |attachment| %>
|
||||||
|
<div><%= thumbnail_tag(attachment) %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
@ -0,0 +1,78 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
input.is_public,input.is_public_checkbox{height:12px;}
|
||||||
|
input.is_public_checkbox{margin-left:4px;margin-right:4px;}
|
||||||
|
</style>
|
||||||
|
<div class="fl">
|
||||||
|
<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 => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><span class="ispublic-label"><%= l(:field_is_public) %>:</span>
|
||||||
|
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
|
||||||
|
<%= 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"} %>
|
||||||
|
|
||||||
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
<% container.saved_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 => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
|
||||||
|
<span class="ispublic-label"><%= l(:field_is_public) %>:</span>
|
||||||
|
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
|
||||||
|
<%= 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"} %>
|
||||||
|
|
||||||
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<span class="add_attachment" style="font-weight:normal;">
|
||||||
|
<%#= 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()',:class => 'sub_btn' %>
|
||||||
|
<a href="javascript:void(0);" onclick="_file.click();" class="AnnexBtn fl mr15">上传附件</a>
|
||||||
|
<%= file_field_tag 'attachments[dummy][file]',
|
||||||
|
:id => '_file',
|
||||||
|
:class => 'file_selector',
|
||||||
|
:multiple => true,
|
||||||
|
:onchange => 'addInputFiles(this);',
|
||||||
|
:style => ie8? ? '' : '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', :project => container),
|
||||||
|
:description_placeholder => l(:label_optional_description),
|
||||||
|
:field_is_public => l(:field_is_public),
|
||||||
|
:are_you_sure => l(:text_are_you_sure),
|
||||||
|
:file_count => l(:label_file_count),
|
||||||
|
:delete_all_files => l(:text_are_you_sure_all)
|
||||||
|
} %>
|
||||||
|
<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 %>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,53 @@
|
|||||||
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'blog' %>
|
||||||
|
<div class="resources mt10">
|
||||||
|
<div id="new_course_topic">
|
||||||
|
<div class="homepagePostBrief c_grey">
|
||||||
|
<div>
|
||||||
|
<input type="text" value="<%= article.title%>" name="blog_comment[title]" id="message_subject" class="InputBox w713" style="width: 720px !important;" maxlength="255" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " />
|
||||||
|
<p id="subjectmsg"></p>
|
||||||
|
</div>
|
||||||
|
<div id="topic_editor" style="display: block;">
|
||||||
|
<%if User.current.id == user.id%>
|
||||||
|
<div class="mt10">
|
||||||
|
<%= f.check_box :sticky%>
|
||||||
|
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||||
|
<%= f.check_box :locked%>
|
||||||
|
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="mt10">
|
||||||
|
<div id="message_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
|
||||||
|
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||||
|
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||||
|
|
||||||
|
<%= f.kindeditor :content,:editor_id => 'message_content_editor',
|
||||||
|
:owner_id => article.nil? ? 0: article.id,
|
||||||
|
:owner_type => OwnerTypeHelper::BLOGCOMMENT,
|
||||||
|
:width => '100%',
|
||||||
|
:height => 300,
|
||||||
|
:minHeight=>300,
|
||||||
|
:class => 'talk_text fl',
|
||||||
|
:input_html => { :id => 'message_content',
|
||||||
|
:class => 'talk_text fl',
|
||||||
|
:maxlength => 5000 }%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="message_content_span"></p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="mt10">
|
||||||
|
<div class="fl" id="topic_attachments">
|
||||||
|
<%= render :partial => 'blog_comments/blog_attachments', :locals => {:container => article} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="mt5">
|
||||||
|
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_article();">确定</a>
|
||||||
|
<span class="fr mr10 mt3">或</span>
|
||||||
|
<a href="<%= user_blog_blog_comment_path(:user_id=>article.author.id,:blog_id=>article.blog_id,:id=>article.id)%>" class="fr mr10 mt3" >取消</a>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,62 @@
|
|||||||
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'blog' %>
|
||||||
|
<div class="resources mt10">
|
||||||
|
<div id="new_course_topic">
|
||||||
|
<div class="homepagePostBrief c_grey">
|
||||||
|
<div>
|
||||||
|
<input type="text" name="blog_comment[title]" id="message_subject" class="InputBox w713" style="width: 720px !important;" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " >
|
||||||
|
<p id="subjectmsg"></p>
|
||||||
|
</div>
|
||||||
|
<div id="topic_editor" style="display: none;">
|
||||||
|
<%if User.current.id == user.id%>
|
||||||
|
<div class="mt10">
|
||||||
|
<%= f.check_box :sticky%>
|
||||||
|
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
||||||
|
<%= f.check_box :locked%>
|
||||||
|
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="mt10">
|
||||||
|
<div id="message_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
|
||||||
|
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||||
|
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||||
|
|
||||||
|
<%= f.kindeditor :content, :editor_id => 'message_content_editor',
|
||||||
|
:owner_id => article.nil? ? 0: article.id,
|
||||||
|
:owner_type => OwnerTypeHelper::BLOGCOMMENT,
|
||||||
|
:width => '100%',
|
||||||
|
:height => 300,
|
||||||
|
:minHeight=>300,
|
||||||
|
:class => 'talk_text fl',
|
||||||
|
:input_html => { :id => 'message_content',
|
||||||
|
:class => 'talk_text fl',
|
||||||
|
:maxlength => 5000 }%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="message_content_span"></p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="mt10">
|
||||||
|
<div class="fl" id="topic_attachments">
|
||||||
|
<%= render :partial => 'blog_comments/blog_attachments', :locals => {:container => article} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="mt5">
|
||||||
|
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_article();">确定</a>
|
||||||
|
<span class="fr mr10 mt3">或</span>
|
||||||
|
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="reset_article();">取消</a>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%#= render :partial => 'course_new_topic', :locals => {:f => f, :topic => @message} %>
|
||||||
|
<!--<li>
|
||||||
|
<div class="ml55 fl" nhname="toolbar_container"></div>
|
||||||
|
<a href="javascript:void(0);" nhname="cancelbtn" class="grey_btn fr ml10"><%#= l(:button_cancel) %></a>
|
||||||
|
<a href="javascript:void(0);" nhname="submitbtn" class="blue_btn fr " style="margin-left: 55px">
|
||||||
|
<%#= l(:button_submit)%>
|
||||||
|
</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,34 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
/*回复框*/
|
||||||
|
.ReplyToMessageInputContainer .ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||||
|
.ReplyToMessageInputContainer .ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||||
|
.ReplyToMessageInputContainer .ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||||
|
.ReplyToMessageInputContainer .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||||
|
.ReplyToMessageInputContainer .ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||||
|
.ReplyToMessageInputContainer .ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||||
|
.ReplyToMessageInputContainer .ke-outline{border:none;}
|
||||||
|
.ReplyToMessageInputContainer .ke-inline-block{display: none;}
|
||||||
|
.ReplyToMessageInputContainer .ke-container{float:left;}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="ReplyToMessageContainer borderBottomNone"id="reply_to_message_<%= reply.id%>">
|
||||||
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||||
|
<div class="ReplyToMessageInputContainer mb10">
|
||||||
|
<div nhname='new_message_<%= reply.id%>'>
|
||||||
|
<%= form_for @blog_comment, :as => :reply, :url => {:controller => 'blog_comments',:action => 'reply', :id => @blogComment.id}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||||
|
<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||||
|
<% if course_id%>
|
||||||
|
<input type="hidden" name="course_id" id="" value="<%= course_id%>">
|
||||||
|
<% end %>
|
||||||
|
<input type="hidden" name="blog_comment[title]" id="reply_subject">
|
||||||
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="blog_comment[content]"></textarea>
|
||||||
|
<div nhname='toolbar_container_<%= reply.id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
|
||||||
|
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||||
|
<% end%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
@ -0,0 +1,6 @@
|
|||||||
|
<% if User.current.logged? && User.current.id == @user.id %>
|
||||||
|
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id},:method=>'PUT',
|
||||||
|
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||||
|
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
@ -0,0 +1,10 @@
|
|||||||
|
if($("#reply_message_<%= @blogComment.id%>").length > 0) {
|
||||||
|
$("#reply_message_<%= @blogComment.id%>").replaceWith("<%= escape_javascript(render :partial => 'blog_comments/simple_ke_reply_form', :locals => {:reply => @blogComment,:temp =>@temp,:subject =>@subject,:course_id=>@course_id}) %>");
|
||||||
|
$(function(){
|
||||||
|
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
|
||||||
|
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
||||||
|
init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%");
|
||||||
|
});
|
||||||
|
}else if($("#reply_to_message_<%= @blogComment.id%>").length >0) {
|
||||||
|
$("#reply_to_message_<%= @blogComment.id%>").replaceWith("<p id='reply_message_<%= @blogComment.id%>'></p>");
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
<% if @in_user_center%>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
||||||
|
<% else%>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
|
||||||
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
||||||
|
<% end %>
|
@ -0,0 +1,172 @@
|
|||||||
|
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" >
|
||||||
|
<div class="homepagePostBrief" onmouseover="$('#message_setting_<%=activity.id%>').show();" onmouseout="$('#message_setting_<%= activity.id%>').hide();">
|
||||||
|
<div class="homepagePostPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDes">
|
||||||
|
<% if activity.author.id == User.current.id%>
|
||||||
|
<div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none">
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
|
<ul class="homepagePostSettiongText">
|
||||||
|
<li>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_edit),
|
||||||
|
{:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
|
||||||
|
:class => 'postOptionLink'
|
||||||
|
) if User.current && User.current.id == activity.author.id %>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_delete),
|
||||||
|
{:controller => 'blog_comments',:action => 'destroy',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
|
||||||
|
:method => :delete,
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:class => 'postOptionLink'
|
||||||
|
) if User.current && User.current.id == activity.author.id %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<%end%>
|
||||||
|
<div class="homepagePostTo mt-4 fl">
|
||||||
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
|
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
|
<% end %>
|
||||||
|
TO
|
||||||
|
<%= link_to activity.blog.name+" | 博客", user_blogs_path(:user_id=>activity.author_id,:host=>Setting.host_user), :class => "newsBlue ml15 mr5"%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="homepagePostTitle hidden m_w530 fl">
|
||||||
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey"%>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% if activity.sticky == 1%>
|
||||||
|
<span class="sticky_btn_cir ml10">置顶</span>
|
||||||
|
<% end%>
|
||||||
|
<% if activity.locked%>
|
||||||
|
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||||
|
<% end%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="homepagePostDate">
|
||||||
|
发帖时间:<%= format_time(activity.created_on) %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="homepagePostIntro break_word upload_img list_style" id="activity_description_<%= user_activity_id%>">
|
||||||
|
<% if activity.parent_id.nil? %>
|
||||||
|
<%= activity.content.to_s.html_safe%>
|
||||||
|
<% else %>
|
||||||
|
<%= activity.parent.content.to_s.html_safe%>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class=" fl" style="width: 600px">
|
||||||
|
<% if activity.attachments.any?%>
|
||||||
|
<% options = {:author => true, :deletable => false } %>
|
||||||
|
<%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
|
<ul class="homepagePostSettiongText">
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% count=0 %>
|
||||||
|
<% if activity.parent %>
|
||||||
|
<% count=activity.parent.children.count%>
|
||||||
|
<% else %>
|
||||||
|
<% count=activity.children.count%>
|
||||||
|
<% end %>
|
||||||
|
<div class="homepagePostReply">
|
||||||
|
<div class="topBorder" style="display: <%= count<=0 && !activity.locked ? '': 'none' %>"></div>
|
||||||
|
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||||
|
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||||
|
<%= count %>
|
||||||
|
)</div>
|
||||||
|
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||||
|
<%if count > 3 %>
|
||||||
|
<div class="homepagePostReplyBannerMore">
|
||||||
|
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||||
|
展开更多
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% activity= activity.parent ? activity.parent : activity%>
|
||||||
|
<% replies_all_i = 0 %>
|
||||||
|
<% if count > 0 %>
|
||||||
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
|
<ul>
|
||||||
|
<% activity.children.reorder("created_on desc").each do |reply|%>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<% replies_all_i=replies_all_i+1 %>
|
||||||
|
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||||
|
<div class="homepagePostReplyPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyDes">
|
||||||
|
<div class="homepagePostReplyPublisher mt-4">
|
||||||
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||||
|
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
|
<% end %>
|
||||||
|
<%= format_time(reply.created_on) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyContent break_word list_style upload_img" id="reply_content_<%= reply.id %>">
|
||||||
|
<%= reply.content.html_safe %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if !activity.locked? %>
|
||||||
|
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||||
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||||
|
<div class="homepagePostReplyInputContainer mb10">
|
||||||
|
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||||
|
<%= form_for('new_form',:url => {:controller=>'blog_comments',:action => 'reply', :id => activity.id, :blog_id => activity.blog.id, :user_id => activity.author_id},:method => "post",:remote=>true) do |f|%>
|
||||||
|
<input type="hidden" name="quote[quote]" value="">
|
||||||
|
<input type="hidden" name="blog_comment[sticky]" value="0">
|
||||||
|
<input type="hidden" name="blog_comment[locked]" value="0">
|
||||||
|
<input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>">
|
||||||
|
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||||
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
|
||||||
|
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
|
||||||
|
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||||
|
<% end%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,101 @@
|
|||||||
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
||||||
|
<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>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
$("#RSide").removeAttr("id");
|
||||||
|
$("#Container").css("width","1000px");
|
||||||
|
});
|
||||||
|
function reset_article(){
|
||||||
|
$("#message_subject").val("");
|
||||||
|
$("#subjectmsg").text("");
|
||||||
|
document.getElementById("blog_comment_sticky").checked=false;
|
||||||
|
document.getElementById("blog_comment_locked").checked=false;
|
||||||
|
$("#topic_attachments").html("<%= escape_javascript(render :partial => 'blog_comments/blog_attachments', :locals => {:container => BlogComment.new})%>");
|
||||||
|
message_content_editor.html("");
|
||||||
|
$("#topic_editor").slideToggle();
|
||||||
|
}
|
||||||
|
<%# if @is_new%>
|
||||||
|
// $(function(){
|
||||||
|
// $("#message_subject").focus();
|
||||||
|
// });
|
||||||
|
<%#end%>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="homepageRight mt0 ml10">
|
||||||
|
<div class="homepageRightBanner">
|
||||||
|
<div class="NewsBannerName">
|
||||||
|
<%= @user.name%>的博客
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% if User.current.logged? && User.current.id == @user.id %>
|
||||||
|
<%= labelled_form_for @article, :url =>{:controller=>'blog_comments',:action => 'create',:user_id=>user.id , :blog_id => blog.id},
|
||||||
|
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||||
|
<%= render :partial => 'blog_comments/new', :locals => {:f => f, :article => @article, :edit_mode => false, :user => @user} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if topics%>
|
||||||
|
<% topics.each do |topic| %>
|
||||||
|
<script>
|
||||||
|
function expand_reply(container, btnid) {
|
||||||
|
var target = $(container);
|
||||||
|
var btn = $(btnid);
|
||||||
|
if (btn.data('init') == '0') {
|
||||||
|
btn.data('init', 1);
|
||||||
|
btn.html('收起回复');
|
||||||
|
target.show();
|
||||||
|
} else {
|
||||||
|
btn.data('init', 0);
|
||||||
|
btn.html('展开更多');
|
||||||
|
target.hide();
|
||||||
|
target.eq(0).show();
|
||||||
|
target.eq(1).show();
|
||||||
|
target.eq(2).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function expand_reply_input(id) {
|
||||||
|
$(id).toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
|
||||||
|
showNormalImage('activity_description_<%= topic.id %>');
|
||||||
|
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
|
||||||
|
if (description_images.length>0) {
|
||||||
|
for (var i=0; i<description_images.length; i++){
|
||||||
|
var image=$(description_images[i]);
|
||||||
|
var element=$("<a></a>").attr("href",image.attr('src'));
|
||||||
|
image.wrap(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#activity_description_<%#= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});*/
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<% if topic %>
|
||||||
|
<%= render :partial => 'blogs/article', :locals => {:activity => topic, :user_activity_id => topic.id} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%# if topics.count == 10 %>
|
||||||
|
<!--<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%#= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>-->
|
||||||
|
<%# end %>
|
||||||
|
<% end%>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#show_more_course_topic").mouseover(function () {
|
||||||
|
$("#more_topic_link").click();
|
||||||
|
});
|
||||||
|
</script>
|
@ -0,0 +1,187 @@
|
|||||||
|
<style type="text/css">
|
||||||
|
div.talk_new .ke-container{margin-left:2px;}
|
||||||
|
.break_word {width:100%;}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//头部导航
|
||||||
|
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
|
||||||
|
function buildsubmenus(){
|
||||||
|
for (var i=0; i<menuids.length; i++){
|
||||||
|
var div = document.getElementById(menuids[i]);
|
||||||
|
if(div == undefined)continue;
|
||||||
|
var ultags=div.getElementsByTagName("ul");
|
||||||
|
for (var t=0; t<ultags.length; t++){
|
||||||
|
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle";
|
||||||
|
ultags[t].parentNode.onmouseover=function(){
|
||||||
|
this.getElementsByTagName("ul")[0].style.display="block";
|
||||||
|
}
|
||||||
|
ultags[t].parentNode.onmouseout=function(){
|
||||||
|
this.getElementsByTagName("ul")[0].style.display="none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.addEventListener)
|
||||||
|
window.addEventListener("load", buildsubmenus, false)
|
||||||
|
else if (window.attachEvent)
|
||||||
|
window.attachEvent("onload", buildsubmenus)
|
||||||
|
</script>
|
||||||
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||||
|
<%#= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
|
||||||
|
|
||||||
|
|
||||||
|
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.created_on desc"), :page => 0, :user => @user} %>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">//侧导航
|
||||||
|
|
||||||
|
function nh_check_field(params){
|
||||||
|
var result=true;
|
||||||
|
if(params.subject!=undefined){
|
||||||
|
if($.trim(params.subject.val()) == ""){
|
||||||
|
params.subjectmsg.html('主题不能为空');
|
||||||
|
params.subjectmsg.css({color:'#ff0000'});
|
||||||
|
result=false;
|
||||||
|
}else{
|
||||||
|
params.subjectmsg.html('填写正确');
|
||||||
|
params.subjectmsg.css({color:'#008000'});
|
||||||
|
}
|
||||||
|
params.subjectmsg.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(params.content!=undefined){
|
||||||
|
if(params.content.isEmpty()){
|
||||||
|
result=false;
|
||||||
|
}
|
||||||
|
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||||
|
params.textarea.html(params.content.html());
|
||||||
|
params.content.sync(); //用上面那句ie11提交到服务器居然木有值
|
||||||
|
if(params.content.isEmpty()){
|
||||||
|
params.contentmsg.html('内容不能为空');
|
||||||
|
params.contentmsg.css({color:'#ff0000'});
|
||||||
|
}else{
|
||||||
|
params.contentmsg.html('填写正确');
|
||||||
|
params.contentmsg.css({color:'#008000'});
|
||||||
|
}
|
||||||
|
params.contentmsg.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function nh_init_board(params){
|
||||||
|
//发帖/编辑/回复按钮的click
|
||||||
|
params.showbtn.click(function(){
|
||||||
|
params.textarea.removeAttr('placeholder');
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
//初始化编辑器
|
||||||
|
var editor = params.kindutil.create(params.textarea, {
|
||||||
|
// allowPreviewEmoticons : false,
|
||||||
|
// allowImageUpload : false,
|
||||||
|
autoHeightMode : true,
|
||||||
|
resizeType : 1,minWidth:"1px",width:"560px",height:"150px",
|
||||||
|
allowFileManager:true,uploadJson:"/kindeditor/upload",
|
||||||
|
fileManagerJson:"/kindeditor/filemanager",
|
||||||
|
afterChange:function(){//按键事件
|
||||||
|
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||||
|
// var edit = this.edit;
|
||||||
|
// var body = edit.doc.body;
|
||||||
|
// edit.iframe.height(minHeight);
|
||||||
|
// this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 30, minHeight));
|
||||||
|
},
|
||||||
|
afterCreate:function(){
|
||||||
|
this.loadPlugin("autoheight");
|
||||||
|
var userAgent = navigator.userAgent.toLowerCase();
|
||||||
|
if(/trident/.test(userAgent)){
|
||||||
|
$("div.talk_new .ke-container").css({'margin-left':'0px'});
|
||||||
|
}
|
||||||
|
// var toolbar = $("div[class='ke-toolbar']",params.about_talk);
|
||||||
|
// $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||||
|
// params.toolbar_container.append(toolbar);
|
||||||
|
}
|
||||||
|
}).loadPlugin('paste');
|
||||||
|
|
||||||
|
//主题输入框按键事件
|
||||||
|
params.inputsubject.keyup(function(){
|
||||||
|
nh_check_field({subject:params.inputsubject,subjectmsg:params.subjectmsg});
|
||||||
|
})
|
||||||
|
//表单提交
|
||||||
|
params.form.submit(function(){
|
||||||
|
var is_checked = nh_check_field({
|
||||||
|
issubmit:true,
|
||||||
|
subject:params.inputsubject,
|
||||||
|
subjectmsg:params.subjectmsg,
|
||||||
|
content:editor,
|
||||||
|
contentmsg:params.contentmsg,
|
||||||
|
textarea:params.textarea
|
||||||
|
});
|
||||||
|
if(is_checked){
|
||||||
|
//return true 居然不提交 fuck your sister
|
||||||
|
$(this)[0].submit();
|
||||||
|
// return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
//提交按钮click
|
||||||
|
params.submitbtn.click(function(){
|
||||||
|
params.form.submit();
|
||||||
|
});
|
||||||
|
//取消按钮click
|
||||||
|
params.cancelbtn.click(function(){
|
||||||
|
params.about_talk.toggle();//显示/隐藏编辑区
|
||||||
|
if(params.about_talk.is(':hidden')){//隐藏时reset表单数据
|
||||||
|
params.form[0].reset();
|
||||||
|
if(params.type=='reply'){
|
||||||
|
params.textarea.empty();
|
||||||
|
}else{
|
||||||
|
params.textarea.html(params.init_content_val.val());
|
||||||
|
}
|
||||||
|
var str = params.textarea.html();
|
||||||
|
str=str.replace(new RegExp(/</g),'<');
|
||||||
|
str=str.replace(new RegExp(/>/g),'>');
|
||||||
|
editor.html(str);
|
||||||
|
params.subjectmsg.hide();
|
||||||
|
params.contentmsg.hide();
|
||||||
|
if(params.quote_show!=undefined)params.quote_show.empty();
|
||||||
|
if(params.quote_input!=undefined)params.quote_input.empty();
|
||||||
|
}else{
|
||||||
|
if(params.type=='reply'){
|
||||||
|
params.textarea.show();
|
||||||
|
params.textarea.focus();
|
||||||
|
params.textarea.hide();
|
||||||
|
//params.jumphref.attr('href','#'+params.form.attr('id'));
|
||||||
|
//params.jumphref[0].click();
|
||||||
|
}else{
|
||||||
|
params.textarea.show();
|
||||||
|
params.textarea.focus();
|
||||||
|
params.textarea.hide();
|
||||||
|
// params.inputsubject.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
params.textarea.data('init','1');//标记为已经初始化
|
||||||
|
}
|
||||||
|
params.cancelbtn.click();//显示/隐藏编辑区
|
||||||
|
});
|
||||||
|
if(params.type == 'reply'){
|
||||||
|
params.showbtn_child.click(function(){
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
params.showbtn.click();
|
||||||
|
}else{
|
||||||
|
params.cancelbtn.click();
|
||||||
|
if(params.about_talk.is(':hidden')){
|
||||||
|
params.cancelbtn.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var parent_topic_id = $(this).data('topic-id');
|
||||||
|
if(parent_topic_id!=undefined)$("input[name='parent_topic']",params.form).val(parent_topic_id);
|
||||||
|
var ref_str = params.get_ref_str_call($(this));
|
||||||
|
params.quote_show.html(ref_str);
|
||||||
|
params.quote_input.html(ref_str);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
<div class="f16 fontBlue fb fl">请选择课程大纲</div>
|
||||||
|
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>-->
|
||||||
|
<div class="fl">
|
||||||
|
<div class="blogSearchBox">
|
||||||
|
<input type="text" name="course_outline_search" id="course_outline_search" placeholder="请输入大纲名称搜索" class="blogSearchContent" />
|
||||||
|
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
|
||||||
|
<!--<input class="searchIconPopup" name="commit" onfocus="this.blur();" style="border-style:none" type="submit" value="">-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="f12 c_red fl mb8" id="course_outline_hint" style="display: none">未搜索到对应大纲,请重新输入</span>
|
||||||
|
<%= form_tag(url_for(:controller=>'courses',:action=>'set_course_outline',:id=>course.id),:method=>'post',:remote=>'true') do %>
|
||||||
|
<input name="is_in_show_outline_page" value="<%= show_page %>" type="hidden" />
|
||||||
|
<div class="blogBlock fl" id="course_outline_list" >
|
||||||
|
<% unless articles.blank? %>
|
||||||
|
<% articles.each do |article|%>
|
||||||
|
<ul class="blogRow">
|
||||||
|
<li class="fl">
|
||||||
|
<input name="outline_id" type="radio" value="<%= article.id%>" class="courseSendCheckbox"/>
|
||||||
|
</li>
|
||||||
|
<li class="blogTitle fl"><%= article.title%></li>
|
||||||
|
</ul>
|
||||||
|
<div class="homeworkPublishTime">发布时间:<%= format_date(article.created_at)%></div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="courseSendSubmit"><a href="javascript:void(0);" class="sendSourceText" onclick="if($('input[name=outline_id]:radio:checked').length != 0 ) { $(this).parent().parent().submit(); }else{ return false;}">确定</a></div>
|
||||||
|
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
@ -0,0 +1,9 @@
|
|||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'course_outlines_list',:locals => {:articles=>@blog_articles,:course=>@course,:show_page=>@is_in_show_outline_page}) %>');
|
||||||
|
showModal('ajax-modal', '300px');
|
||||||
|
//$('#ajax-modal').css('height','250px');
|
||||||
|
$('#ajax-modal').css('padding-top','0px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before(' <a href="javascript:void(0);" onclick="hideModal()" class="resourceClose" style="margin-left: 285px"></a>');
|
||||||
|
$('#ajax-modal').parent().css("top","30%").css("left","50%");
|
||||||
|
$('#ajax-modal').parent().addClass("courseOutlinePopup");
|
||||||
|
$('#ajax-modal').css("padding-left","16px")//.css("padding-bottom","16px");
|
@ -0,0 +1,8 @@
|
|||||||
|
hideModal();
|
||||||
|
<%if @course.tea_id == User.current.id && @course.outline == 0 %>
|
||||||
|
<% else %>
|
||||||
|
$("#course_outline_bar").html('<a href="<%=syllabus_course_path(@course) %>" title="课程大纲" class="mr5 syllabusIcon fl"> </a>')
|
||||||
|
<%end %>
|
||||||
|
<%if @is_in_show_outline_page && @is_in_show_outline_page == 'Y'%>
|
||||||
|
window.location.href='<%=syllabus_course_path(@course) %>';
|
||||||
|
<% end %>
|
@ -0,0 +1,6 @@
|
|||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:remote=>true}) %>');
|
||||||
|
showModal('ajax-modal', '350px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||||
|
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
|
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
@ -1,6 +1,10 @@
|
|||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>');
|
||||||
|
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
|
||||||
showModal('ajax-modal', '350px');
|
showModal('ajax-modal', '350px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
||||||
|
$(function() { $('#evaluation_start_time').datepicker(datepickerOptions);
|
||||||
|
$('#evaluation_end_time').datepicker(datepickerOptions);
|
||||||
|
});
|
@ -0,0 +1,14 @@
|
|||||||
|
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
|
||||||
|
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||||
|
|
||||||
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||||
|
<span style="float: left; width: 526px">
|
||||||
|
<p><span style="color:#1b55a7; font-weight:bold;"><%= @user.show_name %></span> 请求成为课程:<span style="color:#1b55a7; font-weight:bold;"><%=link_to @course.name, course_url(@course) %></span>的<%= @role.eql?('9') ? '老师': '教辅' %> </p>
|
||||||
|
<p><%=link_to user_message_url(@receive),user_message_url(@receive)%></p>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="cl" style="margin-top: 30px; clear:both; overflow:hidden;"></div>
|
||||||
|
</div>
|
@ -0,0 +1,4 @@
|
|||||||
|
<%= @user.show_name %>申请成为课程<%= @course.name %>的<%= @role.eql?('9') ? '老师': '教辅' %>
|
||||||
|
<%=link_to user_message_url(@receive),user_message_url(@receive)%>
|
||||||
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
|||||||
<%if @project%>
|
<%if @project%>
|
||||||
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
|
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
|
||||||
|
$("#project_members_number").html("<%= @project.members.count %>");
|
||||||
// $('#tab-content-members').html('<%#= escape_javascript(render :partial => 'projects/settings/members') %>');
|
// $('#tab-content-members').html('<%#= escape_javascript(render :partial => 'projects/settings/members') %>');
|
||||||
<%elsif @course%>
|
<%elsif @course%>
|
||||||
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
||||||
|
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>")
|
||||||
|
$("#student_number").html("<%= studentCount(@course) %>");
|
||||||
<%end%>
|
<%end%>
|
||||||
hideOnLoad();
|
hideOnLoad();
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
||||||
|
<div class="project_r_h">
|
||||||
|
<h2 class="project_h2">组织活动</h2>
|
||||||
|
</div>
|
@ -1,32 +1,13 @@
|
|||||||
<%= link_to @repository.identifier.present? ? h(@repository.identifier) : 'root',
|
<div class="git_usr_title">
|
||||||
{:action => 'show', :id => @project,
|
<span><%= link_to @repository.identifier.present? ? h(@repository.identifier) : 'root',
|
||||||
:repository_id => @repository.identifier_param,
|
{:action => 'show', :id => @project,
|
||||||
:path => nil, :rev => @rev },
|
:repository_id => @repository.identifier_param,
|
||||||
:class=>"fl c_blue f14 fb" %>
|
:path => nil, :rev => @rev },
|
||||||
<%
|
:class => "repository-title-dec"
|
||||||
dirs = path.split('/')
|
%>
|
||||||
if 'file' == kind
|
/
|
||||||
filename = dirs.pop
|
<%=link_to @project.owner, user_path(@project.owner), :class => "repository-title-dec" %>
|
||||||
end
|
</span>
|
||||||
link_path = ''
|
</div>
|
||||||
dirs.each do |dir|
|
|
||||||
next if dir.blank?
|
|
||||||
link_path << '/' unless link_path.empty?
|
|
||||||
link_path << "#{dir}"
|
|
||||||
%>
|
|
||||||
/ <%= link_to h(dir), :action => 'show', :id => @project, :repository_id => @repository.identifier_param,
|
|
||||||
:path => to_path_param(link_path), :rev => @rev %>
|
|
||||||
<% end %>
|
|
||||||
<% if filename %>
|
|
||||||
/ <%= link_to h(filename),
|
|
||||||
:action => 'changes', :id => @project, :repository_id => @repository.identifier_param,
|
|
||||||
:path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %>
|
|
||||||
<% end %>
|
|
||||||
<%
|
|
||||||
# @rev is revsion or Git and Mercurial branch or tag.
|
|
||||||
# For Mercurial *tip*, @rev and @changeset are nil.
|
|
||||||
rev_text = @changeset.nil? ? @rev : format_revision(@changeset)
|
|
||||||
%>
|
|
||||||
<p class="fl f14 fb c_grey02"><%= "@ #{h rev_text}" unless rev_text.blank? %></p>
|
|
||||||
|
|
||||||
<% html_title(with_leading_slash(path)) -%>
|
<% html_title(with_leading_slash(path)) -%>
|
||||||
|
@ -1,34 +1,33 @@
|
|||||||
<% content_for :header_tags do %>
|
<!--<a href="javascript:void(0);" class="pic_stats fl ml20 mt3"></a>-->
|
||||||
<%= javascript_include_tag 'repository_navigation' %>
|
<%#= link_to l(:label_statistics),
|
||||||
<% end %>
|
|
||||||
<a href="javascript:void(0);" class="pic_stats fl ml20 mt3"></a>
|
|
||||||
<%= link_to l(:label_statistics),
|
|
||||||
{:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
|
{:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
|
||||||
:class => 'mt3 c_blue fl' if @repository.supports_all_revisions? %>
|
:class => 'mt3 c_blue fl' if @repository.supports_all_revisions? %>
|
||||||
|
<div class="repositorytitle mr15">
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= javascript_include_tag 'repository_navigation' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= form_tag({:action => controller.action_name,
|
|
||||||
:id => @project,
|
|
||||||
:repository_id => @repository.identifier_param,
|
|
||||||
:path => to_path_param(@path),
|
|
||||||
:rev => nil},
|
|
||||||
{:method => :get, :id => 'revision_selector', :class => "fl c_grey02 ml5"}) do -%>
|
|
||||||
<!-- Branches Dropdown -->
|
|
||||||
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
|
|
||||||
| <%= l(:label_branch) %>:
|
|
||||||
<%= select_tag :branch,
|
|
||||||
options_for_select([''] + @repository.branches, @rev),
|
|
||||||
:id => 'branch' %>
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
|
|
||||||
| <%= l(:label_tag) %>:
|
|
||||||
<%= select_tag :tag,
|
|
||||||
options_for_select([''] + @repository.tags, @rev),
|
|
||||||
:id => 'tag' %>
|
|
||||||
<% end -%>
|
|
||||||
|
|
||||||
<% if @repository.supports_all_revisions? %>
|
<%= form_tag({:action => controller.action_name,
|
||||||
| <%= l(:label_revision) %>:
|
:id => @project,
|
||||||
<%= text_field_tag 'rev', @rev, :size => 8 %>
|
:repository_id => @repository.identifier_param,
|
||||||
<% end %>
|
:path => to_path_param(@path),
|
||||||
<% end -%>
|
:rev => nil},
|
||||||
|
{:method => :get, :id => 'revision_selector'}) do -%>
|
||||||
|
<!-- Branches Dropdown -->
|
||||||
|
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
|
||||||
|
<%= l(:label_branch) %>:
|
||||||
|
<%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), :id => 'branch' %>
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
<% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
|
||||||
|
<%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), :id => 'tag', :style=>" display:none" %>
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
<% if @repository.supports_all_revisions? %>
|
||||||
|
<%= hidden_field_tag 'rev', @rev, :size => 8 %>
|
||||||
|
<% end %>
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@ -1,53 +1,51 @@
|
|||||||
<% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
|
|
||||||
<%= if show_revision_graph && revisions && revisions.any?
|
|
||||||
indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid|
|
|
||||||
url_for(
|
|
||||||
:controller => 'repositories',
|
|
||||||
:action => 'revision',
|
|
||||||
:id => project,
|
|
||||||
:repository_id => @repository.identifier_param,
|
|
||||||
:rev => scmid)
|
|
||||||
end
|
|
||||||
render :partial => 'revision_graph',
|
|
||||||
:locals => {
|
|
||||||
:commits => indexed_commits,
|
|
||||||
:space => graph_space
|
|
||||||
}
|
|
||||||
end %>
|
|
||||||
<%= form_tag(
|
<%= form_tag(
|
||||||
{:controller => 'repositories', :action => 'diff', :id => project,
|
{:controller => 'repositories', :action => 'diff', :id => project,
|
||||||
:repository_id => @repository.identifier_param, :path => to_path_param(path)},
|
:repository_id => @repository.identifier_param, :path => to_path_param(path)},
|
||||||
:method => :get
|
:method => :get
|
||||||
) do %>
|
) do %>
|
||||||
<table class="list changesets">
|
<table class="list changesets">
|
||||||
<thead><tr>
|
<!--<thead><tr>-->
|
||||||
<th>#</th>
|
<!--<th>#</th>-->
|
||||||
<th></th>
|
<!--<th></th>-->
|
||||||
<th></th>
|
<!--<th></th>-->
|
||||||
<th><%= l(:label_date) %></th>
|
<!--<th><%= l(:label_date) %></th>-->
|
||||||
<th><%= l(:field_author) %></th>
|
<!--<th><%= l(:field_author) %></th>-->
|
||||||
<th><%= l(:field_comments) %></th>
|
<!--<th><%= l(:field_comments) %></th>-->
|
||||||
</tr></thead>
|
<!--</tr></thead>-->
|
||||||
<tbody>
|
<tbody>
|
||||||
<% show_diff = revisions.size > 1 %>
|
<% show_diff = revisions.size > 1 %>
|
||||||
<% line_num = 1 %>
|
<% line_num = 1 %>
|
||||||
<% revisions.each do |changeset| %>
|
<% revisions.each do |changeset| %>
|
||||||
<tr class="changeset <%= cycle 'odd', 'even' %>">
|
<div class="col-md-10 col-sm-12">
|
||||||
<% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %>
|
<ul class="bordered-list">
|
||||||
<%= content_tag(:td, :class => 'id', :style => id_style) do %>
|
<li class="commit js-toggle-container">
|
||||||
<%= link_to_revision(changeset, @repository) %>
|
<div class="commit-row-title">
|
||||||
<% end %>
|
<strong class="str-truncated">
|
||||||
<td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %></td>
|
<a class="commit-row-message"><%= textilizable(truncate_at_line_break(changeset.message)) %></a>
|
||||||
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %></td>
|
</strong>
|
||||||
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
|
<div class="pull-right" title="修订号">
|
||||||
<td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td>
|
<%= h truncate(changeset.short_id.to_s, :length => 20) %>
|
||||||
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
|
</div>
|
||||||
</tr>
|
<div class="notes_count">
|
||||||
<% line_num += 1 %>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="commit-row-info">
|
||||||
|
<a class="commit-author-link has_tooltip"> <span class="commit-author-name">
|
||||||
|
<%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %>
|
||||||
|
<%= link_to user_commit_rep(changeset.author_email), user_path(user_commit_rep(changeset.author_email)), :length => 30 %></span></a>
|
||||||
|
提交于
|
||||||
|
<div class="committed_ago">
|
||||||
|
<time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %> 前</time>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p style="padding-top: 10px;">
|
<p style="padding-top: 10px;">
|
||||||
<%= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
|
<%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
<div class="overall-summary overall-summary-bottomless">
|
||||||
|
|
||||||
|
<div class="stats-switcher-viewport js-stats-switcher-viewport">
|
||||||
|
<div class="stats-switcher-wrapper">
|
||||||
|
<ul class="numbers-summary">
|
||||||
|
<li class="commits">
|
||||||
|
<a data-pjax="" href="/redmine/redmine/commits/0.6-stable">
|
||||||
|
<span class="octicon octicon-history"></span>
|
||||||
|
<span class="num text-emphasized">
|
||||||
|
<%=link_to @changesets.count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev}, :class => "num text-emphasized c_blue" %>
|
||||||
|
</span>
|
||||||
|
commits
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<span class="octicon image-type"></span>
|
||||||
|
<span class="num text-emphasized" style="color: #269AC9">
|
||||||
|
<%= @repository.branches.count %>
|
||||||
|
</span>
|
||||||
|
branches
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<span class="octicon octicon-organization"></span>
|
||||||
|
<span class="num text-emphasized">
|
||||||
|
<%=link_to @repository.committers.count, committers_repository_path(@repository), :class => "c_blue" %>
|
||||||
|
</span>
|
||||||
|
contributors
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue