diff --git a/Gemfile b/Gemfile index dd19b4435..dc4db9c84 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' +gem "seems_rateable" gem "rails", "3.2.13" gem "jquery-rails", "~> 2.0.2" gem "i18n", "~> 0.6.0" diff --git a/Gemfile.lock b/Gemfile.lock index d60847b17..42cb62272 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -79,6 +79,9 @@ GEM rdoc (3.12.2) json (~> 1.4) ruby-openid (2.1.8) + seems_rateable (1.0.13) + jquery-rails + rails sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) @@ -109,3 +112,4 @@ DEPENDENCIES rails (= 3.2.13) rdoc (>= 2.4.2) ruby-openid (~> 2.1.4) + seems_rateable diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9b3a672c3..dd900bf37 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1601,5 +1601,9 @@ module ApplicationHelper end content_tag :ul, content_li.html_safe end + + def current_user + User.current + end end diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb index fa90881bf..603279fbd 100644 --- a/app/models/softapplication.rb +++ b/app/models/softapplication.rb @@ -1,6 +1,8 @@ class Softapplication < ActiveRecord::Base attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers acts_as_attachable + seems_rateable :allow_update => true, :dimensions => :quality + seems_rateable_rater has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :contesting_softapplications, :dependent => :destroy belongs_to :user diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index f8c7056b6..c0e23bf21 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -8,8 +8,9 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> + <%= seems_rateable_stylesheet %> <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> @@ -148,7 +149,7 @@
<%= render :partial => 'tags/tag', :locals => {:obj => @contest, :object_flag => "7"}%> diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 0e2ee738d..fcd746776 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -34,6 +34,10 @@ | 开发人员:<%= @softapplication.application_developers %> |
rate: <%=rating_for @softapplication, :dimension => :qulity %> | ++ |