diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index f797c7a2f..32cd4d197 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -66,15 +66,17 @@ class BoardsController < ApplicationController 'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)" @topic_count = @board.topics.count - @topic_pages = Paginator.new @topic_count, per_page_option, params['page'] - @topics = @board.topics. + #@topic_pages = paginateHelper @board.topics,10 + #@topic_pages = Paginator.new @topic_count, per_page_option, params['page'] + board_topics = @board.topics. reorder("#{Message.table_name}.sticky DESC"). includes(:last_reply). - limit(@topic_pages.per_page). - offset(@topic_pages.offset). + # limit(@topic_pages.per_page). + # offset(@topic_pages.offset). order(sort_clause). preload(:author, {:last_reply => :author}). all + @topics = paginateHelper board_topics,10 @message = Message.new(:board => @board) #modify by nwb if @project diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index d2a253c2a..b72cb9218 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -76,6 +76,13 @@ class MessagesController < ApplicationController layout_file = @project ? 'base_projects' : 'base_courses' render :action => 'new', :layout => layout_file end + else + respond_to do |format| + format.html { + layout_file = @project ? 'base_projects' : 'base_courses' + render :layout => layout_file + } + end end end diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index e00121d97..617e56575 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -68,15 +68,15 @@ class NewsController < ApplicationController elsif @course if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) scope = @course ? @course.news.course_visible : News.course_visible - scope_page = paginateHelper scope,10 + @news_count = scope.count #@news_pages = Paginator.new @news_count, @limit, params['page'] #@offset ||= scope_page.offset - @newss = scope_page.all(:include => [:author, :course], + scope_order = scope.all(:include => [:author, :course], :order => "#{News.table_name}.created_on DESC") # :offset => @offset, # :limit => @limit) - + @newss = paginateHelper scope_order,10 respond_to do |format| format.html { @news = News.new diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index b2089d629..bfe600131 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -38,7 +38,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> -<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()" %> +<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn" %> <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', @@ -52,7 +52,7 @@ :upload_path => uploads_path(:format => 'js'), :description_placeholder => l(:label_optional_description) } %> -<%= l(:label_no_file_uploaded)%> +<%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index eac85e2d7..7ddb4eb9c 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -26,10 +26,11 @@ -
- <%=h @board.name %> +
+

<%= l(:label_board_plural) %>

+ <% if !User.current.logged?%>
<%= l(:label_user_login_course_board) %> @@ -37,71 +38,35 @@
<% end %> - -
- - 共有 - <%=link_to @topic_count,:controller => 'boards',:action => 'index' %> - 个贴子 - - - <%= link_to l(:label_message_new), - new_board_message_path(@board), - :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.logged? %> - +
+

<%= l(:label_totle) %><%= @topic_count %><%= l(:label_course_momes_count) %>

+ <%= link_to l(:label_message_new), + new_board_message_path(@board), + :class => 'problem_new_btn fl c_dorange' if User.current.logged? %> +
-
<% if @topics.any? %> <% @topics.each do |topic| %> - - - - - -
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %> - - - - - - - - -
- <%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %> - - - - - - - - -
- <%=link_to (topic.replies_count), board_message_path(@board, topic) %> -
- 回答 -
-
- - <%= authoring topic.created_on, topic.author %> -
-
-
-
+
+ <%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %> +
+ <%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s,:class => "problem_tit fl fb c_dblue" %> + 置顶 +

由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %>

+
+ <%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %> + +
+
<% end %> - <% else %>

<%= l(:label_no_data) %>

<% end %> -
- + <% other_formats_links do |f| %> <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <% end %> diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 50e943eaa..680bafb46 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -1,10 +1,7 @@ -
+
<%# reply_allow = JournalsForMessage.create_by_user? User.current %> - -

- <%= l(:label_user_response) %> -

+

<%= l(:label_leave_message) %>

<% if !User.current.logged?%>
@@ -13,20 +10,14 @@
<% else %> -
<%= form_for('new_form', :method => :post, :url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%> <%= f.text_area 'course_message',:id => "leave_meassge", :rows => 3, :cols => 65, - :placeholder => "#{l(:label_welcome_my_respond)}", - :style => "resize: none; width: 98%", - :class => 'noline',:maxlength => 250%> - - <%= l(:button_leave_meassge)%> - + :placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250%> + 取  消 + <%= l(:button_leave_meassge)%> <% end %> -
<% end %> -
@@ -34,5 +25,4 @@
    <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> -
-
\ No newline at end of file + \ No newline at end of file diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index 555e94f6d..23d4909d9 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -1,16 +1,13 @@ <% reply_allow = JournalsForMessage.create_by_user? User.current %> - -
-
<% if journals.size > 0 %> <% for journal in journals %>
-
+
@@ -26,7 +23,7 @@
<% ids = 'project_respond_form_'+ journal.id.to_s%> - + <% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %> <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, @@ -38,31 +35,28 @@ {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %> <% end %> - - - <%= l(:label_bids_published) %>  - <%= time_tag(journal.created_on).html_safe %>  - <%= l(:label_bids_published_ago) %> -
-
+
+ <% ids = 'project_respond_form_'+ journal.id.to_s%> <% if reply_allow %>
- <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %> + <%= render :partial => 'words/new_respond_course', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
<% end %> -
-
- <%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %> -
+
+ + <%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true, :allow_delete => @course && User.current.allowed_to?(:as_teacher,@course)} %> +
<% end %> <% end %> -
-
diff --git a/app/views/courses/feedback.html.erb b/app/views/courses/feedback.html.erb index ccd171679..b7713c4a9 100644 --- a/app/views/courses/feedback.html.erb +++ b/app/views/courses/feedback.html.erb @@ -1,5 +1,8 @@ <% reply_allow = JournalsForMessage.create_by_user? User.current %> -<%= stylesheet_link_tag 'css', :media => 'all' %> + +
+

用户留言

+
<%= render :partial => 'courses_jours', :locals => { :contest => @contest, :journals => @jour, :state => false} @@ -21,7 +24,7 @@ function setMaxLength() { } function setMaxLengthItem(textarea){ if (textarea.getAttribute('maxlength')) { - var counter = document.createElement('div'); + var counter = document.createElement('span'); counter.className = 'counter'; var counterClone = counter.cloneNode(true); counterClone.innerHTML = '0/'+textarea.getAttribute('maxlength'); diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index 001519a28..d36ff2bd6 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -22,7 +22,7 @@
- + <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', @@ -37,10 +37,9 @@ :description_placeholder => l(:label_optional_description) } %> - \ No newline at end of file diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index ac7a23232..ac02342ed 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -48,7 +48,7 @@ <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% end %> <% if is_course_teacher(User.current,@course) %> - 上传资源 + 上传资源 <% end %>
@@ -56,8 +56,11 @@
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@curse_attachments} %>
+
+ <%= render :partial => 'upload_show',:locals => {:course => @course}%> +
+
123
- <% html_title(l(:label_attachment_plural)) -%> \ No newline at end of file diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index 91d050d93..bc7fc9030 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -1,4 +1,7 @@ -
+ +
+
+

<%= l(:label_upload_files)%>

@@ -8,8 +11,8 @@ <%= render :partial => 'attachement_list',:locals => {:course => course} %>
- <%= l(:button_confirm)%> - <%= l(:button_cancel)%> + <%= l(:button_cancel)%> + <%= l(:button_confirm)%> <% end %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 8ee4f323b..684765b9b 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -133,7 +133,7 @@