diff --git a/app/models/bid.rb b/app/models/bid.rb index 038c45cd5..02569ade1 100644 --- a/app/models/bid.rb +++ b/app/models/bid.rb @@ -42,9 +42,9 @@ class Bid < ActiveRecord::Base validates :author_id, presence: true validates :deadline, presence: true, format: {:with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/} validates :name, length: {maximum: NAME_LENGTH_LIMIT} - validates :budget, - format: {with : /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/, if: Proc.new { |p| p.reward_type == 1 }}, - format: {with: /^(\d+)$|^(\d+).([0-9]{1})$/, if: Proc.new { |p| p.reward_type == 3 }} + validates :budget, format: { with: ->(p) { if p.reward_type == 1 then /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/ + elsif p.reward_type == 3 then /^(\d+)$|^(\d+).([0-9]{1})$/ end } } + validate :validate_user validate :validate_reward_type after_create :act_as_activity diff --git a/app/views/contests/_history.html.erb b/app/views/contests/_history.html.erb index f59bc0fc7..b62f91146 100644 --- a/app/views/contests/_history.html.erb +++ b/app/views/contests/_history.html.erb @@ -32,7 +32,6 @@ <% 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), @@ -43,15 +42,12 @@ <%= 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;" + :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user}: '); $('##{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), diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 3ba3e73ba..9d5b08ea9 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -102,8 +102,6 @@ - -
<%= render "new_softapplication" %>
@@ -114,12 +112,6 @@ <%= link_to l(:label_user_login_new), signin_path %> <% end %> - - - - - -
@@ -230,7 +222,7 @@
-
+
<%= l(:label_profile) %>: diff --git a/app/views/contests/show_contest.html.erb b/app/views/contests/show_contest.html.erb index 5435f67fe..cc1210751 100644 --- a/app/views/contests/show_contest.html.erb +++ b/app/views/contests/show_contest.html.erb @@ -19,10 +19,6 @@

<%= @contest.description %> -
<%= render :partial => "/praise_tread/praise_tread", diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index d65a93c6c..4d4ac256c 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -27,7 +27,7 @@
    <% unless issue.author.nil? || issue.author.name == "Anonymous" %> -
      +
        <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %> <%= l(:label_post_on)%> <% a = [] %> <% a << column_content[1] %> diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb index 740016ff8..ae44933ab 100644 --- a/app/views/layouts/base_contest.html.erb +++ b/app/views/layouts/base_contest.html.erb @@ -27,27 +27,27 @@
        - - - - - - - - - - -
        <%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : - -
        <%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> > - <%= link_to @bid.name, bid_path %>
        + + + + + + + + + + +
        <%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : + +
        <%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> > + <%= link_to @bid.name, bid_path %>
        @@ -86,10 +91,14 @@
        - - + + diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index adce80d24..d8945a5dc 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -5,19 +5,17 @@ - - <%= h html_title %> - - - <%= csrf_meta_tag %> - <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> - <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> - <%= yield :header_tags -%> @@ -26,12 +24,15 @@
        <%=render :partial => 'layouts/base_header'%>
        -
        <%=link_to "#{@bid.join_in_contests.count}",:controller => "bids", - :action => "show_participator" %><%=link_to "#{@bid.projects.where('is_public=1').count}", :controller => 'bids', - :action => 'show_project' %> + <%=link_to "#{@bid.join_in_contests.count}",:controller => "bids", + :action => "show_participator" %> + + <%=link_to "#{@bid.projects.where('is_public=1').count}", :controller => 'bids', + :action => 'show_project' %> +
        <%= l(:label_participator) %> <%= l(:label_bidding_project) %>
        - - + + - +
        <%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : + <%=l(:label_contest_innovate_community)%> + + <%= l(:label_user_location) %> : +
        <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %> + <%=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 h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %> + + <%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %> +
        @@ -61,17 +66,19 @@ <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> - - + <% if User.current.login? %> <% end %> @@ -80,12 +87,17 @@ <% if (@contest.author.id == User.current.id) || User.current.admin? %> <% end %> @@ -116,7 +128,6 @@ - @@ -128,13 +139,22 @@
        <%= link_to @contest.name, show_contest_contest_path(@contest) %> + <%= link_to @contest.name, show_contest_contest_path(@contest) %> +
        - - <%= new_watcher_link(@contest, User.current) %> + + <%= new_watcher_link(@contest, User.current) unless (@contest.author.id == User.current.id) || User.current.admin? %> +
        - <%= link_to l(:label_contest_modify_settings), {:controller => 'contests', :action => 'settings', :id => @contest} %> + + <%= link_to l(:label_contest_modify_settings), {:controller => 'contests', :action => 'settings', :id => @contest} %> +
        - <%= link_to l(:label_contest_delete), {:controller => 'contests', :action => 'destroy_contest', :id => @contest}, data: { confirm: '你确定要删除该竞赛吗?' }, method: :delete %> + + <%= link_to l(:label_contest_delete), {:controller => 'contests', :action => 'destroy_contest', :id => @contest}, + data: { confirm: '你确定要删除该竞赛吗?' }, method: :delete %> +
        <%= l(:label_contest_watchers) %> <%= l(:label_contest_work) %>
        - + - + - +
        <%= l(:lable_contest_user) %>: <%= link_to(@user.name, user_path(@user))%> + <%= l(:lable_contest_user) %>:  + <%= link_to(@user.name, user_path(@user))%> +
        <%= l(:label_bids_reward_method) %><%= @contest.budget%> + <%= l(:label_bids_reward_method) %> + <%= @contest.budget%> +
        <%= l(:label_limit_time) %> : <%= @contest.deadline%> + <%= l(:label_limit_time) %> : + <%= @contest.deadline%> +
        @@ -156,7 +176,10 @@
        <% end %>
        - <%= l(:label_create_time) %>:<%= format_time(@contest.created_on) %> + + <%= l(:label_create_time) %>: + + <%= format_time(@contest.created_on) %>
@@ -173,7 +196,6 @@
-
@@ -193,22 +215,16 @@
- - - -
-
-
<% if display_main_menu?(@contest) %>
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 3cb4fad80..8f118de05 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -16,7 +16,7 @@ function get_options(value) { $.ajax({ type: "POST", - url: '/school/get_options/' + encodeURIComponent(value), + url: '<%= Setting.host_name == "micros.nudt.edu.cn" ? '/ros/school/get_options/' : '/school/get_options/'%>' + encodeURIComponent(value), data: 'text', success: function (data) { $("#province").val(value) diff --git a/app/views/repositories/diff.html.erb b/app/views/repositories/diff.html.erb index 9416e551c..97630153a 100644 --- a/app/views/repositories/diff.html.erb +++ b/app/views/repositories/diff.html.erb @@ -16,9 +16,9 @@ <%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type, :diff_style => @repository.class.scm_name} %> <% end -%> -<% other_formats_links do |f| %> - <%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %> -<% end %> +<%# other_formats_links do |f| %> + <%#= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %> +<%# end %> <% html_title(with_leading_slash(@path), 'Diff') -%> diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 1410563c3..1d6d46e9e 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -1,7 +1,4 @@ <%= render :partial => 'layouts/base_softapplication_top_content' %> - - -
@@ -16,46 +13,55 @@ - <%=l(:label_attendingcontestwork_belongs_type)%>:<%= @softapplication.app_type_name %> + + <%=l(:label_attendingcontestwork_belongs_type)%>: + <%= @softapplication.app_type_name %> <% contest = @softapplication.contests.first %> - <%=l(:label_attendingcontestwork_belongs_contest)%>:<%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %> + + <%=l(:label_attendingcontestwork_belongs_contest)%>: + <%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %> + - <%=l(:label_attendingcontestwork_release_person)%>:<%= @softapplication.user.name %> - <%=l(:label_attendingcontestwork_adaptive_system)%>:<%= @softapplication.android_min_version_available %> + + <%=l(:label_attendingcontestwork_release_person)%>: + <%= @softapplication.user.name %> + + + <%=l(:label_attendingcontestwork_adaptive_system)%>: + <%= @softapplication.android_min_version_available %> + <%=l(:label_attendingcontestwork_download)%>: - - <% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %> - + + <% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %> + - - <%=l(:label_attendingcontestwork_developers)%>:<%= @softapplication.application_developers %> - - - <%=l(:label_attendingcontestwork_average_scores)%>: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %> - <%=l(:label_attendingcontestwork_release_time)%>:<%=format_time @softapplication.created_at %> - - - - <% if @project %> - <%=l(:label_attendingcontestwork_deposit_project)%>:<%= link_to "#@project", project_path(@project) %> - <% end %> - - + <%=l(:label_attendingcontestwork_developers)%>:<%= @softapplication.application_developers %> + + + <%=l(:label_attendingcontestwork_average_scores)%>: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %> + <%=l(:label_attendingcontestwork_release_time)%>:<%=format_time @softapplication.created_at %> + + + + <% if @project %> + <%=l(:label_attendingcontestwork_deposit_project)%>:<%= link_to "#@project", project_path(@project) %> + <% end %> + +
-
+
<%=l(:label_work_description)%>:
-
<%= @softapplication.description %>
@@ -102,7 +108,9 @@
    <% @image_results.take(4).each do |attachment| %>
  • - + <%= link_to_attachment_img attachment, :class => "soft-application", :download => "true"%>
  • <% end %> @@ -114,14 +122,14 @@
    -
    <%=l(:label_work_comment)%>:
    +
    + <%=l(:label_work_comment)%>: +
    <% if (User.current.logged? and User.current.id != @softapplication.user_id) %>
    <%=l(:label_work_rating)%>: <%= rating_for @softapplication, dimension: :quality, class: 'rateable div_inline' %> (<%=l(:label_attendingcontestwork_sorting_intimation)%>)
    <% end %> -
    -
    <%= render :partial => 'message_history', :locals => {:contest => @softapplication, :journals => @jour, :state => false} %> @@ -133,7 +141,3 @@ <%= pagination_links_full @feedback_pages %>
- - -
-
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index d7bf08fb5..8e6d5f439 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -277,7 +277,8 @@ span.forums-avatar-right{ .borad-text-list{ margin-bottom: 10px; border-bottom: 1px dashed rgb(204, 204, 204); - width: 680px; + width: 680px; + table-layout: fixed; } .borad-message{ diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 098e02be2..58183ce3d 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -1058,7 +1058,6 @@ float: left; margin-left: 20px; margin-top: 10px; width: 470px; -max-height: 121px; font-family: '微软雅黑'; /*modify by men*/ color: rgb(0, 0, 0); font-size: 13px;