parent
64f36f2c9d
commit
56e5e55589
|
@ -43,7 +43,7 @@ class ProjectsController < ApplicationController
|
|||
|
||||
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise]
|
||||
before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
|
||||
:statistics, :feedback, :course, :enterprise_course, :course_enterprise]
|
||||
:statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond]
|
||||
before_filter :authorize_global, :only => [:new, :create]
|
||||
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
||||
#by young
|
||||
|
|
|
@ -4,6 +4,12 @@ class TestController < ApplicationController
|
|||
|
||||
|
||||
def index
|
||||
# @users = User.where('status = ?', 1)
|
||||
# for user in @users
|
||||
# if user.user_extensions.nil?
|
||||
# UserExtensions.create(:user_id => user.id)
|
||||
# end
|
||||
# end
|
||||
|
||||
# @message = Message.all
|
||||
# @message.each do |m|
|
||||
|
|
|
@ -54,7 +54,8 @@ class UsersController < ApplicationController
|
|||
helper :words
|
||||
#added by young
|
||||
def user_projects
|
||||
@memberships = @user.memberships.all(:conditions => Project.visible_condition(User.current))
|
||||
cond = Project.visible_condition(User.current) + "AND projects.project_type <> 1"
|
||||
@memberships = @user.memberships.all(:conditions => cond)
|
||||
|
||||
events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20)
|
||||
@events_by_day = events.group_by(&:event_date)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
include AvatarHelper
|
||||
module ProjectsHelper
|
||||
def link_to_version(version, options = {})
|
||||
return '' unless version && version.is_a?(Version)
|
||||
|
|
|
@ -218,7 +218,8 @@
|
|||
<td class="info" style="width: 10px">
|
||||
<%= select_tag 'identity', "<option value = '0'>#{l(:label_teacher)}</option>
|
||||
<option value = '1'>#{l(:label_student)}</option>
|
||||
<option value = '2'>#{l(:label_other)}</option>".html_safe %></td></tr></table></p>
|
||||
<option value = '2'>#{l(:label_enterprise)}</option>
|
||||
<option value = '3'>#{l(:label_developer)}</option> ".html_safe %></td></tr></table></p>
|
||||
|
||||
|
||||
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_gender) %></strong></td>
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
<tr>
|
||||
<td><span class="font_lighter"><%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<strong><%= link_to bid.biding_projects.count, project_for_bid_path(bid) %></strong>) </span><span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span><span class="font_lighter"> <%= l(:label_x_followers, :count => bid.watcher_users.count) %>(<strong><%= link_to bid.watcher_users.count, respond_path(bid) %></strong>)</span></td>
|
||||
</tr>
|
||||
<% unless bid.courses.empty? %>
|
||||
<% teacher = Course.find_by_extra(bid.courses.first.identifier).teacher %>
|
||||
<tr>
|
||||
<td><span class="font_lighter">课程名称:<%= link_to bid.courses.first.name, project_path(bid.courses.first)%> 教师:<%= link_to teacher.lastname+teacher.firstname, user_path(teacher) %></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</table></td>
|
||||
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
<!-- fq -->
|
||||
<!-- fq --> <!-- modified by bai -->
|
||||
<%= error_messages_for 'bid' %>
|
||||
<!--[form:project]-->
|
||||
<p><%= l(:label_homeworks_form_new_description) %></p>
|
||||
<p>选择课程<%= select_tag 'course', course_options_for_select(@courses) %></p>
|
||||
|
||||
<!-- modified by bai -->
|
||||
<p style="margin-left:-68px;padding-right: 20px;"><strong><%= l(:label_choose_course) %><span class="required"> * </span></strong><%= select_tag 'course', course_options_for_select(@courses) %></p>
|
||||
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :value => @bid.name %></p>
|
||||
<!-- end -->
|
||||
|
||||
<p style="margin-left:-10px;padding-right: 20px;">
|
||||
<%= f.text_area :description, :rows => 8, :value => @bid.description, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!-- fq -->
|
||||
<h3><%=l(:label_new_call)%></h3>
|
||||
<h3><%=l(:label_course_homework_new)%></h3>
|
||||
|
||||
<%= labelled_form_for @bid, :url => {:controller => 'bids', :action => 'create_fork', :id => @bid.id} do |f| %>
|
||||
<div class="box tabular">
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
<td valign="center"><% if User.current.logged? %>
|
||||
|
||||
<!-- <div class='icon icon-add'> -->
|
||||
|
||||
<% unless @project_type == '1' %>
|
||||
<%= link_to(l(:label_new_call), {:controller => 'bids', :action => 'new_bid'}, :class => 'icon icon-add') %>
|
||||
|
||||
<% end %>
|
||||
<!-- <%= toggle_link l(:label_new_call), 'put-bid-form', {:focus => 'project_id'} %> -->
|
||||
<!-- </div> -->
|
||||
<% end %></td>
|
||||
|
|
|
@ -38,7 +38,18 @@
|
|||
<% @course = Course.find_by_extra(@project.identifier)%>
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
|
||||
<td>
|
||||
<% if(@project.project_type==1)%>
|
||||
|
||||
<% if get_avatar?(@project)%>
|
||||
<%= link_to image_tag(url_to_avatar(@project), :class => "avatar2"), project_path(@project) %>
|
||||
<% else %>
|
||||
<%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(@project)%>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to image_tag(url_to_avatar(@project), :class => "avatar2") %>
|
||||
<% end %>
|
||||
<!--<%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %>--></td>
|
||||
<td align="center">
|
||||
<div class="info_font" style=" word-wrap: break-word; word-break: break-all">
|
||||
<%= @project.name %>
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<td style="padding-left: 8px" width="70px"><%= l(:field_occupation) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.occupation %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px"><%= l(:label_location) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.location %></td>
|
||||
<td style="padding-left: 8px" width="70px"><%= l(:label_location) %>:</td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= @user.user_extensions.location %><%= @user.user_extensions.location_city %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px" width="70px">
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
<!--Added by nie-->
|
||||
<div class="project-block">
|
||||
<div class="img-tag">
|
||||
<% if(@project.project_type==1)%>
|
||||
<% if get_avatar?(project)%>
|
||||
<%= link_to image_tag(url_to_avatar(project), :class => "avatar2"), project_path(project) %>
|
||||
<% else %>
|
||||
<%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(project)%>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%=link_to image_tag(url_to_avatar(project), :class => "avatar2"), project_path(project) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="wiki-description">
|
||||
<p>
|
||||
|
@ -39,6 +47,10 @@
|
|||
<% if @admin.size > 0 %>
|
||||
<%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>
|
||||
<% end %>
|
||||
<% if(@project.project_type==1)%>
|
||||
大学:
|
||||
<%= @admin.first.user.user_extensions.occupation %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="licences">
|
||||
<%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %>
|
||||
|
|
|
@ -8,9 +8,11 @@
|
|||
<tr>
|
||||
<td width="16%"><span style="margin-left:0px"><%= l(:label_new_course)%></span></td>
|
||||
<td valign="center">
|
||||
<% if User.current.logged?%>
|
||||
<% if User.current.user_extensions.identity == 0 %>
|
||||
<%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<td align="right">
|
||||
<div class="project-search">
|
||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||
|
|
|
@ -6,11 +6,16 @@
|
|||
</p>
|
||||
<% else %>
|
||||
<p class="font_description">
|
||||
<%= l(:label_project_course_unadd) %><%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1}, :class => 'icon icon-add' %>
|
||||
<%= l(:label_project_course_unadd) %>
|
||||
<% if User.current.user_extensions.identity == 0 %>
|
||||
<%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1}, :class => 'icon icon-add' %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if User.current.user_extensions.identity == 0 %>
|
||||
<%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1}, :class => 'icon icon-add' %>
|
||||
<% end %>
|
||||
<ul class="user_project_sort">
|
||||
<% for membership in @memberships %>
|
||||
<li>
|
||||
|
|
|
@ -1508,6 +1508,8 @@ zh:
|
|||
label_teacher_homework: 教师姓名
|
||||
label_student: 学生
|
||||
label_other: 其他
|
||||
label_enterprise: 企业
|
||||
label_developer: 开发者
|
||||
label_gender: 性别
|
||||
label_gender_male: 男
|
||||
label_gender_female: 女
|
||||
|
@ -1519,6 +1521,9 @@ zh:
|
|||
label_main_term: 课程学期
|
||||
label_teacher_work_unit: 教师单位
|
||||
label_course_time: 课程年度
|
||||
label_i_new_activity: 有了新活动在
|
||||
label_choose_course: 选择课程
|
||||
|
||||
#end
|
||||
|
||||
label_course: 课程
|
||||
|
|
|
@ -466,7 +466,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'calls/:id/set_reward',:controller => 'bids',:action => 'set_reward',:as => 'set_reward'
|
||||
|
||||
## 测试用
|
||||
# match 'test/index', :controller => 'test', :action => 'index'
|
||||
match 'test/index', :controller => 'test', :action => 'index'
|
||||
# added by young
|
||||
match 'calls', :controller => 'bids', :action => 'index'
|
||||
|
||||
|
|
|
@ -223,8 +223,9 @@ end
|
|||
|
||||
Redmine::MenuManager.map :top_enterprise_menu do |menu|
|
||||
menu.push :home, :home_path
|
||||
menu.push :projects, { :controller => 'projects', :action => 'index', :project_type => 0 }, :caption => :label_project_plural
|
||||
menu.push :requirement, {:controller => 'bids', :action => 'index', :project_type => 0 }
|
||||
menu.push :projects, { :controller => 'projects', :action => 'index', :project_type => 0 }, :caption => :label_project_plural
|
||||
|
||||
menu.push :developer, {:controller => 'users', :action => 'index', :project_type => 0 }
|
||||
menu.push :college_into, {:controller=>'projects', :action=>'course_enterprise', :project_type => 1 }
|
||||
# menu.push :investor, :home_path
|
||||
|
|
Loading…
Reference in New Issue