This commit is contained in:
z9hang 2014-08-07 11:36:08 +08:00
commit 96fa28f70d
21 changed files with 373 additions and 303 deletions

View File

@ -44,11 +44,11 @@ class FilesController < ApplicationController
if params[:sort] if params[:sort]
if params[:sort].include?":" if params[:sort].include?":"
@orderBy = params[:sort].split(":")[0]; @orderBy = params[:sort].split(":")[0]
@orderType = params[:sort].split(":")[1].split(",")[0]; @orderType = params[:sort].split(":")[1].split(",")[0]
else else
@orderBy = params[:sort].split(",")[0]; @orderBy = params[:sort].split(",")[0]
@orderType = "asc"; @orderType = "asc"
end end
end end

View File

@ -1,4 +1,7 @@
class NotificationcommentsController < ApplicationController class NotificationcommentsController < ApplicationController
def show
end
# default_search_scope :contestnotifications # default_search_scope :contestnotifications
# model_object Contestnotifications # model_object Contestnotifications
# before_filter :authorize # before_filter :authorize
@ -20,8 +23,14 @@ class NotificationcommentsController < ApplicationController
end end
def destroy def destroy
@contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy @contest = Contest.find(params[:contest_id])
redirect_to contest_contestnotification_path(@contestnotifications) @contestnotification = Contestnotification.find(params[:contestnotification_id])
notificaioncomments = Notificationcomment.find(params[:id])
notificaioncomments.destroy if notificaioncomments
#@contestnotifications = notificaioncomments.Contestnotification
#@contest = @contestnotifications.contest
#@contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy
redirect_to contest_contestnotification_path(@contest,@contestnotification)
end end
end end

View File

@ -156,8 +156,8 @@ class SoftapplicationsController < ApplicationController
format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]), notice: l(:notice_attendingcontest_work_successfully_created) } format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]), notice: l(:notice_attendingcontest_work_successfully_created) }
# format.json { render json: @softapplication, status: :created, location: @softapplication } # format.json { render json: @softapplication, status: :created, location: @softapplication }
else else
format.js { render status: 406 } #format.js { render status: 406 }
format.html { render action: "new" } format.html { render action: "contests/show_attendingcontest" }
# format.json { render json: @softapplication.errors, status: :unprocessable_entity } # format.json { render json: @softapplication.errors, status: :unprocessable_entity }
end end
end end

View File

@ -53,10 +53,13 @@ module MembersHelper
# 当前申请加入的成员名单 # 当前申请加入的成员名单
def render_principals_for_applied_members(project) def render_principals_for_applied_members(project)
scope = Principal.active.sorted.applied_members(project).like(params[:q]) scope = project.applied_projects.map(&:user)
principal_count = scope.count principal_count = scope.count
principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page'] principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page']
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all offset ||= principal_pages.offset
principals = scope[offset, 10]
#principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
#principals = ApplicationController.new.paginateHelper scope,10
s = content_tag('div', principals_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals') s = content_tag('div', principals_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals')

View File

@ -4,6 +4,7 @@ class Notificationcomment < ActiveRecord::Base
include Redmine::SafeAttributes include Redmine::SafeAttributes
belongs_to :notificationcommented, :polymorphic => true#, :counter_cache => true belongs_to :notificationcommented, :polymorphic => true#, :counter_cache => true
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
belongs_to :Contestnotification
validates_presence_of :notificationcommented, :author, :notificationcomments validates_presence_of :notificationcommented, :author, :notificationcomments

View File

@ -11,7 +11,7 @@ class Softapplication < ActiveRecord::Base
belongs_to :project belongs_to :project
has_many :contests, :through => :contesting_softapplications has_many :contests, :through => :contesting_softapplications
validates_length_of :name, :maximum => 125 validates_length_of :name, :maximum => 25
validates_length_of :application_developers, :maximum => 125 validates_length_of :application_developers, :maximum => 125
validates_length_of :android_min_version_available, :maximum => 125 validates_length_of :android_min_version_available, :maximum => 125

View File

@ -8,7 +8,7 @@
<table width="100%" valign="center"> <table width="100%" valign="center">
<tr> <tr>
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span> <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(is_teacher && @bid.homeworks.count > 0) %> <%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher && @bid.homeworks.count > 0) %>
</td> </td>
<td align="right"> <td align="right">
<div class="project-search"> <div class="project-search">
@ -106,7 +106,7 @@
<td> <td>
<strong>提交文件:&nbsp; <strong>提交文件:&nbsp;
<% if is_evaluation || is_teacher%> <% if is_evaluation || is_teacher%>
<%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework, :remote => true%> <%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
<% else %> <% else %>
<span class="required">未开启互评功能作业不允许下载</span> <span class="required">未开启互评功能作业不允许下载</span>
<% end %> <% end %>

View File

@ -69,7 +69,21 @@
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<tr> <tr>
<td colspan="2" valign="top"><strong><%= link_to_user(notificationcomment.author) if notificationcomment.respond_to?(:author) %> </strong><span class="font_lighter"><%= l(:label_project_newadd) %></span><%= l(:label_comment_plural) %></td> <td colspan="2" valign="top">
<strong>
<%= link_to_user(notificationcomment.author) if notificationcomment.respond_to?(:author) %>
</strong>
<span class="font_lighter">
<%= l(:label_project_newadd) %>
</span>
<%= l(:label_comment_plural) %>
</td>
<td>
<% if notificationcomment.author==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), contest_contestnotification_notificationcomment_path(@contest, @contestnotification,notificationcomment),
:method => :delete,:confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<% end %>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" > <td colspan="2" width="580px" >

View File

@ -21,7 +21,7 @@
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %> <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> --> <!-- <%#= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -21,7 +21,7 @@
<%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %> <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense") %>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> --> <!-- <%#= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -104,6 +104,8 @@
<div class="memo-content"> <div class="memo-content">
<%= textilizable(@topic, :content) %> <%= textilizable(@topic, :content) %>
<%= link_to_attachments @topic, :author => false %> <%= link_to_attachments @topic, :author => false %>
<%# options = {:author => true, :deletable => @topic.author.eql?(User.current)} %>
<%#= render :partial => 'attachments/app_link', :locals => {:attachments => @topi.attachments, :options => options} %>
</div> </div>
<div class="memo-timestamp"> <div class="memo-timestamp">
<div style="float: left"><%= authoring @topic.created_on, @topic.author %></div> <div style="float: left"><%= authoring @topic.created_on, @topic.author %></div>

View File

@ -82,7 +82,7 @@
</span> </span>
<span id='enterprise' style='display:none'> <span id='enterprise' style='display:none'>
<p style="width:400px;padding-left: 26px;">企业名<%= text_field_tag :enterprise_name, @user.firstname %> <p style="width:400px;padding-left: 26px;"><%= l(:label_company_name)%><%= text_field_tag :enterprise_name, @user.firstname %>
</p> </p>
</span> </span>

View File

@ -113,7 +113,7 @@
<%= render :partial => 'attachments/form' %> <%= render :partial => 'attachments/form' %>
</p> </p>
<p style="font-size: 10px">1、<%=l(:label_upload_softapplication_packets_mustpacketed)%><br>2、<%=l(:label_upload_softapplication_photo_condition)%></p> <p style="font-size: 10px">1、<%=l(:label_upload_softapplication_packets_mustpacketed)%><br>2、<%=l(:label_upload_softapplication_photo_condition)%></p>
<p style="font-size: 10px; color: red"><%=l(:label_updated_caution)%></p> <!-- p style="font-size: 10px; color: red"><%#=l(:label_updated_caution)%></p-->
</fieldset> </fieldset>
</fieldset></br> </fieldset></br>

View File

@ -43,6 +43,7 @@
<% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %> <% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %>
<% act = e.act %> <% act = e.act %>
<% unless act.nil? %> <% unless act.nil? %>
<% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;"> <table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr> <tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td> <td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
@ -278,12 +279,15 @@
<% end %> <% end %>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580"> <td colspan="2" width="580" style="WORD-BREAK: break-all; WORD-WRAP: break-word">
<!--
<div class="issue-list-description"> <div class="issue-list-description">
<div class="wiki"> <div class="wiki">
</div>
</div>
-->
<%= textilizable act, :description %> <%= textilizable act, :description %>
</div>
</div>
<!-- <p class="font_description"> <%#= textilizable(act.description) %> </p> --> <!-- <p class="font_description"> <%#= textilizable(act.description) %> </p> -->
</td> </td>
</tr> </tr>
@ -320,12 +324,14 @@
</div> </div>
</tr> </tr>
<% else %> <% else %>
<% f=1 %> <%# f=1 %>
<% end %><!-- < % #case end %> --> <% end %><!-- < % #case end %> -->
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
<% end %>
<% end %><!-- < % #unless act.nil? end %> --> <% end %><!-- < % #unless act.nil? end %> -->
<% end %><!-- < % #@activity.each do |e| end%> --> <% end %><!-- < % #@activity.each do |e| end%> -->

View File

@ -169,13 +169,15 @@
(<%= link_to "#{files_count}份", course_files_path(course) %>资料) (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
</div> </div>
<!--
<div class='join_course_link'> <div class='join_course_link'>
<% if !course_endTime_timeout?(course) %> <%# if !course_endTime_timeout?(course) %>
<div> <div>
<%= join_in_course(course, User.current) %> <%#= join_in_course(course, User.current) %>
</div> </div>
<% end %> <%# end %>
</div> </div>
-->
</li> </li>
<%end%> <%end%>
<% end; reset_cycle %> <% end; reset_cycle %>

View File

@ -16,6 +16,9 @@
<%= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25, <%= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25,
:class => 'wiki-edit', :accesskey => accesskey(:edit) %> :class => 'wiki-edit', :accesskey => accesskey(:edit) %>
<!--p style="max-width:680px"><input id="editor02" required="true" /><%#= f.text_area :comments, :required => true, :id => 'editor02' %></p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script-->
<% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %> <% if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? %>
<%= fields_for @page do |fp| %> <%= fields_for @page do |fp| %>
<p> <p>

View File

@ -229,7 +229,7 @@ en:
field_description: Description field_description: Description
field_summary: Summary field_summary: Summary
field_is_required: Required field_is_required: Required
field_firstname: First name field_firstname: Name
field_lastname: Last name field_lastname: Last name
field_mail: Email field_mail: Email
field_job_category: Job category # added by bai field_job_category: Job category # added by bai
@ -1707,7 +1707,7 @@ en:
label_upload_softapplication_packets: Upload-apppacket label_upload_softapplication_packets: Upload-apppacket
label_upload_softapplication_photo: Upload-appphoto label_upload_softapplication_photo: Upload-appphoto
label_upload_softapplication_packets_mustpacketed: Works code and ralated-document must be packaged before upload. label_upload_softapplication_packets_mustpacketed: Works code and ralated-document must be packaged before upload.
label_upload_softapplication_photo_condition: Need upload 0~4 works screenshot, each is less than 5M, photo format such as gif,jpg,png etc. label_upload_softapplication_photo_condition: The best works. 0~4 (redundant pictures would not show page), each is less than 5M, photo format such as gif,jpg,png etc.
label_updated_caution: Note:if you edit the work, the uploaded screenshot and package will be deleted, please re-load! label_updated_caution: Note:if you edit the work, the uploaded screenshot and package will be deleted, please re-load!
label_softapplication_name: App-name label_softapplication_name: App-name
label_work_name: Work name label_work_name: Work name
@ -1799,3 +1799,6 @@ en:
# ajax异步验证 # ajax异步验证
modal_valid_passing: can be used. modal_valid_passing: can be used.
label_company_name: Company Name
notice_account_invalid_creditentials_new: You have not to the mailbox activation

View File

@ -1975,7 +1975,7 @@ zh:
label_upload_softapplication_packets: 上传应用软件包 label_upload_softapplication_packets: 上传应用软件包
label_upload_softapplication_photo: 上传产品截图 label_upload_softapplication_photo: 上传产品截图
label_upload_softapplication_packets_mustpacketed: 作品相关代码及相关说明文件必须打包后以压缩包的形式上传,便于上传和下载 label_upload_softapplication_packets_mustpacketed: 作品相关代码及相关说明文件必须打包后以压缩包的形式上传,便于上传和下载
label_upload_softapplication_photo_condition: 作品截图需上传0~4张格式为gif/jpg/png 每张小于5M label_upload_softapplication_photo_condition: 作品截图最好0~4张(多余图片不会再展示页面上显示)格式为gif/jpg/png 每张小于5M
label_updated_caution: 注意:若编辑参赛作品,则之前上传的软件包和截图都将被删除,请重新上传! label_updated_caution: 注意:若编辑参赛作品,则之前上传的软件包和截图都将被删除,请重新上传!
label_softapplication_name: 应用名称 label_softapplication_name: 应用名称
label_work_name: 作品名称 label_work_name: 作品名称
@ -2016,6 +2016,7 @@ zh:
label_contest_work_list: 参赛作品列表 label_contest_work_list: 参赛作品列表
label_attending_contest: 我要参赛 label_attending_contest: 我要参赛
label_contest_notification: 竞赛通知 label_contest_notification: 竞赛通知
label_company_name: 企业名
label_coursefile_sharingarea: 课程资源共享区 label_coursefile_sharingarea: 课程资源共享区
label_sort_by_activity: 按动态数排序 label_sort_by_activity: 按动态数排序

View File

@ -83,6 +83,10 @@ RedmineApp::Application.routes.draw do
end end
end end
#resources :notificationcomments do
#
#end
#resources :contestnotifications, :only => [:index, :show, :edit, :update, :destroy] #resources :contestnotifications, :only => [:index, :show, :edit, :update, :destroy]
# match '/contestnotifications/:id/notificationcomments', :to => 'notificationcomments#create', :via => :post # match '/contestnotifications/:id/notificationcomments', :to => 'notificationcomments#create', :via => :post
# match '/contestnotifications/:id/notificationcomments/:notificationcomment_id', :to => 'notificationcomments#destroy', :via => :delete # match '/contestnotifications/:id/notificationcomments/:notificationcomment_id', :to => 'notificationcomments#destroy', :via => :delete
@ -91,7 +95,9 @@ RedmineApp::Application.routes.draw do
resources :contests, only: [:index] do resources :contests, only: [:index] do
resources :contestnotifications do resources :contestnotifications do
# get 'preview', on: :collection # get 'preview', on: :collection
resources :notificationcomments resources :notificationcomments do
end
end end
collection do collection do

View File

@ -0,0 +1,20 @@
# -*coding:utf-8 -*-
class ChangeBoardsName < ActiveRecord::Migration
def up
boards = Board.where("project_id <> -1 and name like '%课程讨论区%'")
boards.each do |board|
board.name = "项目讨论区"
board.description = "项目讨论区"
board.save(:validate => false)
end
end
def down
boards = Board.where("project_id <> -1 and name like '%项目讨论区%'")
boards.each do |board|
board.name = " 课程讨论区"
board.description = " 课程讨论区"
board.save(:validate => false)
end
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140730024419) do ActiveRecord::Schema.define(:version => 20140801034242) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false