From dea1a299af914c9c15a016ec3c02110f93ecac48 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 12 Sep 2014 16:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9competition=E7=9A=84view?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E5=B0=86=E5=85=B6=E4=B8=AD=E4=B8=8D?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E7=9A=84=E4=BB=A3=E7=A0=81=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=B9=B6=E5=B0=86=E5=85=B6=E4=B8=AD?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=9A=84link=5Fto=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=88=90"link=5Fto=20=E2=80=98welcome=E2=80=99=20home=5Fpath,?= =?UTF-8?q?=20=20{option}"=20=E7=9A=84=E5=BD=A2=E5=BC=8F=EF=BC=9B=20?= =?UTF-8?q?=E7=BB=9F=E4=B8=80route=E9=A3=8E=E6=A0=BC=20match=20'path',=20:?= =?UTF-8?q?to=20=3D>=20'controller#action'=20=E5=A6=82=E6=9E=9C=20path=20?= =?UTF-8?q?=3D=20controller#action=20=E5=88=99=20match=20'path'=20Example:?= =?UTF-8?q?=20match=20'welcome/course',=20:to=20=3D>=20'welcome#course'=20?= =?UTF-8?q?=E5=8F=98=E6=88=90=20match=20'welcome/cource'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: alan <547533434@qq.com> --- app/views/boards/_project_show.html.erb | 7 +- app/views/contest_notification/show.html.erb | 8 +- app/views/contestnotifications/_form.html.erb | 19 +- app/views/contestnotifications/_news.html.erb | 37 ++- app/views/contestnotifications/edit.html.erb | 10 +- app/views/contestnotifications/new.html.erb | 4 +- app/views/contestnotifications/show.html.erb | 54 ++- app/views/contests/_contest_list.html.erb | 77 ++++- app/views/contests/_form_contest.html.erb | 50 ++- app/views/contests/_history.html.erb | 80 +++-- app/views/contests/_list_projects.html.erb | 5 +- .../contests/_list_softapplications.html.erb | 9 +- app/views/contests/_new_join.html.erb | 13 +- .../contests/_new_softapplication.html.erb | 68 +++- app/views/contests/_pre_show.html.erb | 7 +- app/views/contests/_project_list.html.erb | 8 +- .../contests/_softapplication_list.html.erb | 15 +- app/views/contests/index.html.erb | 38 ++- app/views/contests/new_contest.html.erb | 12 +- app/views/contests/set_reward_project.js.erb | 31 +- .../set_reward_softapplication.js.erb | 32 +- app/views/contests/settings.html.erb | 3 +- .../contests/show_attendingcontest.html.erb | 19 +- app/views/contests/show_contest.html.erb | 23 +- app/views/contests/show_contest_user.html.erb | 7 +- app/views/contests/show_participator.html.erb | 6 +- app/views/contests/show_project.html.erb | 43 ++- .../contests/show_softapplication.html.erb | 40 ++- config/routes.rb | 307 +++++++++--------- 29 files changed, 717 insertions(+), 315 deletions(-) diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index a14e32d6d..199155838 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -67,12 +67,15 @@ <% @topics.each do |topic| %> - +
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %> + <%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %> +     + +    

diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 799656f36..b9616043d 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -79,16 +79,27 @@ <%= render_flash_messages %>
-
<%= l(:label_wellmeaning_intimation_contentone) %>
-
1) <%= l(:label_wellmeaning_intimation_contenttwo) %>
-
2) <%= l(:label_wellmeaning_intimation_contentthree) %>
+
+ <%= l(:label_wellmeaning_intimation_contentone) %> +
+
+ 1) <%= l(:label_wellmeaning_intimation_contenttwo) %> +
+
+ 2) <%= l(:label_wellmeaning_intimation_contentthree) %> +
<% if User.current.logged? %>
<%= l(:label_attending_contest) %>: - <%= link_to l(:label_new_attendingcontest_work), "javascript:void(0);", onclick: "$('#put-project-form').slideToggle();" %> + + <%= link_to l(:label_new_attendingcontest_work), + "javascript:void(0);", + onclick: "$('#put-project-form').slideToggle();" + %> +
<% else %> diff --git a/app/views/contests/show_contest.html.erb b/app/views/contests/show_contest.html.erb index 121f5e690..11937d2bd 100644 --- a/app/views/contests/show_contest.html.erb +++ b/app/views/contests/show_contest.html.erb @@ -2,9 +2,18 @@
<%= image_tag(url_to_avatar(@contest.author), :class => "avatar")%> -

<%= link_to(@contest.author.lastname+@contest.author.firstname, user_path(@contest.author))%>:<%= @contest.name %>

+

+ <%= link_to(@contest.author.lastname+@contest.author.firstname, + user_path(@contest.author)) + %> + :<%= @contest.name %>

- <%= l(:label_bids_reward_method) %><%= @contest.budget%> + + <%= l(:label_bids_reward_method) %> + + <%= @contest.budget%> + +

<%= @contest.description %> @@ -15,7 +24,11 @@
<%= render :partial => "/praise_tread/praise_tread", - :locals => {:obj => @contest,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%> + :locals => {:obj => @contest, + :show_flag => true, + :user_id =>User.current.id, + :horizontal => false} + %>
@@ -23,7 +36,9 @@
- <%= render :partial => 'history', :locals => { :contest => @contest, :journals => @jour, :state => false} %> + <%= render :partial => 'history', + :locals => { :contest => @contest, :journals => @jour, :state => false} + %>
<%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %> + <%= topic.locked? ? 'locked' : '' %>"> + <%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %> diff --git a/app/views/contest_notification/show.html.erb b/app/views/contest_notification/show.html.erb index 93fa1f4af..5664d5398 100644 --- a/app/views/contest_notification/show.html.erb +++ b/app/views/contest_notification/show.html.erb @@ -9,8 +9,12 @@ - - + +
contest.trustie.net<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> > 详情 + contest.trustie.net + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_contest_innovate), welcome_contest_path %> > 详情
diff --git a/app/views/contestnotifications/_form.html.erb b/app/views/contestnotifications/_form.html.erb index afcb60657..36bcd78c6 100644 --- a/app/views/contestnotifications/_form.html.erb +++ b/app/views/contestnotifications/_form.html.erb @@ -3,8 +3,23 @@ <%= l(:bale_news_notice) %>
-

<%= f.text_field :title, :required => true, :size => 60,:maxlength => 60, :style => "width:488px;" %>

-

<%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %>

+

+ <%= f.text_field :title, + :required => true, + :size => 60, + :maxlength => 60, + :style => "width:488px;" + %> +

+

+ <%= f.text_area :description, + :required => true, + :cols => 60, + :rows => 11, + :class => 'wiki-edit', + :style => "width:490px;" + %> +

diff --git a/app/views/contestnotifications/_news.html.erb b/app/views/contestnotifications/_news.html.erb index fbac2557f..c8af85cf4 100644 --- a/app/views/contestnotifications/_news.html.erb +++ b/app/views/contestnotifications/_news.html.erb @@ -2,24 +2,47 @@ + <%# unless news.summary.blank? %>
<%#= link_to h(news.title), news_path(news) %> <%#= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %> - <%# unless news.summary.blank? %><%#=h news.summary %><% end %><%#=h news.summary %> <%#= authoring news.created_on, news.author %>

--> - + - - + +
+ + - - + - - + diff --git a/app/views/contestnotifications/edit.html.erb b/app/views/contestnotifications/edit.html.erb index 7b91d922c..1606d97d6 100644 --- a/app/views/contestnotifications/edit.html.erb +++ b/app/views/contestnotifications/edit.html.erb @@ -1,9 +1,15 @@

<%=l(:label_news)%>

-<%= labelled_form_for @contestnotification, url: contest_contestnotification_path, :html => { :id => 'contestnotifications-form', :multipart => true, :method => :put } do |f| %> +<%= labelled_form_for @contestnotification, + :url => contest_contestnotification_path, + :html => { :id => 'contestnotifications-form', + :multipart => true, + :method => :put } do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> -<%= preview_link preview_contestnotifications_path(id: @contestnotification), 'contestnotifications-form' %> +<%= preview_link preview_contestnotifications_path(id: @contestnotification), + 'contestnotifications-form' +%> <% end %>
diff --git a/app/views/contestnotifications/new.html.erb b/app/views/contestnotifications/new.html.erb index 30d5f0106..a5a1c7e58 100644 --- a/app/views/contestnotifications/new.html.erb +++ b/app/views/contestnotifications/new.html.erb @@ -1,5 +1,7 @@ -<%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest), :html => { :id => 'contestnotifications-form', :multipart => true } do |f| %> +<%= labelled_form_for @contestnotification, + :url => contest_contestnotifications_path(@contest), + :html => { :id => 'contestnotifications-form', :multipart => true } do |f| %> <%= render :partial => 'contestnotifications/form', :locals => { :f => f } %> <%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> <%= submit_tag l(:button_cancel), :class => "whiteButton m3p10 h30",:onclick => "cancel();" %> diff --git a/app/views/contestnotifications/show.html.erb b/app/views/contestnotifications/show.html.erb index b6ac88008..a44ee5909 100644 --- a/app/views/contestnotifications/show.html.erb +++ b/app/views/contestnotifications/show.html.erb @@ -1,21 +1,26 @@
<%= link_to(l(:button_edit), - edit_contest_contestnotification_path(@contest, @contestnotification), - :class => 'icon icon-edit', - :accesskey => accesskey(:edit), - :onclick => '$("#edit-contestnotifications").show(); return true;') if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?)%> + edit_contest_contestnotification_path(@contest, @contestnotification), + :class => 'icon icon-edit', + :accesskey => accesskey(:edit), + :onclick => '$("#edit-contestnotifications").show(); return true;') if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?)%> <%= delete_link contest_contestnotification_path(@contest, @contestnotification) if (User.current.admin? && User.current.logged? )||(User.current == @contest.author && User.current.logged?) %>

<%=h @contestnotification.title %>

@@ -23,7 +28,9 @@
- <%= textilizable(@contestnotification, :description) %> + + <%= textilizable(@contestnotification, :description) %> +
<%#= link_to_attachments @contestnotification %>
@@ -31,16 +38,26 @@ <% if User.current.logged? %>

- <%= toggle_link l(:label_comment_add), "add_notificationcomment_form", :focus => "notificationcomment_notificationcomments" %> + <%= toggle_link l(:label_comment_add), + "add_notificationcomment_form", + :focus => "notificationcomment_notificationcomments" + %>

<% else %> <%= l(:label_user_login_notificationcomment) %> <%= link_to l(:label_user_login_new), signin_path %> <% end %> - <%= form_tag( contest_contestnotification_notificationcomments_path(@contest, @contestnotification) , :id => "add_notificationcomment_form", :style => "display:none;") do %> + <%= form_tag( contest_contestnotification_notificationcomments_path(@contest, @contestnotification) , + :id => "add_notificationcomment_form", + :style => "display:none;") do %>
- <%= text_area 'notificationcomment', 'notificationcomments', :cols => 80, :rows => 15, :class => 'wiki-edit' %> + <%= text_area 'notificationcomment', + 'notificationcomments', + :cols => 80, + :rows => 15, + :class => 'wiki-edit' + %> <%= wikitoolbar_for 'notificationcomment_notificationcomments' %>

@@ -65,7 +82,9 @@ <% next if notificationcomment.new_record? %>

<%=link_to contestnotifications.author,contest_contestnotification_path(contestnotifications)%> - <%= l(:label_project_newshare) %> <%= link_to h(contestnotifications.title), contest_contestnotification_path(contestnotifications) %> + + + <%=link_to contestnotifications.author, + contest_contestnotification_path(contestnotifications) + %> + + + <%= l(:label_project_newshare) %> + + <%= link_to h(contestnotifications.title), + contest_contestnotification_path(contestnotifications) + %>

<%=h contestnotifications.description%>

+

+ <%=h contestnotifications.description%> +

+
<%= contestnotifications.created_at %><%= link_to l(:label_project_newother),contest_contestnotification_path(contestnotifications)%> + + + <%= contestnotifications.created_at %> + + + <%= link_to l(:label_project_newother), + contest_contestnotification_path(contestnotifications) + %> <%= "(#{l(:label_x_comments, :count => contestnotifications.notificationcomments_count)})" if contestnotifications.notificationcomments_count > 0 %>
- + <%= l(:label_work_name) %> * : - + (<%= l(:label_workname_lengthlimit) %>)
@@ -101,7 +108,12 @@ <%= l(:label_running_platform) %> * : (<%= l(:label_workdescription_lengthlimit) %>) @@ -116,7 +128,9 @@ <%#= select_tag 'app_type_name', work_type_opttion, {:name => 'app_type_name',:style => "width:358px;"} %> - <%= f.select :app_type_name,work_type_opttion, {},{:style => "width:328px;",:onchange => "selectChange(this)"} %> + <%= f.select :app_type_name,work_type_opttion, + {}, + {:style => "width:328px;",:onchange => "selectChange(this)"} %> <%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> <%= l(:label_work_description) %> * : - +
@@ -141,8 +161,17 @@ <%= l(:label_softapplication_developers) %> * : - - (<%= l(:label_workdescription_lengthlimit) %>) + + + (<%= l(:label_workdescription_lengthlimit) %>) +

@@ -150,8 +179,23 @@ <%= l(:label_work_deposit_project) %>: - <%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2',:style => "width:328px;" %> - <%= link_to l(:label_create_new_projects),{:controller => 'projects',:action => 'new',course: 0, project_type: 0,host: Setting.project_domain}, :target => '_blank' %> + + <%= select_tag 'project', + options_for_select(select_option_helper(@option)), + :name => 'project', + :class => 'grayline2', + :style => "width:328px;" + %> + + + + + <%= link_to l(:label_create_new_projects), + new_project_path(:course => 0, :project_type => 0, :host => Setting.project_domain), + :target => '_blank' + %> + +

@@ -177,8 +221,12 @@
<%#= submit_tag l(:button_create) %> - <%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();", - :type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'", + <%= submit_tag l(:button_cancel), + :name => nil, + :onclick => "cancel();", + :type => 'button', + :class => "enterprise", + :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
<% end %> \ No newline at end of file diff --git a/app/views/contests/_pre_show.html.erb b/app/views/contests/_pre_show.html.erb index fef1f16e4..67ceeb356 100644 --- a/app/views/contests/_pre_show.html.erb +++ b/app/views/contests/_pre_show.html.erb @@ -5,7 +5,12 @@ - +
<%= image_tag(url_to_avatar(notificationcomment.author), :class => "avatar")%> + <%= image_tag(url_to_avatar(notificationcomment.author), :class => "avatar")%> + @@ -80,8 +99,9 @@ @@ -92,7 +112,11 @@

- + diff --git a/app/views/contests/_contest_list.html.erb b/app/views/contests/_contest_list.html.erb index a91978079..967d31459 100644 --- a/app/views/contests/_contest_list.html.erb +++ b/app/views/contests/_contest_list.html.erb @@ -4,7 +4,10 @@ +  <%= link_to(contest.name, + contest_contestnotifications_path(contest), + :class => 'bid_path', + :target => "_blank") %> - +
@@ -31,5 +34,7 @@ <% end %>
<% end %> - + diff --git a/app/views/contests/_new_join.html.erb b/app/views/contests/_new_join.html.erb index 3b0cff690..fc638d218 100644 --- a/app/views/contests/_new_join.html.erb +++ b/app/views/contests/_new_join.html.erb @@ -50,8 +50,17 @@ <%= text_field_tag 'contest_password', nil, :size => 45 %>

- <%= submit_tag l(:label_new_join), :name => nil, :class => "contest_btn", :onclick => "hideModal(this);" %> - <%= submit_tag l(:button_cancel), :name => nil, :class => "contest_btn", :onclick => "hideModal(this);", :type => 'button' %> + <%= submit_tag l(:label_new_join), + :name => nil, :class => "contest_btn", + :onclick => "hideModal(this);" + %> + <%= submit_tag l(:button_cancel), + :name => nil, + :class => "contest_btn", + :onclick => "hideModal(this);", + :type => 'button' + %> +

<% 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)) %> + <%= 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 %>
<%= format_time(notificationcomment.created_at) %> + + <%= format_time(notificationcomment.created_at) %> + + <%#= link_to_if_authorized_contest image_tag('delete.png'), {:controller => 'notificationcomments', :action => 'destroy', :id => @contestnotifications, :notificationcomment_id => notificationcomment}, :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
<% unless contest.author.nil? %> - <%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), user_path(contest.author), :class => "avatar") %> + <%= link_to(image_tag(url_to_avatar(contest.author), :class => 'avatar'), + user_path(contest.author), + :class => "avatar") + %> <% end %> @@ -12,33 +15,85 @@
<% unless contest.author.nil? %> - <%= link_to(contest.author, user_path(contest.author), :class => 'bid_user') %>: + <%= link_to(contest.author, + user_path(contest.author), + :class => 'bid_user') + %>: <% end %> -  <%= link_to(contest.name, contest_contestnotifications_path(contest), :class => 'bid_path', :target => "_blank") %>
- <%= l(:label_contests_reward_method) %>:  <%= contest.budget%> + <%= l(:label_contests_reward_method) %>:   + + <%= contest.budget%> + +
- - <% if contest.id == 2 or contest.id == 3 or contest.id == 6 %> - <%= l(:label_contest_work, :count => contest.contesting_projects.count) %>(<%= link_to(contest.projects.where('is_public=1').count, show_attendingcontest_contest_path(contest), :target => "_blank") %>) + + + <% if contest.id == 2 || contest.id == 3 || contest.id == 6 %> + <%= l(:label_contest_work, + :count => contest.contesting_projects.count) + %> + ( + + <%= link_to(contest.projects.where('is_public=1').count, + show_attendingcontest_contest_path(contest), + :target => "_blank") + %> + + ) <% else %> - <%= l(:label_contest_work, :count => contest.contesting_softapplications.count) %>(<%= link_to(contest.contesting_softapplications.count, show_attendingcontest_contest_path(contest), :target => "_blank") %>) + <%= l(:label_contest_work, + :count => contest.contesting_softapplications.count) + %> + ( + + <%= link_to(contest.contesting_softapplications.count, + show_attendingcontest_contest_path(contest), + :target => "_blank") %> + + ) <% end %>
<%= l :label_create_time %>: <%= format_time contest.created_on %> + + <%= l :label_create_time %>: <%= format_time contest.created_on %> + +
@@ -58,6 +113,6 @@ diff --git a/app/views/contests/_form_contest.html.erb b/app/views/contests/_form_contest.html.erb index 79c531969..68e941a27 100644 --- a/app/views/contests/_form_contest.html.erb +++ b/app/views/contests/_form_contest.html.erb @@ -20,17 +20,55 @@ <%= error_messages_for 'contest' %> -

<%= l(:label_bids_form_contest_new_description) %>

-

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Contest::NAME_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_name)}" %>

+

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

+

+ <%= f.text_field :name, + :required => true, + :size => 60, + :style => "width:490px;", + :maxlength => Contest::NAME_LENGTH_LIMIT, + :placeholder => "#{l(:label_contest_name)}" + %> +

-

<%= f.text_area :description, :rows => 5, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :placeholder => "#{l(:label_contest_description)}" %>

+

+ <%= f.text_area :description, + :rows => 5, + :class => 'wiki-edit', + :style => "font-size:small;width:490px;margin-left:10px;", + :maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, + :placeholder => "#{l(:label_contest_description)}" + %> +

-

<%= f.text_field :password, :size => 60, :style => "width:488px;margin-left: 10px;" %>

+

+ <%= f.text_field :password, + :size => 60, + :style => "width:488px;margin-left: 10px;" + %> +

- <%= f.text_area :budget, :required => true, :size => 60,:rows => 4,:maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, :style => "width:490px;", :placeholder => l(:label_bids_reward_what) %> + <%= f.text_area :budget, + :required => true, + :size => 60, + :rows => 4, + :maxlength => Contest::DESCRIPTION_LENGTH_LIMIT, + :style => "width:490px;", + :placeholder => l(:label_bids_reward_what) + %>

-

<%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;", :placeholder => "#{l(:label_deadline)}" %><%= calendar_for('contest_deadline')%>

+

+ <%= f.text_field :deadline, + :required => true, + :size => 60, + :style => "width:150px;", + :placeholder => "#{l(:label_deadline)}" + %> + <%= calendar_for('contest_deadline')%> +

diff --git a/app/views/contests/_history.html.erb b/app/views/contests/_history.html.erb index 6be572c65..f59bc0fc7 100644 --- a/app/views/contests/_history.html.erb +++ b/app/views/contests/_history.html.erb @@ -11,36 +11,66 @@
    <% for journal in journals%>
  • - <%= image_tag(url_to_avatar(journal.user), :class => "avatar") %> - - <%= link_to journal.user, user_path(journal.user)%> - <% label = l(:label_contest_requirement) %> -
    <%= textilizable journal.notes%>
    - <%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %> - - <% ids = 'project_respond_form_'+ journal.id.to_s%> - - - <% if reply_allow %> - <%#= link_to(l(:button_quote), {:controller => 'contests', :action => 'new', :id => contest, :journal_id => journal}, :remote => true, :method => 'post', :title => l(:button_quote))%> - <%= link_to(l(:button_quote), contests_path(:id => contest, :journal_id => journal), :remote => true, :method => 'post', :title => l(:button_quote))%> - <%= link_to l(:label_bid_respond_quote),'', - {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"}%> - <% end %> - - <% if @user==User.current|| User.current.admin? %> - <%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm), - :remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %> - <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> - <% end %> - -
    + + <%= image_tag(url_to_avatar(journal.user), :class => "avatar") %> + + + + <%= link_to journal.user, user_path(journal.user)%> + + + <% label = l(:label_contest_requirement) %> + +
    <%= textilizable journal.notes%>
    + + <%= l(:label_bids_published) %>  + <%= time_tag(journal.created_on).html_safe %>  + <%= l(:label_bids_published_ago) %> + + + <% ids = 'project_respond_form_'+ journal.id.to_s%> + + + <% if reply_allow %> + <%#= link_to(l(:button_quote), {:controller => 'contests', :action => 'new', :id => contest, :journal_id => journal}, :remote => true, :method => 'post', :title => l(:button_quote))%> + <%= link_to(l(:button_quote), + contests_path(:id => contest, + :journal_id => journal), + :remote => true, + :method => 'post', + :title => l(:button_quote)) + %> + <%= link_to l(:label_bid_respond_quote), + '', + {:focus => 'project_respond', + :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;" + } + %> + <% end %> + + <% if @user==User.current|| User.current.admin? %> + <%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm), + :remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %> + + <%= link_to(l(:label_bid_respond_delete), + + words_destroy_path(:user_id => @user, :object_id => journal), + :remote => true, + :confirm => l(:text_are_you_sure), + :method => 'delete', + :class => "delete", + :title => l(:button_delete)) %> + <% end %> + +
    <% ids = 'project_respond_form_'+ journal.id.to_s%> <% if reply_allow %>
    - <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %> + <%= render :partial => 'words/new_respond', + :locals => {:journal => journal, :m_reply_id => journal} + %>
    <% end %>
    diff --git a/app/views/contests/_list_projects.html.erb b/app/views/contests/_list_projects.html.erb index 10086e5a3..fec4cf24c 100644 --- a/app/views/contests/_list_projects.html.erb +++ b/app/views/contests/_list_projects.html.erb @@ -26,8 +26,9 @@
- <%= l(:label_system_grade) %>:<%= (c_project.project.project_status.nil? ? 0.0 : c_project.project.project_status.grade) unless (c_project.project.project_status.nil? && c_project.project.nil?) %> - <% if get_prize(c_project).nil? or get_prize(c_project) == "" %> + <%= l(:label_system_grade) %>: + <%= (c_project.project.project_status.nil? ? 0.0 : c_project.project.project_status.grade) unless (c_project.project.project_status.nil? && c_project.project.nil?) %> + <% if get_prize(c_project).nil? || get_prize(c_project) == "" %> <% if @contest.deadline < Date.today %> <%= l(:label_noawards)%> <% end %> diff --git a/app/views/contests/_list_softapplications.html.erb b/app/views/contests/_list_softapplications.html.erb index 89e8a3172..40a6f1cb2 100644 --- a/app/views/contests/_list_softapplications.html.erb +++ b/app/views/contests/_list_softapplications.html.erb @@ -6,7 +6,10 @@
<%=l(:label_softapplication)%>: - <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %> + <%= link_to(c_softapplication.softapplication.name, + softapplication_path(c_softapplication.softapplication), + :target => '_blank') + %>
<% end %> diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb index 9fb3fc7f1..11be49fbc 100644 --- a/app/views/contests/_new_softapplication.html.erb +++ b/app/views/contests/_new_softapplication.html.erb @@ -90,7 +90,14 @@
<%= f.text_field :name, :required => true, :size => 60, :style => "width:320px;", :onblur => "regexName();" %> + <%= f.text_field :name, + :required => true, + :size => 60, + :style => "width:320px;", + :onblur => "regexName();" + %> +
- <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:320px;", :onblur=>"regexWorkdescription();"%> + <%= f.text_field :android_min_version_available, + :required => true, + :size => 60, + :style => "width:320px;", + :onblur=>"regexWorkdescription();" + %>
<%= f.text_field :description, :required => true, :size => 60, :style => "width:320px;" %> + <%= f.text_field :description, + :required => true, + :size => 60, + :style => "width:320px;" + %> +
<%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:320px;", :onblur => 'regexDevelopers();' %> + <%= f.text_field :application_developers, + :required => true, + :size => 60, + :style => "width:320px;", + :onblur => 'regexDevelopers();' + %> +
<%= textilizable content %>
<%= hidden_field_tag 'reference_content', params[:reference_content], :value => content%> + <%= hidden_field_tag 'reference_content', + params[:reference_content], + :value => content + %> +
<% end %> diff --git a/app/views/contests/_project_list.html.erb b/app/views/contests/_project_list.html.erb index 325e87105..33e884020 100644 --- a/app/views/contests/_project_list.html.erb +++ b/app/views/contests/_project_list.html.erb @@ -2,7 +2,9 @@ <%= render_flash_messages %> - + <% if User.current.logged? %>
<%= l(:label_bidding_project) %>(<%= contesting_project.count%>) + <%= l(:label_bidding_project) %>(<%= contesting_project.count%>) +
@@ -12,4 +14,6 @@ <% end %>
-<%= render :partial=> "list_projects",:locals => {:contesting_project => contesting_project,:contest => @contest }%> +<%= render :partial=> "list_projects", + :locals => {:contesting_project => contesting_project,:contest => @contest } +%> diff --git a/app/views/contests/_softapplication_list.html.erb b/app/views/contests/_softapplication_list.html.erb index e5d030123..d93923d72 100644 --- a/app/views/contests/_softapplication_list.html.erb +++ b/app/views/contests/_softapplication_list.html.erb @@ -2,14 +2,23 @@ <%= render_flash_messages %> - + <% if User.current.logged? %> <% end %>
<%= l(:label_contest_softapplication) %>(<%= @contest.contesting_softapplications.count%>) + <%= l(:label_contest_softapplication) %> + (<%= @contest.contesting_softapplications.count%>) +
- <%= link_to l(:button_contesting_as_application), "javascript:void(0);", onclick: "$('#put-bid-form').toggle();" %> + <%= link_to l(:button_contesting_as_application), + "javascript:void(0);", + onclick: "$('#put-bid-form').toggle();" + %>
-<%= render :partial=> "list_softapplications",:locals => {:contesting_softapplication => contesting_softapplication,:contest => @contest }%> +<%= render :partial=> "list_softapplications", + :locals => {:contesting_softapplication => contesting_softapplication, + :contest => @contest } +%> diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb index 6f8430ca0..60608fd89 100644 --- a/app/views/contests/index.html.erb +++ b/app/views/contests/index.html.erb @@ -6,22 +6,44 @@
<%= l(:label_user_location) %> : <% if User.current.logged? %> - <% unless User.current.user_extensions.identity == 1 %> - <%= link_to(l(:label_newtype_contest), {:controller => 'contests', :action => 'new_contest'}, :class => 'icon icon-add', :target => "_blank") %> - <% end %> + <% unless User.current.user_extensions.identity == 1 %> + + <%= link_to(l(:label_newtype_contest), contest_new_contest_path, :class => 'icon icon-add', :target => "_blank") %> + + <% end %> <% end %>
<%= 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 request.host()+"/contests", contests_path %> + + + + <%=link_to l(:field_homepage), home_path %> > + + <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %> + +
<% end %> diff --git a/app/views/contests/new_contest.html.erb b/app/views/contests/new_contest.html.erb index 7366b4203..019c8c1db 100644 --- a/app/views/contests/new_contest.html.erb +++ b/app/views/contests/new_contest.html.erb @@ -1,10 +1,12 @@

<%=l(:label_newtype_contest)%>

-<%= labelled_form_for @contest, :url => {:controller => 'contests', :action => 'create_contest'}, method: :post do |f| %> +<%= labelled_form_for @contest, + :url => {:controller => 'contests', :action => 'create_contest'}, + method: :post do |f| %>
- <%= render :partial => 'form_contest', :locals => { :f => f } %> - <%= submit_tag l(:button_create) %> - <%= javascript_tag "$('#bid_name').focus();" %> - <% end %> + <%= render :partial => 'form_contest', :locals => { :f => f } %> + <%= submit_tag l(:button_create) %> + <%= javascript_tag "$('#bid_name').focus();" %> + <% end %>
\ No newline at end of file diff --git a/app/views/contests/set_reward_project.js.erb b/app/views/contests/set_reward_project.js.erb index c0de3e2ef..2ea06abb1 100644 --- a/app/views/contests/set_reward_project.js.erb +++ b/app/views/contests/set_reward_project.js.erb @@ -1,26 +1,27 @@ + $('#reward_result_<%= @contesting_project_id %>').html('<%= j( -if get_prize(@c_p).nil? or get_prize(@c_p) == "" +if get_prize(@c_p).nil? || get_prize(@c_p) == "" if @contest.deadline < Date.today puts '未评奖' end else case get_prize(@c_p) - 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") + 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 diff --git a/app/views/contests/set_reward_softapplication.js.erb b/app/views/contests/set_reward_softapplication.js.erb index a8cf0d486..2906d95d3 100644 --- a/app/views/contests/set_reward_softapplication.js.erb +++ b/app/views/contests/set_reward_softapplication.js.erb @@ -1,26 +1,28 @@ + $('#reward_result_<%= @contesting_softapplication_id %>').html('<%= j( -if get_prize(@c_sa).nil? or get_prize(@c_sa) == "" + +if get_prize(@c_sa).nil? || 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") + 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 diff --git a/app/views/contests/settings.html.erb b/app/views/contests/settings.html.erb index a2780f060..4f8b8b0f2 100644 --- a/app/views/contests/settings.html.erb +++ b/app/views/contests/settings.html.erb @@ -1,6 +1,7 @@

-

<%=l(:label_contest_settings)%><%=l(:label_contest_settings)%> <%= image_tag(url_to_avatar(user), :class => "avatar") %> - - +
<%= content_tag "div", link_to_user(user), :class => "project_avatar_name" %> + + + <%= content_tag "div", link_to_user(user), :class => "project_avatar_name" %> +

<% unless user.memberships.empty? %> diff --git a/app/views/contests/show_participator.html.erb b/app/views/contests/show_participator.html.erb index da51aef3a..9c829b9f2 100644 --- a/app/views/contests/show_participator.html.erb +++ b/app/views/contests/show_participator.html.erb @@ -1,5 +1,9 @@ -

<%=link_to l(:label_x_join_in_contest, :count => @contest.join_in_contests.count)+"("+@contest.join_in_contests(@user.id).count.to_s+")", :controller=>"contests", :action=>"show_participator"%>

+

+ <%=link_to l(:label_x_join_in_contest, :count => @contest.join_in_contests.count)+"("+@contest.join_in_contests(@user.id).count.to_s+")", + show_participator_contest_path + %> +

<% for temp in @contest.join_in_contests %> <% user = temp.user %> diff --git a/app/views/contests/show_project.html.erb b/app/views/contests/show_project.html.erb index 3e759cfc1..84dfbbbc2 100644 --- a/app/views/contests/show_project.html.erb +++ b/app/views/contests/show_project.html.erb @@ -60,15 +60,28 @@ <% end %>
- <%= render :partial => 'project_list', :locals => {:contesting_project => @contesting_project,:contest => @contest} %> + <%= render :partial => 'project_list', + :locals => {:contesting_project => @contesting_project,:contest => @contest} + %>
diff --git a/app/views/contests/show_softapplication.html.erb b/app/views/contests/show_softapplication.html.erb index d12a70e35..7bb4b0231 100644 --- a/app/views/contests/show_softapplication.html.erb +++ b/app/views/contests/show_softapplication.html.erb @@ -60,15 +60,29 @@