From aa83609c9d3dce024f8150ca7e226eed89cd1642 Mon Sep 17 00:00:00 2001
From: gonglexin <18008490802@163.com>
Date: Mon, 20 Oct 2014 20:14:29 +0800
Subject: [PATCH 1/3] =?UTF-8?q?#759=20=E5=AE=8C=E5=96=84=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?-=E8=B5=84=E6=BA=90=E5=BA=93=20=E8=B5=84=E6=BA=90=E5=A4=A7?=
=?UTF-8?q?=E5=B0=8F,=20=E4=B8=8B=E8=BD=BD=E6=AC=A1=E6=95=B0=E5=8D=87?=
=?UTF-8?q?=E5=BA=8F=E9=99=8D=E5=BA=8F=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 2 +-
app/views/files/_course_show_all_attachment.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 89ad42c17..313afa1c7 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -113,7 +113,7 @@ class FilesController < ApplicationController
end
if order_by.count == 1
- sort += "#{Attachment.table_name}.#{attribute} desc "
+ sort += "#{Attachment.table_name}.#{attribute} asc "
elsif order_by.count == 2
sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} "
end
diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb
index 15ef36580..3ce583cb8 100644
--- a/app/views/files/_course_show_all_attachment.html.erb
+++ b/app/views/files/_course_show_all_attachment.html.erb
@@ -17,7 +17,7 @@
<%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %>
<%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %>
- <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype",:class => "tableth") %>
+ <%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%>
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %>
From 6e0c916246e7f821ee3f31fe30b5133174360c6f Mon Sep 17 00:00:00 2001
From: gonglexin <18008490802@163.com>
Date: Mon, 20 Oct 2014 22:50:49 +0800
Subject: [PATCH 2/3] =?UTF-8?q?#1026=20=E4=B8=8A=E4=BC=A0=E5=87=BA?=
=?UTF-8?q?=E7=8E=B0=E7=BD=91=E7=BB=9C=E9=97=AE=E9=A2=98=E6=97=B6=E7=BB=99?=
=?UTF-8?q?=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/views/files/_course_new.html.erb | 1 +
public/javascripts/attachments.js | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/app/views/files/_course_new.html.erb b/app/views/files/_course_new.html.erb
index 960b2d399..88c33d865 100644
--- a/app/views/files/_course_new.html.erb
+++ b/app/views/files/_course_new.html.erb
@@ -1,6 +1,7 @@
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index c20617ce5..1a1d11363 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -69,6 +69,10 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
})
.fail(function(result) {
progressSpan.text(result.statusText);
+ if($("#network_issue"))
+ {
+ $("#network_issue").show();
+ }
}).always(function() {
ajaxUpload.uploading--;
fileSpan.removeClass('ajax-loading');
From f15c870053363c922f0dcc267bc99b774d3ab385 Mon Sep 17 00:00:00 2001
From: z9hang
Date: Tue, 21 Oct 2014 10:40:03 +0800
Subject: [PATCH 3/3] =?UTF-8?q?1=E3=80=81=E4=BB=A3=E7=A0=81=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E3=80=822=E3=80=81=E9=A1=B9=E7=9B=AE=E6=96=B0?=
=?UTF-8?q?=E5=BB=BA=E9=A1=B9=E7=9B=AE=E5=90=8E=E4=B8=AA=E4=BA=BA=E4=B8=BB?=
=?UTF-8?q?=E9=A1=B5=E4=B8=AD=E9=A1=B9=E7=9B=AEtab=E9=A1=B5=E7=82=B9?=
=?UTF-8?q?=E5=87=BB=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 6 +---
app/controllers/users_controller.rb | 2 +-
.../web_footer_companies_controller.rb | 2 --
app/views/admin/_tab_partial.html.erb | 8 ++++++
app/views/admin/contest_page_made.html.erb | 28 +------------------
app/views/admin/course_page_made.html.erb | 9 +-----
app/views/admin/first_page_made.html.erb | 9 +-----
app/views/admin/web_footer_made.html.erb | 9 +-----
app/views/layouts/base_courses.html.erb | 7 -----
app/views/messages/_form.html.erb | 28 ++++++-------------
app/views/news/_project_show.html.erb | 2 +-
config/routes.rb | 3 +-
12 files changed, 26 insertions(+), 87 deletions(-)
create mode 100644 app/views/admin/_tab_partial.html.erb
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index f3b8b421a..fb6c2e8fe 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -217,21 +217,17 @@ class AdminController < ApplicationController
if request.get?
@contest_page = FirstPage.find_by_page_type('contest')
@first_page = FirstPage.find_by_page_type('project')
- @notification = ContestNotification.first;
elsif request.post?
@first_page = FirstPage.find_by_page_type('project')
@contest_page = FirstPage.find_by_page_type('contest')
- @notification = ContestNotification.first;
@first_page.web_title = params[:web_title]
@contest_page.web_title = params[:web_title]
@contest_page.title = params[:contest_title]
@contest_page.image_width = params[:image_width]
@contest_page.image_height = params[:image_height]
@contest_page.description = params[:contest_description]
- @notification.title = params[:contest_notification_title]
- @notification.content = params[:contest_notification][:content]
- if @first_page.save && @contest_page.save && @notification.save
+ if @first_page.save && @contest_page.save
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 21adfa19e..7e6e3d04a 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -33,7 +33,7 @@ class UsersController < ApplicationController
before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info,
:user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
- :activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities]
+ :activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index]
#edit has been deleted by huang, 2013-9-23
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
:user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
diff --git a/app/controllers/web_footer_companies_controller.rb b/app/controllers/web_footer_companies_controller.rb
index 4c5748e40..b61a58189 100644
--- a/app/controllers/web_footer_companies_controller.rb
+++ b/app/controllers/web_footer_companies_controller.rb
@@ -20,7 +20,6 @@ class WebFooterCompaniesController < ApplicationController
redirect_to web_footer_companies_url
else
flash[:error] = "#{l :web_footer_company_create_fail}: #{@company.errors.full_messages[0]}"
- new
render :action => 'new'
end
end
@@ -42,7 +41,6 @@ class WebFooterCompaniesController < ApplicationController
redirect_to web_footer_companies_url
else
flash[:error] = "#{l :web_footer_company_update_fail}: #{@company.errors.full_messages[0]}"
- edit
render :action => 'edit'
end
end
diff --git a/app/views/admin/_tab_partial.html.erb b/app/views/admin/_tab_partial.html.erb
new file mode 100644
index 000000000..86191fdb5
--- /dev/null
+++ b/app/views/admin/_tab_partial.html.erb
@@ -0,0 +1,8 @@
+
+
+ - <%= link_to l(:label_project_first_page), {:action => 'first_page_made'}, class: "#{current_page?(first_page_made_path)? 'selected' : nil }" %>
+ - <%= link_to l(:label_course_first_page), {:action => 'course_page_made'}, class: "#{current_page?(course_page_made_path)? 'selected' : nil }" %>
+ - <%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'}, class: "#{current_page?(contest_page_made_path)? 'selected' : nil }" %>
+ - <%= link_to l(:label_web_footer_page), {:action => 'web_footer_made'}, class: "#{current_page?(web_footer_made_path)? 'selected' : nil }" %>
+
+
\ No newline at end of file
diff --git a/app/views/admin/contest_page_made.html.erb b/app/views/admin/contest_page_made.html.erb
index dab3b6885..a25f149ed 100644
--- a/app/views/admin/contest_page_made.html.erb
+++ b/app/views/admin/contest_page_made.html.erb
@@ -5,14 +5,7 @@
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
-
-
- - <%= link_to l(:label_project_first_page), {:action => 'first_page_made'} %>
- - <%= link_to l(:label_course_first_page), {:action => 'course_page_made'} %>
- - <%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} , :class => 'selected'%>
- - <%= link_to l(:label_web_footer_page),{:action => 'web_footer_made'} %>
-
-
+ <%= render 'tab_partial' %>
<%=l(:label_contest_first_page)%>
@@ -38,26 +31,7 @@
<%= text_area_tag 'contest_description',@contest_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
-
-
-
-
-
-
-
- <%= text_field_tag 'contest_notification_title', params[:label_contest_notification_title], :value => @notification.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
-
-
- <%= text_area 'contest_notification', 'content', :value => @notification.content,:cols => 80, :rows => 15, :class => 'wiki-edit' %>
- <%= wikitoolbar_for 'contest_notification_content' %>
-
-
-
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
<% end %>
diff --git a/app/views/admin/course_page_made.html.erb b/app/views/admin/course_page_made.html.erb
index aa99dc7cd..8b91e2600 100644
--- a/app/views/admin/course_page_made.html.erb
+++ b/app/views/admin/course_page_made.html.erb
@@ -5,14 +5,7 @@
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
-
-
- - <%= link_to l(:label_project_first_page), {:action => 'first_page_made'} %>
- - <%= link_to l(:label_course_first_page), {:action => 'course_page_made'}, :class => 'selected' %>
- - <%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} %>
- - <%= link_to l(:label_web_footer_page),{:action => 'web_footer_made'} %>
-
-
+ <%= render 'tab_partial' %>
<%=l(:label_course_first_page)%>
diff --git a/app/views/admin/first_page_made.html.erb b/app/views/admin/first_page_made.html.erb
index e4403457c..d8fbc0533 100644
--- a/app/views/admin/first_page_made.html.erb
+++ b/app/views/admin/first_page_made.html.erb
@@ -5,14 +5,7 @@
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
-
-
- - <%= link_to l(:label_project_first_page), {:action => 'first_page_made'}, :class => 'selected' %>
- - <%= link_to l(:label_course_first_page), {:action => 'course_page_made'} %>
- - <%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} %>
- - <%= link_to l(:label_web_footer_page),{:action => 'web_footer_made'} %>
-
-
+ <%= render 'tab_partial' %>
<%=l(:label_project_first_page)%>
diff --git a/app/views/admin/web_footer_made.html.erb b/app/views/admin/web_footer_made.html.erb
index 52f7cd5eb..65e77631c 100644
--- a/app/views/admin/web_footer_made.html.erb
+++ b/app/views/admin/web_footer_made.html.erb
@@ -5,14 +5,7 @@
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
-
-
- - <%= link_to l(:label_project_first_page), {:action => 'first_page_made'} %>
- - <%= link_to l(:label_course_first_page), {:action => 'course_page_made'} %>
- - <%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'}%>
- - <%= link_to l(:label_web_footer_page),{:action => 'web_footer_made'} , :class => 'selected' %>
-
-
+ <%= render 'tab_partial' %>
<%= link_to l(:label_cooperation_compnay), web_footer_companies_path %>
<%=l(:label_web_footer_page)%>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index bfb8d11d5..edc90f8cc 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -67,7 +67,6 @@
-
<%= link_to @course.name,course_path(@course) %> |
@@ -80,9 +79,6 @@
<% else %>
<%= join_in_course(@course, User.current) %>
<% end %>
- <%# unless User.current.member_of_course?(@course) %>
-
- <%# end %>
<% end %>
@@ -118,12 +114,10 @@
<%= link_to files_count, course_files_path(@course) %> |
-
<%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %>
|
<%= l(:label_x_base_courses_student, :count => studentCount(@course)) %>
-
|
<%= l(:label_x_course_data, :count => files_count) %>
@@ -168,7 +162,6 @@
<% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %>
|
<%= l(:label_teacher_work_unit) %> : |
-
<% else %>
diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb
index 2cfeea80e..eb0a7f53e 100644
--- a/app/views/messages/_form.html.erb
+++ b/app/views/messages/_form.html.erb
@@ -4,25 +4,15 @@
- <% unless replying %>
-
-
-
- <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :maxlength => 254 %>
-
- <% else %>
-
-
-
- <%= f.text_field :subject, :size => 60, :style => "width: 99%;", :id => "message_subject", :readonly => true %>
-
- <% end %>
+ <% extra_option = replying ? { readonly: true} : { maxlength: 254 } %>
+
+
+
+ <%= f.text_field :subject, { size: 60, style: "width: 99%;", id: "message_subject" }.merge(extra_option) %>
+
<% unless replying %>
<% if @message.safe_attribute? 'sticky' %>
diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb
index 7b4c209b0..70fca5e48 100644
--- a/app/views/news/_project_show.html.erb
+++ b/app/views/news/_project_show.html.erb
@@ -141,7 +141,7 @@
<%= format_time(comment.created_on) %>
- <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
+ <%= link_to_if_authorized image_tag('delete.png'), delete_news_comments_path(id: @news, comment: comment),
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:title => l(:button_delete) %>
diff --git a/config/routes.rb b/config/routes.rb
index 91f96bfb2..a20ab8ef6 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -460,7 +460,8 @@ RedmineApp::Application.routes.draw do
resources :news, :only => [:index, :show, :edit, :update, :destroy]
match '/news/:id/comments', :to => 'comments#create', :via => :post
- match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
+ #match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
+ delete '/news/:id/comments/:comment_id', :to => 'comments#destroy', as: :delete_news_comments
resources :versions, :only => [:show, :edit, :update, :destroy] do
post 'status_by', :on => :member
| |