├── log └── .keep ├── app ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── concerns │ │ └── .keep │ ├── company_branch.rb │ ├── like.rb │ ├── branch.rb │ ├── user.rb │ └── company.rb ├── assets │ ├── images │ │ ├── .keep │ │ ├── close.png │ │ ├── form.jpg │ │ ├── forms.jpg │ │ └── header.jpg │ ├── stylesheets │ │ ├── application.css │ │ └── custom.css.scss │ └── javascripts │ │ └── application.js ├── controllers │ ├── concerns │ │ └── .keep │ ├── application_controller.rb │ ├── pages_controller.rb │ ├── branches_controller.rb │ ├── users_controller.rb │ └── companies_controller.rb ├── views │ ├── branches │ │ ├── _branch.html.erb │ │ ├── new.html.erb │ │ ├── _form.html.erb │ │ └── show.html.erb │ ├── users │ │ ├── edit.html.erb │ │ ├── new.html.erb │ │ ├── _form.html.erb │ │ └── show.html.erb │ ├── companies │ │ ├── edit.html.erb │ │ ├── new.html.erb │ │ ├── _form.html.erb │ │ ├── show.html.erb │ │ ├── user_likes.html.erb │ │ └── index.html.erb │ ├── shared │ │ └── _errors.html.erb │ ├── layouts │ │ ├── application.html.erb │ │ ├── _messages.html.erb │ │ ├── _navigationWithoutLogin.html.erb │ │ └── _navigation.html.erb │ └── pages │ │ └── home.html.erb ├── helpers │ └── application_helper.rb └── uploaders │ └── picture_uploader.rb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── public ├── favicon.ico ├── uploads │ ├── company │ │ └── picture │ │ │ ├── 2 │ │ │ └── voicemail.png │ │ │ ├── 4 │ │ │ └── hhh_wallpaper_05.jpg │ │ │ └── 5 │ │ │ └── maxresdefault.jpg │ └── tmp │ │ ├── 1479297567-4469-3917 │ │ └── forms.jpg │ │ ├── 1479300249-6390-4091 │ │ └── forms.jpg │ │ ├── 1479303568-6756-8590 │ │ └── forms.jpg │ │ ├── 1479303752-6788-4245 │ │ └── forms.jpg │ │ ├── 1479304760-6897-0878 │ │ └── forms.jpg │ │ ├── 1479304880-6897-7913 │ │ └── form.jpg │ │ ├── 1479307427-7023-7144 │ │ └── form.jpg │ │ ├── 1479307512-7052-9080 │ │ └── forms.jpg │ │ ├── 1479297270-4469-3107 │ │ └── voicemail.png │ │ ├── 1479297761-4615-7359 │ │ └── voicemail.png │ │ ├── 1479298199-4615-0402 │ │ └── voicemail.png │ │ ├── 1479298310-4615-3531 │ │ └── voicemail.png │ │ ├── 1479298597-4777-7504 │ │ └── voicemail.png │ │ ├── 1479299539-4777-2915 │ │ └── voicemail.png │ │ ├── 1479299871-6390-8606 │ │ └── voicemail.png │ │ ├── 1479299998-6390-4791 │ │ └── voicemail.png │ │ ├── 1479300293-6472-3511 │ │ └── voicemail.png │ │ ├── 1479302715-6650-3125 │ │ └── voicemail.png │ │ ├── 1479303698-6756-2516 │ │ └── voicemail.png │ │ ├── 1479304123-6836-9347 │ │ └── voicemail.png │ │ ├── 1479304498-6836-6229 │ │ └── voicemail.png │ │ ├── 1479307292-6980-7074 │ │ └── voicemail.png │ │ └── 1479564592-3918-1651 │ │ └── maxresdefault.jpg ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── test ├── helpers │ └── .keep ├── mailers │ └── .keep ├── models │ └── .keep ├── controllers │ └── .keep ├── fixtures │ └── .keep ├── integration │ └── .keep └── test_helper.rb ├── vendor └── assets │ ├── javascripts │ └── .keep │ └── stylesheets │ └── .keep ├── screenshots ├── one.png ├── six.png ├── two.png ├── eight.png ├── five.png ├── four.png ├── seven.png ├── three.png └── placementor.jpg ├── bin ├── bundle ├── rake ├── rails ├── spring └── setup ├── config ├── boot.rb ├── initializers │ ├── cookies_serializer.rb │ ├── session_store.rb │ ├── mime_types.rb │ ├── filter_parameter_logging.rb │ ├── carrier_wave.rb │ ├── backtrace_silencers.rb │ ├── assets.rb │ ├── wrap_parameters.rb │ └── inflections.rb ├── environment.rb ├── routes.rb ├── database.yml ├── locales │ └── en.yml ├── secrets.yml ├── application.rb └── environments │ ├── development.rb │ ├── test.rb │ └── production.rb ├── config.ru ├── db ├── migrate │ ├── 20161113150329_add_user_id_to_company.rb │ ├── 20161116112252_add_picture_to_recipes.rb │ ├── 20161120185511_add_branch_column_to_users.rb │ ├── 20161118133605_add_password_digest_to_users.rb │ ├── 20161120172833_create_branches.rb │ ├── 20161118081337_create_likes.rb │ ├── 20161113141520_fix_column_name.rb │ ├── 20161120173337_create_company_branches.rb │ ├── 20161113134030_create_users.rb │ └── 20161113133230_create_companies.rb ├── seeds.rb └── schema.rb ├── Rakefile ├── .gitignore ├── README.rdoc └── README.md /log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /screenshots/one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/one.png -------------------------------------------------------------------------------- /screenshots/six.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/six.png -------------------------------------------------------------------------------- /screenshots/two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/two.png -------------------------------------------------------------------------------- /screenshots/eight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/eight.png -------------------------------------------------------------------------------- /screenshots/five.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/five.png -------------------------------------------------------------------------------- /screenshots/four.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/four.png -------------------------------------------------------------------------------- /screenshots/seven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/seven.png -------------------------------------------------------------------------------- /screenshots/three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/three.png -------------------------------------------------------------------------------- /app/views/branches/_branch.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to branch.name, branch_path(branch) %> -------------------------------------------------------------------------------- /app/assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/app/assets/images/close.png -------------------------------------------------------------------------------- /app/assets/images/form.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/app/assets/images/form.jpg -------------------------------------------------------------------------------- /app/assets/images/forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/app/assets/images/forms.jpg -------------------------------------------------------------------------------- /screenshots/placementor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/screenshots/placementor.jpg -------------------------------------------------------------------------------- /app/assets/images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/app/assets/images/header.jpg -------------------------------------------------------------------------------- /app/models/company_branch.rb: -------------------------------------------------------------------------------- 1 | class CompanyBranch < ActiveRecord::Base 2 | belongs_to :company 3 | belongs_to :branch 4 | end -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /public/uploads/company/picture/2/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/company/picture/2/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479297567-4469-3917/forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479297567-4469-3917/forms.jpg -------------------------------------------------------------------------------- /public/uploads/tmp/1479300249-6390-4091/forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479300249-6390-4091/forms.jpg -------------------------------------------------------------------------------- /public/uploads/tmp/1479303568-6756-8590/forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479303568-6756-8590/forms.jpg -------------------------------------------------------------------------------- /public/uploads/tmp/1479303752-6788-4245/forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479303752-6788-4245/forms.jpg -------------------------------------------------------------------------------- /public/uploads/tmp/1479304760-6897-0878/forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479304760-6897-0878/forms.jpg -------------------------------------------------------------------------------- /public/uploads/tmp/1479304880-6897-7913/form.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479304880-6897-7913/form.jpg -------------------------------------------------------------------------------- /public/uploads/tmp/1479307427-7023-7144/form.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479307427-7023-7144/form.jpg -------------------------------------------------------------------------------- /public/uploads/tmp/1479307512-7052-9080/forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479307512-7052-9080/forms.jpg -------------------------------------------------------------------------------- /public/uploads/company/picture/5/maxresdefault.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/company/picture/5/maxresdefault.jpg -------------------------------------------------------------------------------- /public/uploads/company/picture/4/hhh_wallpaper_05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/company/picture/4/hhh_wallpaper_05.jpg -------------------------------------------------------------------------------- /public/uploads/tmp/1479297270-4469-3107/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479297270-4469-3107/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479297761-4615-7359/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479297761-4615-7359/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479298199-4615-0402/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479298199-4615-0402/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479298310-4615-3531/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479298310-4615-3531/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479298597-4777-7504/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479298597-4777-7504/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479299539-4777-2915/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479299539-4777-2915/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479299871-6390-8606/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479299871-6390-8606/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479299998-6390-4791/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479299998-6390-4791/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479300293-6472-3511/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479300293-6472-3511/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479302715-6650-3125/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479302715-6650-3125/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479303698-6756-2516/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479303698-6756-2516/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479304123-6836-9347/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479304123-6836-9347/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479304498-6836-6229/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479304498-6836-6229/voicemail.png -------------------------------------------------------------------------------- /public/uploads/tmp/1479307292-6980-7074/voicemail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479307292-6980-7074/voicemail.png -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /public/uploads/tmp/1479564592-3918-1651/maxresdefault.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thegenuinegourav/PlaceMentor/HEAD/public/uploads/tmp/1479564592-3918-1651/maxresdefault.jpg -------------------------------------------------------------------------------- /app/models/like.rb: -------------------------------------------------------------------------------- 1 | class Like < ActiveRecord::Base 2 | belongs_to :user 3 | belongs_to :company 4 | 5 | validates_uniqueness_of :user, scope: :company 6 | 7 | end -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json 4 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_workspace_session' 4 | -------------------------------------------------------------------------------- /db/migrate/20161113150329_add_user_id_to_company.rb: -------------------------------------------------------------------------------- 1 | class AddUserIdToCompany < ActiveRecord::Migration 2 | def change 3 | add_column :companies, :user_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20161116112252_add_picture_to_recipes.rb: -------------------------------------------------------------------------------- 1 | class AddPictureToRecipes < ActiveRecord::Migration 2 | def change 3 | add_column :companies, :picture, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20161120185511_add_branch_column_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddBranchColumnToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :branch_id, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /db/migrate/20161118133605_add_password_digest_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddPasswordDigestToUsers < ActiveRecord::Migration 2 | def change 3 | add_column :users, :password_digest, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20161120172833_create_branches.rb: -------------------------------------------------------------------------------- 1 | class CreateBranches < ActiveRecord::Migration 2 | def change 3 | create_table :branches do |t| 4 | t.string :name 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20161118081337_create_likes.rb: -------------------------------------------------------------------------------- 1 | class CreateLikes < ActiveRecord::Migration 2 | def change 3 | create_table :likes do |t| 4 | t.integer :like, :user_id, :company_id 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20161113141520_fix_column_name.rb: -------------------------------------------------------------------------------- 1 | class FixColumnName < ActiveRecord::Migration 2 | def change 3 | rename_column :users, :name, :username 4 | rename_column :companies, :name, :companyname 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | 7 | require 'carrierwave/orm/activerecord' 8 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /db/migrate/20161120173337_create_company_branches.rb: -------------------------------------------------------------------------------- 1 | class CreateCompanyBranches < ActiveRecord::Migration 2 | def change 3 | create_table :company_branches do |t| 4 | t.integer :company_id, :branch_id 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/models/branch.rb: -------------------------------------------------------------------------------- 1 | class Branch < ActiveRecord::Base 2 | has_many :company_branches 3 | has_many :companies, through: :company_branches 4 | has_many :users 5 | validates :name, presence: true, length: { minimum: 2, maximum: 25 } 6 | end -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../../config/application', __FILE__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /db/migrate/20161113134030_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :name 5 | t.string :email 6 | t.string :phone 7 | t.boolean :admin, :default => false 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20161113133230_create_companies.rb: -------------------------------------------------------------------------------- 1 | class CreateCompanies < ActiveRecord::Migration 2 | def change 3 | create_table :companies do |t| 4 | t.string :name 5 | t.date :date 6 | t.string :location 7 | t.float :package 8 | t.text :description 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /app/views/branches/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 | 7 |
8 |

9 |
10 | background image 11 | <%= render 'form' %> 12 | 13 |
-------------------------------------------------------------------------------- /app/views/users/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 | 7 |
8 |

9 |
10 | background image 11 | <%= render 'form' %> 12 | 13 |
-------------------------------------------------------------------------------- /app/views/users/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 | 7 |
8 |

9 |
10 | background image 11 | <%= render 'form' %> 12 | 13 |
-------------------------------------------------------------------------------- /app/views/companies/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 | 7 |
8 |

9 |
10 | background image 11 | <%= render 'form' %> 12 | 13 |
-------------------------------------------------------------------------------- /app/views/companies/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 | 7 |
8 |

9 |
10 | background image 11 | <%= render 'form' %> 12 | 13 |
-------------------------------------------------------------------------------- /config/initializers/carrier_wave.rb: -------------------------------------------------------------------------------- 1 | if Rails.env.production? 2 | CarrierWave.configure do |config| 3 | config.fog_credentials = { 4 | :provider => 'AWS', 5 | :aws_access_key_id => ENV['S3_ACCESS_KEY'], 6 | :aws_secret_access_key => ENV['S3_SECRET_KEY'] 7 | } 8 | 9 | config.fog_directory = ENV['S3_BUCKET'] 10 | 11 | end 12 | end -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | 3 | def gravatar_for(user,options = {size: 80}) 4 | gravatar_id = Digest::MD5::hexdigest(user.email.downcase) 5 | size = options[:size] 6 | gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}" 7 | image_tag(gravatar_url,alt: user.username,class: "gravatar circle") 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /app/views/shared/_errors.html.erb: -------------------------------------------------------------------------------- 1 | <% if obj.errors.any? %> 2 |
3 |
4 |
Please correct the following errors:
5 | 12 |
13 |
14 | <% end %> -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root 'pages#home' 3 | get '/home', to: 'pages#home' 4 | post '/home', to: 'pages#create' 5 | get '/logout', to: 'pages#destroy' 6 | 7 | resources :companies do 8 | member do 9 | post 'like' 10 | get '/likes', to: 'companies#user_likes' 11 | end 12 | end 13 | 14 | resources :users, except: [:new,:index, :destroy] 15 | get '/register', to: 'users#new' 16 | 17 | resources :branches, only: [:new, :create, :show] 18 | 19 | 20 | end 21 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) 11 | Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } 12 | gem 'spring', match[1] 13 | require 'spring/binstub' 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/views/branches/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'shared/errors', obj: @branch %> 2 | 3 |
4 |
5 |

Create New Branch

6 | 7 |

8 | <%= form_for @branch do |f| %> 9 | <%= f.label :name %> <%= f.text_field :name %> 10 | 11 | <%= f.submit 'Create Branch',class: "btn btn-warning" %> 12 | <% end %> 13 |
14 |
15 | 16 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PlaceMentor 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | <%= google_webfonts_init({ 10 | google: ['Open+Sans', 'Merriweather'] 11 | }) %> 12 | 13 | 14 | 15 | 16 | 17 | <%= render 'layouts/messages' %> 18 | <%= yield %> 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | !/log/.keep 17 | /tmp 18 | 19 | # Ignore all cloud9 hidden files 20 | .c9/ -------------------------------------------------------------------------------- /app/views/pages/home.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'layouts/navigation' %> 2 | 3 |
4 |
5 |
6 |

“Only those who dare to fail greatly can ever achieve greatly.”

7 |
8 |

PlaceMentor helps you to get information regarding Oncampus companies visit!
Designed for Jamians only

9 | <%= link_to "Sign Up Now!", register_path, class: "btn btn-primary btn-xl page-scroll" %> 10 |
11 |
12 |
-------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /app/views/layouts/_messages.html.erb: -------------------------------------------------------------------------------- 1 | <% flash.each do |message_type,message| %> 2 | <% if message_type === "success" %> 3 |
4 | <%= message %>[close] 5 |
6 | <% else %> 7 |
8 | <%= message %>[close] 9 |
10 | <% end %> 11 | <% end %> 12 | 13 | 20 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | 6 | helper_method :current_user,:logged_in? 7 | 8 | def current_user 9 | current_user ||= User.find(session[:user_id]) if session[:user_id] 10 | end 11 | 12 | def logged_in? 13 | !!current_user 14 | end 15 | 16 | def require_user 17 | if !logged_in? 18 | flash[:danger] = "You must be logged in to perform this action!" 19 | redirect_to home_path 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ActiveRecord::Base 2 | has_many :companies 3 | has_many :likes 4 | belongs_to :branch 5 | before_save {self.email = email.downcase } 6 | validates :username, presence: true, length: { minimum: 3, maximum: 70 } 7 | validates :phone, presence: true, length: {minimum: 10, maximum: 10 } 8 | VALID_EMAIL_REGEX = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i 9 | validates :email, presence: true, length: { maximum: 105 }, 10 | uniqueness: { case_sensitive: false }, 11 | format: { with: VALID_EMAIL_REGEX } 12 | 13 | has_secure_password 14 | 15 | end -------------------------------------------------------------------------------- /app/controllers/pages_controller.rb: -------------------------------------------------------------------------------- 1 | class PagesController < ApplicationController 2 | def home 3 | redirect_to companies_path if logged_in? 4 | end 5 | 6 | def create 7 | user = User.find_by(email: params[:email]) 8 | if user && user.authenticate(params[:password]) 9 | session[:user_id] = user.id 10 | flash[:success]="You have been logged in" 11 | redirect_to companies_path 12 | else 13 | flash.now[:danger]="Incorrect email or password" 14 | render 'home' 15 | end 16 | end 17 | 18 | def destroy 19 | session[:user_id]=nil 20 | flash[:success]="You have been logged out" 21 | redirect_to root_path 22 | end 23 | end -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | 17 | -------------------------------------------------------------------------------- /app/controllers/branches_controller.rb: -------------------------------------------------------------------------------- 1 | class BranchesController < ApplicationController 2 | 3 | before_action :require_user, except: [:show] 4 | 5 | def new 6 | @branch = Branch.new 7 | end 8 | 9 | def create 10 | @branch = Branch.new(branch_params) 11 | if @branch.save 12 | flash[:success] = "Branch was created successfully" 13 | redirect_to companies_path 14 | else 15 | render 'new' 16 | end 17 | end 18 | 19 | def show 20 | @branch = Branch.find(params[:id]) 21 | @companies = @branch.companies.paginate(page: params[:page],per_page: 4) 22 | end 23 | 24 | private 25 | def branch_params 26 | params.require(:branch).permit(:name) 27 | end 28 | end -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | 4 | # path to your application root. 5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 6 | 7 | Dir.chdir APP_ROOT do 8 | # This script is a starting point to setup your application. 9 | # Add necessary setup steps to this file: 10 | 11 | puts "== Installing dependencies ==" 12 | system "gem install bundler --conservative" 13 | system "bundle check || bundle install" 14 | 15 | # puts "\n== Copying sample files ==" 16 | # unless File.exist?("config/database.yml") 17 | # system "cp config/database.yml.sample config/database.yml" 18 | # end 19 | 20 | puts "\n== Preparing database ==" 21 | system "bin/rake db:setup" 22 | 23 | puts "\n== Removing old logs and tempfiles ==" 24 | system "rm -f log/*" 25 | system "rm -rf tmp/cache" 26 | 27 | puts "\n== Restarting application server ==" 28 | system "touch tmp/restart.txt" 29 | end 30 | -------------------------------------------------------------------------------- /app/views/users/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'shared/errors', obj: @user %> 2 | 3 |
4 |
5 | <% if @user.new_record? %> 6 |

Register Your Account

7 | <% else %> 8 |

Edit Your Account

9 | <% end %> 10 |

11 | <%= form_for @user do |f| %> 12 | <%= f.label :userName %> <%= f.text_field :username %> 13 | <%= f.label :email %> <%= f.email_field :email %> 14 | <%= f.label :phoneNumber %> <%= f.text_field :phone %> 15 | <%= f.label :password %> <%= f.password_field :password ,rows: 10%> 16 | <%= f.label :branch %> <%= f.select :branch_id, Branch.all.collect {|c| [ c.name, c.id ] } %> 17 | <%= f.submit(@user.new_record? ? 'Register' : 'Edit Profile',class: "btn btn-success") %> 18 | <% end %> 19 |
20 |
-------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: b0c1e5b975e44c760d1e77d6ef5d3bf3c9b482e457b9f6812d423fcaee532a349c11d457a8680e6177b4bcbc38cae18e0feb92943ad124feef4d7d8be917635e 15 | 16 | test: 17 | secret_key_base: 43ff26b6416b8041269c0a36a08b0c90e879750eb29034055b6022445236e9c0adba35b2512cd8fe0d9c43e5df83448566a4b7929741670afb559af65c681c74 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module Workspace 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 17 | # config.time_zone = 'Central Time (US & Canada)' 18 | 19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 21 | # config.i18n.default_locale = :de 22 | 23 | # Do not swallow errors in after_commit/after_rollback callbacks. 24 | config.active_record.raise_in_transactional_callbacks = true 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /app/models/company.rb: -------------------------------------------------------------------------------- 1 | class Company < ActiveRecord::Base 2 | belongs_to :user 3 | has_many :likes 4 | has_many :company_branches 5 | has_many :branches, through: :company_branches 6 | validates :user_id, presence: true 7 | validates :companyname, presence: true, length: { minimum: 3 ,maximum: 100 } 8 | validates :location, presence: true, length: { minimum: 5, maximum: 300 } 9 | validates :package, presence: true 10 | validates :description, presence: true, length: {minimum: 10, maximum: 1000 } 11 | mount_uploader :picture, PictureUploader 12 | validate :picture_size 13 | 14 | default_scope -> { order(updated_at: :desc) } 15 | 16 | def count_one_stars 17 | self.likes.where(like: 1).size 18 | end 19 | 20 | def count_two_stars 21 | self.likes.where(like: 2).size 22 | end 23 | 24 | def count_three_stars 25 | self.likes.where(like: 3).size 26 | end 27 | 28 | def count_four_stars 29 | self.likes.where(like: 4).size 30 | end 31 | 32 | def count_five_stars 33 | self.likes.where(like: 5).size 34 | end 35 | 36 | def rating 37 | ((count_one_stars + 2*count_two_stars + 3*count_three_stars + 4*count_four_stars + 5*count_five_stars)/self.likes.size.to_f).round(1) 38 | end 39 | 40 | private 41 | def picture_size 42 | if picture.size > 5.megabytes 43 | errors.add(:picture,"should be less than 5MB") 44 | end 45 | end 46 | end -------------------------------------------------------------------------------- /app/controllers/users_controller.rb: -------------------------------------------------------------------------------- 1 | class UsersController < ApplicationController 2 | 3 | before_action :set_user, only: [:edit, :update, :show] 4 | before_action :require_same_user, only: [:edit, :update] 5 | before_action :require_user, only: [:show] 6 | 7 | def new 8 | @user = User.new 9 | end 10 | 11 | def create 12 | @user = User.new(user_params) 13 | if @user.save 14 | flash[:success] = "Your Account has been registered successfully!!" 15 | session[:user_id] = @user.id 16 | redirect_to companies_path 17 | else 18 | render 'new' 19 | end 20 | end 21 | 22 | def edit 23 | end 24 | 25 | def update 26 | if @user.update(user_params) 27 | flash[:success] = "Your profile has been updated successfully!" 28 | redirect_to user_path(@user) 29 | else 30 | render 'edit' 31 | end 32 | end 33 | 34 | def show 35 | @companies = @user.companies.paginate(page: params[:page],per_page: 3) 36 | end 37 | 38 | private 39 | def user_params 40 | params.require(:user).permit(:username, :email,:phone, :password, :branch_id) 41 | end 42 | 43 | def set_user 44 | @user = User.find(params[:id]) 45 | end 46 | 47 | def require_same_user 48 | if current_user != @user 49 | flash[:danger]="You can only edit your own profile" 50 | redirect_to root_path 51 | end 52 | end 53 | 54 | 55 | end -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 31 | # yet still be able to expire them through the digest params. 32 | config.assets.digest = true 33 | 34 | # Adds additional error checking when serving assets at runtime. 35 | # Checks for improperly declared sprockets dependencies. 36 | # Raises helpful error messages. 37 | config.assets.raise_runtime_errors = true 38 | 39 | # Raises error for missing translations 40 | # config.action_view.raise_on_missing_translations = true 41 | end 42 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /app/uploaders/picture_uploader.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | class PictureUploader < CarrierWave::Uploader::Base 4 | 5 | include CarrierWave::MiniMagick 6 | process resize_to_limit: [600,600] 7 | 8 | # Include RMagick or MiniMagick support: 9 | # include CarrierWave::RMagick 10 | 11 | 12 | # Choose what kind of storage to use for this uploader: 13 | 14 | if Rails.env.production? 15 | storage :fog 16 | else 17 | storage :file 18 | end 19 | 20 | # storage :fog 21 | 22 | # Override the directory where uploaded files will be stored. 23 | # This is a sensible default for uploaders that are meant to be mounted: 24 | def store_dir 25 | "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" 26 | end 27 | 28 | # Provide a default URL as a default if there hasn't been a file uploaded: 29 | # def default_url 30 | # # For Rails 3.1+ asset pipeline compatibility: 31 | # # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_')) 32 | # 33 | # "/images/fallback/" + [version_name, "default.png"].compact.join('_') 34 | # end 35 | 36 | # Process files as they are uploaded: 37 | # process :scale => [200, 300] 38 | # 39 | # def scale(width, height) 40 | # # do something 41 | # end 42 | 43 | # Create different versions of your uploaded files: 44 | # version :thumb do 45 | # process :resize_to_fit => [50, 50] 46 | # end 47 | 48 | # Add a white list of extensions which are allowed to be uploaded. 49 | # For images you might use something like this: 50 | def extension_white_list 51 | %w(jpg jpeg gif png) 52 | end 53 | 54 | # Override the filename of the uploaded files: 55 | # Avoid using model.id or version_name here, see uploader/store.rb for details. 56 | # def filename 57 | # "something.jpg" if original_filename 58 | # end 59 | 60 | end -------------------------------------------------------------------------------- /app/views/companies/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= render 'shared/errors', obj: @company %> 2 | 3 |
4 |
5 | <% if @company.new_record? %> 6 |

Visiting Company Info

7 | <% else %> 8 |

Edit Company Info

9 | <% end %> 10 |

11 | <%= form_for(@company, html: { multipart: true }) do |f| %> 12 | <%= f.label :company_Name %> <%= f.text_field :companyname %> 13 | <%= f.label :date %> <%= f.date_select(:date, :order => [:month, :day, :year]) %> 14 | <%= f.label :location %> <%= f.text_field :location %> 15 | <%= f.label :package_in_Lakhs_Per_Annum %> <%= f.number_field :package, :step => "0.01" %> 16 | <%= f.label :description %> <%= f.text_area :description ,rows: 10%> 17 | 18 | Branches: 19 | <%= f.collection_check_boxes :branch_ids, Branch.all, :id, :name do |cb| %> 20 | <% cb.label(class: "checkbox-inline input_checkbox"){cb.check_box(class: "checkbox") + cb.text} %> 21 | <% end %> 22 |

23 | 24 | 25 | 26 | <%= f.file_field :picture,accept: 'image/jpeg,image/png,image/gif' %> 27 | 28 | <%= f.submit(@company.new_record? ? 'Create Company' : 'Edit Company',class: "btn btn-warning") %> 29 | <% end %> 30 |
31 |
32 | 33 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static file server for tests with Cache-Control for performance. 16 | config.serve_static_files = true 17 | config.static_cache_control = 'public, max-age=3600' 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Randomize the order test cases are executed. 35 | config.active_support.test_order = :random 36 | 37 | # Print deprecation notices to the stderr. 38 | config.active_support.deprecation = :stderr 39 | 40 | # Raises error for missing translations 41 | # config.action_view.raise_on_missing_translations = true 42 | end 43 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20161120185511) do 15 | 16 | create_table "branches", force: :cascade do |t| 17 | t.string "name" 18 | end 19 | 20 | create_table "companies", force: :cascade do |t| 21 | t.string "companyname" 22 | t.date "date" 23 | t.string "location" 24 | t.float "package" 25 | t.text "description" 26 | t.datetime "created_at" 27 | t.datetime "updated_at" 28 | t.integer "user_id" 29 | t.string "picture" 30 | end 31 | 32 | create_table "company_branches", force: :cascade do |t| 33 | t.integer "company_id" 34 | t.integer "branch_id" 35 | end 36 | 37 | create_table "likes", force: :cascade do |t| 38 | t.integer "like" 39 | t.integer "user_id" 40 | t.integer "company_id" 41 | end 42 | 43 | create_table "users", force: :cascade do |t| 44 | t.string "username" 45 | t.string "email" 46 | t.string "phone" 47 | t.boolean "admin", default: false 48 | t.datetime "created_at" 49 | t.datetime "updated_at" 50 | t.string "password_digest" 51 | t.integer "branch_id" 52 | end 53 | 54 | end 55 | -------------------------------------------------------------------------------- /app/views/layouts/_navigationWithoutLogin.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](https://github.com/thegenuinegourav/PlaceMentor/blob/master/screenshots/placementor.jpg) 2 | 3 | # PlaceMentor 4 | :mortar_board: PlaceMentor helps you to get information regarding Oncampus companies visit! 5 | Designed for Jamians only 6 | PlaceMentor is currently hosting on [Heroku](http://placementor.herokuapp.com/) 7 | 8 | 9 | ### Technologies used 10 | 11 | This website uses a number of open source projects to work properly: 12 | 13 | * Frontend 14 | * HTML/CSS 15 | * Bootstrap 16 | 17 | * Backend 18 | * Ruby/Rails 19 | * AWS 20 | 21 | 22 | ### Development 23 | 24 | Want to contribute? **:pencil:** 25 | 26 | To fix a bug or enhance an existing module, follow these steps: 27 | 28 | 1. Fork the repo 29 | 2. Create a new branch (`git checkout -b exciting-stuff`) 30 | 3. Make the appropriate changes in the files 31 | 4. Add changes to reflect the changes made 32 | 5. Commit your changes (`git commit -am 'exciting-stuff!!'`) 33 | 6. Push to the branch (`git push origin exciting-stuff`) 34 | 7. Create a Pull Request 35 | 36 | ### Interested? 37 | 38 | If you find a bug (the website couldn't handle the query and / or gave irrelevant results), kindly open an issue [here](https://github.com/thegenuinegourav/PlaceMentor/issues/new) by including your search query and the expected result. 39 | 40 | If you'd like to request a new functionality, feel free to do so by opening an issue [here](https://github.com/thegenuinegourav/PlaceMentor/issues/new) including some sample queries and their corresponding results. 41 | 42 | ### Screenshots 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /app/views/layouts/_navigation.html.erb: -------------------------------------------------------------------------------- 1 | 49 | 50 | -------------------------------------------------------------------------------- /app/controllers/companies_controller.rb: -------------------------------------------------------------------------------- 1 | require 'mini_magick' 2 | class CompaniesController < ApplicationController 3 | 4 | before_action :set_company, only: [:edit,:update,:like, :show, :user_likes] 5 | before_action :require_user, except: [:like] 6 | before_action :require_user_likes, only: [:like] 7 | before_action :require_admin, except: [:index, :show, :like, :user_likes] 8 | before_action :require_same_user, only: [:edit, :update] 9 | 10 | 11 | def index 12 | @companies = Company.paginate(page: params[:page],per_page: 3) 13 | end 14 | 15 | def show 16 | 17 | end 18 | 19 | def new 20 | @company = Company.new 21 | end 22 | 23 | def create 24 | @company = Company.new(company_params) 25 | @company.user = current_user 26 | 27 | if @company.save 28 | flash[:success] = "Created Successfully!" 29 | redirect_to companies_path 30 | else 31 | render :new 32 | end 33 | 34 | end 35 | 36 | def edit 37 | 38 | end 39 | 40 | def update 41 | 42 | if @company.update(company_params) 43 | flash[:success] = "Updated Successfully!" 44 | redirect_to company_path(@company) 45 | else 46 | render :edit 47 | end 48 | end 49 | 50 | def like 51 | 52 | like = Like.create(like: params[:like], user: current_user, company: @company) 53 | if like.valid? 54 | flash[:success] = "You reviewed this company!" 55 | else 56 | flash[:danger] = "You can only reviewed this company once!" 57 | end 58 | redirect_to likes_company_path(@company) 59 | end 60 | 61 | def user_likes 62 | 63 | end 64 | 65 | private 66 | def company_params 67 | params.require(:company).permit(:companyname,:date,:location,:package,:description,:picture,branch_ids: []) 68 | end 69 | 70 | def set_company 71 | @company = Company.find(params[:id]) 72 | end 73 | 74 | def require_same_user 75 | if current_user != @company.user 76 | flash[:danger] = "You can only edit your own provided company info" 77 | redirect_to companies_path 78 | end 79 | end 80 | 81 | def require_user_likes 82 | if !logged_in? 83 | flash[:danger] = "You must be logged in to perform this action!" 84 | redirect_to :back 85 | end 86 | end 87 | 88 | def require_admin 89 | if !current_user.admin? 90 | flash[:danger] = "You must be an admin to perform this action!" 91 | redirect_to companies_path 92 | end 93 | end 94 | end -------------------------------------------------------------------------------- /app/views/companies/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 |
7 |
8 |

<%= @company.companyname %>

9 |
10 | <%= link_to "Rated: " + @company.rating.round(2).to_s,likes_company_path(@company) %> 11 |
12 |
13 | <%= link_to like_company_path(@company, like: 5), method: :post do %> 14 | ☆ 15 | <% end %> 16 | 17 | <%= link_to like_company_path(@company, like: 4), method: :post do %> 18 | ☆ 19 | <% end %> 20 | 21 | <%= link_to like_company_path(@company, like: 3), method: :post do %> 22 | ☆ 23 | <% end %> 24 | 25 | <%= link_to like_company_path(@company, like: 2), method: :post do %> 26 | ☆ 27 | <% end %> 28 | 29 | <%= link_to like_company_path(@company, like: 1), method: :post do %> 30 | ☆ 31 | <% end %> 32 | 33 |
34 | 35 | <% if logged_in? and (current_user == @company.user) %> 36 | <%= link_to "Edit this info",edit_company_path(@company), class: "btn btn-danger pull-right" %> 37 | <% end %> 38 |
39 | 40 |
41 |
42 | <%= image_tag(@company.picture.url,size: "400x400",class: "gravatar img-responsive img-circle") if @company.picture? %> 43 |
44 | 45 |
46 | 47 |
48 |
  Arriving on <%= @company.date %>
49 |
  Package: <%= @company.package %> lakhs per annum
50 | <% if @company.branches.any? %>
  For <%= render @company.branches %> Branch
<% end %> 51 |
  Location: <%= @company.location %>
52 |
53 | 54 | 55 |
56 | 57 |
58 |
59 |

<%= simple_format(@company.description) %>

60 |
61 |
62 | 63 |
64 | 65 |
66 | 67 | 68 |
-------------------------------------------------------------------------------- /app/views/users/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 |
7 |
8 |

<%= @user.username %>

9 |
10 |
11 |
12 |
13 | Email: <%= @user.email %> 14 |
15 |
16 |
17 | Phone: <%= @user.phone %> 18 |
19 |
20 |
21 | Branch: <%= @user.branch.name %> 22 |
23 |
24 |

25 | <% if @user.companies.any? %> 26 |
27 |

Companies brought to you by <%= @user.username %> :

28 |
29 |
30 |
31 | <% @user.companies.each do |company| %> 32 |
33 |
34 |
35 | 40 |
41 |
42 |
Rated: <%= company.rating.round(2) %>
43 |
44 |
45 |
46 |
47 |
48 | <%= link_to company.companyname,company_path(company) %> 49 |
50 | 51 | Arriving on <%= company.date %> 52 |
53 | Package: <%= company.package %> lpa 54 |
55 |
56 |
57 |
58 |

<%= company.description %>

59 |
60 |
61 | 62 |
63 |
64 | 65 | <% end %> 66 | 67 | 68 |
69 | <% end %> 70 |
71 |
72 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like 20 | # NGINX, varnish or squid. 21 | # config.action_dispatch.rack_cache = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? 26 | 27 | # Compress JavaScripts and CSS. 28 | config.assets.js_compressor = :uglifier 29 | # config.assets.css_compressor = :sass 30 | 31 | # Do not fallback to assets pipeline if a precompiled asset is missed. 32 | config.assets.compile = true 33 | config.serve_static_files = true 34 | 35 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 36 | # yet still be able to expire them through the digest params. 37 | config.assets.digest = true 38 | 39 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 40 | 41 | # Specifies the header that your server uses for sending files. 42 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 43 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 44 | 45 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 46 | # config.force_ssl = true 47 | 48 | # Use the lowest log level to ensure availability of diagnostic information 49 | # when problems arise. 50 | config.log_level = :debug 51 | 52 | # Prepend all log lines with the following tags. 53 | # config.log_tags = [ :subdomain, :uuid ] 54 | 55 | # Use a different logger for distributed setups. 56 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 57 | 58 | # Use a different cache store in production. 59 | # config.cache_store = :mem_cache_store 60 | 61 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 62 | # config.action_controller.asset_host = 'http://assets.example.com' 63 | 64 | # Ignore bad email addresses and do not raise email delivery errors. 65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 66 | # config.action_mailer.raise_delivery_errors = false 67 | 68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 69 | # the I18n.default_locale when a translation cannot be found). 70 | config.i18n.fallbacks = true 71 | 72 | # Send deprecation notices to registered listeners. 73 | config.active_support.deprecation = :notify 74 | 75 | # Use default logging formatter so that PID and timestamp are not suppressed. 76 | config.log_formatter = ::Logger::Formatter.new 77 | 78 | # Do not dump schema after migrations. 79 | config.active_record.dump_schema_after_migration = false 80 | end 81 | -------------------------------------------------------------------------------- /app/views/companies/user_likes.html.erb: -------------------------------------------------------------------------------- 1 | div style="padding-top: 50px;"> 2 | <%= render 'layouts/navigationWithoutLogin' %> 3 | 4 | 5 |
6 | 7 |

Ratings for <%= link_to @company.companyname,company_path(@company) %>

8 | 9 | 10 |
11 |
12 | <% @company.likes.each do |l| %> 13 |
14 |
15 | <%= link_to gravatar_for(l.user, size: 70), user_path(l.user), class: "img-circle" %> 16 |
17 |
18 | <%= link_to l.user.username,user_path(l.user) %> 19 |
20 |
21 | <% case l.like %> 22 | <% when 1...2 %> 23 |     24 |     25 |     26 |     27 |     28 | <% when 2...3 %> 29 |     30 |     31 |     32 |     33 |     34 | <% when 3...4 %> 35 |     36 |     37 |     38 |     39 |     40 | <% when 4...5 %> 41 |     42 |     43 |     44 |     45 |     46 | <% when 5 %> 47 |     48 |     49 |     50 |     51 |     52 | <% end %> 53 |
54 | 55 |
56 | Rated: <%= l.like.round(2) %> 57 |
58 | 59 |
60 | 61 | <% end %> 62 |
63 | 64 |
65 |
-------------------------------------------------------------------------------- /app/views/branches/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 | 7 |

Companies Recruiting From <%= @branch.name %> Branch

8 | 9 | <% @branch.companies.each do |company| %> 10 | 11 |
12 |
13 |
14 |
15 | 16 | <%= link_to image_tag(company.picture.url,size: "250x250", class: "gravatar img-responsive img-box img-thumbnail"),company_path(company) if company.picture? %> 17 | 18 |
19 |
20 |
21 | <% case company.rating.round(2) %> 22 | <% when 1...2 %> 23 | 24 | 25 | 26 | 27 | 28 | <% when 2...3 %> 29 | 30 | 31 | 32 | 33 | 34 | <% when 3...4 %> 35 | 36 | 37 | 38 | 39 | 40 | <% when 4...5 %> 41 | 42 | 43 | 44 | 45 | 46 | <% when 5 %> 47 | 48 | 49 | 50 | 51 | 52 | <% else %> 53 | Not Rated Yet 54 | <% end %> 55 |
56 |
57 |
58 |
59 | <%= link_to gravatar_for(company.user, size: 100), user_path(company.user)%> 60 |
61 |
62 |
63 | <%= link_to company.companyname,company_path(company) %> 64 |
65 | 66 | Arriving on <%= company.date %> 67 |
68 | Package: <%= company.package %> lpa 69 |
70 |
71 |
72 |
73 |

<%= company.description %>

74 | For <%= render company.branches %> Branch 75 |
Brought to you by <%= link_to company.user.username,user_path(company.user) %>
76 | 77 |
78 |
79 | 80 |
81 |
82 | 83 | <% end %> 84 | 85 | 86 |
87 | 88 |
89 | 90 | -------------------------------------------------------------------------------- /app/views/companies/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= render 'layouts/navigationWithoutLogin' %> 3 |
4 | 5 |
6 | 7 |
8 | 9 | <% @companies.each do |company| %> 10 | 11 |
12 |
13 |
14 |
15 | 16 | <%= link_to image_tag(company.picture.url,size: "250x250", class: "gravatar img-responsive img-box img-thumbnail"),company_path(company) if company.picture? %> 17 | 18 |
19 |
20 |
21 | <% case company.rating.round(2) %> 22 | <% when 1...2 %> 23 | 24 | 25 | 26 | 27 | 28 | <% when 2...3 %> 29 | 30 | 31 | 32 | 33 | 34 | <% when 3...4 %> 35 | 36 | 37 | 38 | 39 | 40 | <% when 4...5 %> 41 | 42 | 43 | 44 | 45 | 46 | <% when 5 %> 47 | 48 | 49 | 50 | 51 | 52 | <% else %> 53 | Not Rated Yet 54 | <% end %> 55 |
56 |
57 |
58 |
59 | <%= link_to gravatar_for(company.user, size: 100), user_path(company.user)%> 60 |
61 |
62 |
63 | <%= link_to company.companyname,company_path(company) %> 64 |
65 | 66 | Arriving on <%= company.date %> 67 |
68 | Package: <%= company.package %> lpa 69 |
70 |
71 |
72 |
73 |

<%= company.description %>

74 | <% if company.branches.any? %>For <%= render company.branches %> Branch<% end %> 75 |
Brought to you by <%= link_to company.user.username,user_path(company.user) %>
76 | 77 |
78 |
79 | 80 |
81 |
82 | 83 | <% end %> 84 | 85 |
86 | <%= will_paginate %> 87 |
88 | 89 |
90 | 91 |
92 | 93 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require turbolinks 16 | //= require bootstrap-sprockets 17 | //= require_tree . 18 | 19 | 20 | ;window.Modernizr=function(a,b,c){function C(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+o.join(c+" ")+c).split(" ");return B(d,b)}function B(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function A(a,b){return!!~(""+a).indexOf(b)}function z(a,b){return typeof a===b}function y(a,b){return x(n.join(a+";")+(b||""))}function x(a){k.cssText=a}var d="2.0.6",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l,m=Object.prototype.toString,n=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),o="Webkit Moz O ms Khtml".split(" "),p={},q={},r={},s=[],t=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["­",""].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},u,v={}.hasOwnProperty,w;!z(v,c)&&!z(v.call,c)?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],c)};var D=function(a,c){var d=a.join(""),f=c.length;t(d,function(a,c){var d=b.styleSheets[b.styleSheets.length-1],g=d.cssRules&&d.cssRules[0]?d.cssRules[0].cssText:d.cssText||"",h=a.childNodes,i={};while(f--)i[h[f].id]=h[f];e.csstransforms3d=i.csstransforms3d.offsetLeft===9},f,c)}([,["@media (",n.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join("")],[,"csstransforms3d"]);p.cssanimations=function(){return C("animationName")},p.csstransforms=function(){return!!B(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},p.csstransforms3d=function(){var a=!!B(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d);return a};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));x(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++bli>a,.navbar-default .nav>li>a:focus{text-transform:uppercase;font-weight:700;font-size:13px;color:#222}.navbar-default .nav>li>a:focus:hover,.navbar-default .nav>li>a:hover{color:#F05F40}.navbar-default .nav>li.active>a,.navbar-default .nav>li.active>a:focus{color:#F05F40!important;background-color:transparent}.navbar-default .nav>li.active>a:focus:hover,.navbar-default .nav>li.active>a:hover{background-color:transparent}@media (min-width:768px){.navbar-default{background-color:transparent;border-color:rgba(255,255,255,.3)}.navbar-default .navbar-header .navbar-brand{color:rgba(255,255,255,.7)}.navbar-default .navbar-header .navbar-brand:focus,.navbar-default .navbar-header .navbar-brand:hover{color:#fff}.navbar-default .nav>li>a,.navbar-default .nav>li>a:focus{color:rgba(255,255,255,.7)}.navbar-default .nav>li>a:focus:hover,.navbar-default .nav>li>a:hover{color:#fff}.navbar-default.affix{background-color:#fff;border-color:rgba(34,34,34,.05)}.navbar-default.affix .navbar-header .navbar-brand{color:#F05F40;font-size:14px}.navbar-default.affix .navbar-header .navbar-brand:focus,.navbar-default.affix .navbar-header .navbar-brand:hover{color:#eb3812}.navbar-default.affix .nav>li>a,.navbar-default.affix .nav>li>a:focus{color:#222}.navbar-default.affix .nav>li>a:focus:hover,.navbar-default.affix .nav>li>a:hover{color:#F05F40}}header{min-height:auto;-webkit-background-size:cover;-moz-background-size:cover;background-size:cover;-o-background-size:cover;background-position:center;background-image: url('/assets/header.jpg');color:#fff}header .header-content{padding:100px 15px}header .header-content .header-content-inner h1{font-weight:700;text-transform:uppercase;margin-top:0;margin-bottom:0;font-size:30px}header .header-content .header-content-inner hr{margin:30px auto}header .header-content .header-content-inner p{font-weight:300;color:rgba(255,255,255,.7);font-size:16px;margin-bottom:50px}@media (min-width:768px){header{min-height:100%}header .header-content{position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);padding:0 50px}header .header-content .header-content-inner{max-width:1000px;margin-left:auto;margin-right:auto}header .header-content .header-content-inner h1{font-size:50px}header .header-content .header-content-inner p{font-size:18px;max-width:80%;margin-left:auto;margin-right:auto}}.section-heading{margin-top:0}.service-box{max-width:400px;margin:50px auto 0}@media (min-width:992px){.service-box{margin:20px auto 0}}.service-box p{margin-bottom:0}.portfolio-box{position:relative;display:block;max-width:650px;margin:0 auto}.portfolio-box .portfolio-box-caption{color:#fff;opacity:0;display:block;background:rgba(240,95,64,.9);position:absolute;bottom:0;text-align:center;width:100%;height:100%;transition:all .35s}.btn-default.active,.btn-default:active,.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-default,.open>.dropdown-toggle.btn-primary{background-image:none}.portfolio-box .portfolio-box-caption .portfolio-box-caption-content{width:100%;text-align:center;position:absolute;top:50%;transform:translateY(-50%)}.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category,.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name{font-family:'Open Sans','Helvetica Neue',Arial,sans-serif;padding:0 15px}.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category{text-transform:uppercase;font-weight:600;font-size:14px}.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name{font-size:18px}.portfolio-box:hover .portfolio-box-caption{opacity:1}.portfolio-box:focus{outline:0}@media (min-width:768px){.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-category{font-size:16px}.portfolio-box .portfolio-box-caption .portfolio-box-caption-content .project-name{font-size:22px}}.call-to-action h2{margin:0 auto 20px}.text-primary{color:#F05F40}.no-gutter>[class*=col-]{padding-right:0;padding-left:0}.btn-default{color:#222;background-color:#fff;border-color:#fff;transition:all .35s}.btn-default.active,.btn-default.focus,.btn-default:active,.btn-default:focus,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#222;background-color:#f2f2f2;border-color:#ededed}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#fff}.btn-default .badge{color:#fff;background-color:#222}.btn-primary{color:#fff;background-color:#F05F40;border-color:#F05F40;-webkit-transition:all .35s;-moz-transition:all .35s;transition:all .35s}.btn-primary.active,.btn-primary.focus,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#ee4b28;border-color:#ed431f}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#F05F40;border-color:#F05F40}.btn-primary .badge{color:#F05F40;background-color:#fff}.btn{border:none;border-radius:300px;font-weight:700;text-transform:uppercase}.btn-xl{padding:15px 30px}::-moz-selection{color:#fff;text-shadow:none;background:#222}::selection{color:#fff;text-shadow:none;background:#222}img::selection{color:#fff;background:0 0}img::-moz-selection{color:#fff;background:0 0} 5 | 6 | .list-group {border-radius: 0;} 7 | .list-group .list-group-item {background-color: transparent;overflow: hidden;border: 0;border-radius: 0;padding: 0 16px;} 8 | .list-group .list-group-item .row-picture, 9 | .list-group .list-group-item .row-action-primary {float: left;display: inline-block;padding-right: 16px;padding-top: 8px;} 10 | .list-group .list-group-item .row-picture img, 11 | .list-group .list-group-item .row-action-primary img, 12 | .list-group .list-group-item .row-picture i, 13 | .list-group .list-group-item .row-action-primary i, 14 | .list-group .list-group-item .row-picture label, 15 | .list-group .list-group-item .row-action-primary label {display: block;width: 56px;height: 56px;} 16 | .list-group .list-group-item .row-picture img, 17 | .list-group .list-group-item .row-action-primary img {background: rgba(0, 0, 0, 0.1);padding: 1px;} 18 | .list-group .list-group-item .row-picture img.circle, 19 | .list-group .list-group-item .row-action-primary img.circle {border-radius: 100%;} 20 | .list-group .list-group-item .row-picture i, 21 | .list-group .list-group-item .row-action-primary i {background: rgba(0, 0, 0, 0.25);border-radius: 100%;text-align: center;line-height: 56px;font-size: 20px;color: white;} 22 | .list-group .list-group-item .row-picture label, 23 | .list-group .list-group-item .row-action-primary label {margin-left: 7px;margin-right: -7px;margin-top: 5px;margin-bottom: -5px;} 24 | .list-group .list-group-item .row-content {display: inline-block;width: calc(100% - 92px);min-height: 66px;} 25 | .list-group .list-group-item .row-content .action-secondary {position: absolute;right: 16px;top: 16px;} 26 | .list-group .list-group-item .row-content .action-secondary i {font-size: 20px;color: rgba(0, 0, 0, 0.25);cursor: pointer;} 27 | .list-group .list-group-item .row-content .action-secondary ~ * {max-width: calc(100% - 30px);} 28 | .list-group .list-group-item .row-content .least-content {position: absolute;right: 16px;top: 0px;color: rgba(0, 0, 0, 0.54);font-size: 14px;} 29 | .list-group .list-group-item .list-group-item-heading {color: rgba(0, 0, 0, 0.77);font-size: 20px;line-height: 29px;} 30 | .list-group .list-group-separator {clear: both;overflow: hidden;margin-top: 10px;margin-bottom: 10px;} 31 | .list-group .list-group-separator:before {content: "";width: calc(100% - 90px);border-bottom: 1px solid rgba(0, 0, 0, 0.1);float: right;} 32 | 33 | .bg-profile{background-color: #3498DB !important;height: 150px;z-index: 1;} 34 | .bg-bottom{height: 100px;margin-left: 30px;} 35 | .img-profile{display: inline-block !important;background-color: #fff;border-radius: 6px;margin-top: -50%;padding: 1px;vertical-align: bottom;border: 2px solid #fff;-moz-box-sizing: border-box;box-sizing: border-box;color: #fff;z-index: 2;} 36 | .row-float{margin-top: -40px;} 37 | .explore a {color: green; font-size: 13px;font-weight: 600} 38 | .twitter a {color:#4099FF} 39 | .img-box{box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);border-radius: 2px;border: 0;} 40 | 41 | 42 | input,textarea,select,uneditable-input { 43 | border: 1px solid #d2d2d2; 44 | border-radius: 5px; 45 | width: 100%; 46 | margin-bottom: 15px; 47 | } 48 | 49 | .input_checkbox input { 50 | width: auto !important; 51 | } 52 | 53 | input { 54 | height: auto !important; 55 | } 56 | 57 | span.picture { 58 | margin-top: 10px; 59 | input { 60 | border: 0; 61 | } 62 | } 63 | 64 | .show_recipe { 65 | margin: 10px 0px 10px 10px; 66 | } 67 | 68 | .rating { 69 | unicode-bidi: bidi-override; 70 | direction: rtl; 71 | margin-top: 10px; 72 | font-size: 50px; 73 | } 74 | 75 | .rating > a { 76 | display: inline-block; 77 | position: relative; 78 | width: 0.7em; 79 | text-decoration: none; 80 | } 81 | 82 | 83 | .rating > a:hover:before, 84 | .rating > a:hover ~ a:before { 85 | content: "\2605"; 86 | position: absolute; 87 | text-decoration: none; 88 | 89 | } 90 | 91 | 92 | #note { 93 | position: absolute; 94 | z-index: 6001; 95 | top: 0; 96 | left: 0; 97 | right: 0; 98 | text-align: center; 99 | line-height: 2.5; 100 | overflow: hidden; 101 | -webkit-box-shadow: 0 0 5px black; 102 | -moz-box-shadow: 0 0 5px black; 103 | box-shadow: 0 0 5px black; 104 | } 105 | .cssanimations.csstransforms #note { 106 | -webkit-transform: translateY(-50px); 107 | -webkit-animation: slideDown 2.5s 1.0s 1 ease forwards; 108 | -moz-transform: translateY(-50px); 109 | -moz-animation: slideDown 2.5s 1.0s 1 ease forwards; 110 | } 111 | 112 | #close { 113 | position: absolute; 114 | right: 10px; 115 | top: 9px; 116 | text-indent: -9999px; 117 | background: url(images/close.png); 118 | height: 16px; 119 | width: 16px; 120 | cursor: pointer; 121 | } 122 | .cssanimations.csstransforms #close { 123 | display: none; 124 | } 125 | 126 | @-webkit-keyframes slideDown { 127 | 0%, 100% { -webkit-transform: translateY(-50px); } 128 | 10%, 90% { -webkit-transform: translateY(0px); } 129 | } 130 | @-moz-keyframes slideDown { 131 | 0%, 100% { -moz-transform: translateY(-50px); } 132 | 10%, 90% { -moz-transform: translateY(0px); } 133 | } 134 | 135 | 136 | .pagniation-wrapper { 137 | text-align: center; 138 | } 139 | 140 | 141 | #mybg { 142 | position: fixed; 143 | top: 0; 144 | left: 0; 145 | 146 | /* Preserve aspet ratio */ 147 | min-width: 100%; 148 | min-height: 100%; 149 | } 150 | 151 | .myBorder { 152 | border:1px solid #EE4B28; 153 | width: 250px; 154 | } 155 | 156 | .myBorderGlyphicons { 157 | border:1px solid #EE4B28; 158 | } 159 | 160 | .orangebg { 161 | background-color: #EE4B28; 162 | color: white; 163 | } 164 | 165 | .verticalLine { 166 | border-left: thin solid #CCCCCC; 167 | } 168 | 169 | 170 | .nav_item .hovering:hover{ 171 | 172 | color:white!important; 173 | 174 | } 175 | 176 | .nav_item .dropdown .hovering:hover{ 177 | color:white!important; 178 | } 179 | 180 | .hovering:hover{ 181 | 182 | color:white!important; 183 | 184 | } 185 | 186 | .input_checkbox input { 187 | width: auto !important; 188 | } 189 | 190 | #no_decoration a{ 191 | text-decoration: none; 192 | color: white; 193 | } 194 | 195 | #no_decoration a:hover{ 196 | text-decoration: none; 197 | color: #FFD700; 198 | } 199 | --------------------------------------------------------------------------------