浼佷笟鍚 *
diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb
index 101779297..b44d72b5f 100644
--- a/app/views/bids/_bid_homework_show.html.erb
+++ b/app/views/bids/_bid_homework_show.html.erb
@@ -4,7 +4,6 @@
鏆傛棤浣滀笟锛
<% else %>
<% bids.each do |bid|%>
-
<%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %>
@@ -14,6 +13,8 @@
<%= l(:label_user_create_project_homework) %>
<%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %>
+ <%# 鎻愪氦浣滀笟鎸夐挳 %>
+ <%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@project) %>
<% if (User.current.admin?||User.current.id==bid.author_id) %>
<%= link_to(
l(:button_edit),
@@ -29,7 +30,6 @@
) %>
<% end %>
-
@@ -61,7 +61,7 @@
<%= bid.description %>
-
+
<%= l(:label_create_time) %> : <%=format_time bid.created_on %> <%= l(:field_deadline) %> : <%=bid.deadline %>
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index bae83f14a..8e0c93a79 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -22,7 +22,7 @@
- <%= link_to homework.user, user_path(homework.user)%> 鎻愪氦浜嗕綔涓
+ <%= link_to homework.user, user_path(homework.user)%> 宸叉彁浜
diff --git a/app/views/bids/homework_ajax_modal.js.erb b/app/views/bids/homework_ajax_modal.js.erb
new file mode 100644
index 000000000..c95e4aad6
--- /dev/null
+++ b/app/views/bids/homework_ajax_modal.js.erb
@@ -0,0 +1,3 @@
+$('#OpenWindow-content').html(' <%=
+ j(render partial: "projects/homeworkupload", locals: {bid: @bid})
+ %>');
\ No newline at end of file
diff --git a/app/views/bids/show.html.erb b/app/views/bids/show.html.erb
index 46b05c292..aaa45c37a 100644
--- a/app/views/bids/show.html.erb
+++ b/app/views/bids/show.html.erb
@@ -14,7 +14,7 @@
<% else %>
<% end %>
- <%= @bid.description %>
+ <%= textilizable(@bid, :description) %>
<% if @bid.attachments.any?%>
<% options = {:author => true} %>
<%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %>
diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb
index 6de055d04..422f2dbd7 100644
--- a/app/views/layouts/_base_footer.html.erb
+++ b/app/views/layouts/_base_footer.html.erb
@@ -1,4 +1,5 @@
+
- <%=link_to request.host()+"/course", :controller => 'projects', :action => 'course' %>
+ <%=link_to request.host()+"/course", :controller => 'projects', :action => 'course' %>
<%=link_to "涓婚〉", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> > <%=link_to @project.name, nil %>
@@ -78,8 +79,8 @@
<%= render :partial => 'courses/set_course_time', :locals => {:project => @project}%>
<% else %>
- <%= join_in_course(@project, User.current) %>
- <% end %>
+ <%= join_in_course(@project, User.current) %>
+ <% end %>
<% unless User.current.member_of?(@project) %>
@@ -87,7 +88,7 @@
<%= watcher_link(@project, User.current) %>
<% end %>
<% end %>
-
+
@@ -232,8 +233,8 @@
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0))%>
-
<% end %>
+
<%= render_flash_messages %>
<%= yield %>
diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb
index 9f39d3762..aa60f3645 100644
--- a/app/views/layouts/base_homework.html.erb
+++ b/app/views/layouts/base_homework.html.erb
@@ -82,6 +82,9 @@
<%= l(:label_limit_time) %>: <%= @bid.deadline %>
+
+ 浣滀笟绫诲瀷: <%=@bid.homework_type==Bid::HomeworkFile ? "鎻愪氦鏂囦欢" : "鎻愪氦椤圭洰"%>
+
<% unless @bid.parent_id.nil?%>
diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb
index 232103273..2063528cc 100644
--- a/app/views/layouts/base_users.html.erb
+++ b/app/views/layouts/base_users.html.erb
@@ -78,7 +78,7 @@
<% user_changesets_score = user_changesets_count * 0.3 %>
<% finall_user_project_score = journals_score + user_changesets_score %>
- <% journals_for_messages_count = @user.journals_for_messages.count %>
+ <% journals_for_messages_count = @user.journals_messages.count %>
<% activities_count = @user.activities.count %>
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
<% activities_score = activities_count * 0.2 %>
diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb
index 391e6b956..6f7e5d5ef 100644
--- a/app/views/messages/show.html.erb
+++ b/app/views/messages/show.html.erb
@@ -104,7 +104,7 @@
<%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %>
- <% if !@topic.locked? && authorize_for('messages', 'reply') %>
+
@@ -172,7 +172,7 @@
-
+<% if !@topic.locked? && authorize_for('messages', 'reply') %>
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb
index 970e228e9..ed1bcacb5 100644
--- a/app/views/news/show.html.erb
+++ b/app/views/news/show.html.erb
@@ -25,8 +25,8 @@
- <%= @news.created_on %>
+ <%= format_time(comment.created_on) %>
<%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
diff --git a/app/views/projects/_course.html.erb b/app/views/projects/_course.html.erb
index 2ea16a3ce..f55a80db3 100644
--- a/app/views/projects/_course.html.erb
+++ b/app/views/projects/_course.html.erb
@@ -47,6 +47,7 @@
+ <% if @project.project_type==Project::ProjectType_course %>
<% if(course_endTime_timeout? @project) %>
璇剧▼瀛︽湡宸茬粨鏉
@@ -54,6 +55,7 @@
<% else %>
<%= join_in_course_for_list(@project, User.current,['regular'])%>
<% end -%>
+ <% end %>
diff --git a/app/views/projects/_homeworkupload.html.erb b/app/views/projects/_homeworkupload.html.erb
new file mode 100644
index 000000000..d5f4b90f5
--- /dev/null
+++ b/app/views/projects/_homeworkupload.html.erb
@@ -0,0 +1,23 @@
+
+<% if hadcommittedhomework(User.current.id, bid.id) %>
+
+ 浣滀笟宸茬粡鎻愪氦
+ <%= link_to "鏌ョ湅璇︽儏", project_for_bid_path(bid) %>
+
+
+<% elsif bid.reward_type==Bid::Homework &&
+ bid.homework_type==Bid::HomeworkFile %>
+ <%= render partial: 'projects/homeworkupload_homeworkfile', locals: {bid: bid} %>
+
+<% elsif bid.reward_type==Bid::Homework &&
+ bid.homework_type==Bid::HomeworkProject %>
+ <%= render partial: 'projects/homeworkupload_homeworkproject', locals: {bid: bid} %>
+
+
+<% else %>
+
+ Unkown Error
+ <%= link_to "鎴戣鍙嶉" , suggestion_send_path, target: '_blank' %>
+
+<% end -%>
+
diff --git a/app/views/projects/_homeworkupload_homeworkfile.html.erb b/app/views/projects/_homeworkupload_homeworkfile.html.erb
new file mode 100644
index 000000000..7bb91ffff
--- /dev/null
+++ b/app/views/projects/_homeworkupload_homeworkfile.html.erb
@@ -0,0 +1,17 @@
+<%= form_for HomeworkAttach.new,
+ :url => {:controller => 'bids', :action => 'add_homework', id: bid.id, back_url: homework_project_path(bid.try(:courses).try(:first)) },
+ :update => "bidding_project_list",
+ :complete => '$("#put-bid-form").hide();',
+ :html => {:multipart => true, :id => 'add_homework_form'} do |f| %>
+
+
+
+ 浣滀笟鏂囦欢涓婁紶
+
+
+ <%= render :partial => 'attachments/form' %>
+
+
+
+ <%= submit_tag l(:button_create), :onclick => "return true" %>
+<% end %>
diff --git a/app/views/projects/_homeworkupload_homeworkproject.html.erb b/app/views/projects/_homeworkupload_homeworkproject.html.erb
new file mode 100644
index 000000000..e269eb32b
--- /dev/null
+++ b/app/views/projects/_homeworkupload_homeworkproject.html.erb
@@ -0,0 +1,41 @@
+<%
+ membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
+ option = []
+ membership.each do |member|
+ unless(member.project.project_type==1)
+ member.member_roles.each{|role|
+ if(role.role_id == 3)
+ option << member.project
+ end
+ }
+ end
+ end
+ %>
+
+
\ No newline at end of file
diff --git a/app/views/projects/homework.html.erb b/app/views/projects/homework.html.erb
index 17c8b9efa..0f3d22130 100644
--- a/app/views/projects/homework.html.erb
+++ b/app/views/projects/homework.html.erb
@@ -1,3 +1,9 @@
+
+<%= javascript_include_tag 'attachments' %>
@@ -9,4 +15,45 @@
<%= render :partial => 'bids/bid_homework_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
+
+
diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb
index fd81c636e..4bc094f7e 100644
--- a/app/views/projects/index.html.erb
+++ b/app/views/projects/index.html.erb
@@ -10,7 +10,7 @@
<%= l(:label_user_location) %> :
<% if User.current.logged? %>
- <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
+ <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type =>( @project_type||=0)}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
<% end %>
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index a5f155058..c49b08b5d 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -27,7 +27,7 @@
- <%= h (truncate(e.event_description, :length => 240)) %>
+ <%= h(truncate(strip_tags(e.event_description).gsub(/ /,' '), length: 30, omission:'...')) %>
diff --git a/app/views/users/_activity_score_index.html.erb b/app/views/users/_activity_score_index.html.erb
index fd1947812..fa9aad180 100644
--- a/app/views/users/_activity_score_index.html.erb
+++ b/app/views/users/_activity_score_index.html.erb
@@ -1,10 +1,10 @@
-<% journals_for_messages_count = @user.journals_for_messages.count %>
+<% journals_for_messages_count = @user.journals_messages.count %>
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
<% activities_count = @user.activities.count %>
<% activities_score = activities_count * 0.2 %>
<% finall_activity_score = journals_for_messages_score + activities_score %>
-<%= l(:label_message_number) %> * 0.05 = <%= @user.journals_for_messages.count %> * 0.05 = <%= format("%.2f" , journals_for_messages_score).to_f %>
+<%= l(:label_message_number) %> * 0.05 = <%= @user.journals_messages.count %> * 0.05 = <%= format("%.2f" , journals_for_messages_score).to_f %>
<%= l(:label_activity_number) %> * 0.2 = <%= @user.activities.count %> * 0.2 = <%= format("%.2f" , activities_score).to_f %>
<%= l(:label_user_score_of_activity) %> = <%= format("%.2f" , journals_for_messages_score).to_f %> + <%= format("%.2f" , activities_score).to_f %>
= <%= format("%.2f" , finall_activity_score).to_f %>
diff --git a/app/views/users/_score_index.html.erb b/app/views/users/_score_index.html.erb
index 8c2f98541..814e9d9ec 100644
--- a/app/views/users/_score_index.html.erb
+++ b/app/views/users/_score_index.html.erb
@@ -9,7 +9,7 @@
<% user_changesets_score = user_changesets_count * 0.3 %>
<% finall_user_project_score = journals_score + user_changesets_score %>
-<% journals_for_messages_count = @user.journals_for_messages.count %>
+<% journals_for_messages_count = @user.journals_messages.count %>
<% activities_count = @user.activities.count %>
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
<% activities_score = activities_count * 0.2 %>
diff --git a/app/views/users/_show_score.html.erb b/app/views/users/_show_score.html.erb
index 7001f7a94..0297a4e02 100644
--- a/app/views/users/_show_score.html.erb
+++ b/app/views/users/_show_score.html.erb
@@ -11,7 +11,7 @@
<% user_changesets_score = user_changesets_count * 0.3 %>
<% finall_user_project_score = journals_score + user_changesets_score %>
-<% journals_for_messages_count = @user.journals_for_messages.count %>
+<% journals_for_messages_count = @user.journals_messages.count %>
<% activities_count = @user.activities.count %>
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
<% activities_score = activities_count * 0.2 %>
diff --git a/app/views/users/_user_show.html.erb b/app/views/users/_user_show.html.erb
index 71157d070..905265c8b 100644
--- a/app/views/users/_user_show.html.erb
+++ b/app/views/users/_user_show.html.erb
@@ -13,7 +13,7 @@
<% user_changesets_score = user_changesets_count * 0.3 %>
<% finall_user_project_score = journals_score + user_changesets_score %>
- <% journals_for_messages_count = user.journals_for_messages.count %>
+ <% journals_for_messages_count = user.journals_messages.count %>
<% activities_count = user.activities.count %>
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
<% activities_score = activities_count * 0.2 %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 6ce5e2095..541fa67ed 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -20,6 +20,8 @@
<% unless @activity.empty? %>
<% @activity.each do |e| %>
+ <%# 浠ヤ笅涓琛屼唬鐮佽В鍐虫湁鏈煡鐨勬椿鍔ㄦ棤娉曡浆鎹㈡垚Model鎶ラ敊%>
+ <% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next; ) if e.act_type.safe_constantize.nil? %>
<% act = e.act %>
<% unless act.nil? %>
diff --git a/app/views/users/user_projects.html.erb b/app/views/users/user_projects.html.erb
index 9d6c7e64e..6b218a97d 100644
--- a/app/views/users/user_projects.html.erb
+++ b/app/views/users/user_projects.html.erb
@@ -1,10 +1,6 @@
-娓╅Θ鎻愮ず锛氳繖閲屾樉绀虹殑鏄偍鍒涘缓鎴栧弬涓庣殑鎵鏈夐」鐩
-
-<% if @user == User.current %>
- <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
-<% end %>
-
+<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
+娓╅Θ鎻愮ず锛氶」鐩彲浠ユ槸涓娆′綔涓氾紝涔熷彲浠ユ槸鍒汉鎴栬呰嚜宸卞垱寤虹殑涓椤瑰皬宸ョ▼~
<%= watch_projects @state %>
<% unless @memberships.empty? %>
diff --git a/app/views/users/watch_projects.html.erb b/app/views/users/watch_projects.html.erb
index 137fc21fb..7842e6d52 100644
--- a/app/views/users/watch_projects.html.erb
+++ b/app/views/users/watch_projects.html.erb
@@ -1,9 +1,7 @@
-
娓╅Θ鎻愮ず锛氶」鐩彲浠ユ槸涓娆′綔涓氾紝涔熷彲浠ユ槸鍒汉鎴栬呰嚜宸卞垱寤虹殑涓椤瑰皬宸ョ▼~
-<% if @user == User.current %>
- <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
-<% end %>
+<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%>
+
娓╅Θ鎻愮ず锛氶」鐩彲浠ユ槸涓娆′綔涓氾紝涔熷彲浠ユ槸鍒汉鎴栬呰嚜宸卞垱寤虹殑涓椤瑰皬宸ョ▼~
<%= watch_projects @state%>
-<% if @watch_projects.nil?&&watch_projects.project.nil? %>
+<% if @watch_projects.count > 0 %>
<% for watch_project in @watch_projects %>
@@ -11,7 +9,7 @@
- <%= link_to_user(@user) if watch_project.respond_to?(:user) %> <%= @user.name%><%= l(:label_watch_project) %> <%= link_to_project(watch_project.project) %>
+ <%= link_to_user(@user) if watch_project.respond_to?(:user) %> <%= link_to_project(watch_project.project) %>
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index db1c1ea81..1f498fb5d 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -161,15 +161,15 @@
- 璇剧▼鎬婚噺: <%=@course.count%>
- 鏁欏笀鏁伴噺: <%=@teacher.count%>
+ 璇剧▼鎬婚噺: <%#=@course.count%>
+ 鏁欏笀鏁伴噺: <%#=@teacher.count%>
- 鐢ㄦ埛鎬婚噺: <%=User.count%>
- 瀛︾敓鏁伴噺: <%=@student.count%>
+ 鐢ㄦ埛鎬婚噺: <%#=User.count%>
+ 瀛︾敓鏁伴噺: <%#=@student.count%>
- 璧勬簮鎬婚噺: <%=Attachment.count%>
+ 璧勬簮鎬婚噺: <%#=Attachment.count%>
@@ -208,7 +208,16 @@
-
-
-
-
+
+
+
+
+ 褰撳墠缃戠珯鐘舵
+ 娲昏穬璇剧▼: <%=@courseCount%>
+ 楂樻牎锛 2涓
+ 鏁欏笀锛 <%=@teacherCount%> 鍚
+ 瀛︾敓锛 <%=@studentCount%> 鍚
+
+
+
+
\ No newline at end of file
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 0af3f5134..6c4cd3e6b 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -191,7 +191,7 @@
-
+
<%= link_to_attachments @news %>
@@ -74,7 +74,7 @@