Permalink
Browse files

first commit of the code 5 february 2016

  • Loading branch information...
emirn committed Feb 5, 2016
1 parent e15d9ca commit 9f15aae887ab0090082665453e075213795715a5
Showing 619 changed files with 35,033 additions and 0 deletions.
View
171 Gemfile
@@ -0,0 +1,171 @@
source "https://rubygems.org"
ruby '2.1.1'
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
gem "rails", "4.1.1"
# Use Postgresql as the database for Active Record
gem "pg", group: :production
# Use sqlite3 as the database for Active Record
gem "sqlite3", group: :development
# Use mysql2 as the database for Active Record
gem "mysql2", group: :development
# Use SCSS for stylesheets
gem "sass-rails", "~> 4.0.3"
# Use Uglifier as compressor for JavaScript assets
gem "uglifier", ">= 1.3.0"
# Use CoffeeScript for .js.coffee assets and views
gem "coffee-rails", "~> 4.0.0"
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem "therubyracer", platforms: :ruby
gem "lol_dba", group: :development
# Use jquery as the JavaScript library
gem "jquery-rails"
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem "jquery-ui-rails", "~> 5.0.0"
gem "turbolinks"
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem "jbuilder", "~> 2.0"
# bundle exec rake doc:rails generates the API under doc/api.
gem "sdoc", "~> 0.4.0", group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring", group: :development
#random key generate
gem "webget_ruby_secure_random"
#pagination
gem "will_paginate"
gem 'kaminari'
# Haml
gem "haml"
# Haml scaffolding functions
gem "haml-rails"
# Process attachiment
gem "paperclip", "~> 4.1"
gem 'aws-sdk'
gem "devise"
gem "cancan"
gem "omniauth"
gem "omniauth-facebook"
gem "omniauth-twitter"
gem "omniauth-google_oauth2"
gem 'omniauth-linkedin'
gem 'omniauth-github'
#gem "acts-as-messageable"
gem 'simple-private-messages', '0.0.0', :git => 'git://github.com/jongilbraith/simple-private-messages.git'
gem "font-awesome-rails"
gem "famfamfam_flags_rails"
gem "activeadmin", github: "activeadmin"
#gem "activeadmin-dragonfly", github: "stefanoverna/activeadmin-dragonfly"
#gem "activeadmin-wysihtml5", github: "stefanoverna/activeadmin-wysihtml5"
gem 'rails_12factor', group: :production
gem "mail"
gem "country_select"
gem 'countries'
gem "domp"
gem "sidekiq"
gem 'valid_email', require: 'valid_email/validate_email'
gem "faye"
gem "thin"
# 'newrelic_rpm'
gem 'newrelic_rpm'
# no longer required as cloudfront now is doing all the work
# gem 'asset_sync'
# gem 'font_assets'
gem 'mobu'
gem "remotipart", "~> 1.0"
gem 'gabba'
#seedbank
gem "seedbank"
gem 'draper'
gem 'exception_notification'
gem 'mixpanel-ruby'
group :development, :test do
gem 'rspec-rails', '~> 3.0'
gem 'factory_girl_rails'
gem 'capybara'
gem 'database_cleaner'
gem 'fabrication'
gem 'ffaker'
gem 'seed_dump'
gem 'sweet-logger' # added to Development env according to http://nikolay.rocks/2015-08-06-unslow-rails-dev
end
# gem to convert russian letters into latin letters, so called "translit"
gem 'cyrillizer'
# required to fix the issue with CORS and AWesome Font
# see http://blog.jdwyah.com/2014/09/cors-for-rails-heroku-cloudfront-for.html
gem 'rack-cors'
gem 'puma'
gem 'acts-as-taggable-on', '~> 3.4'
gem 'rails4-autocomplete'
gem 'ckeditor'
gem "lazyload-rails"
gem "figaro"
# Use ActiveModel has_secure_password
# gem "bcrypt", "~> 3.1.7"
# Use unicorn as the app server
# gem "unicorn"
# Use Capistrano for deployment
# gem "capistrano-rails", group: :development
# Use debugger
# gem "debugger", group: [:development, :test]
gem "letter_opener", :group => :development
gem 'acts_as_votable', '~> 0.10.0'
# ace javascript editor
# gem 'ace-rails-ap'
# shows maintenance page (public/maintenance.html if exists)
gem 'rack-maintenance'
View
@@ -0,0 +1,2 @@
worker: bundle exec sidekiq -e production
web: bundle exec puma -C config/puma.rb
View
@@ -0,0 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Rails.application.load_tasks
View
@@ -0,0 +1,28 @@
ActiveAdmin.register AdminUser do
permit_params :email, :password, :password_confirmation
index do
selectable_column
id_column
column :email
column :current_sign_in_at
column :sign_in_count
column :created_at
actions
end
filter :email
filter :current_sign_in_at
filter :sign_in_count
filter :created_at
form do |f|
f.inputs "Admin Details" do
f.input :email
f.input :password
f.input :password_confirmation
end
f.actions
end
end
View
@@ -0,0 +1,58 @@
ActiveAdmin.register Advertise do
permit_params :body, :language_id, :start_time, :expiration_time, :programmer_only, :skill_id, :is_active, :gender, :country, :views, :clicks, :close_text
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# permit_params :list, :of, :attributes, :on, :model
#
# or
#
# permit_params do
# permitted = [:permitted, :attributes]
# permitted << :other if resource.something?
# permitted
# end
index do
column :language
column :country
column :start_time, :sortable => :start_time do |obj|
obj.start_time.localtime.strftime("%B %d, %Y %H:%M")
end
column :expiration_time, :sortable => :expiration_time do |obj|
obj.expiration_time.localtime.strftime("%B %d, %Y %H:%M")
end
column :programmer_only
column :skill
column :views
column :clicks
column :conversion_rate do |c|
((c.clicks*c.views)/100).to_s + "%"
end
column :is_active
actions
end
form do |f|
f.inputs do
f.input :body, as: :ckeditor
f.input :language_id, as: :select, collection: [['All', '']] + Language.all.map{ |language| [language.name, language.id] }, include_blank: false
f.input :country, as: :select, collection: [['All', '']] + User.where("country IS NOT NULL AND country != ''").pluck(:country).uniq.sort, include_blank: false
f.input :start_time
f.input :expiration_time
f.input :programmer_only, as: :radio
f.input :skill_id, as: :select, collection: [['No Skill', '0']] + Skill.all.map{ |skill| [skill.name, skill.id] }
f.input :gender, as: :select, collection: [['Both', '3']] + [['Male', '1']] + [['Female', '2']]
f.input :close_text
f.input :is_active, as: :radio
end
f.actions
end
end
View
@@ -0,0 +1,59 @@
ActiveAdmin.register Course do
permit_params :instructor_id, :language_id, :title, :description, :avatar, :is_published, :is_approved, :technology_list, :congratulations
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# permit_params :list, :of, :attributes, :on, :model
#
# or
#
# permit_params do
# permitted = [:permitted, :attributes]
# permitted << :other if resource.something?
# permitted
# end
collection_action :autocomplete_tag_name, :method => :get
controller do
autocomplete :tag, :name, :full => true, :display_value => :funky_method
end
index do
selectable_column
column :instructor
column :language
column :title
column :is_published
column :is_approved
column :created_at, :sortable => :created_at do |obj|
obj.created_at.localtime.strftime("%B %d, %Y %H:%M")
end
actions
end
filter :instructor
filter :language
filter :title
filter :is_published
filter :is_approved
filter :created_at
form do |f|
f.inputs do
f.input :instructor
f.input :language_id, as: :select, collection: Language.all.map{ |language| [language.name, language.id] }
f.input :title
f.input :description, as: :ckeditor
f.input :is_published, as: :radio
f.input :is_approved, as: :radio
f.input :avatar, as: :file, :hint => image_tag(f.object.avatar.url)
f.input :technology_list, :as => :autocomplete, :url => autocomplete_tag_name_admin_courses_path, input_html: { :multiple => true, 'data-delimiter' => ',', :name => "course[technology_list]"}
f.input :congratulations, as: :ckeditor
end
f.actions
end
end
View
@@ -0,0 +1,48 @@
ActiveAdmin.register CourseLevel do
permit_params :course_id, :title, :description, :question, :answer, :predefined_answer, :case_sensitive, :regular_expression, :error_message, :congratulations
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# permit_params :list, :of, :attributes, :on, :model
#
# or
#
# permit_params do
# permitted = [:permitted, :attributes]
# permitted << :other if resource.something?
# permitted
# end
index do
selectable_column
column :course
column :title
column :created_at, :sortable => :created_at do |obj|
obj.created_at.localtime.strftime("%B %d, %Y %H:%M")
end
actions
end
filter :course
filter :title
filter :created_at
form do |f|
f.inputs do
f.input :course
f.input :title
f.input :description, as: :ckeditor
f.input :question, as: :ckeditor
f.input :answer
f.input :regular_expression, as: :radio
f.input :case_sensitive, as: :radio
f.input :predefined_answer
f.input :error_message, as: :ckeditor
f.input :congratulations, as: :ckeditor
end
f.actions
end
end
Oops, something went wrong.

0 comments on commit 9f15aae

Please sign in to comment.