diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 36216530b..13ef9be5d 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -585,14 +585,18 @@ class BidsController < ApplicationController end def edit + @bid = Bid.find(params[:bid_id]) + if (User.current.admin?||User.current.id==@bid.author_id)&&(@bid.homework_type == 1) @project_id = params[:project_id] - @bid = Bid.find(params[:bid_id]) respond_to do |format| format.html { @project = Project.find(params[:project_id]) @user= User.find(User.current.id) render :layout => 'base_courses' } + end + else + render 403 end end diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 7baaafaf5..0f447d831 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -35,13 +35,15 @@ - - + diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index f993aa651..5b031bda1 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -149,15 +149,19 @@ -
+ <% if User.current.logged? %> + <% if User.current.admin?||User.current.login==@user.login%> +
-
-
- <%= render :partial => 'tags/tag', :locals => {:obj => @user,:object_flag => "1"}%> +
+
+ <%= render :partial => 'tags/tag', :locals => {:obj => @user,:object_flag => "1"}%> +
-
+ <% end %> + <% end %> diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb index 0ed34e84c..e57371f33 100644 --- a/app/views/projects/_course_form.html.erb +++ b/app/views/projects/_course_form.html.erb @@ -10,21 +10,15 @@ <% end %>

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %>

-

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>

- <%= f.fields_for @course do |m| %> - - -

<%= m.text_field :password, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %>

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

课程名: + <%= link_to(@bid.courses.first.name, project_path(@bid.courses.first)) %>
作业名:<%= h @bid.name %> + <%= h @bid.name %> +
+ <%= f.fields_for @course do |m| %> + +

<% unless @course.nil? %> <% if @course.time == 2008 %>

@@ -227,10 +221,12 @@ <% end %> <% end %>
<%= l(:label_term) %> *  

- - - -<% end %> + + +

<%= m.text_field :password, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %>

+ <%= l(:text_command) %> + <% end %> +

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>

<%= f.check_box :is_public, :style => "margin-left:10px;" %>

<%= f.text_field :project_type, :value => 1 %>

diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index ef1cedd4a..c3d0cb4b5 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -2,11 +2,10 @@ <% if object_flag == '3' %> - <%= image_tag("/images/sidebar/tags.png") %> + <%= image_tag("/images/sidebTar/tags.png") %> <%= l(:label_tag) %>: - <% if User.current.logged? %> - <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %> + <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %> <% end %>