diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 7741333a8..debda938f 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -5,7 +5,7 @@ class ContestsController < ApplicationController menu_item :project, :only => :show_project menu_item :application, :only => :show_softapplication menu_item :attendingcontest, :only => :show_attendingcontest - before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward, + before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :set_reward_project, :set_reward_softapplication, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward, :show_contest_project, :show_contest_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings] # added by fq @@ -335,7 +335,12 @@ class ContestsController < ApplicationController end ##取出参赛应用 @softapplication = Softapplication.all - @contesting_softapplication = @contest.contesting_softapplications.reverse + @contesting_softapplication = @contest.contesting_softapplications. + joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id"). + joins("LEFT JOIN ( + SELECT * FROM seems_rateable_cached_ratings WHERE cacheable_type='Softapplication' AND DIMENSION = 'quality') AS cached + ON cached.cacheable_id=softapplications.id"). + order("cached.avg").reverse_order @contesting_softapplication = paginateHelper @contesting_softapplication, 10 @@ -350,6 +355,44 @@ class ContestsController < ApplicationController end ###end + + def set_reward_project + @c_p = nil + @contesting_project_id = nil + + if params[:set_reward_project][:reward]&&((User.current.id==@contest.author_id)||User.current.admin) + # @bid_id = params[:id] + @contesting_project_id = params[:set_reward_project][:c_id] + @c_p = ContestingProject.find_by_id(@contesting_project_id) + + # 把字段存进表中 + @c_p.update_reward(params[:set_reward_project][:reward].to_s) + end + + respond_to do |format| + format.js + end + end + + def set_reward_softapplication + @c_sa = nil + @contesting_softapplication_id = nil + + if params[:set_reward_softapplication][:reward]&&((User.current.id==@contest.author_id)||User.current.admin) + # @bid_id = params[:id] + @contesting_softapplication_id = params[:set_reward_softapplication][:c_id] + @c_sa = ContestingSoftapplication.find_by_id(@contesting_softapplication_id) + + # 把字段存进表中 + @c_sa.update_reward(params[:set_reward_softapplication][:reward].to_s) + end + + respond_to do |format| + format.js + end + end + + ###添加已创建的参赛项目 def add project = Project.find(params[:contest]) diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index 9ede52489..6860bfa6a 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -100,14 +100,34 @@ class SoftapplicationsController < ApplicationController # POST /softapplications # POST /softapplications.json + # def create + # @softapplication = Softapplication.new(params[:softapplication]) + # @softapplication.user = User.current + # @softapplication.save_attachments(params[:attachments]) + # respond_to do |format| + # if @softapplication.save + # format.js + # format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' } + # # format.json { render json: @softapplication, status: :created, location: @softapplication } + # else + # format.js { render status: 406 } + # format.html { render action: "new" } + # # format.json { render json: @softapplication.errors, status: :unprocessable_entity } + # end + # end + # end + + +#new changed created function def create @softapplication = Softapplication.new(params[:softapplication]) @softapplication.user = User.current @softapplication.save_attachments(params[:attachments]) respond_to do |format| if @softapplication.save + ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id) format.js - format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' } + format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]) } # format.json { render json: @softapplication, status: :created, location: @softapplication } else format.js { render status: 406 } @@ -115,8 +135,13 @@ class SoftapplicationsController < ApplicationController # format.json { render json: @softapplication.errors, status: :unprocessable_entity } end end + #关联新建的参赛作品 + + # @contesting_softapplication = paginateHelper @contest.contesting_softapplications + + + end - # PUT /softapplications/1 # PUT /softapplications/1.json def update diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6b8525a00..0c4514769 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -182,11 +182,27 @@ module ApplicationHelper end def thumbnail_tag(attachment) - link_to image_tag(thumbnail_path(attachment)), - named_attachment_path(attachment, attachment.filename), + imagepath = named_attachment_path(attachment, attachment.filename) + link_to image_tag(imagepath), + imagepath , :title => attachment.filename end + # 图片缩略图链接 + def thumbnail_small_tag(attachment) + imagesize = attachment.thumbnail(:size => "200*200") + imagepath = named_attachment_path(attachment, attachment.filename) + if imagesize + link_to image_tag(imagesize), + imagepath, + :title => attachment.filename + else + link_to image_tag(imagepath , height: '200', width: '250'), + imagepath, + :title => attachment.filename + end + end + def toggle_link(name, id, options={}) onclick = "$('##{id}').toggle(); " onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ") diff --git a/app/helpers/contests_helper.rb b/app/helpers/contests_helper.rb index 36f2351cb..fff2f785a 100644 --- a/app/helpers/contests_helper.rb +++ b/app/helpers/contests_helper.rb @@ -91,6 +91,10 @@ module ContestsHelper def get_prize(c_project) c_project.get_reward end + + def get_prize(c_softapplication) + c_softapplication.get_reward + end def count_contest_project contests = Contest.find(:id) diff --git a/app/helpers/open_source_projects_helper.rb b/app/helpers/open_source_projects_helper.rb index f758580d9..ce1593cf1 100644 --- a/app/helpers/open_source_projects_helper.rb +++ b/app/helpers/open_source_projects_helper.rb @@ -34,4 +34,8 @@ module OpenSourceProjectsHelper def get_open_source_projects_by_tag(tag_name) OpenSourceProject.tagged_with(tag_name).order('created_at desc') end + + def show_origin(url) + + end end diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 661762e5c..aff63439e 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -228,7 +228,6 @@ class Attachment < ActiveRecord::Base end size = 100 unless size > 0 target = File.join(self.class.thumbnails_storage_path, "#{id}_#{digest}_#{size}.thumb") - begin Redmine::Thumbnail.generate(self.diskfile, target, size) rescue => e diff --git a/app/models/contesting_softapplication.rb b/app/models/contesting_softapplication.rb index 93aea2658..f880818d9 100644 --- a/app/models/contesting_softapplication.rb +++ b/app/models/contesting_softapplication.rb @@ -11,5 +11,18 @@ class ContestingSoftapplication < ActiveRecord::Base self.create(:user_id => User.current.id, :contest_id => contest_id, :softapplication_id => softapplication_id, :description => description) end + + def self.create_work_contesting(contest_id, softapplication_id) + self.create(:user_id => User.current.id, :contest_id => contest_id, + :softapplication_id => softapplication_id) + end + + def update_reward(which) + self.update_attribute(:reward,which) + end + + def get_reward + self.reward + end end diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb index 6782b2436..3911424e9 100644 --- a/app/models/softapplication.rb +++ b/app/models/softapplication.rb @@ -1,5 +1,5 @@ class Softapplication < ActiveRecord::Base - attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers + attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers, :deposit_project_url acts_as_attachable seems_rateable :allow_update => true, :dimensions => :quality diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index c135ee214..f73df8fb4 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -33,7 +33,7 @@ <% if images.any? %>
<% images.each do |attachment| %> -
<%= thumbnail_tag(attachment) %>
+
<%= thumbnail_small_tag(attachment) %>
<% end %>
<% end %> diff --git a/app/views/contests/set_reward.js.erb b/app/views/contests/set_reward_project.js.erb similarity index 87% rename from app/views/contests/set_reward.js.erb rename to app/views/contests/set_reward_project.js.erb index d6d8c4f9f..c0de3e2ef 100644 --- a/app/views/contests/set_reward.js.erb +++ b/app/views/contests/set_reward_project.js.erb @@ -1,15 +1,14 @@ $('#reward_result_<%= @contesting_project_id %>').html('<%= j( -if get_prize(@b_p).nil? or get_prize(@b_p) == "" +if get_prize(@c_p).nil? or get_prize(@c_p) == "" if @contest.deadline < Date.today puts '未评奖' end else - case get_prize(@b_p) + case get_prize(@c_p) when '-1' image_tag("/images/bid/special_reward.png") - when '1' when '0' image_tag("/images/bid/first_reward.png") when '1' @@ -22,7 +21,7 @@ else image_tag("/images/bid/fifth_reward.png") when '5' image_tag("/images/bid/qualified.png") - end + end end ) diff --git a/app/views/contests/set_reward_softapplication.js.erb b/app/views/contests/set_reward_softapplication.js.erb new file mode 100644 index 000000000..a8cf0d486 --- /dev/null +++ b/app/views/contests/set_reward_softapplication.js.erb @@ -0,0 +1,30 @@ +$('#reward_result_<%= @contesting_softapplication_id %>').html('<%= j( + +if get_prize(@c_sa).nil? or get_prize(@c_sa) == "" + if @contest.deadline < Date.today + puts '未评奖' + end +else + + case get_prize(@c_sa) + when '-1' + image_tag("/images/bid/special_reward.png") + when '0' + image_tag("/images/bid/first_reward.png") + when '1' + image_tag("/images/bid/second_reward.png") + when '2' + image_tag("/images/bid/third_reward.png") + when '3' + image_tag("/images/bid/forth_reward.png") + when '4' + image_tag("/images/bid/fifth_reward.png") + when '5' + image_tag("/images/bid/qualified.png") + end + +end +) +%>') + +$('#<%= @contesting_softapplication_id %>').hide() diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index d63c4f816..7d2831e8f 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -61,41 +61,39 @@ -
- 温馨提示:如果您希望在我们平台托管参赛数据和代码,请按下面参赛步骤参赛! +
+ 温馨提示:如果您准备参加竞赛,请点击下面的"新建参赛作品"!
<% if User.current.logged? %> -
-
- 参赛步骤: +
+
+ 参加竞赛: + <%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %>
-
+ +
- - -
+ +
- 简介: + 简介: <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %>
-
- - 发布时间: - <%= format_time c_softapplication.created_at %> - - + +
+ 参赛时间:<%= format_time c_softapplication.created_at %> + 参赛代表:<%= c_softapplication.softapplication.user.name %> +
+ + +
+ 最终得分:<%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分 + + + + + <% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %> + <% if @contest.deadline < Date.today %> + <%= l(:label_noawards)%> + <% else%> + <%= l(:label_noawards_current)%> + <% end %> + <% else %> + <% case get_prize(c_softapplication) %> + <% when '-1' %> + <%= image_tag("/images/bid/special_reward.png")%> + <% when '0' %> + <%= image_tag("/images/bid/first_reward.png")%> + <% when '1' %> + <%= image_tag("/images/bid/second_reward.png")%> + <% when '2' %> + <%= image_tag("/images/bid/third_reward.png")%> + <% when '3' %> + <%= image_tag("/images/bid/forth_reward.png")%> + <% when '4' %> + <%= image_tag("/images/bid/fifth_reward.png")%> + <% when '5' %> + <%= image_tag("/images/bid/qualified.png")%> + <% end %> + <% end %> + + + + + + <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> +
+ <%= toggle_link '评奖', c_softapplication.id.to_s %> + + +
+ <% end %> +
<% end %> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index bbdfbfe66..785479bd5 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -140,7 +140,7 @@
- +
@@ -266,5 +266,7 @@ <%= call_hook :view_layouts_base_body_bottom %> + + \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 642d71649..91bb1387d 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -110,8 +110,7 @@ <%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %> - - + + + + + @@ -80,13 +86,14 @@ <% end %> -
-
最终得分
-
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
+
+
最终得分
+
<%=@softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分
+
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
-
+
打分总人数
-
<%= @softapplication.raters(:quality).count%>
+
<%= @softapplication.raters(:quality).count%>
diff --git a/app/views/users/_course_form.html.erb b/app/views/users/_course_form.html.erb index cadebff41..058c92d4e 100644 --- a/app/views/users/_course_form.html.erb +++ b/app/views/users/_course_form.html.erb @@ -1,56 +1,59 @@
-
    - <% for membership in memberships %> -
  • -
-
<%=h reply.content.html_safe %>
- +
<%=h sanitize(reply.content.html_safe) %>

<% if reply.attachments.any?%> <% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %> @@ -140,3 +139,11 @@


<% end %> + + + \ No newline at end of file diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index 116c25931..4f22fd140 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -185,3 +185,9 @@ <% end %> <% html_title @topic.subject %> + + \ No newline at end of file diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index 499c58b3c..4dfa21d52 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -1,100 +1,108 @@ - <% - if @project.project_type == 1 - btn_tips = l(:label_news_notice) - label_tips = l(:label_course_news) - else - btn_tips = l(:label_news_new) - label_tips = l(:label_news) - end + if @project.project_type == Project::ProjectType_course + btn_tips = l(:label_news_notice) + label_tips = l(:label_course_news) + else + btn_tips = l(:label_news_new) + label_tips = l(:label_news) + end %> -<% if @project && User.current.allowed_to?(:manage_news, @project) %> -
- <%= link_to(btn_tips, - new_project_news_path(@project), - :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %> -
- + + <%= label_tips %> + +<%= link_to(btn_tips, + new_project_news_path(@project), + :class => 'icon icon-add', + :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %> + +<% if @project && User.current.allowed_to?(:manage_news, @project) %> + <% end %> - -

<%=label_tips%>

- <% if @newss.empty? %> -

- <%= l(:label_no_data) %> -

- <% else %> - <% @newss.each do |news| %> - - - - - - -
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> - - <% if @project.project_type == 1 %> - - - - <% else %> - - - - <% end %> - - - - - - - -
<%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_notice)%><%= link_to h(news.title), news_path(news) %> - <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
<%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_newshare)%> <%= link_to h(news.title), news_path(news) %> - <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
<%= textilizable(news, :description) %>
<%= l :label_update_time %>: <%= format_time(news.created_on) %><%= link_to l(:label_project_newother),news_path(news)%><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %>
- <% end %> - <% end %> + <% if @newss.empty? %> +

+ <%= l(:label_no_data) %> +

+ <% else %> + <% @newss.each do |news| %> + + + + + + +
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %> + + <% if @project.project_type == 1 %> + + + + <% else %> + + + + <% end %> + + + + + + + +
+ <%= link_to_user(news.author) if news.respond_to?(:author) %><%= l(:label_project_notice) %><%= link_to h(news.title), news_path(news) %> + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> +
+ <%= link_to_user(news.author) if news.respond_to?(:author) %><%= l(:label_project_newshare) %> <%= link_to h(news.title), news_path(news) %> + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> +
+ <%= textilizable(news, :description) %>
<%= l :label_update_time %> + : <%= format_time(news.created_on) %><%= link_to l(:label_project_newother), news_path(news) %><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %>
+
+ <% end %> + <% end %>
- + - <% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %> - <% end %> + <% other_formats_links do |f| %> + <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %> + <% end %> - <% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> - <%= stylesheet_link_tag 'scm' %> - <% end %> + <% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> + <%= stylesheet_link_tag 'scm' %> + <% end %> - <% html_title(l(:label_news_plural)) -%> + <% html_title(l(:label_news_plural)) -%>
+ diff --git a/app/views/projects/_course.html.erb b/app/views/projects/_course.html.erb index 58168c999..adc7c9306 100644 --- a/app/views/projects/_course.html.erb +++ b/app/views/projects/_course.html.erb @@ -45,7 +45,7 @@ <%= content_tag('span', l(:label_x_data,:count => files_count)) %>

- <%= content_tag('span', link_to("#{@project.members.count}", member_project_path(@project)), :class => "info") %> + <%= content_tag('span', "#{@project.members.count}", :class => "info") %> <%= content_tag('span', l(:label_x_member, :count => @project.members.count)) %>

diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 09ab9738f..d11fd2564 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -36,7 +36,7 @@

git add .

git commit -m "first commit"

git config http.postBuffer 524288000 #设置本地post缓存为500MB

-

git push -u origin master:matser

+

git push -u origin master:master

从网上获取别人的开源版本库,转交到trustie网站上,打开命令行执行如下:

@@ -45,7 +45,7 @@

git add .

git commit -m "first commit"

git config http.postBuffer 524288000 #设置本地post缓存为500MB

-

git push -u trustie master:matser

+

git push -u trustie master:master

<%= link_to "李海提供", user_path(646)%>

diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 4bd6871a0..c077bc822 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -10,7 +10,6 @@

<%= notice %>

-
@@ -44,8 +43,15 @@ 开发人员:<%= @softapplication.application_developers %>
平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>发布时间:<%=format_time @softapplication.created_at %>平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>发布时间:<%=format_time @softapplication.created_at %>
+ <% unless @softapplication.deposit_project_url.nil? %> + <%= textilizable ("托管项目网址: " + @softapplication.deposit_project_url) %> + <% end %> +
- - - - -
<%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %> - - - - - - - - -
- <%= link_to_project(membership.project) %> - - - <%=render :partial => 'courses/set_course_time', :locals => {:project => membership.project} %> - <% if User.current == @user %> - <% (membership.roles).each do |role| %> - <% unless (role == Role.find(9) || role == Role.find(3)) %> - <%= join_in_course(membership.project, User.current)%>     - <% end %> - <% end %> - <% else %> - <% end %> - - <%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)   - <%= l(:label_homework) %> (<%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %>) -    - <%= l(:label_course_news)%> (<%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %>) -
-

- <%= membership.project.description %> -

- - - <% @course = Course.find_by_extra(membership.project.identifier)%> - <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %> - <%= l(:label_main_teacher) %> : <%= link_to(@course.teacher.name, user_path(@course.teacher)) %> - <%= l(:label_course_term) %> : <%= @course.time %><%= @course.term %> - - <% end %> -
- - - <% end %> - - -
- <%= call_hook :view_account_left_bottom, :user => @user %> \ No newline at end of file +
    + <% for membership in memberships %> +
  • + + + + + +
    <%= image_tag(url_to_avatar(membership.project), :class => 'avatar') %> + + + + + + + + + + +
    + <%= link_to_project(membership.project) %> + + <%= render :partial => 'courses/set_course_time', :locals => {:project => membership.project} %> + <% if User.current == @user %> + <% (membership.roles).each do |role| %> + <% unless (role == Role.find(9) || role == Role.find(3)) %> + <%= join_in_course(membership.project, User.current) %>     + <% end %> + <% end %> + <% else %> + <% end %> + <%= l(:label_x_base_courses_member, :count => membership.project.members.count) %> + (<%= "#{membership.project.members.count}" %>)   + <%= l(:label_homework) %> + (<%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %>) +    + <%= l(:label_course_news) %> + (<%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %>) +
    +

    + <%= membership.project.description %> +

    + + <% @course = Course.find_by_extra(membership.project.identifier) %> + <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %> + <%= l(:label_main_teacher) %> + : <%= link_to(@course.teacher.name, user_path(@course.teacher)) %> + <%= l(:label_course_term) %> + : <%= @course.time %><%= @course.term %> + <% end %> +
    +
    +
  • + + <% end %> +
+
+<%= call_hook :view_account_left_bottom, :user => @user %> \ No newline at end of file diff --git a/app/views/users/_my_course.html.erb b/app/views/users/_my_course.html.erb index 2fb2b5bde..8feb0ecca 100644 --- a/app/views/users/_my_course.html.erb +++ b/app/views/users/_my_course.html.erb @@ -12,7 +12,7 @@ <% end %> <% else %>

- <%=l(:label_course_doing)%>(<%=@memberships_doing.count%>) + <%=l(:label_course_doing)%>(<%=@memberships_doing.count%>) <%= link_to"#{l(:label_course_new)}",{:controller=>'projects',:action=>'new', :course => 1, :project_type => 1}, :class => 'icon icon-add' if @user == User.current %>

diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index 0dc89b96c..65238110b 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -120,21 +120,7 @@ <%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_contest) %> , <%= l(:label_welcome_trustie_contest_description) %>

- - +
<%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %> @@ -160,7 +146,7 @@ <% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
  • -
    +
    <%= image_tag('/images/contest1.png')%>
    @@ -170,7 +156,7 @@ <% 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") %>) <% else %> - (<%= link_to("含#{contest.contesting_softapplications.count}个app", show_attendingcontest_contest_path(contest), :target => "_blank") %>) + (<%= link_to("含#{contest.contesting_softapplications.count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %>) <% end %>
    @@ -192,7 +178,7 @@
    -

    +

    问题和反馈动态 <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%> @@ -207,11 +193,11 @@ <%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
    - <%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前 + <%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前 由 <%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);" %> 发表 - 回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>) + 回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)

  • <% end %> @@ -228,7 +214,7 @@ <% find_all_hot_softapplication.map do |softapplication| break if(softapplication == find_all_hot_softapplication[5]) %>
  • -
    +
    <%= image_tag('/images/app1.png')%>
    @@ -237,7 +223,7 @@
    - ><%=softapplication.description.truncate(50, omission: '...')%> + ><%=softapplication.description.to_s.truncate(50, omission: '...')%>

    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 0c375a67c..4ff4b0c55 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1859,15 +1859,20 @@ zh: label_release_softapplication: 发布应用 label_upload_softapplication_packets: 上传应用软件包 label_upload_softapplication_photo: 上传产品截图 - label_upload_softapplication_packets_mustpacketed: 应用软件作品必须打包后以压缩包的形式上传,便于上传和下载 ; - label_upload_softapplication_photo_condition: 应用软件截图需上传4张;格式为gif/jpg/png, 尺寸480*800, 每张小于2M - label_updated_caution: 注意:若修改应用,则之前上传的软件包和截图都将被删除,请重新上传! + label_upload_softapplication_packets_mustpacketed: 作品相关代码及相关说明文件必须打包后以压缩包的形式上传,便于上传和下载 ; + label_upload_softapplication_photo_condition: 作品截图需上传0~4张;格式为gif/jpg/png, 每张小于5M + label_updated_caution: 注意:若参赛作品,则之前上传的软件包和截图都将被删除,请重新上传! label_softapplication_name: 应用名称 + label_work_name: 作品名称 label_softapplication_description: 应用简介 + label_work_description: 作品简介 label_softapplication_type: 应用分类 + label_work_type: 作品分类 label_softapplication_version_available: 适配版本 + label_running_platform: 运行平台 label_softapplication_developer: 上传人员 label_softapplication_developers: 开发人员 + label_work_deposit_project_url: 托管项目网址 label_softapplication_name_condition: 25个汉字以内(50个字符) label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。 label_contest_description_no: 暂无描述。 @@ -1897,6 +1902,7 @@ zh: label_relation_files: 关联已有资源 label_contest_settings: 配置竞赛 label_contest_delete: 删除竞赛 + label_noawards_current: 暂未评奖 # ajax异步验证 modal_valid_passing: 可以使用 diff --git a/config/routes.rb b/config/routes.rb index 14a750743..f9aa041d7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -76,16 +76,18 @@ RedmineApp::Application.routes.draw do end member do match 'add_softapplication' - match 'update_contest' , via: [:put] - match 'show_contest' , via: :get - match 'show_project' , via: :get - match 'show_softapplication' , via: :get - match 'show_attendingcontest' , via: :get - match 'show_participator' , via: :get - match 'add' , via: [:get, :post] - match 'add_softapplication' , via: [:get, :post] - match 'create' , via: :post - match 'settings' , via: [:get, :post] + match 'update_contest' , via: [:put] + match 'show_contest' , via: :get + match 'show_project' , via: :get + match 'show_softapplication' , via: :get + match 'show_attendingcontest' , via: :get + match 'show_participator' , via: :get + match 'set_reward_project' , via: [:get, :post] + match 'set_reward_softapplication' , via: [:get, :post] + match 'add' , via: [:get, :post] + match 'add_softapplication' , via: [:get, :post] + match 'create' , via: :post + match 'settings' , via: [:get, :post] end end diff --git a/db/migrate/20140513073801_add_deposit_project_url_to_softapplications.rb b/db/migrate/20140513073801_add_deposit_project_url_to_softapplications.rb new file mode 100644 index 000000000..dd01cdab5 --- /dev/null +++ b/db/migrate/20140513073801_add_deposit_project_url_to_softapplications.rb @@ -0,0 +1,5 @@ +class AddDepositProjectUrlToSoftapplications < ActiveRecord::Migration + def change + add_column :softapplications, :deposit_project_url, :string + end +end diff --git a/db/migrate/20140515013449_add_author_to_relative_memo.rb b/db/migrate/20140515013449_add_author_to_relative_memo.rb new file mode 100644 index 000000000..ba097ac4c --- /dev/null +++ b/db/migrate/20140515013449_add_author_to_relative_memo.rb @@ -0,0 +1,7 @@ +class AddAuthorToRelativeMemo < ActiveRecord::Migration + def change + add_column :relative_memos, :username, :string + add_column :relative_memos, :userhomeurl, :string + add_column :relative_memos, :date_collected, :date + end +end diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 8e4db7fe6..81160fa93 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -609,6 +609,14 @@ function toggleAndSettingWordsVal(parent_widget, text_widget, value){ text_widget.val(value) parent_widget.slideToggle(400) } +function transpotUrl (scope) { + $(scope).each(function(){ + var tmpContent = $(this).html(); + tmpContent = tmpContent.replace(/(^|[^\"\'])(http|ftp|mms|rstp|news|https)(\:\/\/[^<\s\+,,]+)/gi,"$1$2$3<\/a>"); + // tmpContent = tmpContent.replace(/(^|[^\/])(www\.[^<\s\+,,]+)/gi,"$1$2"); + $(this).html(tmpContent); + }); +} $(document).ready(setupAjaxIndicator); $(document).ready(hideOnLoad);