Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18 translators #56

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
.bundle/

log/*.log

pkg/
test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache

spec/dummy/db/*.sqlite3
spec/dummy/log/*.log
spec/dummy/tmp/
spec/dummy/.sass-cache

.rvmrc
*.gem

.ruby-gemset
.ruby-version
File renamed without changes.
30 changes: 2 additions & 28 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "http://rubygems.org"
###########################IMPORTANT################################
####################################################################
####################################################################
# When add new gem, don't forget to add it to
# When add new gem, don't forget to add it to
# 1- engine.rb
# 2- translation_center.gemspec
####################################################################
Expand All @@ -15,30 +15,4 @@ source "http://rubygems.org"
# development dependencies will be added by default to the :development group.
gemspec

gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'mysql2'
gem 'haml'
gem 'haml-rails'
gem 'acts_as_votable'
gem 'ya2yaml'
# gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache'
gem 'devise'
gem 'font-awesome-rails'
gem 'audited-activerecord'

group :development do
gem 'ruby-debug-base19x', '~> 0.11.30.pre4'
gem 'ruby-debug19'
gem 'debugger'
gem 'better_errors'
gem 'binding_of_caller'
end

# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.

# To use debugger
# gem 'debugger'
gem 'devise'
156 changes: 87 additions & 69 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
PATH
remote: .
specs:
translation_center (1.6.9)
translation_center (1.7.1)
acts_as_votable
audited-activerecord
bing_translator
devise
font-awesome-rails
haml
haml-rails
jquery-rails
jquery-ui-rails
meta_search
rails (>= 3.1.0)
rails (>= 3.1.0, <= 3.2.12)
ya2yaml

GEM
Expand Down Expand Up @@ -43,10 +44,11 @@ GEM
activesupport (3.2.12)
i18n (~> 0.6)
multi_json (~> 1.0)
acts_as_votable (0.5.0)
rails (>= 3.0.0)
archive-tar-minitar (0.5.2)
arel (3.0.2)
acts_as_votable (0.9.0)
akami (1.2.2)
gyoku (>= 0.4.0)
nokogiri
arel (3.0.3)
audited (3.0.0)
audited-activerecord (3.0.0)
activerecord (~> 3.0)
Expand All @@ -57,64 +59,75 @@ GEM
erubis (>= 2.6.6)
binding_of_caller (0.7.1)
debug_inspector (>= 0.0.1)
bing_translator (4.3.0)
json (~> 1.8.0)
nokogiri (~> 1.6.0)
savon (~> 2.0)
builder (3.0.4)
coderay (1.0.9)
columnize (0.3.6)
columnize (0.8.9)
database_cleaner (1.2.0)
debug_inspector (0.0.2)
debugger (1.3.3)
debugger (1.6.6)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.2.0)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.2.0)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.3.2)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.3.2)
devise (2.2.3)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (~> 3.1)
warden (~> 1.2.1)
diff-lcs (1.2.5)
erubis (2.7.0)
font-awesome-rails (3.0.2.0)
railties (>= 3.1)
haml (4.0.0)
factory_girl (4.4.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.1)
factory_girl (~> 4.4.0)
railties (>= 3.0.0)
font-awesome-rails (4.0.3.2)
railties (>= 3.2, < 5.0)
generator_spec (0.9.2)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
gyoku (1.1.1)
builder (>= 2.1.2)
haml (4.0.5)
tilt
haml-rails (0.4)
actionpack (>= 3.1, < 4.1)
activesupport (>= 3.1, < 4.1)
haml (>= 3.1, < 4.1)
railties (>= 3.1, < 4.1)
hike (1.2.1)
i18n (0.6.2)
hike (1.2.3)
httpi (2.1.0)
rack
rubyntlm (~> 0.3.2)
i18n (0.6.9)
journey (1.0.4)
jquery-rails (2.2.1)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.0.1)
jquery-rails
jquery-ui-rails (4.1.2)
railties (>= 3.1.0)
json (1.7.7)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
json (1.8.1)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
meta_search (1.1.3)
actionpack (~> 3.1)
activerecord (~> 3.1)
activesupport (~> 3.1)
polyamorous (~> 0.5.0)
mime-types (1.21)
multi_json (1.6.1)
mysql2 (0.3.11)
mime-types (1.25.1)
mini_portile (0.5.3)
multi_json (1.9.3)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
nori (2.4.0)
orm_adapter (0.4.0)
polyamorous (0.5.0)
activerecord (~> 3.0)
polyglot (0.3.3)
polyglot (0.3.4)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.3)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
Expand All @@ -133,56 +146,61 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.0.3)
rake (10.3.1)
rdoc (3.12.2)
json (~> 1.4)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug-base19x (0.11.30.pre10)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
rake (>= 0.8.1)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
rspec-rails (2.14.2)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rubyntlm (0.3.4)
savon (2.5.0)
akami (~> 1.2.0)
builder (>= 2.1.2)
gyoku (~> 1.1.0)
httpi (~> 2.1.0)
nokogiri (>= 1.4.0)
nori (~> 2.4.0)
wasabi (~> 3.3.0)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thor (0.17.0)
tilt (1.3.3)
treetop (1.4.12)
sqlite3 (1.3.9)
thor (0.19.1)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.35)
tzinfo (0.3.39)
warden (1.2.1)
rack (>= 1.0)
wasabi (3.3.0)
httpi (~> 2.0)
mime-types (< 2.0.0)
nokogiri (>= 1.4.0)
ya2yaml (0.31)

PLATFORMS
ruby

DEPENDENCIES
acts_as_votable
audited-activerecord
better_errors
binding_of_caller
debugger
database_cleaner
debugger (~> 1.6.5)
devise
font-awesome-rails
haml
haml-rails
jquery-rails
jquery-ui-rails
mysql2
ruby-debug-base19x (~> 0.11.30.pre4)
ruby-debug19
factory_girl_rails
generator_spec
rspec-rails
sqlite3
translation_center!
ya2yaml
21 changes: 8 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rescue LoadError
RDoc::Task = Rake::RDocTask
end

desc 'Generating documentation'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'TranslationCenter'
Expand All @@ -20,21 +21,15 @@ RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end

APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'



Bundler::GemHelper.install_tasks
Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each {|f| load f }

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end

desc 'RSpec tests'
require 'rspec/core'
require 'rspec/core/rake_task'

task :default => :test
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
task :default => :spec
4 changes: 2 additions & 2 deletions app/controllers/translation_center/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ApplicationController < ActionController::Base

render "translation_center/errors/exception"
end

end

# defaults
Expand All @@ -24,7 +24,7 @@ def translation_langs_filters
end

protected

def can_admin?
current_user.can_admin_translations?
end
Expand Down
14 changes: 12 additions & 2 deletions app/controllers/translation_center/translations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module TranslationCenter
class TranslationsController < ApplicationController
before_filter :can_admin?, only: [ :destroy, :accept, :unaccept ]
before_filter :can_admin?, only: [ :destroy, :accept, :unaccept, :suggest ]
before_filter :set_page_number, only: [:search]

# POST /translations/1/vote
Expand Down Expand Up @@ -41,7 +41,7 @@ def unaccept
format.js
end
end

# DELETE /translations/1
# DELETE /translations/1.json
def destroy
Expand All @@ -68,5 +68,15 @@ def search
end
end

# GET /translations/1/suggest
# GET /translations/1/suggest.js
def suggest
@translation = Translation.find(params[:id])

respond_to do |format|
format.json { render json: { translation: @translation.suggest_translation } }
format.js
end
end
end
end
Loading