diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 7d7861c16..aeaf19b49 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -715,13 +715,20 @@ class BidsController < ApplicationController end def add_homework - # homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id) - # homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads])) - @homework = HomeworkAttach.new - @homework.bid_id = @bid.id - @homework.user_id = User.current.id - @homework.save_attachments(params[:attachments]) - @homework.save + if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) + # homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id) + # homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads])) + @homework = HomeworkAttach.new + @homework.bid_id = @bid.id + @homework.user_id = User.current.id + @homework.save_attachments(params[:attachments]) + @homework.save + if @homework.attachments.empty? + @homework.delete + flash[:error] = l(:no_attachmens_allowed) + # else + end + end @homework_list = @bid.homeworks end diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 637ebaa38..74e776398 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -100,12 +100,12 @@ class BoardsController < ApplicationController end def edit + if @project.project_type == 1 + render :layout => 'base_courses' + end end def update - if @project.project_type ==1 - render :layout => 'base_courses' - end @board.safe_attributes = params[:board] if @board.save redirect_to_settings_in_projects diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb index a75374eb8..c082013b9 100644 --- a/app/views/layouts/base_contest.html.erb +++ b/app/views/layouts/base_contest.html.erb @@ -81,6 +81,35 @@ <% end %> + + + + +
<%=link_to "#{@bid.join_in_contests.count}",:controller => "bids", :action => "show_participator" %> | + +<%=link_to "#{@bid.projects.count}", :controller => 'bids', :action => 'show_project' %> | + + +
<%= l(:label_participator) %> | + +<%= l(:label_bidding_project) %> | + + +
<%= l(:lable_contest_user) %><%= link_to(@user.show_name, user_path(@user))%> | ||
<%=image_tag("/images/sidebar/tool_tag.png", weight:"15px", height:"15px") %> + + | <%=image_tag("/images/sidebar/tool_tag.png", weight:"15px", height:"15px") %> + <%= link_to l(:label_module_share) ,share_show_path(@project) %> + | +<%=image_tag("/images/sidebar/tool_tag.png", weight:"15px", height:"15px") %> + <%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %> + |
<%=image_tag("/images/sidebar/tool_tag.png", weight:"15px", height:"15px") %> - <%= link_to l(:label_project_tool_response) ,project_feedback_path(@project) %> - | ||
<%= l(:label_welcome_trustie) %> , <%= l(:label_welcome_trustie_description) %> |
<%= call_hook :view_account_login_top %>
<%= form_tag(signin_path) do %>
- <%= back_url_hidden_field_tag if is_logout? %>
- <% unless User.current.logged? %>
- <%= call_hook :view_account_login_bottom %>
+
+ <%= call_hook :view_account_login_bottom %>
<% if params[:username].present? %>
<%= javascript_tag "$('#password').focus();" %>
@@ -100,37 +100,78 @@
}
}
+<%= stylesheet_link_tag 'welcome' %>
+
-
-
-
-
+ <% end %>
<% end %>
- <% end %>
-
+
+
+
<%= image_tag(url_to_avatar(User.current), :class => 'avatar') %> |
+ <%= link_to l(:label_user_watcher)+"("+User.watched_by(User.current).count.to_s+")", user_path(User.current) %> 
+ <%=link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+User.current.watcher_users(User.current.id).count.to_s+")", user_path(User.current) %> |
+ <% unless User.current.memberships.empty? %>
+ <%= l(:label_x_welcome_participate, :count => User.current.memberships.count) %> <%= link_to User.current.memberships.count, {:controller => 'users', :action => 'user_projects', :id => User.current} %> <%= l(:label_welcome_participate_project)%>
+ <% end %>
+ |
+
+
+
+
+
+
+ 热门项目
+
+ This is a project!balabalabalabala...
+
+
+
+
+
+
+
+新手指引 & 问答
+
+
+ 新手入门指引帖 && FAQ bala... [ Trustie ]
+
+
|