Date: Mon, 27 Jul 2015 15:21:31 +0800
Subject: [PATCH 013/146] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=B2=A1?=
=?UTF-8?q?=E6=9C=89=E6=8F=90=E4=BA=A4=E8=AE=B0=E5=BD=95=E6=97=B6=E4=B8=8D?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=BB=9F=E8=AE=A1=E7=BB=93=E6=9E=9C=EF=BC=8C?=
=?UTF-8?q?=E5=B9=B6=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/repositories_controller.rb | 2 +
app/views/repositories/stats.html.erb | 49 ++++++++++++----------
2 files changed, 29 insertions(+), 22 deletions(-)
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 208a8bdb0..e0aea0c2e 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -449,6 +449,8 @@ update
def stats
@project_id = params[:id]
@repository_id = @repository.identifier
+ # 提交次数统计
+ @status_commit_count = Changeset.count(:conditions => ["#{Changeset.table_name}.repository_id = ?", @repository.id])
render :layout => 'base_projects'
end
diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb
index b5283629c..0bce15069 100644
--- a/app/views/repositories/stats.html.erb
+++ b/app/views/repositories/stats.html.erb
@@ -1,25 +1,30 @@
<%= l(:label_statistics) %>
-
修订 是版本库的提交次数, 显示为橘红色。
-
变更 是对版本库中文件的修改次数, 显示为蓝色。
-
- <%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
-
-
- <%# 用户每月提交代码次数 %>
- <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
-
-
- <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_per_month")) %>
-
-
- <%# 用户最近六个月的提交次数 %>
- <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_six_month")) %>
-
-
- <%# 用户最近六个月的代码量 %>
- <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_six_months")) %>
-
-<%= link_to l(:button_back), :action => 'show', :id => @project %>
-<% html_title(l(:label_repository), l(:label_statistics)) -%>
+<% if @status_commit_count ==0 %>
+ 该项目目前还没有提交过代码!
+<% else %>
+
修订 是版本库的提交次数, 显示为橘红色。
+
变更 是对版本库中文件的修改次数, 显示为蓝色。
+
+
+ <%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
+
+
+ <%# 用户每月提交代码次数 %>
+ <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
+
+
+ <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_per_month")) %>
+
+
+ <%# 用户最近六个月的提交次数 %>
+ <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_six_month")) %>
+
+
+ <%# 用户最近六个月的代码量 %>
+ <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_six_months")) %>
+
+ <%= link_to l(:button_back), :action => 'show', :id => @project %>
+ <% html_title(l(:label_repository), l(:label_statistics)) -%>
+<% end %>
\ No newline at end of file
From ed27b6e30f2672e57a9fdd3d8de93e2dbf79e49a Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 27 Jul 2015 16:03:03 +0800
Subject: [PATCH 014/146] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8A=A0=E5=85=A5?=
=?UTF-8?q?=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5=E6=B7=BB=E5=8A=A0=E8=87=AA?=
=?UTF-8?q?=E5=8A=A8=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/mailer.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 5ae9df001..a25aff6bb 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -388,7 +388,8 @@ class Mailer < ActionMailer::Base
@user = applied.user
recipients = @project.manager_recipients
s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name)
- @applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members')
+ @token = Token.get_token_from_user(@user, 'autologin')
+ @applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members', :token => @token.value)
mail :to => recipients,
:subject => s
end
From 7c818ce59ac3cbfdcf6c6d996899c95796ad43db Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 27 Jul 2015 16:07:29 +0800
Subject: [PATCH 015/146] =?UTF-8?q?admin=E7=95=8C=E9=9D=A2=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=AD=A6=E6=A0=A1=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=8F=8A=E6=8C=89=E5=90=8D=E7=A7=B0=E8=BF=87?=
=?UTF-8?q?=E6=BB=A4=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 13 +++++++++
app/views/admin/schools.html.erb | 44 +++++++++++++++++++++++++++++
config/locales/zh.yml | 1 +
config/routes.rb | 1 +
lib/redmine.rb | 1 +
public/stylesheets/courses.css | 1 -
6 files changed, 60 insertions(+), 1 deletion(-)
create mode 100644 app/views/admin/schools.html.erb
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 086ecfb7f..d2c94f5de 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -337,6 +337,19 @@ class AdminController < ApplicationController
format.html
end
end
+
+ #学校列表
+ def schools
+ @q = params[:school_name]
+ if @q
+ @schools = School.where("name like '%#{@q}%'")
+ else
+ @schools = School.all
+ end
+ respond_to do |format|
+ format.html
+ end
+ end
#移动端版本管理
def mobile_version
@versions = PhoneAppVersion.reorder('created_at desc')
diff --git a/app/views/admin/schools.html.erb b/app/views/admin/schools.html.erb
new file mode 100644
index 000000000..760a0c5a4
--- /dev/null
+++ b/app/views/admin/schools.html.erb
@@ -0,0 +1,44 @@
+
+ <%=l(:label_school_plural)%>
+
+<%= form_tag({:controller => 'admin', :action => 'schools' }, :method => :get,:id=>"search_course_form") do %>
+ <%= submit_tag "搜索",:style => "float: right;margin-right: 15px;"%>
+
+<% end %>
+
+
+
+
+<% html_title(l(:label_project_plural)) -%>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 83ccebbe9..1018a213a 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -381,6 +381,7 @@ zh:
label_organization_choose: --请选择组织--
label_organization_name: 组织名称
label_organization_list: 组织列表
+ label_school_plural: 学校列表
label_organization_new: 新建组织
label_organization_edit: 修改组织
label_project_plural: 项目列表
diff --git a/config/routes.rb b/config/routes.rb
index 1ae607eb7..d353c60ff 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -670,6 +670,7 @@ RedmineApp::Application.routes.draw do
match 'admin/test_email', :via => :get
match 'admin/default_configuration', :via => :post
get 'admin/organization'
+ get 'admin/schools'
resources :auth_sources do
member do
diff --git a/lib/redmine.rb b/lib/redmine.rb
index 3043cfe5d..0f6c14b8a 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -369,6 +369,7 @@ Redmine::MenuManager.map :admin_menu do |menu|
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
menu.push :courses, {:controller => 'admin', :action => 'courses'}, :caption => :label_course_all
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
+ menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural
menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made
menu.push :mobile_version, {:controller => 'admin',:action => 'mobile_version'},:caption => :label_mobile_version
menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 778a474cd..00a2f0034 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -665,7 +665,6 @@ a:hover.ping_pic{border:1px solid #64bdd9;}
.ping_back_tit{ float:left; width:523px; margin-left:10px; }
a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; text-align:center; display:block;}
a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;}
-.fr{ float:right;}
.min_search{ width:140px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 185px -193px no-repeat; }
.li_min_search{ float:right; margin-right:-10px;}
.info_ni_download{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;margin-left: 200px;margin-top: 10px;}
From 19c515e11ed210611170cccd37bca61ac2a81e31 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 27 Jul 2015 16:15:04 +0800
Subject: [PATCH 016/146] =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=8F=E5=8F=B7=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/admin/schools.html.erb | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/app/views/admin/schools.html.erb b/app/views/admin/schools.html.erb
index 760a0c5a4..b5e649dd0 100644
--- a/app/views/admin/schools.html.erb
+++ b/app/views/admin/schools.html.erb
@@ -11,20 +11,26 @@
-
+
+ 序号
+
+
LOGO
学校名称
-
+
<% @schools.each do |school|%>
">
+
+ <%= school.id %>
+
- <%= image_tag(school.logo_link,width:46,height:46) %>
+ <%= image_tag(school.logo_link,width:40,height:40) %>
From 9beb8acb991ad24d34e686d92fa9f70202d2c03d Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 27 Jul 2015 16:49:21 +0800
Subject: [PATCH 017/146] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=EF=BC=9A1=E3=80=81=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E5=87=A0=E6=9D=A1=E8=AE=B0=E5=BD=95=E5=90=8E=E4=B8=8D=E6=BB=A1?=
=?UTF-8?q?=E5=8D=81=E6=9D=A1=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=202=E3=80=81=E6=96=87=E6=A1=A3=E8=AE=B0=E5=BD=95=E4=B8=8D?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=98=BE=E7=A4=BA=E5=9C=A8=E5=8A=A8=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 2efaf591a..d578fe586 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -280,11 +280,11 @@ class ProjectsController < ApplicationController
# 根据私密性,取出符合条件的所有数据
if User.current.member_of?(@project) || User.current.admin?
- @events_pages = ForgeActivity.where("project_id = ?",@project).order("created_at desc").page(params['page'|| 1]).per(20);
+ @events_pages = ForgeActivity.where("project_id = ? and forge_act_type != ?",@project, "Document" ).order("created_at desc").page(params['page'|| 1]).per(20);
#events = @activity.events(@date_from, @date_to)
else
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public
- = ?",@project,1).order("created_at desc")
+ = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc")
.page(params['page'|| 1]).per(10);
# @events = @activity.events(@date_from, @date_to, :is_public => 1)
end
From 0f82bbf79739794b1ce160c06e00e875b7b0199c Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 27 Jul 2015 18:15:05 +0800
Subject: [PATCH 018/146] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8C=BF=E5=90=8D?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 18 +++++++++++++-----
app/views/projects/show.html.erb | 14 --------------
2 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index d578fe586..09ae5ad79 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -150,11 +150,15 @@ class ProjectsController < ApplicationController
end
def new
- @issue_custom_fields = IssueCustomField.sorted.all
- @trackers = Tracker.sorted.all
- @project = Project.new
- @project.safe_attributes = params[:project]
- render :layout => 'base'
+ if User.current.login?
+ @issue_custom_fields = IssueCustomField.sorted.all
+ @trackers = Tracker.sorted.all
+ @project = Project.new
+ @project.safe_attributes = params[:project]
+ render :layout => 'base'
+ else
+ redirect_to signin_url
+ end
end
def share
@@ -167,6 +171,10 @@ class ProjectsController < ApplicationController
end
def create
+ unless User.current.login?
+ redirect_to signin_url
+ return
+ end
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index ca7bb6159..f1b3d9b7b 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -93,21 +93,7 @@
-
- <% elsif e.forge_act_type == "Document" %>
-
<% elsif e.forge_act_type == "Attachment" %>
From 6091369e02b33042749218e39a401eace43da23c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 27 Jul 2015 18:20:20 +0800
Subject: [PATCH 019/146] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=A6=E6=A0=A1log?=
=?UTF-8?q?o=E7=9A=84=E4=B8=8A=E4=BC=A0=E5=8A=9F=E8=83=BD=EF=BC=8C?=
=?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=AE=9E=E6=97=B6=E9=A2=84=E8=A7=88=E6=95=88?=
=?UTF-8?q?=E6=9E=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 6 +++---
app/controllers/school_controller.rb | 17 +++++----------
app/views/admin/schools.html.erb | 4 ++--
app/views/school/upload_logo.html.erb | 31 +++++++++++++++++++++++----
config/routes.rb | 14 +++++++++---
public/stylesheets/application.css | 13 ++++++++++-
6 files changed, 60 insertions(+), 25 deletions(-)
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index d2c94f5de..a44b58789 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -340,9 +340,9 @@ class AdminController < ApplicationController
#学校列表
def schools
- @q = params[:school_name]
- if @q
- @schools = School.where("name like '%#{@q}%'")
+ @school_name = params[:school_name]
+ if @school_name
+ @schools = School.where("name like '%#{@school_name}%'")
else
@schools = School.all
end
diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb
index 008fe00fc..3e0c280ac 100644
--- a/app/controllers/school_controller.rb
+++ b/app/controllers/school_controller.rb
@@ -4,28 +4,21 @@ class SchoolController < ApplicationController
def upload
uploaded_io = params[:logo]
- school_id = 0
- schools = School.where("name = ?", params[:school])
-
- schools.each do |s|
- school_id = s.id
- end
-
+ school_id ||= params[:id]
unless uploaded_io.nil?
File.open(Rails.root.join('public', 'images', 'school', school_id.to_s+'.png'), 'wb') do |file|
file.write(uploaded_io.read)
end
-
s1 = School.find(school_id)
s1.logo_link = '/images/school/'+school_id.to_s+'.png'
s1.save
-
-
- end
+ end
+ redirect_to admin_schools_url(:school_name => params[:school_name])
end
def upload_logo
-
+ @school = School.find params[:id]
+ @school_name = params[:school_name]
end
#获取制定学校开设的课程数
diff --git a/app/views/admin/schools.html.erb b/app/views/admin/schools.html.erb
index b5e649dd0..0956981e8 100644
--- a/app/views/admin/schools.html.erb
+++ b/app/views/admin/schools.html.erb
@@ -3,7 +3,7 @@
<%= form_tag({:controller => 'admin', :action => 'schools' }, :method => :get,:id=>"search_course_form") do %>
<%= submit_tag "搜索",:style => "float: right;margin-right: 15px;"%>
-
+
<% end %>
@@ -38,7 +38,7 @@
- <%= link_to("上传logo", edit_organization_path(school.id), :class => 'icon icon-copy') %>
+ <%= link_to("修改", upload_logo_school_path(school.id,:school_name => @school_name), :class => 'icon icon-copy') %>
<%#= link_to(l(:button_delete), organization_path(school.id), :method => :delete,:confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
diff --git a/app/views/school/upload_logo.html.erb b/app/views/school/upload_logo.html.erb
index 97a3f171c..26da7e081 100644
--- a/app/views/school/upload_logo.html.erb
+++ b/app/views/school/upload_logo.html.erb
@@ -1,5 +1,28 @@
-<%= form_tag({action: :upload},method: "post", multipart: true) do %>
- <%= text_field_tag 'school'%>
- <%= file_field_tag 'logo' %>
- <%= submit_tag('Upload') %>
+
+
+<%= form_tag(upload_school_path(@school.id),method: "post", multipart: true) do %>
+ <%#= text_field_tag 'school'%>
+
+
+ <%= image_tag(@school.logo_link, id: "avatar_image", :class=>"school_avatar")%>
+
上传图片
+ <%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%>
+
+
+ <%= submit_tag('上传') %>
+ <%= submit_tag('取消') %>
+
+
<% end %>
+
diff --git a/config/routes.rb b/config/routes.rb
index d353c60ff..280053f60 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -39,6 +39,17 @@ RedmineApp::Application.routes.draw do
end
+ resources :school do
+ collection do
+
+ end
+
+ member do
+ get 'upload_logo'
+ post 'upload'
+ end
+ end
+
resources :homework_attach do
collection do
get 'get_homework_member_list'
@@ -809,9 +820,6 @@ RedmineApp::Application.routes.draw do
post 'school/search_school/', :to => 'school#search_school'
get 'school/search_school/', :to => 'school#search_school'
- post 'school/upload', :to => 'school#upload'
- get 'school/upload_logo', :to => 'school#upload_logo'
-
######added by nie
match 'tags/show_projects_tags'
########### added by liuping
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index d4d309181..3e01d68ff 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -2796,4 +2796,15 @@ div.repos_explain{
.upload_img img{max-width: 100%;}
#activity .upload_img img{max-width: 580px;}
-img,embed{max-width: 100%;}
\ No newline at end of file
+img,embed{max-width: 100%;}
+
+img.school_avatar {
+ background: rgb(245, 245, 245);
+ padding: 4px;
+ border: 1px solid #e5dfc7;
+ float: left;
+ display: block;
+ width: 100px;
+ height: 100px;
+ max-width: none;
+}
\ No newline at end of file
From 45d5972a93d98b576c57a8a78ed82a283949ccad Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Tue, 28 Jul 2015 10:27:45 +0800
Subject: [PATCH 020/146] =?UTF-8?q?=E5=9C=A8=E5=8F=91=E5=B8=83=E9=97=AE?=
=?UTF-8?q?=E5=8D=B7=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=AD=E9=97=B4=E5=8F=AF?=
=?UTF-8?q?=E4=BB=A5=E6=8F=92=E5=85=A5=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 16 +-
app/views/poll/_new_MC.html.erb | 1 +
app/views/poll/_poll_form.html.erb | 186 ++++++++++++++++++++-
app/views/poll/_show_MC.html.erb | 18 +-
app/views/poll/_show_MCQ.html.erb | 14 +-
app/views/poll/_show_mulit.html.erb | 14 +-
app/views/poll/_show_single.html.erb | 14 +-
app/views/poll/create_poll_question.js.erb | 6 +-
public/stylesheets/polls.css | 5 +-
9 files changed, 261 insertions(+), 13 deletions(-)
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 758747e02..8f81bc2c6 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -137,11 +137,19 @@ class PollController < ApplicationController
@poll_questions.poll_answers.new question_option
end
end
- if @poll_questions.save
- respond_to do |format|
- format.js
- end
+ # 如果是插入的话,那么从插入的这个id以后的question_num都将要+1
+ if params[:quest_id]
+ @is_insert = true
+ @poll.poll_questions.where("question_number > #{params[:quest_num].to_i}").update_all(" question_number = question_number + 1")
+ @poll_question_num = params[:quest_num].to_i
+ @poll_questions.question_number = params[:quest_num].to_i + 1
end
+ if @poll_questions.save
+ respond_to do |format|
+ format.js
+ end
+ end
+
end
#修改题目
diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb
index 8c47baa01..e5f2a6b82 100644
--- a/app/views/poll/_new_MC.html.erb
+++ b/app/views/poll/_new_MC.html.erb
@@ -1,5 +1,6 @@
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
+ <% insert_begin = insert_begin %>
问题:
diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb
index 74ca9fb32..0a15143fb 100644
--- a/app/views/poll/_poll_form.html.erb
+++ b/app/views/poll/_poll_form.html.erb
@@ -6,23 +6,203 @@ function edit_head(){
$("#polls_description").val($("#polls_description_div").html());
}
- function add_MC(){
+function chooseQuestionType(quest_type,quest_id){
+ $("#div_"+quest_type+"_"+quest_id).css("position", "absolute");
+
+ $("#div_"+quest_type+"_"+quest_id).css("top", $("#add_"+quest_type+"_"+quest_id).offset().top+30);
+
+ $("#div_"+quest_type+"_"+quest_id).css("left", $("#add_"+quest_type+"_"+quest_id).offset().left-10);
+ if( $("#div_"+quest_type+"_"+quest_id).css('display') == 'block') {
+ $("#div_"+quest_type+"_"+quest_id).css('display', 'none');
+ }
+ else{
+ $("#div_"+quest_type+"_"+quest_id).css('display', 'block');
+ }
+}
+
+function add_MC(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
$("#poll_questions_title").focus();
- }
- function add_MCQ(){
+}
+
+ function insert_MC(quest_type,quest_num,quest_id){
+ $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
+ '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
+ '
'+
+ '
'+
+ '问题: '+
+ ' '+
+ ' '+
+ ' '+
+ ' '+
+ ' '+
+ '必答 '+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ '
'+
+ '<% end%>'
+ );
+ $("#poll_questions_title").focus();
+}
+
+function add_MCQ(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>");
$("#poll_questions_title").focus();
+}
+
+function insert_MCQ(quest_type,quest_num,quest_id){
+ $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
+ '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
+ '
'+
+ '
'+
+ '问题: '+
+ ' '+
+ ' '+
+ ' '+
+ ' '+
+ ' '+
+ '必答 '+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ '
'+
+ '<% end%>'
+ );
+ $("#poll_questions_title").focus();
}
+
function add_single(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>");
$("#poll_questions_title").focus();
}
+
+ function insert_SINGLE(quest_type,quest_num,quest_id){
+ $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
+ '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
+ '
'+
+ '<% end%>'
+ );
+ $("#poll_questions_title").focus();
+ }
function add_mulit(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
$("#poll_questions_title").focus();
}
+ function insert_MULIT(quest_type,quest_num,quest_id){
+ $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
+ '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
+ '
'+
+ '
'+
+ '问题: '+
+ ' '+
+ ' '+
+ ' '+
+ ' '+
+ ' '+
+ '必答 '+
+ '
'+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ '
'+
+ '<% end%>'
+ );
+ $("#poll_questions_title").focus();
+ }
+
//添加标题时确定按钮
function add_poll_question(doc)
{
diff --git a/app/views/poll/_show_MC.html.erb b/app/views/poll/_show_MC.html.erb
index ff8e52f25..9c47894dc 100644
--- a/app/views/poll/_show_MC.html.erb
+++ b/app/views/poll/_show_MC.html.erb
@@ -1,3 +1,6 @@
+
@@ -9,9 +12,11 @@
*
<%end%>
+
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
+
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/poll/_show_MCQ.html.erb b/app/views/poll/_show_MCQ.html.erb
index 63b9d1c1f..fb2c03080 100644
--- a/app/views/poll/_show_MCQ.html.erb
+++ b/app/views/poll/_show_MCQ.html.erb
@@ -12,6 +12,7 @@
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
+
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/poll/_show_mulit.html.erb b/app/views/poll/_show_mulit.html.erb
index 2d52fffb5..ad01d0a3e 100644
--- a/app/views/poll/_show_mulit.html.erb
+++ b/app/views/poll/_show_mulit.html.erb
@@ -13,9 +13,21 @@
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
+
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/poll/_show_single.html.erb b/app/views/poll/_show_single.html.erb
index 8caa7b1a5..f5846b6b7 100644
--- a/app/views/poll/_show_single.html.erb
+++ b/app/views/poll/_show_single.html.erb
@@ -12,8 +12,20 @@
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
+
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/poll/create_poll_question.js.erb b/app/views/poll/create_poll_question.js.erb
index ac44ebb4c..8a597514e 100644
--- a/app/views/poll/create_poll_question.js.erb
+++ b/app/views/poll/create_poll_question.js.erb
@@ -1,4 +1,8 @@
+<% if @is_insert %>
+ $("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>');
+<% else %>
$("#new_poll_question").html("");
+
$("#poll_content").append("" +
"
" +
"<% if @poll_questions.question_type == 1%>" +
@@ -23,4 +27,4 @@ $("#poll_content").append("
" +
"<% end%>" +
"
" +
"
");
-
+<% end %>
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index 353ec3937..83fa5089b 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -28,7 +28,7 @@ a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
#polls div{word-break: break-all;word-wrap: break-word;}
.ur_prefix_content{ color:#656565; text-indent:30px; margin-top:10px; }
.ur_card{border-top:1px solid #dcdcdc;margin-top:20px; color:#3a3a3a;}
-.ur_title{ padding:20px 0px ; float:left; width:604px; }
+.ur_title{ padding:20px 0px ; float:left; width:564px; }
.ur_required{ font-weight: bold; color:red;}
.ur_inputs{ color:#666;}
.ur_table{border-top:1px solid #dcdcdc; background:#fff;}
@@ -101,10 +101,13 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;}
.ur_editor02{width:648px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px;}
a.ur_button_submit{ display:block; width:106px; height:31px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:4px; margin-bottom:10px; }
a:hover.ur_button_submit{ background:#0fa9bb; text-decoration:none;}
+
a.ur_icon_de{ background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px;}
a:hover.ur_icon_de{ background:url(images/icons.png) -20px -338px no-repeat;}
.ur_icon_edit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;}
a:hover.ur_icon_edit{ background:url(images/icons.png) -21px -272px no-repeat;}
+.ur_icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:right; margin-top:15px; margin-right:10px;}
+a:hover.ur_icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
/***弹框***/
.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
From 6b45702f8c403a7f5b37393ae26b9cb8cbf664d0 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Tue, 28 Jul 2015 11:20:21 +0800
Subject: [PATCH 021/146] =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A9=BA=E7=99=BD?=
=?UTF-8?q?=E5=A4=84=E5=8F=AF=E4=BB=A5=E8=AE=A9=E5=BC=B9=E5=87=BA=E6=A1=86?=
=?UTF-8?q?=E9=9A=90=E8=97=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/_poll_form.html.erb | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb
index 0a15143fb..b081f4d18 100644
--- a/app/views/poll/_poll_form.html.erb
+++ b/app/views/poll/_poll_form.html.erb
@@ -2,11 +2,24 @@
-
diff --git a/public/javascripts/user.js b/public/javascripts/user.js
new file mode 100644
index 000000000..7c7189066
--- /dev/null
+++ b/public/javascripts/user.js
@@ -0,0 +1,238 @@
+$(function(){
+ if($(".top_new").length==0){
+ $("#RSide").css("min-height",$("#LSide").height()-30);
+ }
+ else{
+ $("#RSide").css("min-height",$("#LSide").height()-87);
+ }
+
+});
+
+//个人动态
+$(function(){
+
+ function init_editor(params){
+ var editor = params.kindutil.create(params.textarea, {
+ resizeType : 1,minWidth:"1px",width:"100%",height:"80px",
+ items:['emoticons'],
+ afterChange:function(){//按键事件
+ nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
+ },
+ afterCreate:function(){
+ var toolbar = $("div[class='ke-toolbar']",params.div_form);
+ $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
+ params.toolbar_container.append(toolbar);
+ }
+ }).loadPlugin('paste');
+ return editor;
+ }
+
+ function nh_check_field(params){
+ var result=true;
+ 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();
+ 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 init_form(params){
+ params.form.submit(function(){
+ var flag = false;
+ if(params.form.attr('data-remote') != undefined ){
+ flag = true
+ }
+ var is_checked = nh_check_field({
+ issubmit:true,
+ content:params.editor,
+ contentmsg:params.contentmsg,
+ textarea:params.textarea
+ });
+ if(is_checked){
+ if(flag){
+ return true;
+ }else{
+ $(this)[0].submit();
+ return false;
+ }
+ }
+ return false;
+ });
+ }
+ function nh_reset_form(params){
+ params.form[0].reset();
+ params.textarea.empty();
+ if(params.editor != undefined){
+ params.editor.html(params.textarea.html());
+ }
+ params.contentmsg.hide();
+ }
+
+ KindEditor.ready(function(K){
+ $("a[nhname='reply_btn']").live('click',function(){
+ var params = {};
+ params.kindutil = K;
+ params.container = $(this).parent('div');
+ params.div_form = $("div[nhname='div_form']",params.container);
+ params.form = $("form",params.div_form);
+ params.textarea = $("textarea[name='user_notes']",params.div_form);
+ params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
+ params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
+ params.cancel_btn = $("a[nhname='cancel_btn']",params.div_form);
+ params.submit_btn = $("a[nhname='submit_btn']",params.div_form);
+ if(params.textarea.data('init') == undefined){
+ params.editor = init_editor(params);
+ init_form(params);
+ params.cancel_btn.click(function(){
+ nh_reset_form(params);
+ toggleAndSettingWordsVal(params.div_form, params.textarea);
+ });
+ params.submit_btn.click(function(){
+ params.form.submit();
+ });
+ params.textarea.data('init',1);
+ }
+ params.cancel_btn.click();
+ setTimeout(function(){
+ if(!params.div_form.is(':hidden')){
+ params.textarea.show();
+ params.textarea.focus();
+ params.textarea.hide();
+ }
+ },300);
+
+ });
+
+ $("div[nhname='new_message']").each(function(){
+ var params = {};
+ params.kindutil = K;
+ params.div_form = $(this);
+ params.form = $("form",params.div_form);
+ if(params.form==undefined || params.form.length==0){
+ return;
+ }
+ params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
+ params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
+ params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
+ params.cancel_btn = $("#new_message_cancel_btn");
+ params.submit_btn = $("#new_message_submit_btn");
+
+ if(params.textarea.data('init') == undefined){
+ params.editor = init_editor(params);
+ init_form(params);
+ params.cancel_btn.click(function(){
+ nh_reset_form(params);
+ });
+ params.submit_btn.click(function(){
+ params.form.submit();
+ });
+ params.textarea.data('init',1);
+ $(this).show();
+ }
+ });
+ });
+});
+function init_list_more_div(params){
+ var p=params;
+ p.exbtn.click(function(){
+ var isclose = p.container.data('isclose');
+ var hasmore = p.container.data('hasmore');
+ if(isclose == '1'){
+ $("div[nhname='rec']",p.container).show();
+ p.container.data('isclose','0');
+ change_status_4_list_more_div(params);
+ return;
+ }
+ if(hasmore == '0'){
+ change_status_4_list_more_div(params,'get');
+ return;
+ }
+ var url = p.container.data('url');
+ if($("div[nhname='rec']",p.container).length > 0){
+ var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id');
+ url += "?lastid="+lastid;
+ var lasttime = $("div[nhname='rec']",p.container).filter(':last').data('time');
+ if(lasttime != undefined){
+ url += "&lasttime="+lasttime;
+ }
+ }
+ $.ajax( {url:url,dataType:'text',success:function(data){
+ var html = $("
"+data+"
");
+ var lens = $("div[nhname='rec']",html).length;
+ if(lens < p.size){
+ p.container.data('hasmore','0');
+ }
+ if(lens>0){
+ var currpage = parseInt(p.container.data('currpage'))+1;
+ p.container.data('currpage',currpage);
+ p.container.append(html.html())
+ }
+ change_status_4_list_more_div(params,'get');
+ p.div.show();
+ }} );
+ });
+ p.clbtn.click(function(){
+ var i=0;
+ $("div[nhname='rec']",p.container).each(function(){
+ i++;
+ if(i> p.size){
+ $(this).hide();
+ }
+ });
+ p.container.data('isclose','1');
+ change_status_4_list_more_div(params);
+ });
+ p.exbtn.click();
+}
+function change_status_4_list_more_div(params,opt){
+ var p=params;
+ if($("div[nhname='rec']",p.container).length == 0 && opt != 'get'){
+ p.exbtn.click();
+ return;
+ }
+ var show_lens = $("div[nhname='rec']",p.container).length - $("div[nhname='rec']",p.container).filter(':hidden').length;
+ if( show_lens > p.size ){
+ p.clbtn.show();
+ }else{
+ p.clbtn.hide();
+ }
+ if($("div[nhname='rec']",p.container).length == 0){
+ p.exbtn.html(p.nodatamsg);
+ }else if( p.container.data('hasmore') == '1' || p.container.data('isclose')=='1' ){
+ p.exbtn.html('点击展开更多');
+ }else{
+ p.exbtn.html('没有更多了');
+ }
+}
+function init_list_more_div_params(div){
+ var params = {};
+ params.div = div;
+ params.container = $("div[nhname='container']",div);
+ params.exbtn = $("a[nhname='expand']",div);
+ params.clbtn = $("a[nhname='close']",div);
+ params.size = params.container.data('pagesize');
+ params.nodatamsg = params.container.data('nodatamsg');
+ if( params.size == undefined ){
+ params.size = 13;
+ }
+ return params;
+}
+$(function(){
+ $("div[nhname='list_more_div']").each(function(){
+ var params = init_list_more_div_params($(this));
+ init_list_more_div(params)
+ });
+});
+//个人动态 end
\ No newline at end of file
diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css
index 30e6594f5..7c3dad383 100644
--- a/public/stylesheets/users.css
+++ b/public/stylesheets/users.css
@@ -8,7 +8,7 @@
.icon_female{ background:url(../images/pic_uersall.png) 0 -24px no-repeat; width:15px; height:15px;}
.pf_intro{ width:222px; margin-top:5px; color:#696969;word-break: break-all; }
.leftbox{ width:230px; padding:10px; padding-right:0px; padding-bottom:5px;background:#fff; margin-bottom:10px; margin-right:10px;}
-.pic_members{ background:url(../images/pic_users.jpg) 0 0 no-repeat; display:block; width:38px; height:38px; border:1px solid #e9edf0; margin-right:5px; margin-bottom:5px;float:left;}
+.pic_members{ display:block; width:38px; height:38px; border:1px solid #e9edf0; margin-right:5px; margin-bottom:5px;float:left;}
.pic_members:hover{border:1px solid #c9c9c9;}
/*新建*/
.top_new{ height:26px; border-bottom:10px solid #eaebed; padding:10px; background:#fff; float:left; margin-left:10px; width:730px; }
@@ -89,7 +89,7 @@ a.select_btn_select{ background:#64bddb; color:#fff;}
.users_ctt input,.users_ctt select,.users_ctt textarea{ border:1px solid #CCC;}
.users_ctt input,.users_ctt select,.users_ctt option{ height:26px;}
.users_ctt input,.users_ctt textarea{ margin-left:2px;}
-.users_ctt textarea{ margin-bottom:none;}
+/*.users_ctt textarea{ margin-bottom:nor;}*/
.w450{ width:450px;}
.w210{ width:200px;}
.w70{ width:70px;}
@@ -124,4 +124,12 @@ a:hover.c_lgrey{ color:#3ca5c6;}
.newhwork_div textarea{border:1px solid #CCC;}
.w460{ width:460px;}
-a.hidepic>img{display:none;}
\ No newline at end of file
+a.hidepic>img{display:none;}
+
+div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
+span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
+span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )}
+div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
+span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
+span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
+div.ke-toolbar .ke-outline{border:none;}
\ No newline at end of file
From 6a9cb0db5d51ca5c996f13849a1d94291267b867 Mon Sep 17 00:00:00 2001
From: huang
Date: Tue, 28 Jul 2015 17:17:52 +0800
Subject: [PATCH 032/146] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E9=99=84=E4=BB=B6?=
=?UTF-8?q?=E5=8F=AA=E8=83=BD=E7=94=A8=E6=88=B7=E8=87=AA=E5=B7=B1=E6=9C=AC?=
=?UTF-8?q?=E8=BA=AB=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../attachments/_project_file_links.html.erb | 56 +++++++++++--------
1 file changed, 33 insertions(+), 23 deletions(-)
diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb
index b6d934c64..b644fb9fa 100644
--- a/app/views/attachments/_project_file_links.html.erb
+++ b/app/views/attachments/_project_file_links.html.erb
@@ -29,32 +29,32 @@
<% is_float ||= false %>
<% for attachment in attachments %>
-
- <%if is_float%>
-
- <% end%>
-
+
+ <%if is_float%>
+
+ <% end%>
+
<% if options[:length] %>
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%>
<% else %>
- <%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%>
+
<% end %>
- <%if is_float%>
-
- <% end%>
+ <%if is_float%>
+
+ <% end%>
- <% if attachment.is_text? %>
- <%= link_to image_tag('magnifier.png'),
- :controller => 'attachments',
- :action => 'show',
- :id => attachment,
- :filename => attachment.filename%>
- <% end %>
+ <% if attachment.is_text? %>
+ <%= link_to image_tag('magnifier.png'),
+ :controller => 'attachments',
+ :action => 'show',
+ :id => attachment,
+ :filename => attachment.filename%>
+ <% end %>
- <%= h(" - #{attachment.description}") unless attachment.description.blank? %>
-
+ <%= h(" - #{attachment.description}") unless attachment.description.blank? %>
+
(
<%= number_to_human_size attachment.filesize %>)
@@ -66,6 +66,16 @@
:class => 'delete delete-homework-icon',
:remote => true,
:title => l(:button_delete) %>
+ <% elsif attachment.container_type == 'Issue' %>
+ <% if User.current == attachment.author %>
+ <%= 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) %>
+ <% end %>
<% else %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:data => {:confirm => l(:text_are_you_sure)},
@@ -89,13 +99,13 @@
<% end %>
- <% if defined?(thumbnails) && thumbnails %>
- <% images = attachments.select(&:thumbnailable?) %>
- <% if images.any? %>
+ <% if defined?(thumbnails) && thumbnails %>
+ <% images = attachments.select(&:thumbnailable?) %>
+ <% if images.any? %>
<% images.each do |attachment| %>
<%= thumbnail_issue_tag(attachment) %>
<% end %>
- <% end %>
- <% end %>
+ <% end %>
+ <% end %>
From a0a5f3410847752d2c28c535a801976558046546 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 29 Jul 2015 10:07:00 +0800
Subject: [PATCH 033/146] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BB=A5=E5=89=8D?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E5=8D=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/poll_controller.rb | 31 +++++++++++++++++++++
app/views/poll/_poll_form.html.erb | 43 +++++++++++++++++++++++++++++-
app/views/poll/_show_head.html.erb | 3 +++
3 files changed, 76 insertions(+), 1 deletion(-)
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 8f81bc2c6..dda5b81b2 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -336,6 +336,37 @@ class PollController < ApplicationController
end
end
+
+ def import_poll
+ @poll = Poll.find(params[:to_id])
+ question_num = @poll.poll_questions.select("max(question_number) question_number").first.question_number
+ import_poll = Poll.find(params[:import_id])
+ import_poll.poll_questions.each_with_index do |question,index|
+ option = {
+ :is_necessary => question.is_necessary,
+ :question_title => question.question_title,
+ :question_type => question.question_type,
+ :question_number => question_num + index+1
+ }
+ poll_questions = @poll.poll_questions.new option
+ for i in 1..question.poll_answers.count
+ answer = question.poll_answers[i-1][:answer_text]
+ question_option = {
+ :answer_position => i,
+ :answer_text => answer
+ }
+ poll_questions.poll_answers.new question_option
+ end
+ @poll.poll_questions << poll_questions
+ end
+ if @poll.save
+ @poll = Poll.find(params[:to_id])
+ respond_to do |format|
+ format.js
+ end
+ end
+ end
+
#重新发布问卷
def republish_poll
@poll.poll_questions.each do |poll_question|
diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb
index d784edab3..c5c016583 100644
--- a/app/views/poll/_poll_form.html.erb
+++ b/app/views/poll/_poll_form.html.erb
@@ -3,6 +3,7 @@
diff --git a/public/javascripts/project.js b/public/javascripts/project.js
index 98c148372..c7a615ba3 100644
--- a/public/javascripts/project.js
+++ b/public/javascripts/project.js
@@ -491,3 +491,8 @@ function judgeprojectname(){
}
});
}
+
+//用户反馈
+function submitProjectFeedback() {
+ $("#project_feedback_form").submit();
+}
\ No newline at end of file
From e4e99df1135f721da79932e481098af835b687d8 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 29 Jul 2015 17:41:10 +0800
Subject: [PATCH 040/146] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E7=95=99=E8=A8=80=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=BB=A5?=
=?UTF-8?q?=E5=8F=8A=E7=95=99=E8=A8=80=E7=9A=84=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_jours_new.html.erb | 53 +++++++++++++
app/views/users/user_newfeedback.html.erb | 91 +++++------------------
app/views/words/destroy.js.erb | 7 +-
public/javascripts/user.js | 1 -
public/stylesheets/public.css | 1 +
public/stylesheets/users.css | 17 +++--
6 files changed, 86 insertions(+), 84 deletions(-)
create mode 100644 app/views/users/_user_jours_new.html.erb
diff --git a/app/views/users/_user_jours_new.html.erb b/app/views/users/_user_jours_new.html.erb
new file mode 100644
index 000000000..81bbce319
--- /dev/null
+++ b/app/views/users/_user_jours_new.html.erb
@@ -0,0 +1,53 @@
+
+
+ <%= link_to image_tag(url_to_avatar(jour.user),:width => '46',:height => '46'), user_path(jour.user),:class => "users_pic fl" %>
+
+
+ <%= link_to "#{jour.user.login} : ".html_safe, user_path(jour.user),:class => 'fl c_blue02 f14 fb mb5', :target => "_blank"%>
+
+
+
+ <%= jour.notes.html_safe %>
+
+
+
+ <%= time_tag(jour.created_on).html_safe %>
+
+
+ <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %>
+ <% if User.current.admin? || jour.user == User.current%>
+ <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => jour, :user_id => jour.user},
+ :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "ml5 c_purple", :title => l(:button_delete)) %>
+ <% end %>
+
+
+
+
+ <% fetch_user_leaveWord_reply(jour).each do |reply|%>
+
+ <% parent_jour = JournalsForMessage.where("id = #{reply.m_reply_id}").first %>
+
+ <%= link_to image_tag(url_to_avatar(reply.user),:width => '32',:height => '32'), user_path(reply.user),:class => "users_pic_sub fl mr5" %>
+
+ <%= link_to "#{reply.user.login} : ".html_safe, user_path(reply.user),:class => 'course_name fl c_blue02 ', :target => "_blank"%>
+
回复:
+ <%= link_to "#{parent_jour.user.login} : ".html_safe, user_path(parent_jour.user),:class => 'course_name fl c_blue02 mr5 ', :target => "_blank"%>
+
+ <%= reply.notes.html_safe %>
+
+
+
+ <%= time_tag(reply.created_on).html_safe%>
+
+
+ <%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %>
+ <% if User.current.admin? || reply.user == User.current%>
+ <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
+ :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "c_purple ml5", :title => l(:button_delete)) %>
+ <% end %>
+
+
+
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb
index de0bfbd60..52fc0aaa2 100644
--- a/app/views/users/user_newfeedback.html.erb
+++ b/app/views/users/user_newfeedback.html.erb
@@ -1,82 +1,27 @@
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
用户留言
-
-
表情
-
取消
-
发布
+
+
-
-
-
-
黄井泉 :
-
上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。回复 删除
-
-
50分钟前
-
-
-
-
-
-
30分钟前
-
-
-
-
-
-
-
50分钟前
-
-
-
-
-
-
黄井泉 :
-
上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。上周交代的bug修改完成。回复 删除
-
-
50分钟前
-
-
-
-
-
30分钟前
-
-
-
-
-
-
-
50分钟前
-
-
-
-
-
-
+ <%if @jour%>
+ <% @jour.each do |jour|%>
+ <%= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
+ <%end%>
+ <% end%>
+
+
\ No newline at end of file
diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb
index 92e15ab93..c138a7ea7 100644
--- a/app/views/words/destroy.js.erb
+++ b/app/views/words/destroy.js.erb
@@ -2,9 +2,10 @@
alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
<% if @is_user%>
- $("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove();
- var params = init_list_more_div_params($("#nh_messages"));
- change_status_4_list_more_div(params);
+ var destroyedItem = $('#<%=@journal_destroyed.id%>');
+ destroyedItem.fadeOut(600,function(){
+ destroyedItem.remove();
+ });
<% else %>
<% if @bid && @jours_count %>
$('#jours_count').html("<%= @jours_count %>");
diff --git a/public/javascripts/user.js b/public/javascripts/user.js
index 7c7189066..9ad3d1588 100644
--- a/public/javascripts/user.js
+++ b/public/javascripts/user.js
@@ -10,7 +10,6 @@ $(function(){
//个人动态
$(function(){
-
function init_editor(params){
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"80px",
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index d0893ca3d..c1e47c787 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -87,6 +87,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mt10{ margin-top:10px;}
.mt30{ margin-top: 30px;}
.mb5{ margin-bottom:5px;}
+.mb8{ margin-bottom:8px;}
.mb10{ margin-bottom:10px;}
.mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;}
diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css
index 3e17f1f7b..bdc6db47c 100644
--- a/public/stylesheets/users.css
+++ b/public/stylesheets/users.css
@@ -24,12 +24,14 @@ a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; dis
a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; }
.inputUsers_message{ border:1px solid #d2d2d2; width:718px; height:48px; color:#666; padding:5px; margin-bottom:5px;}
.inputUsers_message02{ border:1px solid #d2d2d2; width:618px; height:26px; color:#666; padding:5px; margin-bottom:5px; }
-.message_list_box{ background:#f5f5f5; padding:10px;}
-.users_pic{ width:27px; height:27px; border:1px solid #e3e3e3;}
+.message_list_box{ background:#f5f5f5; padding:10px;margin-top: 10px;}
+.users_pic{ width:46px; height:46px; border:1px solid #e3e3e3;}
.users_pic:hover{ border:1px solid #a5a5a5;}
+.users_pic_sub{width:32px; height:32px; border:1px solid #e3e3e3;}
+.users_pic_sub:hover{ border:1px solid #a5a5a5;}
.massage_txt{ max-width:360px; color: #666;word-break:break-all;}
.massage_time{ color:#8d8d8d; margin-top:5px;}
-.message_list{ border-bottom:1px dashed #c9c9c9; padding-bottom:10px; margin-bottom:10px;}
+.message_list{ border-bottom:1px dashed #c9c9c9; margin-bottom:10px;color: #5f5f5f;}
.message_list_more{ text-align:center; width:720px;}
/*课程动态*/
.line_box{ width:728px; border:1px solid #d9d9d9; padding-bottom:10px;}
@@ -124,9 +126,9 @@ a:hover.c_lgrey{ color:#3ca5c6;}
.newhwork_div textarea{border:1px solid #CCC;}
.w460{ width:460px;}
/* 留言新增*/
-.mes_box{ width:600px;}
-.mes_box02{ margin-left:80px; border-top:1px dashed #c9c9c9; padding-top:10px;}
-.mes_box02_info{ width:500px; margin-left:5px;}
+.mes_box{ width:590px;}
+.mes_box02{ margin-left:50px; border-top:1px dashed #c9c9c9; padding-top:10px;margin-bottom: 10px;}
+.mes_box02_info{ width:540px; margin-left:5px;}
.users_r_top{ width:730px; height:40px; background:#eaeaea; margin-bottom:10px;}
.users_r_h2{background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;}
@@ -139,4 +141,5 @@ span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
-div.ke-toolbar .ke-outline{border:none;}
\ No newline at end of file
+div.ke-toolbar .ke-outline{border:none;}
+.cr{clear: right;}
\ No newline at end of file
From 9bcc633d19c34f0497c64f5467bcdef4d0995388 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 29 Jul 2015 17:56:40 +0800
Subject: [PATCH 041/146] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B7=BB=E5=8A=A0tag?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BC=BA=E9=99=B7=201=E3=80=81=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0ajax=E8=87=AA=E8=BA=AB=E5=88=B7=E6=96=B0=202=E3=80=81?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/tags/_project_tag.html.erb | 17 +++--------
app/views/tags/_tag_project_new_name.html.erb | 30 +++++++++++++++++++
app/views/tags/remove_tag.js.erb | 3 ++
app/views/tags/tag_save.js.erb | 4 +++
4 files changed, 41 insertions(+), 13 deletions(-)
create mode 100644 app/views/tags/_tag_project_new_name.html.erb
diff --git a/app/views/tags/_project_tag.html.erb b/app/views/tags/_project_tag.html.erb
index ce80e36ab..408f3ba1d 100644
--- a/app/views/tags/_project_tag.html.erb
+++ b/app/views/tags/_project_tag.html.erb
@@ -1,15 +1,6 @@
-
- <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
+
-<% if User.current.logged?%>
-
<%= l(:label_add_tag)%>
-
- <%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
- <%= f.text_field :name ,:id => "tags_name",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
- <%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
- <%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
-
- <% end %>
-
-<% end%>
diff --git a/app/views/tags/_tag_project_new_name.html.erb b/app/views/tags/_tag_project_new_name.html.erb
new file mode 100644
index 000000000..e657071bc
--- /dev/null
+++ b/app/views/tags/_tag_project_new_name.html.erb
@@ -0,0 +1,30 @@
+<% @tags = obj.reload.tag_list %>
+<% if non_list_all && @tags.size > 0 %>
+
+<% else %>
+
+ <% if @tags.size > 0 %>
+ <% @tags.each do |tag| %>
+
+ <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
+
+ <%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
+
+
+ <% end %>
+ <% end %>
+<% end %>
+
+<% if User.current.logged?%>
+
<%= l(:label_add_tag)%>
+
+ <%= form_for "tag_for_save",:remote => true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
+ <%= f.text_field :name ,:id => "tags_name2",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
+ <%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
+ <%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
+
+ <% end %>
+
+<% end%>
+
+
diff --git a/app/views/tags/remove_tag.js.erb b/app/views/tags/remove_tag.js.erb
index b8c65c13e..cd56fef1a 100644
--- a/app/views/tags/remove_tag.js.erb
+++ b/app/views/tags/remove_tag.js.erb
@@ -2,6 +2,9 @@
<% if @object_flag == '3'%>
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
+<% elsif @object_flag == '2'%>
+$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
+ :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
<% elsif @object_flag == '6'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name',
diff --git a/app/views/tags/tag_save.js.erb b/app/views/tags/tag_save.js.erb
index 74a38c99d..992c472ed 100644
--- a/app/views/tags/tag_save.js.erb
+++ b/app/views/tags/tag_save.js.erb
@@ -4,6 +4,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
+<% elsif @obj_flag == '2'%>
+$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
+ :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
+$('#tags_name2').val("");
<% elsif @obj_flag == '6'%>
<%if @course%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
From d790fb31e497198d906dab090a59eb2a797dfdae Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 29 Jul 2015 18:00:35 +0800
Subject: [PATCH 042/146] =?UTF-8?q?=E5=8C=BF=E5=90=8D=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E4=B8=8D=E5=8F=AF=E5=9C=A8=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E7=95=99=E8=A8=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/words_controller.rb | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 161791954..4b99224ca 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -4,7 +4,7 @@ class WordsController < ApplicationController
include ApplicationHelper
before_filter :find_user, :only => [:new, :create, :destroy, :more, :back]
def create
- if params[:new_form][:user_message].size>0
+ if params[:new_form][:user_message].size>0 && User.current.logged?
unless params[:user_id].nil?
if params[:reference_content]
message = params[:new_form][:user_message] + "\n" + params[:reference_content]
@@ -31,9 +31,7 @@ class WordsController < ApplicationController
# @jour = paginateHelper @jours,10
respond_to do |format|
- # format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
format.js
- #format.api { render_api_ok }
end
end
From ce89c7d1191dcc79b8ef6f49fa7af60b8c40f8f6 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 29 Jul 2015 18:26:04 +0800
Subject: [PATCH 043/146] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=95=99=E8=A8=80?=
=?UTF-8?q?=E5=90=8E=E7=95=8C=E9=9D=A2=E7=9A=84=E5=88=B7=E6=96=B0=EF=BC=8C?=
=?UTF-8?q?=E7=95=99=E8=A8=80=E7=9A=84=E5=88=86=E9=A1=B5=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/words_controller.rb | 20 ++++++++++----------
app/views/users/_user_jours_new.html.erb | 1 +
app/views/users/user_newfeedback.html.erb | 21 +++++++++++++--------
config/routes.rb | 1 +
4 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 4b99224ca..fc723d5d5 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -18,17 +18,10 @@ class WordsController < ApplicationController
list = User.find(refer_user_id).add_jour(User.current, message, refer_user_id)
end
@jour = list.last
- # @user.count_new_jour
- # if a_message.size > 5
- # @message = a_message[-5, 5]
- # else
- # @message = a_message
- # end
- # @message_count = a_message.count
end
end
- # @jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse
- # @jour = paginateHelper @jours,10
+ jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
+ @jour = paginateHelper jours,10
respond_to do |format|
format.js
@@ -91,7 +84,6 @@ class WordsController < ApplicationController
end
respond_to do |format|
format.js
- #format.api { render_api_ok }
end
end
@@ -204,7 +196,15 @@ class WordsController < ApplicationController
flash[:error] = feedback.errors.full_messages[0]
redirect_to project_feedback_url(params[:id])
end
+ end
+ #给用户留言
+ def leave_user_message
+ @user = User.find(params[:id])
+ if params[:new_form][:user_message].size>0 && User.current.logged? && @user
+ @user.add_jour(User.current, params[:new_form][:user_message])
+ end
+ redirect_to feedback_path(@user)
end
# add by nwb
diff --git a/app/views/users/_user_jours_new.html.erb b/app/views/users/_user_jours_new.html.erb
index 81bbce319..7aa9d97ff 100644
--- a/app/views/users/_user_jours_new.html.erb
+++ b/app/views/users/_user_jours_new.html.erb
@@ -15,6 +15,7 @@
<%= link_to l(:button_reply),'javascript:void(0);',:nhname=>"reply_btn", :class => "ml5 c_purple" %>
+
<% if User.current.admin? || jour.user == User.current%>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => jour, :user_id => jour.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "ml5 c_purple", :title => l(:button_delete)) %>
diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb
index 52fc0aaa2..d594e47e4 100644
--- a/app/views/users/user_newfeedback.html.erb
+++ b/app/views/users/user_newfeedback.html.erb
@@ -5,22 +5,27 @@
-
-
-
-
- 取消
- 留言
-
+ <%= form_for('new_form',:url => leave_user_message_path(@user.id),:method => "post") do |f|%>
+
+
+
+
取消
+
留言
+ <% end%>
-
+
<%if @jour%>
<% @jour.each do |jour|%>
<%= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
<%end%>
<% end%>
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
+
diff --git a/config/routes.rb b/config/routes.rb
index 7c1096303..1536340da 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -791,6 +791,7 @@ RedmineApp::Application.routes.draw do
match 'words/:id/leave_project_message', :to => 'words#leave_project_message'
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
+ post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message"
post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin'
From 206d1a38f7484d50a0273da56001902643679948 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 30 Jul 2015 09:07:11 +0800
Subject: [PATCH 044/146] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=E7=BC=BA=E9=99=B7=E5=BC=82=E5=B8=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/project.css | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index fa1bec754..621e0c556 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -74,7 +74,11 @@ a:hover.problem_pic{border:1px solid #64bdd9;}
.issues_icon{ background:url(../images/public_icon.png) 0 -342px no-repeat; width:16px; height:21px;}
.problem_txt{ width:600px; margin-left:10px; color:#777777; }
.pro_txt_w{width:610px;}
-a.problem_name{ color:#ff5722; }
+a.problem_name{ color:#ff5722;max-width: 80px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
a:hover.problem_name{ color:#d33503;}
a.problem_tit{ color:#0781b4; max-width:430px; font-weight:bold; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
a.problem_tit02{ color:#0781b4; font-weight:bold;max-width:400px;}
From 023f51260a2cee67fa1e4bc83e7f5fe74d4d7eb1 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 30 Jul 2015 09:12:43 +0800
Subject: [PATCH 045/146] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=95=8C=E9=9D=A2js=E5=88=B7=E6=96=B0?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=97=B6=E5=80=99=E7=BB=99=E5=87=BA?=
=?UTF-8?q?=E7=AD=89=E5=BE=85=E7=9A=84=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_users_new.html.erb | 3 +++
public/stylesheets/users.css | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb
index ec2c18602..70106e4a3 100644
--- a/app/views/layouts/base_users_new.html.erb
+++ b/app/views/layouts/base_users_new.html.erb
@@ -269,6 +269,9 @@
<%= render :partial => 'layouts/new_feedback' %>
+
+ <%= l(:label_loading) %>
+
diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css
index bdc6db47c..649ce1255 100644
--- a/public/stylesheets/users.css
+++ b/public/stylesheets/users.css
@@ -126,7 +126,7 @@ a:hover.c_lgrey{ color:#3ca5c6;}
.newhwork_div textarea{border:1px solid #CCC;}
.w460{ width:460px;}
/* 留言新增*/
-.mes_box{ width:590px;}
+.mes_box{ width:580px;}
.mes_box02{ margin-left:50px; border-top:1px dashed #c9c9c9; padding-top:10px;margin-bottom: 10px;}
.mes_box02_info{ width:540px; margin-left:5px;}
.users_r_top{ width:730px; height:40px; background:#eaeaea; margin-bottom:10px;}
From 51a7044e057ecf112d710e2736dbf464dd15b456 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 30 Jul 2015 09:20:54 +0800
Subject: [PATCH 046/146] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E7=95=99=E8=A8=80=E5=9B=BE=E7=89=87=E6=9C=80=E5=A4=A7=E5=AE=BD?=
=?UTF-8?q?=E5=BA=A6=E4=B8=BA100%?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/user_newfeedback.html.erb | 2 +-
public/stylesheets/public_new.css | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb
index d594e47e4..f9573f65e 100644
--- a/app/views/users/user_newfeedback.html.erb
+++ b/app/views/users/user_newfeedback.html.erb
@@ -15,7 +15,7 @@
-