This commit is contained in:
z9hang 2014-08-18 17:15:43 +08:00
commit 9039755fc5
17 changed files with 73 additions and 74 deletions

View File

@ -171,7 +171,6 @@ class AccountController < ApplicationController
ue.location_city = params[:city] if params[:city] != nil
ue.save
end
#end
end
end

View File

@ -62,7 +62,7 @@ class MyController < ApplicationController
end
end
@se = @user.user_extensions ||= UserExtensions.new
@se = @user.extensions
@se.school_id = params[:occupation] if params[:occupation]
@se.gender = params[:gender]
@se.location = params[:province] if params[:province]

View File

@ -369,22 +369,10 @@ class ProjectsController < ApplicationController
#Added by young
def homework
@offset, @limit = api_offset_and_limit({:limit => 10})
@bids = @project.homeworks.order('deadline DESC')
@bids = @project.homeworks.order('deadline')
@bids = @bids.like(params[:name]) if params[:name].present?
@bid_count = @bids.count
@bid_pages = Paginator.new @bid_count, @limit, params['page']
@offset ||= @bid_pages.reverse_offset
#@bids = @bids.offset(@offset).limit(@limit).all.reverse
unless @offset == 0
@bids = @bids.offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count % @limit
if limit == 0
limit = 10
end
@bids = @bids.offset(@offset).limit(limit).all.reverse
end
@bids = paginateHelper @bids
render :layout => 'base_courses'
end

View File

@ -138,10 +138,10 @@ class Issue < ActiveRecord::Base
nil
when 'default'
user_ids = [user.id] + user.groups.map(&:id)
"(#{table_name}.is_private = #{connection.quoted_false}) OR (#{table_name}.author_id = #{user.id} OR #{table_name}.tracker_id IN (#{user_ids.join(',')}) OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
"(#{table_name}.is_private = #{connection.quoted_false}) OR (#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
when 'own'
user_ids = [user.id] + user.groups.map(&:id)
"(#{table_name}.author_id = #{user.id} OR #{table_name}.tracker_id IN (#{user_ids.join(',')}) OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
else
'1=0'
end
@ -159,9 +159,9 @@ class Issue < ActiveRecord::Base
when 'all'
true
when 'default'
(!self.is_private? ||self.tracker == user) || (self.author == user || user.is_or_belongs_to?(assigned_to))
!self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
when 'own'
self.tracker == user || self.author == user || user.is_or_belongs_to?(assigned_to)
self.author == user || user.is_or_belongs_to?(assigned_to)
else
false
end

View File

@ -95,9 +95,6 @@
<% end %>
<% end %>
<div class="pagination">
<ul>
<%= pagination_links_full bid_pages %>
</ul>
<%= pagination_links_full bid_pages %>
</div>

View File

@ -12,7 +12,7 @@
$("#spane_name_notice").focus();
return false;
}
else if(name.length < 25)
else if(name.length <= 25)
{
$("#spane_name_notice").text("填写正确");
$("#spane_name_notice").css('color','#008000');
@ -37,7 +37,7 @@
$("#spane_workdescription_notice").css('color','#ff0000');
return false;
}
if(workDescription.length < 125)
if(workDescription.length <= 125)
{
$("#spane_workdescription_notice").text("填写正确");
$("#spane_workdescription_notice").css('color','#008000');
@ -61,7 +61,7 @@
$("#span_softapplication_application_developers").css('color','#ff0000');
return false;
}
if(workDescription.length < 125)
if(workDescription.length <= 125)
{
$("#span_softapplication_application_developers").text("填写正确");
$("#span_softapplication_application_developers").css('color','#008000');
@ -79,7 +79,6 @@
{
if(regexName() && regexWorkdescription() && regexDevelopers())
{
alert("123123123123");
$("#new_softapplication").submit();
}
}

View File

@ -239,8 +239,9 @@
<!--获奖及教师评奖-->
<div style="padding-left: 18px; padding-bottom: 5px">
<% score = c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_f %>
<span style="padding-left: 50px"><strong><%= l(:label_final_scores) %>
</strong></span><span style="color: red"><%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>
</strong></span><span style="color: red"><%= format("%.2f" , score) %>
分</span>
<span style="padding-left: 334px">
<td>

View File

@ -37,26 +37,26 @@
<!--
<fieldset class="collapsible collapsed">
<legend onclick="toggleFieldset(this);">
<%#= l(:label_options) %>
<%= l(:label_options) %>
</legend>
<div style="display: none;">
<table>
<tr>
<td><%#= l(:field_column_names) %></td>
<td><%#= render_query_columns_selection(@query) %></td>
<td><%= l(:field_column_names) %></td>
<td><%= render_query_columns_selection(@query) %></td>
</tr>
<tr>
<td><label for='group_by'><%#= l(:field_group_by) %></label></td>
<td><%#= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect { |c| [c.caption, c.name.to_s] }, @query.group_by)) %></td>
<td><label for='group_by'><%= l(:field_group_by) %></label></td>
<td><%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect { |c| [c.caption, c.name.to_s] }, @query.group_by)) %></td>
</tr>
<tr>
<td><%#= l(:button_show) %></td>
<td><%#= available_block_columns_tags(@query) %></td>
<td><%= l(:button_show) %></td>
<td><%= available_block_columns_tags(@query) %></td>
</tr>
</table>
</div>
</fieldset>
-->
-->
<div class="buttons hide-when-print">
<%= link_to_function l(:label_issue_query), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
<%= link_to l(:label_issue_cancel_query), {:set_filter => 1, :project_id => @project}, :class => 'icon icon-reload' %>

View File

@ -1,13 +1,13 @@
<!-- <table id="top-menu" style="background-color: #ac344f;margin-top: 10px;margin-bottom: 0px; padding-top: 3px; ">
<tr><td ><%=link_to image_tag("/images/logo_ent.png",weight:"38px", height: "38px"), home_path %></td>
<td valign="top" width="300px"><%= render_menu :top_enterprise_menu if User.current.logged? || !Setting.login_required? -%></td>
<td><%=link_to "企业入口"%></td>
<tr><td ><%#=link_to image_tag("/images/logo_ent.png",weight:"38px", height: "38px"), home_path %></td>
<td valign="top" width="300px"><%#= render_menu :top_enterprise_menu if User.current.logged? || !Setting.login_required? -%></td>
<td><%#=link_to "企业入口"%></td>
<td valign="top" style=" padding-left: 380px">
<%= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %>
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
<%#= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %>
<%#= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
</td>
<td valign="top">
<%= render_menu :account_menu -%>
<%#= render_menu :account_menu -%>
</td>
</tr>
</table> -->
@ -31,14 +31,14 @@
<!-- <div style="float: right; margin-top: 13px;">
<%= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :title => "留言") if User.current.logged? %>
<%#= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :title => "留言") if User.current.logged? %>
</div> -->
<!-- <div align="center" style="float: right; margin-right: -25px; margin-top: 6px; background: #ea7125; width: 12px;border-radius:7px; font-size: 8px; color: #fff; font-weight: bold">
<%= User.current.count_new_jour if User.current.logged? && User.current.count_new_jour != 0 %>
<%#= User.current.count_new_jour if User.current.logged? && User.current.count_new_jour != 0 %>
</div> -->
<!-- <%= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> -->
<!-- <%#= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> -->
<!-- 消息#{link_to((User.current.count_new_jour), feedback_path(User.current))} -->
<!-- <%= content_tag('div', "消息(#{User.current.journals_for_messages.count}".html_safe, :id => 'loggedas')%> -->
<!-- <%#= content_tag('div', "消息(#{User.current.journals_for_messages.count}".html_safe, :id => 'loggedas')%> -->
<!-- <div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 5px;margin-top: -10px;"></div> -->

View File

@ -1,5 +1,4 @@
<!--add by huang-->
<% cache "footer" do %>
<div class="clearfix"></div>
<div id="footer" style="margin-left:-5px;padding-top: 20px;clear: both;font-size: 12px;">
<div style="border-top:solid 1px #C6E9F1;"></div>
@ -46,4 +45,3 @@
</div>
</div>
<% end %>

View File

@ -9,14 +9,14 @@
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
<!-- <div style="float: right; margin-top: 13px;">
<%= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :title => "留言") if User.current.logged? %>
<%#= content_tag('div', "#{link_to(image_tag('/images/mes.png'), feedback_path(User.current))}".html_safe, :title => "留言") if User.current.logged? %>
</div> -->
<!-- <div align="center" style="float: right; margin-right: -25px; margin-top: 6px; background: #ea7125; width: 12px;border-radius:7px; font-size: 8px; color: #fff; font-weight: bold">
<%= User.current.count_new_jour if User.current.logged? && User.current.count_new_jour != 0 %>
<%#= User.current.count_new_jour if User.current.logged? && User.current.count_new_jour != 0 %>
</div> -->
<!-- <%= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> -->
<!-- <%#= content_tag('div', "#{}".html_safe, :id => 'loggedas')%> -->
<!-- 消息#{link_to((User.current.count_new_jour), feedback_path(User.current))} -->
<!-- <%= content_tag('div', "消息(#{User.current.journals_for_messages.count}".html_safe, :id => 'loggedas')%> -->
<!-- <%#= content_tag('div', "消息(#{User.current.journals_for_messages.count}".html_safe, :id => 'loggedas')%> -->
<%= render_menu :top_home_menu if User.current.logged? || !Setting.login_required? -%>
</div>
<div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 5px;margin-top: -10px;"></div>

View File

@ -82,7 +82,7 @@
<%= join_in_course(@course, User.current) %>
<% end %>
<% unless User.current.member_of_course?(@course) %>
<!-- <%= image_tag "/images/fav.png" %> -->
<!-- <%#= image_tag "/images/fav.png" %> -->
<% end %>
<% end %>
</div>

View File

@ -13,16 +13,15 @@
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
<span class="activity-title font_lighter">
<% if @canShowRealName %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>)
<% else %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% end %>
<%= l(:label_new_activity) %>
</span>
<span class="activity-title font_lighter">
<% if @canShowRealName %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>)
<% else %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% end %>
<%= l(:label_new_activity) %>
</span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;">

View File

@ -79,9 +79,10 @@
<% end %>
</div>
</div>
<div style="float: left; padding-left: 100px; padding-top:35px " align="center">
<div><%=l(:label_final_scores)%></div>
<div style="padding-top: 1px; font-size: 15px; color: blue"><%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>分</div>
<div style="float: left; padding-left: 100px; padding-top:35px ">
<div style="text-align: center;"><%=l(:label_final_scores)%></div>
<% score = @softapplication.average(:quality).try(:avg).try(:round, 2).to_f %>
<div style="padding-top: 1px; font-size: 15px; color: blue;text-align: center;"><%= format("%.2f" , score) %>分</div>
<div><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
</div>
<div style="float: left; padding-left: 100px; padding-top:35px;" align="center">

View File

@ -70,14 +70,13 @@
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% when '5' %>
<% if Forum.find(params[:id]) %>
<% if Forum.find(params[:id]).creator_id == User.current.id %>
<% when '5' %>
<% test = Forum.find(obj.id) %>
<% if test && test.creator_id == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %> </span>
<% end %>
<% end %>
<% end %>
<% when '6' %>
<%# if (User.current.logged? &&
User.current.admin?

View File

@ -163,7 +163,7 @@ zh:
notice_account_invalid_creditentials_new: 您还未到邮箱激活
notice_account_password_updated: 密码更新成功
notice_account_wrong_password: 密码错误
notice_account_register_done: 帐号创建成功,请使用注册确认邮件中的链接来激活您的帐号
notice_account_register_done: 帐号创建成功,请使用注册确认邮件中的链接来激活您的帐号, 如果您的邮件没有在收件箱中可能在垃圾箱中,请您注意查收
notice_account_unknown_email: 未知用户
notice_can_t_change_password: 该帐号使用了外部认证,因此无法更改密码。
notice_account_lost_email_sent: 系统已将引导您设置新密码的邮件发送给您。
@ -1331,7 +1331,7 @@ zh:
permission_add_documents: 新建文档
permission_edit_documents: 编辑文档
permission_delete_documents: 删除文档
label_gantt_progress_line: Progress line
label_gantt_progress_line: 进度线
setting_jsonp_enabled: Enable JSONP support
field_inherit_members: Inherit members
field_closed_on: 已关闭

View File

@ -0,0 +1,18 @@
# This migration comes from rich (originally 20111201095829)
class AddCkeditorToSettings < ActiveRecord::Migration
def up
str = "
insert into `settings` (`name`, `value`, `updated_on`) values('plugin_redmine_ckeditor','--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nskin: kama\nui_color: ! \'#f4f4f4\'\nwidth: \'\'\nheight: \'400\'\nenter_mode: \'1\'\nshow_blocks: \'1\'\ntoolbar_can_collapse: \'0\'\ntoolbar_location: top\ntoolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor,Cut,Copy,Paste,BidiLtr,BidiRtl,PasteText,PasteFromWord,RemoveFormat,SelectAll\n','2014-07-24 11:24:50');
"
ActiveRecord::Base.connection.execute(
"insert settings(name, value) values('plugin_redmine_ckeditor', '')"
)
end
def down
ss = Setting.where("name='plugin_redmine_ckeditor'")
ss.each do |s|
s.destroy
end
end
end