From 782071ab64a23fa2df1acfbe3d05f50ec5681391 Mon Sep 17 00:00:00 2001 From: z9hang Date: Sat, 7 Mar 2015 15:36:00 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E7=94=A8=E9=97=AE=E9=A2=98=EF=BC=8Capp?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 4 ++++ app/services/courses_service.rb | 4 ++-- app/views/admin/mobile_version.html.erb | 3 +-- config/routes.rb | 1 + db/schema.rb | 19 +++++++------------ 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 69aae8008..c77ebe704 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -336,4 +336,8 @@ class AdminController < ApplicationController end + def create_version + + end + end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 22b7f8cd3..46b59ef08 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -158,9 +158,9 @@ class CoursesService #显示课程 - def show_course(params,currnet_user) + def show_course(params,current_user) course = Course.find(params[:id]) - unless (course.is_public == 1 || currnet_user.member_of_course?(@course)|| currnet_user.admin?) + unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?) raise '403' end {:course => course,:img_url => url_to_avatar(course),:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course)} diff --git a/app/views/admin/mobile_version.html.erb b/app/views/admin/mobile_version.html.erb index f8fd4ad6c..293b0ec46 100644 --- a/app/views/admin/mobile_version.html.erb +++ b/app/views/admin/mobile_version.html.erb @@ -2,9 +2,8 @@ 发布新版本
-

当前版本:
diff --git a/config/routes.rb b/config/routes.rb index b105dabc3..f867d1351 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -642,6 +642,7 @@ RedmineApp::Application.routes.draw do match 'admin/web_footer_made', as: :web_footer_made match 'admin/enterprise_page_made', as: :enterprise_page_made match 'admin/mobile_version', as: :mobile_version + match 'admin/create_version', as: :create_version match 'admin/search', :via => [:get, :post] match 'admin/plugins', :via => :get match 'admin/info', :via => :get diff --git a/db/schema.rb b/db/schema.rb index f4e6b09c7..bad1cf2ae 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,11 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -<<<<<<< HEAD ActiveRecord::Schema.define(:version => 20150305081132) do -======= -ActiveRecord::Schema.define(:version => 20150305011359) do ->>>>>>> 001b8bb1120fadea713d280e7d5bbabf7f5e57b8 create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -819,19 +815,18 @@ ActiveRecord::Schema.define(:version => 20150305011359) do t.integer "project_id" end -<<<<<<< HEAD - create_table "phone_app_versions", :force => true do |t| - t.string "version" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false -======= create_table "organizations", :force => true do |t| t.string "name" t.string "logo_link" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false ->>>>>>> 001b8bb1120fadea713d280e7d5bbabf7f5e57b8 + end + + create_table "phone_app_versions", :force => true do |t| + t.string "version" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "poll_answers", :force => true do |t| From 48ac3dbea8eb14c6dec361e541a35339b6414b80 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 7 Mar 2015 16:07:48 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=89=88--=E6=B3=A8=E5=86=8C=E6=97=B6=E8=BF=94?= =?UTF-8?q?=E5=9B=9E500=E9=94=99=E8=AF=AF=E3=80=8B=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=82=80=E8=AF=B7=E6=97=B6=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=8A=9F=E8=83=BD=20Signed-off-by:=20alan=20?= =?UTF-8?q?<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 2 +- app/controllers/projects_controller.rb | 10 +++++++++- app/views/projects/_invite_members_by_mail.html.erb | 3 +++ app/views/projects/_regested.html.erb | 3 +++ app/views/projects/send_mail_to_member.js.erb | 1 + config/locales/zh.yml | 1 + 6 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/views/projects/_regested.html.erb create mode 100644 app/views/projects/send_mail_to_member.js.erb diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 87c028354..2cf404ffb 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -125,7 +125,7 @@ class AccountController < ApplicationController #register_by_email_activation(@user) unless @user.new_record? flash[:notice] = l(:notice_account_register_done) - render action: 'email_valid', locals: {:mail => user.mail} + render action: 'email_valid', locals: {:mail => @user.mail} end when '3' #register_automatically(@user) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 6ab757336..052df384e 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -333,13 +333,21 @@ class ProjectsController < ApplicationController end def send_mail_to_member - unless params[:mail].nil? + + if !params[:mail].nil? && User.find_by_mail(params[:mail].to_s).nil? email = params[:mail] Mailer.send_invite_in_project(email, @project, User.current).deliver + @is_zhuce =false + else + @is_zhuce = true + end + respond_to do |format| + format.js end end #发送邮件邀请新用户 def invite_members_by_mail + @is_zhuce =false respond_to do |format| format.html format.js diff --git a/app/views/projects/_invite_members_by_mail.html.erb b/app/views/projects/_invite_members_by_mail.html.erb index 68ab6fae4..42a36bce0 100644 --- a/app/views/projects/_invite_members_by_mail.html.erb +++ b/app/views/projects/_invite_members_by_mail.html.erb @@ -4,6 +4,9 @@

发送邮件邀请新用户

输入好友邮箱地址,Trustie帮您免费发送!

+
+ <%= render :partial => 'regested', locals: { :isregisted => false} %> +
<%= form_tag('send_mail_to_member', :controller => 'projects',:action => 'send_mail_to_member', method: 'get',:remote=>true) do %>
-
- -
- -
+

    <%= l(:lable_bar_active)%> <%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> @@ -156,7 +118,7 @@ <%= link_to l(:label_more), forums_path %>

    - <% topics = find_new_forum_topics(6) %> + <% topics = find_new_forum_topics(12) %> <% topics.includes(:forum, :last_reply, :author).each do |topic|%>
  • From 3cac4336cd2a7b203d13f52de6297390c921fcbf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 7 Mar 2015 17:15:01 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E3=80=81=E9=A1=B9=E7=9B=AE=E3=80=81=E7=AB=9E=E8=B5=9B=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=90=9C=E7=B4=A2=E6=87=92=E4=B8=BA=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 1faa9227d..c6e303b00 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2274,6 +2274,17 @@ zh: # 托管平台主页 > 搜索提示信息 label_search_information: 请输入要搜索的关键字 + welcome: + search: + information: "请输入要搜索的关键字" # 搜索提示信息 + select: # 下拉列表 + project: "项目" + course: "课程" + user: "用户" + userinfo: + nickname: "昵称" + showname: "姓名" + email: "邮箱" # 托管平台主页 > 下拉列表 label_select_project: 项目 label_select_course: 课程 From b0897638d97cf80345e4815433dcee2509ad9b46 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 7 Mar 2015 17:20:33 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=BB=93=E6=9E=9C=E9=A1=B5=E9=9D=A2=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E6=A0=B7=E5=BC=8F=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/poll_result.html.erb | 4 +--- app/views/poll/show.html.erb | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/views/poll/poll_result.html.erb b/app/views/poll/poll_result.html.erb index a7cb415b3..47f3b179d 100644 --- a/app/views/poll/poll_result.html.erb +++ b/app/views/poll/poll_result.html.erb @@ -4,9 +4,7 @@

    <%= @poll.polls_name.empty? ? l(:label_poll_new) : @poll.polls_name %>

    -

    - <%= @poll.polls_description%> -

    + <%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
      diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index ae2691a91..ad10a5468 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -33,9 +33,7 @@

      <%= @poll.polls_name%>

      -

      - <%= @poll.polls_description.html_safe %> -

      + <%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>