From 73537a30cbd220d181c8dc0933b6913a63866664 Mon Sep 17 00:00:00 2001 From: chenmin <19763783@qq.com> Date: Wed, 20 Aug 2014 11:39:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BA=BA=E4=B8=8D=E8=83=BD=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA=E9=9D=9E=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E8=B5=84=E6=BA=90=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- app/views/messages/_project_show.html.erb | 4 ++-- db/schema.rb | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 44d68de26..c58cd3f82 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -79,7 +79,7 @@ class AttachmentsController < ApplicationController else candown = @attachment.is_public == 1 end - if candown || User.current.admin? + if candown || User.current.admin? || User.current.id == @attachment.author_id @attachment.increment_download if stale?(:etag => @attachment.digest) diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index 3bc9b6943..ad91c72f8 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -156,10 +156,10 @@ :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) if message.destroyable_by?(User.current) %> - + + -
<%= textAreailizable message,:content,:attachments => message.attachments %> diff --git a/db/schema.rb b/db/schema.rb index 7d908db6f..cdedc6a2c 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 => 20140814062455) do +ActiveRecord::Schema.define(:version => 20140812065417) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -448,14 +448,14 @@ ActiveRecord::Schema.define(:version => 20140814062455) do end create_table "forums", :force => true do |t| - t.string "name", :null => false - t.text "description" + t.string "name", :null => false + t.string "description", :default => "" t.integer "topic_count", :default => 0 t.integer "memo_count", :default => 0 t.integer "last_memo_id", :default => 0 - t.integer "creator_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "creator_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "groups_users", :id => false, :force => true do |t| From 9bd22b1b99592b646a72dd76d53b6d970bfa328e Mon Sep 17 00:00:00 2001 From: zhanghaitao <562681745@qq.com> Date: Wed, 20 Aug 2014 14:55:32 +0800 Subject: [PATCH 2/6] =?UTF-8?q?1.#1011=20=E5=BD=93=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=87=E7=AD=BE=E4=B8=BA=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E2=80=9C=E6=96=B0=E5=A2=9E=E2=80=9D=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=A2=AB=E6=8E=A9=E7=9B=96=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=202.=E8=AF=BE=E7=A8=8B=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEJS=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_resources_html.erb | 32 +++++++++++++++ app/views/tags/_tag.html.erb | 42 +++++--------------- 2 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 app/views/courses/_course_resources_html.erb diff --git a/app/views/courses/_course_resources_html.erb b/app/views/courses/_course_resources_html.erb new file mode 100644 index 000000000..8f706725d --- /dev/null +++ b/app/views/courses/_course_resources_html.erb @@ -0,0 +1,32 @@ +<% id = "course_resources_ul_" + obj.id.to_s%> + \ No newline at end of file diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index d6ea964b8..2e9b3d217 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -34,42 +34,18 @@
<% elsif object_flag == '6' %> - <%#= image_tag("/images/sidebar/tags.png") %> + <%#= image_tag("/images/sidebar/tags.png") %> <%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', :class => "tags_icona", :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %> - <%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %> + <%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %> -    -
- <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> -
- +    +
+ <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> +
+ <% else %> <%= image_tag("/images/sidebar/tags.png") %> From cc08cdc1400b495525bedeeebf376d066a6868b4 Mon Sep 17 00:00:00 2001 From: luguo Date: Wed, 20 Aug 2014 17:16:14 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=8B=E9=9D=A2=E7=9A=84=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E5=B8=A6=E6=A0=BC=E5=BC=8F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E5=B8=B8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_form.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/users/_course_form.html.erb b/app/views/users/_course_form.html.erb index 71a44f3c9..055dd7d6b 100644 --- a/app/views/users/_course_form.html.erb +++ b/app/views/users/_course_form.html.erb @@ -32,8 +32,9 @@

- <%= membership.course.short_description %> -

+ <%= textilizable membership.course.short_description %> +

+ From 66dfa1ce4f2dadcef019f15fa61f82d5b901bdf8 Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Thu, 21 Aug 2014 08:58:48 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=BB=E7=95=99=E8=A8=80=E5=88=86=E9=A1=B5?= =?UTF-8?q?Url=E9=94=99=E8=AF=AF=E5=92=8C=E9=A1=B5=E6=95=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 26 ++++++++++---- app/controllers/words_controller.rb | 29 +++++++++++++++ app/views/projects/feedback.html.erb | 8 +++-- app/views/words/_feedback.html.erb | 50 ++++++++++++++++++++++++++ app/views/words/destroyJournal.js.erb | 4 ++- 5 files changed, 107 insertions(+), 10 deletions(-) create mode 100644 app/views/words/_feedback.html.erb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ea37766b6..3fea454de 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -403,17 +403,29 @@ class ProjectsController < ApplicationController #Ended by young def feedback - page = params[:page] + @page = params[:page] + @page = @page.to_i # Find the page of the requested reply @jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') - @limit = 10 - if params[:r] && page.nil? - offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i]) - page = 1 + offset / @limit + @limit = 3 + + offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i]) + page = 1 + offset / @limit + if params[:r] && @page.nil? + @page = page end - + + puts @page + if @page < 0 + @page = 1 + end + if @page > page + @page = page + end + + @feedback_count = @jours.count - @feedback_pages = Paginator.new @feedback_count, @limit, page + @feedback_pages = Paginator.new @feedback_count, @limit, @page @offset ||= @feedback_pages.offset @jour = @jours[@offset, @limit] @state = false diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index af850d626..e31bb2738 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -90,8 +90,37 @@ class WordsController < ApplicationController end def destroyJournal + @journalP=JournalsForMessage.find(params[:object_id]) @journalP.destroy + + @page = params[:page] + @page = @page.to_i + @project = Project.find params[:project_id] + # Find the page of the requested reply + @jours = @project.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') + @limit = 3 + + offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i]) + page = 1 + offset / @limit + if params[:r] && @page.nil? + @page = page + end + + if @page < 0 + @page = 1 + end + if @page > page + @page = page + end + + @feedback_count = @jours.count + @feedback_pages = Paginator.new @feedback_count, @limit, @page + @offset ||= @feedback_pages.offset + @jour = @jours[@offset, @limit] + @state = false + @base_courses_tag = @project.project_type + respond_to do |format| format.js end diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb index 13e123b35..8e36b8c59 100644 --- a/app/views/projects/feedback.html.erb +++ b/app/views/projects/feedback.html.erb @@ -36,7 +36,8 @@ function checkMaxLength() { -<% reply_allow = JournalsForMessage.create_by_user? User.current %> + +

<%= l(:label_user_response) %>

@@ -59,6 +60,8 @@ function checkMaxLength() { <% end %>
+
+ <% reply_allow = JournalsForMessage.create_by_user? User.current %> <% if @jour.size >0 %>
\ No newline at end of file diff --git a/app/views/words/_feedback.html.erb b/app/views/words/_feedback.html.erb new file mode 100644 index 000000000..774ee3b64 --- /dev/null +++ b/app/views/words/_feedback.html.erb @@ -0,0 +1,50 @@ +<% reply_allow = JournalsForMessage.create_by_user? User.current %> +<% if @jour.size >0 %> + +<% end %> + + \ No newline at end of file diff --git a/app/views/words/destroyJournal.js.erb b/app/views/words/destroyJournal.js.erb index 5c91c6053..3600c3fd6 100644 --- a/app/views/words/destroyJournal.js.erb +++ b/app/views/words/destroyJournal.js.erb @@ -1,3 +1,5 @@ + <% if @journalP!=nil %> - $(".message-for-user").children("#word_li_<%=@journalP.id%>").remove(); + //$(".message-for-user").children("#word_li_<%#=@journalP.id%>").remove(); + $("#project_feedback").html("<%= escape_javascript(render :partial => 'words/feedback') %>"); <% end %> \ No newline at end of file From 075b43f836a3392666909dd0e5175efe0a4714ec Mon Sep 17 00:00:00 2001 From: luguo Date: Thu, 21 Aug 2014 09:18:10 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=89=88=E6=9D=83?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_footer.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index 990a6d3c8..46fc0debd 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -10,7 +10,7 @@ <%=l(:label_organizers)%> <%= link_to l(:label_organizers_information),"http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%> <%= link_to l(:label_organizers_information_institute), "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %> - <%=l(:label_copyright)%>@2007~2014 + <%=l(:label_copyright)%>©2007~2014 <%= link_to l(:label_contact_us),"http://" + Setting.host_name + "/projects/2/member", :target=>"_blank" %> <%= link_to l(:label_record),"http://www.miibeian.gov.cn/", :target => "_blank" %> From a328a934c8a1640dfccbeb0c088702393d4b5304 Mon Sep 17 00:00:00 2001 From: chenmin <19763783@qq.com> Date: Thu, 21 Aug 2014 09:22:34 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=8D=95=E4=B8=AA=E7=AB=9E=E8=B5=9B=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E3=80=81=E7=BC=96=E8=BE=91=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=9A=84=E6=98=BE=E7=A4=BAbug=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index b5e3e951c..34e254f3d 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -9,8 +9,8 @@ - - +
<%= @softapplication.name %> + <%= @softapplication.name %> <%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: {confirm: '您确定要删除吗?'} if @softapplication.destroyable_by? User.current %>  <%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %>