This commit is contained in:
yanxd 2014-05-22 15:33:38 +08:00
parent 4f9625b265
commit f44b930037
11 changed files with 41 additions and 29 deletions

View File

@ -28,7 +28,6 @@ module ApplicationHelper
include AvatarHelper
## added by william
include PraiseTreadHelper
# add by nyan
include CoursesHelper
extend Forwardable
@ -1330,7 +1329,7 @@ module ApplicationHelper
def hubspot_head
tags = javascript_include_tag('hubspot/messenger.min', 'hubspot/messenger-theme-future')
tags << stylesheet_link_tag('hubspot/messenger', 'hubspot/messenger-theme-future')
tags << stylesheet_link_tag('hubspot/messenger', 'hubspot/messenger-theme-future', 'hubspot/messenger-theme-flat')
unless User.current.pref.warn_on_leaving_unsaved == '0'
tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });")
end

View File

@ -122,7 +122,8 @@ class Project < ActiveRecord::Base
after_save :update_position_under_parent, :if => Proc.new {|project| project.name_changed?}
after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?}
after_save :create_board_sync #nyan
# 创建project之后默认创建一个board之后的board去掉了board的概念
after_save :create_board_sync
before_destroy :delete_all_members
def remove_references_before_destroy
return if self.id.nil?

View File

@ -1,4 +1,13 @@
<% selector = ".#{applied_css(@project)}" %>
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript applied_link(@project, User.current) %>")});
if (window.Messenger) {
Messenger.options = {
extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right',
theme: 'flat'
}
Messenger().post({
id: "label_apply_project_waiting",
message: "<%= l(:label_apply_project_waiting) %>",
showCloseButton: true,
});
};

View File

@ -3,7 +3,12 @@
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span></td>
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span>
<%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(
User.current.admin? ||
!(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) ||
(Rails.env.development?) %>
</td>
<td align="right">
<div class="project-search">
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
@ -14,10 +19,6 @@
</div>
<% end %>
<% display_id = im_watching_student_id? @bid%>
<%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;display: inline-block;" if(
User.current.admin? ||
!(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) ||
(Rails.env.development?) %>
<% @homework_list.each do |homework|%>
<% if homework.attachments.any?%>
<table width="660px" border="0" align="center">

View File

@ -32,18 +32,16 @@
<table id="bidding_table" border="0" width="100%" style="margin-left: 40px;">
<tr>
<td><%= select_tag 'bid', options_for_select(select_option_helper(@option)), :name => 'bid', :class => 'grayline' %></td>
<div id="prompt_create_pro"><!-- nyan -->
<div id="prompt_create_pro">
<td>
<p>
<div class="font_lighter" style="font-size: 13px;">
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
</div>
</p>
</td>
</div>
</tr>
<% if @bid.reward_type == 3 %>
<% if @bid.reward_type == Bid::Homework %>
<tr>
<td><%= f.text_area :bid_message, :id => "bid_message", :required => true, :rows => 4, :cols => 40, :placeholder => l(:label_bid_reason_homework), :style => "resize: none;", :class => 'noline' %></td>
</tr>

View File

@ -2,7 +2,7 @@
<fieldset class="collapsible collapsed" style="padding-left: 50px;">
<legend onclick="toggleFieldset(this);" style="font-size:12px;"><strong><%= l(:label_change_properties) %></strong></legend>
<div class="splitcontent" style="display: block;"> <!-- nyan -->
<div class="splitcontent" style="display: block;">
<div class="splitcontentleft">
<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
<p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true},

View File

@ -12,6 +12,7 @@
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= hubspot_head %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -2,12 +2,12 @@ $('#tab-content-members').html('<%= escape_javascript(render :partial => 'projec
hideOnLoad();
<%if !@applied_members%>
<% if @members.present? && @members.all? {|m| m.valid? } %>
<% @members.each do |member| %>
$("#member-<%= member.id %>").effect("highlight");
<% if @members.present? && @members.all? {|m| m.valid? } %>
<% @members.each do |member| %>
$("#member-<%= member.id %>").effect("highlight");
<% end %>
<% else %>
<% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') %>
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors))) %>');
<% end %>
<% else %>
<% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') %>
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors))) %>');
<% end %>
<%end%>

View File

@ -41,9 +41,10 @@
</p>
</div>
<div class="information"><!-- nyan -->
<div class="information">
<!-- p class="stats">
<%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
<%#= content_tag('span', @project.watcher_users.count, :class => "info") %>
<%#= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
</p -->
<p class="stats">
<%= content_tag('span', link_to("#{@project.homeworks.count}", homework_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_task, :count => @project.homeworks.count)) %>

View File

@ -1168,6 +1168,7 @@ en:
label_tags_issue_description: issue description
label_tags_all_objects: all objects
label_apply_project: Apply Project
label_apply_project_waiting: "Application has been submitted, please wait for administrator review."
label_unapply_project: Unsubscribe
#fq

View File

@ -483,7 +483,7 @@ zh:
label_project_latest: 最近的项目
label_issue: 问题
label_issue_new: 新建问题
label_issue_plural: 缺陷 #问题 #nyan
label_issue_plural: 缺陷
label_issue_view_all: 查看所有问题
label_issues_by: "按 %{value} 分组显示问题"
label_issue_added: 问题已添加
@ -757,7 +757,7 @@ zh:
label_sort_higher: 上移
label_sort_lower: 下移
label_sort_lowest: 置底
label_roadmap: 里程碑 #版本路线图 #nyan
label_roadmap: 里程碑 #版本路线图
label_roadmap_due_in: "截止日期到 %{value}"
label_roadmap_overdue: "%{value} 延期"
label_roadmap_no_issues: 该版本没有问题
@ -1260,9 +1260,9 @@ zh:
setting_default_projects_tracker_ids: Default trackers for new projects
label_total_time: 合计
label_create_time: 创建时间 #Customer addedAdded by nie
label_comment_time: 留言时间 #nyan
label_activity_time: 发布时间 #nyan
label_update_time: 更新时间 #nyan
label_comment_time: 留言时间
label_activity_time: 发布时间
label_update_time: 更新时间
label_current_contributors: 位当前贡献者
label_commit_limit: 作业提交时间已过!
label_commit_ar: 作业提交截止时间快到了!
@ -1330,6 +1330,7 @@ zh:
label_tags_issue_description: 问题描述
label_tags_all_objects: 所有
label_apply_project: 申请加入
label_apply_project_waiting: 已处理申请,请等待管理员审核
label_unapply_project: 取消申请
#fq