Conflicts: app/controllers/bids_controller.rb app/views/bids/_history.html.erb app/views/bids/_project_list.html.erb app/views/bids/show.html.erb config/locales/zh.yml config/routes.rb lib/redmine.rbexceptionHandle
commit
61e4021625
@ -0,0 +1,2 @@
|
||||
// Place all the behaviors and hooks related to the matching controller here.
|
||||
// All this logic will automatically be available in application.js.
|
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Place all the styles related to the matching controller here.
|
||||
They will automatically be included in application.css.
|
||||
*/
|
@ -0,0 +1,42 @@
|
||||
class CoursesController < ApplicationController
|
||||
|
||||
|
||||
before_filter :require_login, :only => [:join, :unjoin]
|
||||
|
||||
def join
|
||||
if User.current.logged?
|
||||
course = Project.find(params[:object_id])
|
||||
if params[:course_password].to_i == Course.find_by_extra(course.identifier).state
|
||||
members = []
|
||||
members << Member.new(:role_ids => [5], :user_id => User.current.id)
|
||||
course.members << members
|
||||
|
||||
StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id])
|
||||
@state = 0
|
||||
else
|
||||
@state = 1
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
|
||||
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
|
||||
end
|
||||
end
|
||||
|
||||
def unjoin
|
||||
if User.current.logged?
|
||||
|
||||
@member = Member.where('project_id = ? and user_id = ?', params[:object_id], User.current.id)
|
||||
@member.first.destroy
|
||||
|
||||
joined = StudentsForCourse.where('student_id = ? and course_id = ?', User.current.id, params[:object_id])
|
||||
joined.each do |join|
|
||||
join.delete
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
# format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
|
||||
format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Project.find(params[:object_id])} }
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class TeachersController < ApplicationController
|
||||
def show
|
||||
|
||||
end
|
||||
end
|
@ -0,0 +1,2 @@
|
||||
module TeachersHelper
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
class HomeworkAttach < ActiveRecord::Base
|
||||
attr_accessible :bid_id, :user_id
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :bid
|
||||
|
||||
acts_as_attachable
|
||||
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
class HomeworkForCourse < ActiveRecord::Base
|
||||
attr_accessible :bid_id, :project_id
|
||||
|
||||
belongs_to :bid
|
||||
belongs_to :project
|
||||
|
||||
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
# Added by young
|
||||
class JournalsForMessageObserver < ActiveRecord::Observer
|
||||
def after_create(journal_for_message)
|
||||
Mailer.journals_for_message_add(User.current, journal_for_message).deliver
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,10 @@
|
||||
class StudentsForCourse < ActiveRecord::Base
|
||||
attr_accessible :course_id, :student_id
|
||||
|
||||
belongs_to :course, :class_name => 'Project', :foreign_key => :course_id
|
||||
belongs_to :student, :class_name => 'User', :foreign_key => :student_id
|
||||
|
||||
validates_presence_of :course_id, :student_id
|
||||
validates_uniqueness_of :student_id, :scope => :course_id
|
||||
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
class Teacher < ActiveRecord::Base
|
||||
attr_accessible :course_code, :couurse_time, :location, :tea_name
|
||||
include Redmine::SafeAttributes
|
||||
|
||||
belongs_to :project
|
||||
|
||||
safe_attributes'tea_name',
|
||||
'location',
|
||||
'couurse_time',
|
||||
'course_code',
|
||||
'extra'
|
||||
|
||||
end
|
@ -0,0 +1 @@
|
||||
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
@ -0,0 +1,46 @@
|
||||
<!-- huang -->
|
||||
<% bids.each do |bid|%>
|
||||
|
||||
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
|
||||
<td>
|
||||
<table width="100%" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author), :class => 'bid_user') %>: <%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="500">
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %>
|
||||
<%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <% else %>
|
||||
<!-- <strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %></span></strong> -->
|
||||
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
|
||||
</tr>
|
||||
<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.id) %></strong>)</span><span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="bid-description" style="border-left: 1px solid rgb(225, 225, 225); border-bottom: 1px solid rgb(225, 225, 225); padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td> <%= bid.description%> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full bid_pages %>
|
||||
<ul>
|
||||
</div>
|
||||
<!--end-->
|
@ -0,0 +1,22 @@
|
||||
<div id="put-bid-form" style="display: none">
|
||||
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add_homework'},
|
||||
:update => "bidding_project_list",
|
||||
:complete => '$("#put-bid-form").hide();' do |f| %>
|
||||
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
|
||||
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
|
||||
</fieldset>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% 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 = ?', 5, 7)).size >0) %>
|
||||
|
||||
<div class='icon icon-add'>
|
||||
<%= toggle_link l(:button_bidding_homework), 'put-bid-form' %>
|
||||
</div>
|
||||
<% elsif @homework_list.empty? %>
|
||||
<div class="font_lighter_sidebar" style="padding-left: 10px">暂无学生提交作业!</div>
|
||||
<% end %>
|
||||
|
||||
<div id='bidding_project_list'>
|
||||
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>
|
||||
</div>
|
@ -0,0 +1,30 @@
|
||||
<!-- fq -->
|
||||
<%= render_flash_messages %>
|
||||
|
||||
<% @homework_list.each do |homework|%>
|
||||
<% if homework.attachments.any?%>
|
||||
|
||||
<table width="660px" border="0" align="center">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar"), user_path(homework.user), :class => "avatar" %></td>
|
||||
<td>
|
||||
<table width="580px" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong> <%= link_to homework.user, user_path(homework.user)%></strong> <span class="font_lighter">提交了作业</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" >
|
||||
<p class="font_description">
|
||||
<% options = {:author => true, :deletable => attach_delete(homework)} %>
|
||||
<%= render :partial => 'attachments/links',
|
||||
:locals => {:attachments => homework.attachments, :options => options} %>
|
||||
<% end %>
|
||||
</p></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="line_under"></div>
|
||||
|
||||
|
||||
<% end %>
|
@ -0,0 +1,51 @@
|
||||
<!-- fq -->
|
||||
<%= render_flash_messages %>
|
||||
<table width="1000px" border="0" style="padding-left: 15px">
|
||||
<td class="font_lighter" style="font-size: 15px;"><%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)</td>
|
||||
<% if User.current.logged? %>
|
||||
<td>
|
||||
<div class='icon icon-add'>
|
||||
<%= toggle_link l(:button_bidding), 'put-bid-form' %>
|
||||
</div></td>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<% @bidding_project.each do |b_project|%>
|
||||
<table width="90%" border="0" align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
<table width="660px" border="0" align='center'>
|
||||
<tr>
|
||||
<td width="50px" valign="top" colspan="2" align="middle">
|
||||
<div style="width: 50px; height: 50px;">
|
||||
<%= link_to image_tag(url_to_avatar(b_project.project), :class => 'avatar3'), :class => "avatar" %>
|
||||
</div></td>
|
||||
<td width="60%" valign="top">
|
||||
<table width="100%" valign="top">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(b_project.project.name, project_path(b_project.project)) %></strong><a class="font_lighter"><%= l(:label_join_bidding)%></a></td>
|
||||
</tr>
|
||||
<tr></tr>
|
||||
<tr>
|
||||
<td valign="top"><%= b_project.project.description %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><a class="font_lighter"><%= b_project.created_at%></a></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="30%">
|
||||
<div class="bid-user-message" style="border-left: 1px solid rgb(225, 225, 225); margin-left: 20px; padding-left: 20px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><%= l(:label_bidding_user) %><%= link_to(b_project.user.name, user_path(b_project.user)) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" word-wrap: break-word; word-break: break-all"><%= l(:label_bidding_reason) %><%= b_project.description %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
@ -0,0 +1,4 @@
|
||||
$('#bidding_project_list').html('<%= escape_javascript(render(:partial => 'homework_list', :locals => {:homework => @homework_list})) %>');
|
||||
$("#project_id").val("请选择项目");
|
||||
$("#bid_message").val("#{l(:label_bid_reason)} ");
|
||||
$("#put-bid-form").hide();
|
@ -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>
|
@ -0,0 +1,8 @@
|
||||
$('#join').html('<%= escape_javascript join_in_course(course, user) %>');
|
||||
<% if @state %>
|
||||
<% if @state == 0 %>
|
||||
alert("加入成功")
|
||||
<% else %>
|
||||
alert("密码错误")
|
||||
<% end %>
|
||||
<% end %>
|
@ -0,0 +1,2 @@
|
||||
<h1><%= link_to("hello", @url) %></h1>
|
||||
<em><%=h @user %></em>
|
@ -0,0 +1,58 @@
|
||||
<%= error_messages_for 'project' %>
|
||||
<%= error_messages_for 'course' %>
|
||||
|
||||
<!--[form:project]-->
|
||||
<% unless @project.new_record? %>
|
||||
<p><%= render :partial=>"avatar/avatar_form",:locals=> {source:@project} %></p>
|
||||
<% end %>
|
||||
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %></p>
|
||||
|
||||
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p><!--by young-->
|
||||
<!-- <p><%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %>
|
||||
<% unless @project.identifier_frozen? %>
|
||||
<em class="info"><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info).html_safe %></em>
|
||||
<% end %></p> -->
|
||||
|
||||
|
||||
<%= f.fields_for @course do |m| %>
|
||||
|
||||
<!-- added by huang -->
|
||||
<p style="margin-left:-10px;"><%= m.text_field :state, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
|
||||
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
|
||||
<p style="margin-left:-10px;"><%= m.text_field :term, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
|
||||
<!-- <p style="margin-left:-28px;"><em class="info"><%= l(:label_term) %> <%= select_tag 'term', "<option value = '0'>#{l(:label_spring)}</option><option value = '1'>#{l(:label_summer)}</option><option value = '2'>#{l(:label_autumn)}</option>".html_safe %></em></p> -->
|
||||
<% end %>
|
||||
<!-- <p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p> -->
|
||||
<p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p>
|
||||
|
||||
|
||||
<%= wikitoolbar_for 'project_description' %>
|
||||
|
||||
<% @project.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :project, value %></p>
|
||||
<% end %>
|
||||
<%= call_hook(:view_projects_form, :project => @project, :form => f) %>
|
||||
|
||||
|
||||
|
||||
<!--[eoform:project]-->
|
||||
|
||||
<% unless @project.identifier_frozen? %>
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'project_identifier' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if !User.current.admin? && @project.inherit_members? && @project.parent && User.current.member_of?(@project.parent) %>
|
||||
<%= javascript_tag do %>
|
||||
$(document).ready(function() {
|
||||
$("#project_inherit_members").change(function(){
|
||||
if (!$(this).is(':checked')) {
|
||||
if (!confirm("<%= escape_javascript(l(:text_own_membership_delete_confirmation)) %>")) {
|
||||
$("#project_inherit_members").attr("checked", true);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
<% end %>
|
||||
<% end %>
|
@ -1,6 +1,10 @@
|
||||
<div class="box tabular" style="margin-right:10px;" >
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% if @project.project_type == 1%>
|
||||
<%= render :partial => 'course_form', :locals => { :f => f } %>
|
||||
<% else %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<% end %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,41 @@
|
||||
<!-- fq -->
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
function show(id, id_t, label_reward, label_money, label_credit, label_content) {
|
||||
var text = $('#' + id);
|
||||
var text_t = $('#' + id_t);
|
||||
if (text.val() == 0) {
|
||||
text_t.attr("placeholder", label_reward);
|
||||
}
|
||||
if (text.val() == 1) {
|
||||
text_t.attr("placeholder", label_money);
|
||||
}
|
||||
if (text.val() == 3) {
|
||||
text_t.attr("placeholder", label_credit);
|
||||
}
|
||||
if (text.val() == 2) {
|
||||
text_t.attr("placeholder", label_content);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
</script>
|
||||
|
||||
<%= error_messages_for 'bid' %>
|
||||
<!--[form:project]-->
|
||||
<p><%= l(:label_homeworks_form_new_description) %></p>
|
||||
<p><%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %></p>
|
||||
|
||||
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
|
||||
<!-- <p><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
|
||||
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
|
||||
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
|
||||
</p> -->
|
||||
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>
|
||||
</p>
|
||||
<p><%= f.select :homework_type, homework_type_option %>
|
||||
</p>
|
||||
<p><%= hidden_field_tag 'course_id', @project.id %>
|
||||
</p>
|
||||
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
|
||||
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
|
||||
</fieldset>
|
@ -0,0 +1,81 @@
|
||||
<!-- fq -->
|
||||
|
||||
<style>
|
||||
input[type="submit"].bid_btn {
|
||||
vertical-align: middle;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 18px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: url("../images/button/bg106.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: -5px;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<%= form_tag({:controller => 'bids',
|
||||
:action => 'new_bid',
|
||||
:remote => true,
|
||||
:method => :post,
|
||||
:id => 'new-bid-form'}) do %>
|
||||
|
||||
<table border="0" width="600px" style="border-left: 1px solid #acaeb1; border-right: 1px solid #acaeb1;
|
||||
border-top: 1px solid #acaeb1; border-bottom: 1px solid #acaeb1; margin-top: 30px; margin-left: 30px;">
|
||||
<tr>
|
||||
<td colspan="2"><%= text_field_tag 'bid_title', "#{l(:label_requirement_name)}", :class => 'noline', :required => true, :onfocus => "clearInfo('bid_title', '#{l(:label_requirement_name)}')", :onblur => "showInfo('bid_title', '#{l(:label_requirement_name)}')"%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="tableline"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><%= text_area_tag 'bid_description', "#{l(:label_requirement_description)}", :class => 'noline', :required => true, :style => "resize: none;", :rows => 6,
|
||||
:onfocus => "clearInfo('bid_description', '#{l(:label_requirement_description)}')", :onblur => "showInfo('bid_description', '#{l(:label_requirement_description)}')" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><div class="tableline"></div></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td width="22%"><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '2'>#{l(:label_reward_1)}</option><option value = '3'>#{l(:label_bids_credit)}</option>".html_safe, :class => 'noline' %></td>
|
||||
<td><%= text_field_tag 'bid_budget', "#{l(:label_requirement_bargain_money)}", :class => 'noline', :required => true,
|
||||
:onfocus => "clearInfo('bid_budget', '#{l(:label_requirement_bargain_money)}')", :onblur => "showInfo('bid_budget', '#{l(:label_requirement_bargain_money)}')" %>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td colspan="2"><div class="tableline"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><%= text_field_tag 'bid_deadline', "#{l(:label_deadline)}", :class => 'noline', :required => true,
|
||||
:onfocus => "clearInfo('bid_deadline', '#{l(:label_deadline)}')", :onblur => "showInfo('bid_deadline', '#{l(:label_deadline)}')"%>
|
||||
<%= calendar_for('bid_deadline')%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="bidding_table" border="0" width="600" style="margin-top: 10px; margin-left: 30px;">
|
||||
<tr>
|
||||
<td align="right"> <%= submit_tag l(:button_new_bid), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<%end%>
|
@ -0,0 +1,54 @@
|
||||
<!-- added by fq -->
|
||||
<style>
|
||||
input[type="submit"].bid_btn {
|
||||
vertical-align: middle;
|
||||
width: 60px;/*modified by ming*/
|
||||
height: 25px;
|
||||
line-height: 19px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: buttonface;/*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;/*modified by ming*/
|
||||
height: 25px;
|
||||
line-height: 19px;
|
||||
font-size: 14px;
|
||||
color: rgb(0, 0, 0);
|
||||
background: buttonface;/*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>
|
||||
|
||||
<h3 class="title">请输入课程密码</h3>
|
||||
|
||||
<%= form_tag({:controller => 'courses',
|
||||
:action => 'join',
|
||||
:object_id => course.id},
|
||||
:remote => true,
|
||||
:method => :post,
|
||||
:id => 'new-watcher-form') do %>
|
||||
|
||||
<%= text_field_tag 'course_password', nil, :size => 48%>
|
||||
|
||||
<p class="buttons" style="padding-top: 10px; padding-bottom: 1px; margin-bottom: 1px">
|
||||
<%= submit_tag '加入', :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %>
|
||||
<%= submit_tag l(:button_cancel), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);", :type => 'button' %>
|
||||
</p>
|
||||
<% end %>
|
@ -0,0 +1,28 @@
|
||||
<!-- fq -->
|
||||
|
||||
<div class="project-search-block">
|
||||
<table width="100%" valign="center">
|
||||
<tr>
|
||||
<td width="16%"><span style="margin-left:0px"><%= l(:label_course_homework_list)%></span></td>
|
||||
<td valign="center"><% 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 = ?', 3, 7)).size >0))%>
|
||||
|
||||
<!-- <div class='icon icon-add'> -->
|
||||
<%= 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>
|
||||
|
||||
|
||||
<td align="right">
|
||||
<div class="project-search">
|
||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||
<%= submit_tag l(:label_search), :class => "small", :name => nil %>
|
||||
</div></td>
|
||||
</tr></table>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="bid-show">
|
||||
<%= render :partial => 'bids/bid_homework_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
|
||||
</div>
|
||||
|
@ -1,12 +1,19 @@
|
||||
<h3><%=l(:label_project_new)%></h3>
|
||||
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<!--Added by young-->
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
||||
<%= javascript_tag "$('#project_name').focus();" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @course_tag == '1' %>
|
||||
<h3><%=l(:label_course_new)%></h3>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'course_form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= submit_tag l(:button_create_and_continue), :name => 'course_continue' %>
|
||||
<% else %>
|
||||
<h3><%=l(:label_project_new)%></h3>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
||||
<% end %>
|
||||
<%= javascript_tag "$('#project_name').focus();" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!--Ended by young-->
|
||||
|
@ -0,0 +1,9 @@
|
||||
<h3><%=l(:label_course_new_homework)%></h3>
|
||||
|
||||
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework'} do |f| %>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'homework_form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= javascript_tag "$('#bid_name').focus();" %>
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,3 @@
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/new_join', :locals => {:course => @course}) %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
$('#ajax-modal').addClass('new-watcher');
|
@ -1,3 +1,7 @@
|
||||
<h3><%=l(:label_settings)%></h3>
|
||||
<%= render_tabs project_settings_tabs %>
|
||||
<% if @project.project_type == 1 %>
|
||||
<%= render_tabs course_settings_tabs %>
|
||||
<% else %>
|
||||
<%= render_tabs project_settings_tabs %>
|
||||
<% end %>
|
||||
<% html_title(l(:label_settings)) -%>
|
||||
|
@ -1,12 +1,6 @@
|
||||
<h3><%= l(:label_statistics) %></h3>
|
||||
|
||||
<p>
|
||||
<%= tag("embed", :width => 670, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
|
||||
</p>
|
||||
<p>
|
||||
<%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
|
||||
</p>
|
||||
|
||||
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
|
||||
<% src = "http://localhost:3000/statistics/"+@project_id+"/index.html"%>
|
||||
<iframe src=<%= src %> name="top" style="border:0;width:100%;height:1000px;"></iframe>
|
||||
|
||||
<% html_title(l(:label_repository), l(:label_statistics)) -%>
|
||||
|
@ -0,0 +1,57 @@
|
||||
<div class="content_frame">
|
||||
<% unless @memberships.empty? %>
|
||||
<ul class="user_project_sort">
|
||||
<% for membership in @memberships %>
|
||||
<li>
|
||||
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
|
||||
<td>
|
||||
<table width="580" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
|
||||
<span style="float: right"><%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
|
||||
|
||||
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)
|
||||
<!-- <%= l(:label_member)%>(<span style="color: #ed8924"><%= link_to (membership.project.members.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>) </span> --></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%= membership.project.description%>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
|
||||
<td align="right" >
|
||||
|
||||
<% if membership.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
|
||||
Teacher
|
||||
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
|
||||
Student
|
||||
<% elsif membership.roles.sort.collect(&:to_s).join(', ') =='TA' %>
|
||||
TA
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<% if @user != User.current %>
|
||||
<p class="font_description">
|
||||
<%= l(:label_project_course_un) %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p class="font_description">
|
||||
<%= l(:label_project_course_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new', :course => 1 %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= call_hook :view_account_left_bottom, :user => @user %>
|
||||
</div>
|
@ -0,0 +1,48 @@
|
||||
<!-- fq -->
|
||||
<% if @bid.size > 0%>
|
||||
|
||||
<% @bid.each do |bids|%>
|
||||
<h2><%= link_to(Project.find(bids[0]).name, project_path(bids[0])) %></h2>
|
||||
|
||||
<% for bid in bids[1]%>
|
||||
|
||||
<table width="95%" border="0" style="padding-left: 10px; padding-top: 10px;">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
|
||||
<td>
|
||||
<table width="100%" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author), :class => 'bid_user') %>: <%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="500">
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <% else %> <!-- <strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %> <%= bid.budget%> <%= l(:label_bids_credit_number) %></span></strong> --> <% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
|
||||
</tr>
|
||||
<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.id) %></strong>)</span><span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="200" align="right" class="a"><span class="font_lighter"> <%= format_time bid.created_on %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="bid-description" style="border-left: 1px solid rgb(225, 225, 225); border-bottom: 1px solid rgb(225, 225, 225); padding-left: 20px; padding-bottom: 10px; margin-bottom: 20px;">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td> <%= bid.description%> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
<p class="font_description">暂无任何作业</p>
|
||||
<% end %>
|
@ -0,0 +1,48 @@
|
||||
<!-- < added by huang > -->
|
||||
<div class="content_frame">
|
||||
<% unless @memberships.empty? %>
|
||||
<ul class="user_project_sort">
|
||||
<% for membership in @memberships %>
|
||||
<li>
|
||||
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
|
||||
<td>
|
||||
<table width="580" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
|
||||
<span style="float: right"><%= l(:label_homework) %> (<span style="color: #ed8924">8</span>)
|
||||
<%= l(:label_course_news)%> (<span style="color: #ed8924">8</span>)
|
||||
<%= l(:label_member)%>(<span style="color: #ed8924"><%=link_to (membership.project.members.count)%></span>)
|
||||
</span>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%= membership.project.description%>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
|
||||
<td align="right" ><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<% if @user != User.current %>
|
||||
<p class="font_description"><%= l(:label_project_un) %></p>
|
||||
<% else %>
|
||||
<p class="font_description"><%= l(:label_project_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new'%></p>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<%= call_hook :view_account_left_bottom, :user => @user %>
|
||||
</div>
|
@ -0,0 +1,11 @@
|
||||
<!-- added by fq -->
|
||||
|
||||
<%= user_course @state%>
|
||||
<% if @state == 0 %>
|
||||
<%= render :partial => 'my_course' %>
|
||||
<% elsif @state == 1 %>
|
||||
<%= render :partial => 'my_homework' %>
|
||||
<% else @state == 2 %>
|
||||
<%= render :partial => 'my_notice' %>
|
||||
<% end %>
|
||||
|
@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
$('#join').html('<%= escape_javascript join_in_course(course, user) %>');
|
@ -0,0 +1,9 @@
|
||||
class AddProjectTypeToProject < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :projects, :project_type, :integer
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :projects, :project_type
|
||||
end
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue