- 创新竞赛社区
+ <%=l(:label_contest_innovate_community)%>
<%= l(:label_user_location) %> :
diff --git a/app/views/layouts/_base_softapplication_top_content.html.erb b/app/views/layouts/_base_softapplication_top_content.html.erb
index 064e84cf0..71c708d63 100644
--- a/app/views/layouts/_base_softapplication_top_content.html.erb
+++ b/app/views/layouts/_base_softapplication_top_content.html.erb
@@ -1,7 +1,7 @@
- 创新竞赛社区
+ <%=l(:label_contest_innovate_community)%>
<%= l(:label_user_location) %> :
diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb
index 2bda701fe..94d55238a 100644
--- a/app/views/layouts/base_contest.html.erb
+++ b/app/views/layouts/base_contest.html.erb
@@ -26,7 +26,7 @@
- 创新竞赛社区
+ <%=l(:label_contest_innovate_community)%>
<%= l(:label_user_location) %> :
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 4e0135eaa..dfdf0a102 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -234,7 +234,7 @@
- <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview) %>
+ <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overviews) %>
<%= link_to l(:label_homework), homework_project_path(@project), :class => link_class(:homework), :project_type => 1 %>
diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb
index 97a6c1497..91120feb8 100644
--- a/app/views/layouts/base_newcontest.html.erb
+++ b/app/views/layouts/base_newcontest.html.erb
@@ -27,7 +27,7 @@
- 创新竞赛社区
+ <%=l(:label_contest_innovate_community)%>
<%= l(:label_user_location) %> :
@@ -43,7 +43,7 @@
<%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %>
<%=link_to l(:field_homepage), home_path %> >
<%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> >
- <%= link_to @contest.name, show_contest_contest_path %>
+ <%= link_to @contest.name, show_contest_contest_path(@contest) %>
@@ -95,21 +95,17 @@
-
-
+
-
- <%=link_to "#{@contest.watcher_users.count}", :controller => 'contests', :action => 'show_project' %>
+ <%=link_to "#{@contest.watcher_users.count}",show_project_contest_path(@contest) %>
<% if @contest.id == 2 or @contest.id == 3 or @contest.id == 6 %>
<%=link_to "#{@contest.projects.where('is_public=1').count}" %>
<% else %>
- <%=link_to "#{@contest.contesting_softapplications.count}", :controller => 'contests', :action => 'show_attendingcontest' %>
+ <%=link_to "#{@contest.contesting_softapplications.count}",show_attendingcontest_contest_path(@contest) %>
<% end %>
@@ -127,7 +123,7 @@
- <%= l(:lable_contest_user) %><%= link_to(@user.show_name, user_path(@user))%>
+ <%= l(:lable_contest_user) %>: <%= link_to(@user.name, user_path(@user))%>
<%= l(:label_bids_reward_method) %><%= @contest.budget%>
@@ -210,33 +206,19 @@
-
-
+
<% if display_main_menu?(@contest) %>
-
- <%= render_menu :contest_menu %>
+
+
+ <%= link_to l(:label_contest_userresponse), show_contest_contest_path(@contest), :class => link_class(:respond) %>
+ <%= link_to l(:label_contest_joincontest), show_attendingcontest_contest_path(@contest), :class => link_class(:attendingcontests) %>
+ <%= link_to l(:label_contest_notification), contest_contestnotifications_path(@contest), :class => link_class(:contestnotifications) %>
+
<% end %>
diff --git a/app/views/open_source_projects/_show_memo.html.erb b/app/views/open_source_projects/_show_memo.html.erb
index c5448a595..6633ccd75 100644
--- a/app/views/open_source_projects/_show_memo.html.erb
+++ b/app/views/open_source_projects/_show_memo.html.erb
@@ -61,7 +61,6 @@
帖子来源:<%=link_to 'OSChina', topic.url %>
- <%= no_use_link(topic, User.current) %>
diff --git a/app/views/open_source_projects/_show_topics.html.erb b/app/views/open_source_projects/_show_topics.html.erb
index f207cc552..38f689244 100644
--- a/app/views/open_source_projects/_show_topics.html.erb
+++ b/app/views/open_source_projects/_show_topics.html.erb
@@ -458,7 +458,6 @@
帖子来源:<%=link_to 'OSChina', topic.url %>
- <%= no_use_link(topic, User.current) %>
diff --git a/app/views/open_source_projects/showmemo.html.erb b/app/views/open_source_projects/showmemo.html.erb
index 387237113..7c3bd5c31 100644
--- a/app/views/open_source_projects/showmemo.html.erb
+++ b/app/views/open_source_projects/showmemo.html.erb
@@ -51,5 +51,6 @@
:title => l(:button_delete)
) if @forum.destroyable_by?(User.current) %>
+
<%= render :partial => 'open_source_projects/show_memo', :locals => {:memos => @memos, :open_source_project => @open_source_project} %>
\ No newline at end of file
diff --git a/app/controllers/roles_controller.rb b/app/views/roles/roles_controller.rb
similarity index 100%
rename from app/controllers/roles_controller.rb
rename to app/views/roles/roles_controller.rb
diff --git a/app/views/welcome/_link_to_another.html.erb b/app/views/welcome/_link_to_another.html.erb
index f5f360d3e..bda48e753 100644
--- a/app/views/welcome/_link_to_another.html.erb
+++ b/app/views/welcome/_link_to_another.html.erb
@@ -1,6 +1,6 @@
\ No newline at end of file
diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb
index e6c3ab1f5..c87cc13e1 100644
--- a/app/views/welcome/contest.html.erb
+++ b/app/views/welcome/contest.html.erb
@@ -109,7 +109,7 @@
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
-
微信扫码
+
<%=l(:label_weixin)%>
@@ -118,13 +118,13 @@
- <%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_contest) %> , <%= l(:label_welcome_trustie_contest_description) %>
+ <%= l(:label_welcome_trustie) %> <%= l(:label_welcome_trustie_contest) %> , <%= l(:label_welcome_trustie_contest_description) %>
<%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
- <%= text_field_tag 'name', params[:name], placeholder:'请输入要搜索的关键字', name: "name", :class => 'blueinputbar', :style => 'width:240px; padding-right:50px;'%>
+ <%= text_field_tag 'name', params[:name], :placeholder => l(:label_search_intimation), name: "name", :class => 'blueinputbar', :style => 'width:240px; padding-right:50px;'%>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise" , :name => nil%>
@@ -138,9 +138,9 @@
-
-
最新热门竞赛
-
<%= link_to "更多>>", {:controller => 'contests', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %>
+
+
<%=l(:label_current_hot_contest)%>
+
<%= link_to l(:label_more_information), {:controller => 'contests', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %>
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
@@ -154,9 +154,9 @@
<%= link_to(contest.name, show_contest_contest_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
<% if contest.id == 2 or contest.id == 3 or contest.id == 6 %>
- (<%= link_to("含#{contest.projects.where('is_public=1').count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %> )
+ (<%= link_to("#{contest.projects.where('is_public=1').count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %> )
<% else %>
- (<%= link_to("含#{contest.contesting_softapplications.count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %> )
+ (<%= link_to("#{contest.contesting_softapplications.count}"+l(:label_work_quantity), show_attendingcontest_contest_path(contest), :target => "_blank") %> )
<% end %>
@@ -166,7 +166,7 @@
- 发布时间:<%=format_time contest.created_on %>
+ <%=l(:label_release_time)%>: <%=format_time contest.created_on %>
@@ -177,16 +177,39 @@
+
+
+ <%=l(:label_notification)%>
+
+
<%#= link_to l(:label_more_information), forums_path %>
+
+
+ 2014年Android程序设计大赛获奖名单
+
+
+ 一等奖:  消灭那怪兽
+ 二等奖:  兄弟向前冲
+ 二等奖:  鸟鸟文件管理器(银河之光版)
+ 三等奖:  疯狂猜图
+ 三等奖:  愉快的定向越野
+ 三等奖:  体能训练助手
+ 三等奖:  迷你日记本
+ 三等奖:  永齐飞机大战
+
+
+
+
+
- 问题和反馈动态
- <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
- <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
+ <%=l(:label_issue_feedback_activities)%>
+ <%= link_to l(:label_my_question), newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
+ <%= link_to l(:label_my_feedback), suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
-
<%= link_to "更多>>", forums_path %>
+
<%= link_to l(:label_more_information), forums_path %>
- <% find_new_forum_topics(11).each do |topic|%>
+ <% find_new_forum_topics(8).each do |topic|%>
@@ -197,13 +220,13 @@
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
- 楼主: <%= link_to_user(topic.author) %>
+ <%=l(:label_question_sponsor)%>: <%= link_to_user(topic.author) %>
- 最后回复:<%=link_to_user topic.last_reply.try(:author) %>
+ <%=l(:label_final_reply)%>: <%=link_to_user topic.last_reply.try(:author) %>
- 回复(<%= link_to topic.try(:replies_count), topic.event_url %>)
+ <%=l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>)
@@ -213,9 +236,10 @@
-
-
最新参赛作品
-
<%= link_to "更多>>", {:controller => 'softapplications', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %>
+
+
+
<%=l(:label_current_attendingcontest_work)%>
+
<%= link_to l(:label_more_information), {:controller => 'softapplications', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %>
<% if Softapplication.count > 0%>
@@ -235,7 +259,7 @@
- 发布时间:<%=format_time softapplication.created_at %>
+ <%=l(:label_release_time)%>: <%=format_time softapplication.created_at %>
@@ -249,6 +273,8 @@
+
+
<%= render partial: 'link_to_another' %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index d8bfc966c..0f987b81b 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1199,7 +1199,7 @@ en:
label_message: message board
field_add: Add before %{time}
button_more: More
- label_user_response: Feedbacks # modified by bai
+ label_user_response: Feedback # modified by bai
label_bidding_project: projects
button_bidding: I will participate in it
label_new_call: New call
@@ -1228,9 +1228,9 @@ en:
label_follow_people: following # modified by bai
#modify by men
label_x_follow_people:
- zero: follower
- one: follower
- other: followers
+ zero: Follower
+ one: Follower
+ other: Followers
#end
label_member_since: joined
label_contribute_to: Participates %{project_count} projects:
@@ -1271,9 +1271,9 @@ en:
other: comments
#end
label_x_followers: #modified by men
- zero: follower
- one: follower
- other: followers
+ zero: Follower
+ one: Follower
+ other: Followers
#end
@@ -1406,7 +1406,7 @@ en:
label_bid_project: projects
label_project_no_follow: The project hasn't been followed now!
label_no_bid_project: has no participate project
- label_bids_reward_method: reward:
+ label_bids_reward_method: Reward:
label_bids_reward_what: input what for reward
label_call_bonus: bonus
label_bids_form_new_description: Publish a requirement,a competition or a course work.
@@ -1423,11 +1423,13 @@ en:
#end
label_bids_published: published
label_bids_published_ago: ago
- label_welcome_trustie: Trustie forge
+ label_welcome_trustie: Trustie
label_welcome_trustie_project: Online projects hosting platform
label_welcome_trustie_course: Online Courses practice platform
+ label_welcome_trustie_contest: Online Contests practice platform
label_welcome_trustie_project_description: Software for Chinese college students and practitioners to provide social-oriented project management, code hosting, resource sharing, cooperation and exchange.
label_welcome_trustie_course_description: Teachers and Students for Chinese universities to provide social-oriented curriculum management, resource sharing, cooperation achieved, collaborative research.
+ label_welcome_trustie_contest_description: Software for Chinese college students and practitioners to provide social-oriented contest management, code hosting, resource sharing, cooperation and exchange.
label_welcome_trustie_description: a socialized collaboration platform for project management, collaborative research, software development and software crowdsourcing for creative university students and entrepreneurs.
label_user_project: Projects
label_bid_respond_quote: Respond
@@ -1579,7 +1581,11 @@ en:
label_course_file: File
label_stores_index: Resource search
label_course_news: News
-
+ #wang
+ label_contest_userresponse: Userresponse
+ label_contest_joincontest: Joincontest
+ label_contest_notification: Notification
+ #end
label_x_base_courses_member:
zero: member
one: member
@@ -1607,7 +1613,7 @@ en:
label_user_location: Location
label_requirement_enterprise: Requirements
label_requirement_enterprise_list: Requirements List
- label_contest_innovate: Competitions
+ label_contest_innovate: Competition community
label_software_user: Users
label_course_practice: Courses
label_course_all: Teacher
@@ -1642,5 +1648,144 @@ en:
label_have_message : have a new message
label_login_prompt: Email/NickName
:lable_not_receive_mail: Click here don't receive email form site!
+#added by linchun as competition#
+
+ label_current_hot_contest: Latest Hot Competition
+ label_current_attendingcontest_work: Latest Competition Work
+ label_issue_feedback_activities: Question&Feedback
+ label_more_information: More...
+ label_my_question: My-question
+ label_my_feedback: My-feedback
+ label_release_time: Release-time
+ label_question_sponsor: Sponsor
+ label_final_reply: Final-reply
+ label_reply: Reply
+ label_weixin: WeiXin
+ label_search_intimation: please input the keywords
+ label_work_quantity: work
+ label_projects_management_platform: Projects-platform
+ label_courses_management_platform: Courses-platform
+ label_contests_management_platform: Competitions-platform
+ label_contest_work: Competition work
+ label_contests_reward_method: Reward method
+ label_attendingcontestwork_developers: Developers
+ label_attendingcontestwork_release_time: Release time
+ label_attendingcontestwork_belongs_contest: Contesting
+ label_attendingcontestwork_belongs_type: Work-type
+ label_attendingcontestwork_release_person: Release person
+ label_attendingcontestwork_adaptive_system: Adaptive-system
+ label_attendingcontestwork_download: Work download
+ label_attendingcontestwork_average_scores: Average score
+ label_attendingcontestwork_deposit_project: Deposit project
+ label_attendingcontestwork_sorting_intimation: You can re-scoring, but just record the last scoring result!
+
+ label_upload_files: Files-upload
+ label_upload_softwarepackage: Softwarepackage-upload
+ label_upload_cuttingphoto: Photo-upload
+ label_system_platform: Platform
+ label_nextstep: Next
+ label_participate: Participate
+ label_setting: Setting
+ label_contest_project: Competition-project
+ label_contest_softapplication: Competition-application
+ label_contest_response: Feedback
+ label_contest_watchers: Watchers
+ label_contest_work: Competition-work
+ button_contesting_as_project: Competition(New-project)
+ button_contesting_as_application: Competition(Release-app)
+ label_release_softapplication: Release-application
+ label_upload_softapplication_packets: Upload-apppacket
+ label_upload_softapplication_photo: Upload-appphoto
+ 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_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_work_name: Work name
+ label_softapplication_description: App-description
+ label_work_description: Work description
+ label_work_scores: Work score
+ label_work_rating: Work rating
+ label_work_tishi: You can re-scoring, but just record the last scoring result!
+ label_work_scores_proportion: Score porportion
+ label_softapplication_type: App-type
+ label_work_type: Work type
+ label_work_photo: Work photo
+ label_work_comment: Work comment
+ label_softapplication_version_available: Version
+ label_running_platform: Running platform
+ label_softapplication_developer: Upload person
+ label_softapplication_developers: Developers
+ label_work_deposit_project_url: Deposit url
+ label_work_deposit_project: Deposit project
+ label_softapplication_name_condition: Less than 50 characters
+ label_softapplication_description_condition: Less than 250 characters
+ label_user_login_softapplication_board: You are not logged in, please log in and then participate in the evaluation!
+ label_user_login_attending_contest: You are not logged in, please log in and then join the competition!
+ label_contest_description_no: No description
+ label_no_contest_softapplication: No application
+ label_button_ok: Ok
+ label_tags_contest: Competition tag
+ label_final_scores: Final scores
+ label_rating_person_amount: Rating person
+ label_tags_contest_description: Contest description
+ label_release_add_contest_succeed: The application succeed released and added!
+ label_add_contest_succeed_fail: Added fails, the application has been joined the competition!
+ label_no_ftapplication: No application
+ label_edit_softapplication: Edit application
+ label_edit_work: Edit work
+ label_contest_delete: Delete contest
+ label_noawards_current: No awards
+ label_softapplication: Application software
+ label_attending_contest: Joining
+ label_new_attendingcontest_work: New competition work
+ label_workname_lengthlimit: Less than 50 characters
+ label_workdescription_lengthlimit: Less than 250 characters
+ label_please_input_password: Please input the competition password!
+ label_please_select_project: Please select the project!
+ label_upload_softworkpacket_photo: Upload work package and screenshots
+ label_reward: Reward
+ label_please_select_contestingsoftapplication: Please select the competition application!
+ label_attendingcontest_time: Join-contest time
+ label_attendingcontest_spoksman: Join-contest representive
+ label_wellmeaning_intimation_contentone: Note:if you are ready attenging contest, please click"New competition work"!
+ label_wellmeaning_intimation_contenttwo: if you have already completed the development, and just release your work, you can not select"Deposit project"!
+ label_wellmeaning_intimation_contentthree: if you want to deposit the competition data and code, and want to keep track of the development and code-submission,please selcet a created project from"Deposit project", if you have no project, please click"New project"!
+
+ notice_attendingcontest_work_successfully_created: Congratulations, competition work successfully created!
+ notice_softapplication_was_successfully_updated: Congratulations, competition work successfully updated!
+
+ label_contest_notification: Notice
+ lable_contest_user: Release person
+ label_contest_innovate_community: Competition community
+
+ label_user_login_score_and_comment: You are not logged in, please log in and then score and comment the work!
+ label_user_login_notificationcomment: You are not logged in, please log in and then comment the notification!
+ label_contest_work_list: Competition work list
+
+
+ label_borad_project: Project-borad
+ label_search_intimation: please input the searching keywords!
+ label_update_time: Update time
+ label_project_notice: release the notice
+ label_no_file_uploaded: No file uploaded
+ label_forum_new: New forum
+ label_memo_new_from_forum: Release memo
+
+ label_user_grade: Individual score
+ label_active_homework: homework
+ label_course_term: Semester
+ label_comment_time: Comment time
+ label_bidding_user_studentcode: Student ID
+
+ label_organizers: Organizer
+ label_organizers_information: National Key Laboratory of Parallel and Distributed Processing, NUDT
+ label_organizers_information_institute: Department of Computer Sciencer and Technology
+ label_copyright: Copyright
+ label_contact_us: Contact us
+ label_record: 湘ICP备09019772
+ label_check_comment: Check comment
+ label_notification: Notification
+#end
+
# ajax异步验证
modal_valid_passing: can be used.
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 0625ebe6a..483d5e10b 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -563,7 +563,7 @@ zh:
label_enterprise_into: 进入企业
label_college_into: 进入高校
label_investor: 投资人:
- lable_contest_user: 竞赛发布人: #huang
+ lable_contest_user: 竞赛发布人
label_user_home: 创客空间
label_user_location: 当前位置
label_course_term: 开课学期
@@ -586,6 +586,7 @@ zh:
label_user_login_project_board: 您还没有登录,请登录后参与项目讨论
label_user_login_attending_contest: 您还没有登录,请登录后参赛
label_user_login_score_and_comment: 您还没有登录,请登录后对作品进行打分评价
+ label_user_login_notificationcomment: 您还没有登录,请登录后参加评论
#end
#by huang # modified by bai
label_college: 高校进入
@@ -1730,6 +1731,11 @@ zh:
label_course_homework_list: 作业列表
label_course_homework_new: 发布作业
label_fork_homework_new: 选为作业
+ #wang
+ label_contest_userresponse: 用户留言
+ label_contest_joincontest: 参入竞赛
+ label_contest_notification: 竞赛通知
+ #end
label_x_course_data:
zero: 资料
@@ -1995,6 +2001,36 @@ zh:
label_attendingcontestwork_deposit_project: 托管项目
label_attendingcontestwork_sorting_intimation: 您可以重新打分,打分结果以最后一次打分为主!
lable_not_receive_mail: 点此设置接收本站邮件偏好!
+ label_contest_notification: 竞赛通知
+ label_contest_innovate_community: 创新竞赛社区
+ #english site translation
+ label_current_hot_contest: 最新热门竞赛
+ label_current_attendingcontest_work: 最新参赛作品
+ label_issue_feedback_activities: 问题和反馈动态
+ label_more_information: 更多...
+ label_my_question: 我要提问
+ label_my_feedback: 我要反馈
+ label_release_time: 发布时间
+ label_question_sponsor: 楼主
+ label_final_reply: 最后回复
+ label_reply: 回复
+ label_weixin: 微信扫码
+ label_search_intimation: 请输入要搜索的关键字
+ label_work_quantity: 个作品
+ label_projects_management_platform: 项目托管平台
+ label_courses_management_platform: 课程实践平台
+ label_contests_management_platform: 竞赛托管平台
+
+ label_organizers: 主办单位
+ label_organizers_information: 国防科学技术大学并行与分布处理国家重点实验室
+ label_organizers_information_institute: 计算机科学与技术系
+ label_copyright: 版权
+ label_contact_us: 联系我们
+ label_record: 湘ICP备09019772
+ label_check_comment: 查看通知评论
+ label_notification: 通知公告
+ #end
+
#end
# ajax异步验证
diff --git a/config/routes.rb b/config/routes.rb
index 1412edaf1..b84885e29 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -16,6 +16,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
RedmineApp::Application.routes.draw do
+
+
+ #match '/contests/:id/contestnotifications', :controller => 'contestnotifications', :action => 'index'
+
resources :homework_users
resources :no_uses
@@ -76,8 +80,17 @@ RedmineApp::Application.routes.draw do
end
end
+ #resources :contestnotifications, :only => [:index, :show, :edit, :update, :destroy]
+ # match '/contestnotifications/:id/notificationcomments', :to => 'notificationcomments#create', :via => :post
+ # match '/contestnotifications/:id/notificationcomments/:notificationcomment_id', :to => 'notificationcomments#destroy', :via => :delete
+ match '/contestnotifications/preview', :controller => 'previews', :action => 'contestnotification', :as => 'preview_contestnotifications', :via => [:get, :post, :put]
## new added by linchun #新竞赛相关
resources :contests, only: [:index] do
+ resources :contestnotifications do
+ # get 'preview', on: :collection
+ resources :notificationcomments
+ end
+
collection do
match 'new_contest' , via: :get
match 'join_in_contest' , via: :post
@@ -90,11 +103,11 @@ RedmineApp::Application.routes.draw do
delete 'destroy_contest'
match 'add_softapplication'
match 'update_contest' , via: [:put]
- match 'show_contest' , via: :get
+ match 'show_contest' , via: [:get, :post]
match 'show_project' , via: :get
match 'show_softapplication' , via: :get
match 'show_attendingcontest' , via: :get
- match 'show_notification' , via: :get
+ #match 'show_notification' , via: :get
match 'show_participator' , via: :get
match 'set_reward_project' , via: [:get, :post]
match 'set_reward_softapplication' , via: [:get, :post]
diff --git a/db/migrate/20140401004102_create_relative_memos.rb b/db/migrate/20140401004102_create_relative_memos.rb
index 6f0d776db..04b8862a3 100644
--- a/db/migrate/20140401004102_create_relative_memos.rb
+++ b/db/migrate/20140401004102_create_relative_memos.rb
@@ -4,7 +4,7 @@ class CreateRelativeMemos < ActiveRecord::Migration
t.integer :osp_id, :null => true
t.integer :parent_id, null: true
t.string :subject, null: false
- t.mediumtext :content, null: false
+ t.text :content, null: false
t.integer :author_id
t.integer :replies_count, default: 0
t.integer :last_reply_id
diff --git a/db/migrate/20140530010015_create_contestnotifications.rb b/db/migrate/20140530010015_create_contestnotifications.rb
new file mode 100644
index 000000000..5aa1e2f9f
--- /dev/null
+++ b/db/migrate/20140530010015_create_contestnotifications.rb
@@ -0,0 +1,14 @@
+class CreateContestnotifications < ActiveRecord::Migration
+ def change
+ create_table :contestnotifications do |t|
+ t.integer :contest_id
+ t.string :title
+ t.string :summary
+ t.string :description
+ t.integer :author_id
+ t.integer :notificationcomments_count
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140605003915_create_notificationcomments.rb b/db/migrate/20140605003915_create_notificationcomments.rb
new file mode 100644
index 000000000..58588d0a5
--- /dev/null
+++ b/db/migrate/20140605003915_create_notificationcomments.rb
@@ -0,0 +1,12 @@
+class CreateNotificationcomments < ActiveRecord::Migration
+ def change
+ create_table :notificationcomments do |t|
+ t.string :notificationcommented_type
+ t.integer :notificationcommented_id
+ t.integer :author_id
+ t.text :notificationcomments
+
+ t.timestamps
+ end
+ end
+end
diff --git a/lib/redmine.rb b/lib/redmine.rb
index 7d3aa9ea7..0fb13076e 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -93,6 +93,7 @@ Redmine::AccessControl.map do |map|
map.permission :edit_project, {:projects => [:settings, :edit, :update]}, :require => :member
map.permission :close_project, {:projects => [:close, :reopen]}, :require => :member, :read => true
map.permission :select_project_modules, {:projects => :modules}, :require => :member
+ map.permission :select_contest_modules, {:contests => :modules}, :require => :member
map.permission :manage_members, {:projects => :settings, :members => [:index, :show, :create, :update, :destroy, :autocomplete]}, :require => :member
map.permission :manage_versions, {:projects => :settings, :versions => [:new, :create, :edit, :update, :close_completed, :destroy]}, :require => :member
map.permission :add_subprojects, {:projects => [:new, :create]}, :require => :member
@@ -146,6 +147,12 @@ Redmine::AccessControl.map do |map|
map.permission :comment_news, {:comments => :create}
end
+ map.contest_module :contestnotifications do |map|
+ map.permission :manage_contestnotifications, {:contestnotifications => [:new, :create, :edit, :update, :destroy], :notificationcomments => [:destroy]}, :require => :member
+ map.permission :view_contestnotifications, {:contestnotifications => [:index, :show]}, :public => true, :read => true
+ map.permission :notificationcomment_contestnotifications, {:notificationcomments => :create}
+ end
+
map.project_module :documents do |map|
map.permission :add_documents, {:documents => [:new, :create, :add_attachment]}, :require => :loggedin
map.permission :edit_documents, {:documents => [:edit, :update, :add_attachment]}, :require => :loggedin
@@ -306,7 +313,8 @@ Redmine::MenuManager.map :contest_menu do |menu|
#menu.push :project, :show_project_contest_path, :caption => :label_contest_project
#menu.push :application, :show_softapplication_contest_path, :caption => :label_contest_application
menu.push :attendingcontest, {:controller => 'contests', :action => 'show_attendingcontest'}, :caption => :label_attending_contest
- # menu.push :contestnotification, {:controller => 'contests', :action => 'show_notification'}, :caption => :label_contest_notification
+ menu.push :contestnotifications, { :controller => 'contestnotifications', :action => 'index' }, :param => :contest_id, :caption => :label_contest_notification
+ #menu.push :contestnotification, {:controller => 'contests', :action => 'show_notification'}, :caption => :label_contest_notification
# menu.push :attendingcontest, :show_attendingcontest_contest_path, :caption => :label_attendin,g_contest
# menu.push :result, { :controller => 'bids', :action => 'show_results' },
# :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }
@@ -409,6 +417,7 @@ Redmine::Activity.map do |activity|
activity.register :issues, :class_name => %w(Issue Journal)
activity.register :changesets
activity.register :news
+ activity.register :contestnotification
activity.register :documents, :class_name => %w(Document Attachment)
activity.register :files, :class_name => 'Attachment'
activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false
@@ -424,6 +433,7 @@ end
Redmine::Search.map do |search|
search.register :issues
search.register :news
+ search.register :contestnotification
search.register :documents
search.register :changesets
search.register :wiki_pages
diff --git a/lib/redmine/access_control.rb b/lib/redmine/access_control.rb
index 7c4a5a5ec..dfde5debc 100644
--- a/lib/redmine/access_control.rb
+++ b/lib/redmine/access_control.rb
@@ -67,20 +67,26 @@ module Redmine
def available_project_modules
@available_project_modules ||= @permissions.collect(&:project_module).uniq.compact
end
-
+ def available_contest_modules
+ @available_contest_modules ||= @permissions.collect(&:contest_module).uniq.compact
+ end
+
def modules_permissions(modules)
@permissions.select {|p| p.project_module.nil? || modules.include?(p.project_module.to_s)}
+ @permissions.select {|p| p.contest_module.nil? || modules.include?(p.contest_module.to_s)}
end
end
class Mapper
def initialize
@project_module = nil
+ @contest_module = nil
end
def permission(name, hash, options={})
@permissions ||= []
options.merge!(:project_module => @project_module)
+ options.merge!(:contest_module => @contest_module)
@permissions << Permission.new(name, hash, options)
end
@@ -90,13 +96,19 @@ module Redmine
@project_module = nil
end
+ def contest_module(name, options={})
+ @contest_module = name
+ yield self
+ @contest_module = nil
+ end
+
def mapped_permissions
@permissions
end
end
class Permission
- attr_reader :name, :actions, :project_module
+ attr_reader :name, :actions, :project_module, :contest_module
def initialize(name, hash, options)
@name = name
@@ -105,6 +117,8 @@ module Redmine
@require = options[:require]
@read = options[:read] || false
@project_module = options[:project_module]
+ @contest_module = options[:contest_module]
+
hash.each do |controller, actions|
if actions.is_a? Array
@actions << actions.collect {|action| "#{controller}/#{action}"}
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index f5a21da5f..57a9ea013 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -2072,6 +2072,7 @@ button.tab-left, button.tab-right {
padding:4px;
width: 20px;
bottom: -1px;
+
}
button.tab-left {
@@ -2115,6 +2116,9 @@ button.tab-right {
font-weight:bold;
border-top-left-radius:4px;
border-top-right-radius:4px;
+ /*new added*/
+ margin-top: 16px;
+ /*end*/
}
#content .tabs_new ul li a:hover {
@@ -2747,6 +2751,12 @@ div.repos_explain{
border-bottom: 1px dashed rgb(204, 204, 204);
width: 688px;
}
+.underline-contests_four{
+ margin-bottom: 10px;
+ border-bottom: 1px dashed rgb(204, 204, 204);
+ width: 349px;
+ padding-bottom:5px
+}
.contest-star{
color: #bb0000;
}
diff --git a/public/stylesheets/buglist-div-use.css b/public/stylesheets/buglist-div-use.css
index de0c7c4ad..8ee6af1e8 100644
--- a/public/stylesheets/buglist-div-use.css
+++ b/public/stylesheets/buglist-div-use.css
@@ -31,7 +31,7 @@
overflow: hidden;
float: left;
width: 440px;
- left: 3%;
+ left: 2%;
}
diff --git a/public/stylesheets/buglist.css b/public/stylesheets/buglist.css
index 4bc9267f7..49e816581 100644
--- a/public/stylesheets/buglist.css
+++ b/public/stylesheets/buglist.css
@@ -9,6 +9,7 @@ padding:0 0 0 0px;
.li_time {
padding:0 7px 0 0;
+list-style-type: square;
}
diff --git a/test/fixtures/contestnotifications.yml b/test/fixtures/contestnotifications.yml
new file mode 100644
index 000000000..6409a5f71
--- /dev/null
+++ b/test/fixtures/contestnotifications.yml
@@ -0,0 +1,17 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ contest_id: 1
+ title: MyString
+ summary: MyString
+ description: MyString
+ author_id: 1
+ comments_count: 1
+
+two:
+ contest_id: 1
+ title: MyString
+ summary: MyString
+ description: MyString
+ author_id: 1
+ comments_count: 1
diff --git a/test/fixtures/notificationcomments.yml b/test/fixtures/notificationcomments.yml
new file mode 100644
index 000000000..54c42b849
--- /dev/null
+++ b/test/fixtures/notificationcomments.yml
@@ -0,0 +1,13 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ notificationcommented_type: MyString
+ notificationcommented_id: 1
+ author_id: 1
+ notificationcomments: MyText
+
+two:
+ notificationcommented_type: MyString
+ notificationcommented_id: 1
+ author_id: 1
+ notificationcomments: MyText
diff --git a/test/functional/contestnotifications_controller_test.rb b/test/functional/contestnotifications_controller_test.rb
new file mode 100644
index 000000000..948955a87
--- /dev/null
+++ b/test/functional/contestnotifications_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class ContestnotificationsControllerTest < ActionController::TestCase
+ setup do
+ @contestnotification = contestnotifications(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:contestnotifications)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create contestnotification" do
+ assert_difference('Contestnotification.count') do
+ post :create, contestnotification: { author_id: @contestnotification.author_id, comments_count: @contestnotification.comments_count, contest_id: @contestnotification.contest_id, description: @contestnotification.description, summary: @contestnotification.summary, title: @contestnotification.title }
+ end
+
+ assert_redirected_to contestnotification_path(assigns(:contestnotification))
+ end
+
+ test "should show contestnotification" do
+ get :show, id: @contestnotification
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @contestnotification
+ assert_response :success
+ end
+
+ test "should update contestnotification" do
+ put :update, id: @contestnotification, contestnotification: { author_id: @contestnotification.author_id, comments_count: @contestnotification.comments_count, contest_id: @contestnotification.contest_id, description: @contestnotification.description, summary: @contestnotification.summary, title: @contestnotification.title }
+ assert_redirected_to contestnotification_path(assigns(:contestnotification))
+ end
+
+ test "should destroy contestnotification" do
+ assert_difference('Contestnotification.count', -1) do
+ delete :destroy, id: @contestnotification
+ end
+
+ assert_redirected_to contestnotifications_path
+ end
+end
diff --git a/test/functional/notificationcomments_controller_test.rb b/test/functional/notificationcomments_controller_test.rb
new file mode 100644
index 000000000..21496467e
--- /dev/null
+++ b/test/functional/notificationcomments_controller_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class NotificationcommentsControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/unit/contestnotification_test.rb b/test/unit/contestnotification_test.rb
new file mode 100644
index 000000000..22b8113c7
--- /dev/null
+++ b/test/unit/contestnotification_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ContestnotificationTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/unit/helpers/contestnotifications_helper_test.rb b/test/unit/helpers/contestnotifications_helper_test.rb
new file mode 100644
index 000000000..d79755d82
--- /dev/null
+++ b/test/unit/helpers/contestnotifications_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ContestnotificationsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/notificationcomments_helper_test.rb b/test/unit/helpers/notificationcomments_helper_test.rb
new file mode 100644
index 000000000..ecec0cbde
--- /dev/null
+++ b/test/unit/helpers/notificationcomments_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class NotificationcommentsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/notificationcomments_test.rb b/test/unit/notificationcomments_test.rb
new file mode 100644
index 000000000..798084efb
--- /dev/null
+++ b/test/unit/notificationcomments_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class NotificationcommentsTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end