solve some little problem
This commit is contained in:
parent
805ad6600b
commit
3a6f055159
|
@ -15,13 +15,23 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
class ProjectsController < ApplicationController
|
||||
# if @project.project_type == 1
|
||||
layout 'base_projects'# by young
|
||||
menu_item :overview
|
||||
menu_item :roadmap, :only => :roadmap
|
||||
menu_item :settings, :only => :settings
|
||||
|
||||
menu_item l(:label_sort_by_time), :only => :index
|
||||
menu_item l(:label_sort_by_active), :only => :index
|
||||
menu_item l(:label_sort_by_influence), :only => :index
|
||||
# else
|
||||
# layout 'base_courses'
|
||||
# menu_item :overview
|
||||
# menu_item l(:label_homework), :only => :homework
|
||||
# menu_item l(:label_course_file), :only => :index
|
||||
# menu_item l(:label_course_news), :only => :index
|
||||
# menu_item l(:label_settings), :only => :settings
|
||||
# end
|
||||
|
||||
|
||||
# layout 'base_courses'# by young
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
<!-- fq -->
|
||||
<style>
|
||||
input[type="submit"].bid_btn {
|
||||
vertical-align: middle;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
line-height: 18px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
|
||||
padding: 0px 0px 4px 0px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgb(148, 148, 148);
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
margin-top: -10px;
|
||||
/*margin-right: -4px;*/
|
||||
}
|
||||
input[type="button"].bid_btn {
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
line-height: 18px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: url("/images/button/bg103.jpg") no-repeat scroll left top transparent;
|
||||
padding: 0px 0px 4px 0px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid rgb(148, 148, 148);
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
margin-top: -10px;
|
||||
margin-right: -2px;
|
||||
}
|
||||
textarea:focus {
|
||||
border: #d5dee9 1px solid;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
function clearInfo(id,content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == content) {
|
||||
$('#' + id).val('');
|
||||
}
|
||||
}
|
||||
|
||||
function showInfo(id,content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == '') {
|
||||
$('#' + id).val(content);
|
||||
}
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
$("#put-bid-form").hide();
|
||||
}
|
||||
</script>
|
||||
|
||||
<% if User.current.logged? %>
|
||||
<div id = 'flash' style="float:left; width: 100%; display: none" ></div>
|
||||
<div id="put-bid-form" style="display: none">
|
||||
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add'},
|
||||
:update => "bidding_project_list",
|
||||
:complete => '$("#put-bid-form").hide();' do |f| %>
|
||||
<table id="bidding_table" border="0" width="400" style="margin-left: 40px;">
|
||||
<tr>
|
||||
<td><%= select_tag 'bid', options_for_select(@option), :name => 'bid', :class => 'grayline' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40,
|
||||
:onfocus => "clearInfo('bid_message','#{l(:label_bid_reason)}')", :onblur => "showInfo('bid_message','#{l(:label_bid_reason)}')",
|
||||
:value => "#{l(:label_bid_reason)}", :style => "resize: none;", :class => 'noline'%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><%= submit_tag l(:button_add), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div id='bidding_project_list'>
|
||||
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project} %>
|
||||
</div>
|
|
@ -1,6 +1,12 @@
|
|||
<div class="contextual" style="padding-right: 440px;padding-top: 5px;">
|
||||
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
|
||||
<% if @project.project_type == 1 %>
|
||||
<div class="contextual" style="padding-right: 540px;padding-top: 5px;">
|
||||
<%= link_to(l(:label_file_upload), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="contextual" style="padding-right: 540px;padding-top: 5px;">
|
||||
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3><%=l(:label_attachment_plural)%></h3>
|
||||
|
||||
|
@ -11,8 +17,8 @@
|
|||
<%= sort_header_tag('filename', :caption => l(:field_filename)) %>
|
||||
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
|
||||
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
|
||||
<%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
|
||||
<th>MD5</th>
|
||||
<!-- <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %> -->
|
||||
<th>描述</th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
|
@ -30,8 +36,8 @@
|
|||
<td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>
|
||||
<td class="created_on"><%= format_time(file.created_on) %></td>
|
||||
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
|
||||
<td class="downloads"><%= file.downloads %></td>
|
||||
<td class="digest"><%= file.digest %></td>
|
||||
<!-- <td class="downloads"><%= file.downloads %></td> -->
|
||||
<td class="digest" width="300px"><%= file.description %></td>
|
||||
<td align="center">
|
||||
<%= link_to(image_tag('delete.png'), attachment_path(file),
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# encoding: utf-8
|
||||
#
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
module IssueCategoriesHelper
|
||||
end
|
|
@ -134,7 +134,7 @@
|
|||
<li><%= link_to(l(:label_overview), project_path(@project))%></li>
|
||||
<li><%= link_to(l(:label_homework), {:controller => 'projects', :action => 'homework'})%></li>
|
||||
<li><%= link_to(l(:label_course_file), project_files_path(@project))%></li>
|
||||
<li><%= link_to "课程通知", {:controller => 'news', :action => 'index', :project_id => @project}%></li>
|
||||
<li><%= link_to(l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project})%></li>
|
||||
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> -->
|
||||
<li><%= link_to(l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project}) %></li></ul>
|
||||
</div>
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
<div style="padding-bottom: 10px">
|
||||
<%= link_to(l(:label_news_new),
|
||||
<% if @project.project_type == 1%>
|
||||
<%= link_to(l(:label_news_notice),
|
||||
new_project_news_path(@project),
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
|
||||
<% else %>
|
||||
<%= link_to(l(:label_news_new),
|
||||
new_project_news_path(@project),
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="add-news" style="display:none;">
|
||||
|
@ -43,9 +51,15 @@
|
|||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%=link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td>
|
||||
<td><table width="580px" border="0">
|
||||
<% if @project.project_type == 1 %>
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%=link_to_user(news.author)if news.respond_to?(:author) %></strong> <span class="font_lighter"><%= l(:label_project_notice)%></span> <%= link_to h(news.title), news_path(news) %></td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%=link_to_user(news.author)if news.respond_to?(:author) %></strong> <span class="font_lighter"><%= l(:label_project_newshare)%></span> <%= link_to h(news.title), news_path(news) %></td>
|
||||
</tr>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" ><span class="font_description"><%= textilizable(news, :description) %></span></td>
|
||||
</tr>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%= link_to(l(:label_course_homework_new), {:controller => 'projects', :action => 'new_homework'}, :class => 'icon icon-add') %>
|
||||
<!-- <%= toggle_link l(:label_new_call), 'put-bid-form', {:focus => 'project_id'} %> -->
|
||||
<!-- </div> -->
|
||||
<% end %></td>
|
||||
<% end %></td>
|
||||
|
||||
|
||||
<td align="right">
|
||||
|
|
|
@ -14,7 +14,23 @@
|
|||
<% end %>
|
||||
<%= member.user.nil? ? '' : (link_to image_tag(url_to_avatar(member.user), :class => 'avatar'), :class => "avatar") %>
|
||||
<%= content_tag "div", link_to_user(member.principal), :class => "nomargin avatar_name" %>
|
||||
<!-- added by huang -->
|
||||
<% if @project.project_type == 1 %>
|
||||
<div class ="clear avatar_name"> <p>
|
||||
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
|
||||
Teacher
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
|
||||
Student
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
|
||||
TA
|
||||
<% else %>
|
||||
|
||||
<% end %>
|
||||
</p></div>
|
||||
<% else%>
|
||||
<%= content_tag "div", content_tag("p", member.roles.sort.collect(&:to_s).join(', ')), :class => "clear avatar_name" %>
|
||||
<% end %>
|
||||
<!-- end -->
|
||||
<%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -17,7 +17,19 @@
|
|||
<div class="splitcontentright" style="width:30%;margin-top: 60px;">
|
||||
<p><%= l(:label_role_plural) %>:
|
||||
<% roles.each do |role| %>
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label>
|
||||
<label>
|
||||
<% if @project.project_type == 1 %>
|
||||
<% if role == Role.find(3) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>Teacher
|
||||
<% elsif role == Role.find(5) %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %>Student
|
||||
<% elsif role == Role.find(4)%>
|
||||
<% else %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %>
|
||||
<% end %></label>
|
||||
<% end %></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
@ -40,11 +52,29 @@
|
|||
<tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member">
|
||||
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
|
||||
<td class="roles">
|
||||
<span id="member-<%= member.id %>-roles"><%=h member.roles.sort.collect(&:to_s).join(', ') %></span>
|
||||
<span id="member-<%= member.id %>-roles">
|
||||
<% if @project.project_type == 1 %>
|
||||
|
||||
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
|
||||
Teacher
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
|
||||
Student
|
||||
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='TA' %>
|
||||
TA
|
||||
<% else %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% else%>
|
||||
<%=h member.roles.sort.collect(&:to_s).join(', ') %>
|
||||
<% end %></span>
|
||||
|
||||
|
||||
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
||||
:method => :put,
|
||||
:html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }}
|
||||
) do |f| %>
|
||||
|
||||
<p><% roles.each do |role| %>
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||
:disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br />
|
||||
|
|
|
@ -571,6 +571,7 @@ zh:
|
|||
label_history: 历史记录
|
||||
label_attachment: 文件
|
||||
label_attachment_new: 新建文件
|
||||
label_file_upload: 上传资料
|
||||
label_attachment_delete: 删除文件
|
||||
label_attachment_plural: 文件
|
||||
label_file_added: 文件已添加
|
||||
|
@ -578,13 +579,14 @@ zh:
|
|||
label_report_plural: 报表
|
||||
label_news: 新闻
|
||||
label_news_new: 添加新闻
|
||||
label_news_notice: 发布课程通知
|
||||
label_news_plural: 新闻
|
||||
label_news_latest: 最近的新闻
|
||||
label_news_view_all: 查看所有新闻
|
||||
label_news_added: 新闻已添加
|
||||
label_settings: 配置
|
||||
label_overview: 课程动态
|
||||
label_question_student: 学生咨询 #huang
|
||||
label_question_student: 问题咨询 #huang
|
||||
label_homework_commit: 提交作业 #huang
|
||||
label_course_file: 资料下载
|
||||
label_course_news: 课程通知
|
||||
|
@ -811,6 +813,7 @@ zh:
|
|||
label_project_issues: "缺陷"
|
||||
label_project_newother: "查看其他评论"
|
||||
label_project_newshare: "分享了"
|
||||
label_project_notice: "发布了通知:"
|
||||
label_project_newadd: "添加了"
|
||||
label_project_unadd: "暂无项目,赶快去创建吧!"
|
||||
label_project_un: "该用户暂未参与任何项目!"
|
||||
|
@ -1459,7 +1462,7 @@ zh:
|
|||
label_public_info: 若不公开,仅项目成员可见该项目
|
||||
label_course_student: 学生
|
||||
label_homework: 课程作业
|
||||
label_course_file: 资料下载
|
||||
label_course_file: 资料共享
|
||||
label_course_new_homework: 新建作业
|
||||
label_course_homework_list: 作业列表
|
||||
label_course_homework_new: 发布作业
|
||||
|
|
Loading…
Reference in New Issue