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/12] =?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 8626692367c000423796af63273e166fe2c6651d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 13 Sep 2016 14:47:05 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=EF=BC=9A=E7=BC=96?= =?UTF-8?q?=E8=BE=91issue=E5=90=8E=E7=82=B9=E5=87=BB=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E5=8D=B4=E8=BF=98=E6=98=AF=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=9A=84=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_edit.html.erb | 2 +- app/views/issues/_jounal_refresh.js.erb | 7 +++++++ app/views/issues/update.js.erb | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index ccd37dc91..ea15af42e 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -3,7 +3,7 @@ <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <% end %> -<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true, :remote => true} do |f| %> +<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %> <%= error_messages_for 'issue', 'time_entry' %> <%= render :partial => 'conflict' if @conflict %> diff --git a/app/views/issues/_jounal_refresh.js.erb b/app/views/issues/_jounal_refresh.js.erb index db5a068bf..5ccbf69d2 100644 --- a/app/views/issues/_jounal_refresh.js.erb +++ b/app/views/issues/_jounal_refresh.js.erb @@ -1,3 +1,8 @@ +/* $("#reply_div_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue}) %>"); +$("#issue_detail_show").html('<%#= escape_javascript(render :partial => 'issues/detail') %>'); +$("#issue_edit_show").html('<%#= escape_javascript(render :partial => 'issues/edit') %>'); +$("#div_issue_attachment_<%#=@issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => @issue}) %>"); +sd_create_editor_from_data(<%#= @issue.id %>, null, "100%", "<%#= @issue.class.name %>");*/ location.reload(); issue_desc_editor = KindEditor.create('#issue_description', @@ -14,3 +19,5 @@ issue_desc_editor = KindEditor.create('#issue_description', "uploadJson":"/kindeditor/upload", "fileManagerJson":"/kindeditor/filemanager"}); // $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); +// $(".homepagePostReplyBannerCount").html('<%#= escape_javascript(render :partial => 'issues/issue_reply_banner') %>'); +// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%","<%#= @issue.class.name %>"); \ No newline at end of file diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb index 733066d38..bcf4c3077 100644 --- a/app/views/issues/update.js.erb +++ b/app/views/issues/update.js.erb @@ -1,4 +1,13 @@ <% if @saved %> +/*$("#issue_detail").replaceWith('<%#= escape_javascript(render :partial => 'issues/detail') %>'); +$("#issue_edit").replaceWith('<%#= escape_javascript(render :partial => 'issues/edit') %>'); + +$("#issue_detail").show(); +$("#issue_edit").hide(); + +$("#reply_div_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>"); +sd_create_editor_from_data(<%#= @issue.id%>, null, "100%","<%#=@issue.class.name%>"); +$(".homepagePostReplyBannerCount").html('<%#= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');*/ location.reload(); //edit里的编辑器貌似显示不出来,所以手动js生成。 issue_desc_editor = KindEditor.create('#issue_description', From 235554a104a6f327fbfb84369bb849145b90ed0f Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 13 Sep 2016 16:34:40 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=96=B0=E9=97=BB=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_newslist.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/users/_course_newslist.html.erb b/app/views/users/_course_newslist.html.erb index 87dbe6b95..961b2bfdf 100644 --- a/app/views/users/_course_newslist.html.erb +++ b/app/views/users/_course_newslist.html.erb @@ -23,7 +23,7 @@ <% if activity.sticky == 1 %> <% end%> - <% u = User.where("id=?",activity.author_id).first%> + <%# u = User.where("id=?",activity.author_id).first%>
@@ -31,9 +31,9 @@
- 发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> + 发布者: <%= activity.author.show_name %> - 更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %> + 更新:<%= format_time(activity.course_acts.first.try(:updated_at)) %> <% count=0 %> <% count=activity.comments.count %>

<%= count>0 ? "#{count}" : "0" %>回复|<%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %>

From f0d150ec47c3d059b7b3e01644df45dbdae5f54d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 13 Sep 2016 17:05:42 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E7=9A=84=E2=80=9C=E5=B8=AE=E5=8A=A9=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E2=80=9D=EF=BC=8C=E5=BC=B9=E6=97=A0=E6=95=88=E5=BC=B9?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/show.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index d684b4297..95059e21d 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -90,7 +90,7 @@
<%= reply.author.name%><%= format_date(reply.created_at) %>
-
<%= h reply.content.html_safe%>
+
<%= h reply.content.html_safe %>