From a3f444819ee34c9e00f1c796f5336100cc913a0e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 12 Sep 2016 10:52:43 +0800 Subject: [PATCH 01/45] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E5=A4=AA=E9=95=BF=E6=8E=92=E7=89=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 31 ++++++++++++++++-------------- public/stylesheets/css/project.css | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 4b188ecbb..443e8c426 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160907061917) do +ActiveRecord::Schema.define(:version => 20160907080621) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -56,10 +56,10 @@ ActiveRecord::Schema.define(:version => 20160907061917) do t.integer "user_id" t.integer "applied_id" t.string "applied_type" - t.integer "viewed", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "viewed" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "name" t.integer "applied_user_id" t.integer "role" @@ -157,13 +157,13 @@ ActiveRecord::Schema.define(:version => 20160907061917) do create_table "attachments", :force => true do |t| t.integer "container_id" t.string "container_type", :limit => 30 - t.string "filename", :default => "", :null => false - t.string "disk_filename", :default => "", :null => false - t.integer "filesize", :default => 0, :null => false + t.string "filename", :default => "", :null => false + t.string "disk_filename", :default => "", :null => false + t.integer "filesize", :default => 0, :null => false t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "", :null => false - t.integer "downloads", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false + t.string "digest", :limit => 40, :default => "", :null => false + t.integer "downloads", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false t.datetime "created_on" t.string "description" t.string "disk_directory" @@ -173,6 +173,7 @@ ActiveRecord::Schema.define(:version => 20160907061917) do t.integer "quotes" t.integer "is_publish", :default => 1 t.date "publish_time" + t.boolean "init_file", :default => false end add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" @@ -310,14 +311,16 @@ ActiveRecord::Schema.define(:version => 20160907061917) do add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false t.string "committer" - t.datetime "committed_on", :null => false + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" t.integer "user_id" + t.integer "project_id" + t.integer "type", :default => 0 end add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 454fce294..d2be2e16c 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -549,7 +549,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .merge-discussion-input textarea {width:720px; height:80px; font-size:13px; line-height:16px; color:#484848; padding:5px;} /*新版项目列表新增*/ -.new_project_title{ font-size:16px; color:#333; max-width:560px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } +.new_project_title{ font-size:16px; color:#333; max-width:480px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .icons_project_list{ width:8px; height:8px; border:2px solid #fff; background:#3b94d6;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;-webkit-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5); } .icons_project_favorite {background: url(/images/syllabus/sy_icons_star.png) 0px 0px no-repeat; width:20px; height:20px; display:block; float:left;} .icons_project_star{background: url(/images/syllabus/sy_icons_star.png) 0px -27px no-repeat; width:20px; height:20px; display:block; float:left;} From 22da03a1e068405957f5d8cc99a533a108ae85cd Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 13 Sep 2016 13:44:26 +0800 Subject: [PATCH 02/45] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=90=8E=E8=B7=B3=E5=85=A5=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=EF=BC=8C=E8=BF=9B=E5=85=A5=E5=88=AB=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=97=A0=E5=A7=93=E5=90=8D=E5=88=99=E8=B7=B3?= =?UTF-8?q?=E5=85=A5=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 29 ++++++++++++++------ public/assets/wechat/edit_userinfo.html | 8 +++++- public/javascripts/wechat/controllers/reg.js | 3 +- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 0c6eb0910..cd911bcd6 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -456,18 +456,29 @@ class WechatsController < ActionController::Base session[:wechat_openid] = open_id if params[:code] - # if params[:state].match("review_class_member") || params[:state].match("review_project_member") + if !(params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message") + uw = user_binded?(open_id) + if uw + user = uw.user + lastname = user.lastname + end + end + + if lastname && lastname == "" + @path = '/edit_userinfo' + else @path = params[:state].split('/')[0] useridstr = params[:state].split('/')[1] - # end - if useridstr - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}{useridstr}" and return - elsif params[:id] - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return - else - redirect_to "/wechat/user_activities##{@path}" and return + + if useridstr + redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}{useridstr}" and return + elsif params[:id] + redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return + else + redirect_to "/wechat/user_activities##{@path}" and return + end + # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return end - # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return end end render 'wechats/user_activities', layout: nil diff --git a/public/assets/wechat/edit_userinfo.html b/public/assets/wechat/edit_userinfo.html index e299b8feb..f4178fee4 100644 --- a/public/assets/wechat/edit_userinfo.html +++ b/public/assets/wechat/edit_userinfo.html @@ -11,7 +11,7 @@