Skip to content
Open

Feed #22

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
63cebac
changes related to nav bar for the app.
kotlav Jun 8, 2017
105661c
Adding relation ship file
kotlav May 26, 2017
685d7dd
changes to ui of profile with causes.
kotlav May 26, 2017
5af75ac
changes to ui of profile with causes.
kotlav May 26, 2017
ac04f49
changes related to aws config,
kotlav May 29, 2017
44ea54e
changes related to saving interests to db
kotlav May 29, 2017
7d3890a
Fixed issues iwth relation ships
kotlav May 29, 2017
cc91a30
Removing byebugs
kotlav May 29, 2017
67cef26
WIP
kotlav May 29, 2017
1032b00
some improvements
kotlav May 29, 2017
72ce168
notes from code review
ravibhim May 29, 2017
ae03bcd
TO dos from yesterday review
kotlav May 30, 2017
2b7d9bc
Added a check to allow registered users to create an issue
kotlav May 30, 2017
c67eab9
Fixing issues iwth deleting an issue
kotlav May 30, 2017
166f284
changes related to follow and unfollow an interest functionality
kotlav May 30, 2017
09909dd
changes to refresh the page after follow or unfollow
kotlav May 30, 2017
91ad3fe
Removing unnecessary code and files of old relationships
kotlav May 30, 2017
060f0cd
some improvements
kotlav May 30, 2017
5ccfad9
changes related to rspec
kotlav May 31, 2017
776bfc1
adding spec directory
kotlav May 31, 2017
84ecb6e
changes related to rspec for models and social interests
kotlav May 31, 2017
2f59b40
changes related to user specs - suggestions and good practices
kotlav Jun 1, 2017
5228aef
spec change
kotlav Jun 2, 2017
930a758
Adding issue spec file
kotlav May 31, 2017
336bbea
chaning texts
kotlav May 31, 2017
3ecfa4d
specs for causes
kotlav May 31, 2017
e80441d
Fixed bug with settings.
kotlav May 31, 2017
06e2024
changes related to issues spec
kotlav Jun 1, 2017
c4a164e
changes related to addition of new fields to Issue model
kotlav Jun 8, 2017
7f22660
changes to Cause view page
kotlav Jun 8, 2017
5b4d60a
changes related to cause creation with social interest tags
kotlav Jun 9, 2017
c3d5508
changes to cause card, removing byebugs
kotlav Jun 12, 2017
62f9652
changes to uploader.
kotlav Jun 12, 2017
a6dc7d7
changes related to styling of issue cards
kotlav Jun 12, 2017
1005982
config changes
kotlav Jun 13, 2017
e8e6b9b
changes related to feed.
kotlav Jun 14, 2017
d7455e7
adding new files for feed
kotlav Jun 14, 2017
c8ac805
changes related to edit functionality on a cause
kotlav Jun 14, 2017
e87c9ba
changes related to edit functionality on a cause
kotlav Jun 14, 2017
0bc270f
changes to cause
kotlav Jun 14, 2017
821432c
social interests seed changes
kotlav Jun 14, 2017
329ca2c
changes to fix an issue with support functionality
kotlav Jun 14, 2017
15ca4d7
textual changes
kotlav Jun 14, 2017
7c62886
Fixed an issue with supporting a cause
kotlav Jun 15, 2017
a21b7e2
Merge branch 'feed-support-fix' into feed
kotlav Jun 15, 2017
e437b64
fixing variable names
kotlav Jun 15, 2017
0f0549d
removing some unused code and changed variable names
kotlav Jun 15, 2017
9b7c276
making use of partials effectively. Using one file in two different v…
kotlav Jun 15, 2017
3f3a8e2
adding concern and partial to weed out common functionalities from co…
kotlav Jun 15, 2017
97fe809
changes related to support count & showing feed based on usrs interests
kotlav Jun 15, 2017
3211f9e
showing supported users in feed.
kotlav Jun 15, 2017
bc737e9
changes related to show all issues in case no interest is selected
kotlav Jun 15, 2017
144c541
changes related to follow unfollow interest.
kotlav Jun 16, 2017
a4bd269
changes to spec - follow and issue support functionality
kotlav Jun 16, 2017
92287ac
changes related to specs
kotlav Jun 16, 2017
e0feb84
changes to cause spec
kotlav Jun 19, 2017
1883ec7
changes to user specs
kotlav Jun 19, 2017
9c3a05c
removing unwanted functionality.
kotlav Jun 19, 2017
1f208b4
changes related to showing error messages
kotlav Jun 19, 2017
e5239fd
changes related to fix an issue with users image in profile
kotlav Jun 19, 2017
bf63df4
changes related to show errors while updating a cause.
kotlav Jun 19, 2017
48b9d88
minor changes
kotlav Jun 19, 2017
aac819c
changes related to code review by SJ
kotlav Jun 20, 2017
c3e7239
changes related to rubocoping
kotlav Jun 20, 2017
8787a63
solving rubocop issues on controllers
kotlav Jun 21, 2017
025bf9b
removing test folder
kotlav Jun 21, 2017
3beaabd
fixed an issue with issues_controller
kotlav Jun 21, 2017
daf8b43
fixing offenses raised by rubocop
kotlav Jun 21, 2017
bce9a50
changes related to fixing issues by rubocop
kotlav Jun 21, 2017
30a1a61
fixing rubocop issues
kotlav Jun 21, 2017
5b031bc
changes related to improvements as per feedback by SJ
kotlav Jun 22, 2017
2aeb036
changes related to rubocop
kotlav Jun 26, 2017
07c571e
changes related to code cleanup
kotlav Jun 26, 2017
a4b6ca5
changes to specs
kotlav Jun 26, 2017
8b30fa7
Adding spec for application helper module
kotlav Jun 26, 2017
975a97b
adding specs for sessions helper
kotlav Jun 26, 2017
7c70663
Adding specs for users helper module
kotlav Jun 26, 2017
a828a56
changes related to feedback by SJ
kotlav Jun 27, 2017
c7928c4
Added tzinfo-data gem
kotlav Jun 27, 2017
9ca1fde
to remove rubocop errors
kotlav Jun 27, 2017
c741396
changes to view
kotlav Jun 27, 2017
1255ede
ignoring code coverage check in wercker
kotlav Jun 27, 2017
fd83a6d
removed coverage from wercker pipeline.
kotlav Jun 27, 2017
3d5cb03
ravi feedback/todos
ravibhim Jun 27, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
!/log/.keep
!/tmp/.keep
/public/uploads/
coverage

# Ignore Byebug command history file.
.byebug_history
Expand Down
2 changes: 0 additions & 2 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
--color
--require spec_helper
--format documentation
45 changes: 38 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ AllCops:
- 'spec/rails_helper.rb'
- 'test/test_helper.rb'
- 'config/puma.rb'
- 'config/initializers/devise.rb'
- 'config/initializers/bower_rails.rb'
- 'config/initializers/wrap_parameters.rb'
- 'config/initializers/backtrace_silencers.rb'
- 'config/initializers/assets.rb'
- 'config/initializers/new_framework_defaults.rb'
- 'config/spring.rb'
- 'config/initializers/*'
- 'app/helpers/application_helper.rb'
- 'db/**/*'
- 'bin/*'
Expand All @@ -26,4 +22,39 @@ Metrics/AbcSize:
Max: 20
Metrics/MethodLength:
CountComments: false
Max: 15
Max: 20
Metrics/ModuleLength:
Exclude:
- "**/*_spec.rb"
- "app/helpers/users_helper.rb"
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Style/SymbolArray:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Date:
Enabled: false
ParenthesesAsGroupedExpression:
Enabled: false
Metrics/ClassLength:
Enabled: false
Lint/HandleExceptions:
Enabled: false
Rails/FindEach:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Documentation:
Enabled: false
CyclomaticComplexity:
Enabled: false
Rails/Delegate:
Description: 'Prefer delegate method for delegations.'
Enabled: false
Rails/HasAndBelongsToMany:
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
Enabled: false
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.1@aindia
ruby-2.4.0@aindia
11 changes: 10 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true.

source 'https://rubygems.org'

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
"https://github.com/#{repo_name}.git"
end

Expand All @@ -20,6 +22,8 @@ gem 'omniauth'
gem 'omniauth-facebook'
gem 'rails', '~> 5.0.2'
gem 'sass-rails', '~> 5.0'
gem 'turbolinks'
gem 'tzinfo-data'
gem 'uglifier', '>= 1.3.0'
gem 'will_paginate', '3.1.0'

Expand All @@ -37,3 +41,8 @@ group :development do
gem 'spring-watcher-listen'
gem 'web-console'
end

group :test do
gem 'factory_girl_rails'
gem 'faker'
end
16 changes: 16 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ GEM
erubis (2.7.0)
excon (0.55.0)
execjs (2.7.0)
factory_girl (4.8.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
railties (>= 3.0.0)
faker (1.7.3)
i18n (~> 0.5)
faraday (0.11.0)
multipart-post (>= 1.2, < 3)
ffi (1.9.18)
Expand Down Expand Up @@ -348,8 +355,13 @@ GEM
thread_safe (0.3.6)
tilt (2.0.7)
trollop (2.1.2)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.3)
tzinfo (1.2.3)
thread_safe (~> 0.1)
tzinfo-data (1.2017.2)
tzinfo (>= 1.0.0)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.2.1)
Expand All @@ -373,6 +385,8 @@ DEPENDENCIES
byebug
carrierwave (= 0.11.2)
dotenv-rails
factory_girl_rails
faker
fog (= 1.38.0)
haml
jbuilder (~> 2.5)
Expand All @@ -390,6 +404,8 @@ DEPENDENCIES
simplecov
spring
spring-watcher-listen
turbolinks
tzinfo-data
uglifier (>= 1.3.0)
web-console
will_paginate (= 3.1.0)
Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
## About

“Adopt India” is to connect people who are socially responsible and to support and encourage civic participation in solving social issues. http://adoptindia.org/
Social Quora is to connect people who are socially responsible and to support and encourage civic participation in solving social issues. http://adoptindia.org/

## Developer Notes

Ruby Version - 2.4.0
Rails Version - 5.1.0
## How to run the app locally?
Install the right ruby and rails versions - 2.4.0 (ruby) with rvm
`rvm install 2.4.0`

`gem install bundler` to install the bundler gem.
`bundle install` to install the gems for the project.
`bundle exec rake db:create` to create the local database
`bundle exec rake db:migrate` to migrate
`bundle exec rake db:seed` to populate an initial list of social interests.

`bundle exec rails s` to start the server on port 3000



## Deployment Steps

* Run "bundle install" to install the dependencies.
* Run "rails s" to install the app on local host.
* Run "rails db:migrate"
* Run "rails db:migrate"
* Run "rails db:seed"


## Test Steps
## Test Steps

* TODO

Binary file added app/.DS_Store
Binary file not shown.
119 changes: 95 additions & 24 deletions app/assets/stylesheets/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ $navbar-inverse-bg: $theme-color;
}

body {
padding-top: 80px
padding-top: 80px;
background-color: #EEE;
}

.app {
Expand Down Expand Up @@ -73,7 +74,7 @@ h3 {
font-size: 1.2em;
text-align: left;
font-weight: bold;
margin-bottom: -15px
// margin-bottom: -15px
}

// button
Expand All @@ -83,27 +84,97 @@ button {
opacity: 1.0
}

material-icons {
font-family: 'Material Icons';
/* issues */

.issues {
list-style: none;
padding: 0;
li {
padding: 10px;
border-top: 1px solid #e8e8e8;
}
.user {
margin-top: 5em;
padding-top: 0;
}
.content {
display: block;
margin-left: 2px;
margin-top: 35px;
margin-bottom: 10px;
img {
display: block;
padding: 5px 0;
}
}
.timestamp {
color: $gray-light;
display: block;
margin-left: 2px;
}
.gravatar {
float: left;
margin-right: 10px;
margin-top: 5px;
}
}

.card {
margin-top: 10px;
padding: 20px;
border: 0.1px solid #ddd;
border-radius: 5px;
background-color: #ffffff;
}

aside {
textarea {
height: 100px;
margin-bottom: 5px;
}
}

span.picture {
margin-top: 10px;
input {
border: 0;
}
}

.chip {
display: inline-block;
padding: 0 25px;
height: 26px;
font-size: 12px;
line-height: 26px;
border-radius: 10px;
background-color: #f1f1f1;
border-width: thick;
}

.edit-icon {
font-size: 20px;
color: gray;
margin-left: 20px;
}

.edit-icon:hover {
text-decoration: none;
}

.support-button {
font-size: 15px;
color: gray;
margin: 5px;
}

.supported-button {
font-size: 15px;
color: blue;
font-weight: bold;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;

/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;

/* Support for IE. */
font-feature-settings: 'liga';
margin: 5px;
}

.button_to {
display: inline;
}
2 changes: 2 additions & 0 deletions app/channels/application_cable/channel.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ApplicationCable
class Channel < ActionCable::Channel::Base
end
Expand Down
2 changes: 2 additions & 0 deletions app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ApplicationCable
class Connection < ActionCable::Connection::Base
end
Expand Down
30 changes: 8 additions & 22 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :current_user, :verify_user_has_logged_in
include SessionsHelper

protected
def current_user
@current_user ||= User.find_by_id(session[:user_id])
end

def signed_in?
!!current_user
end
private

helper_method :current_user, :signed_in?
def current_user=(user)
@current_user = user
session[:user_id] = user.id
end

private
# Confirms a logged-in user.
def logged_in_user
unless logged_in?
store_location
flash[:danger] = "Please log in."
redirect_to root_url
end
def verify_user_has_logged_in
return if logged_in?
flash[:danger] = 'Please log in.'
redirect_to root_url
end

end
11 changes: 11 additions & 0 deletions app/controllers/concerns/support_issue.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module SupportIssue
extend ActiveSupport::Concern

def update_support_issue
issue = Issue.find(params[:issue_id])
@current_user.update_support_issue(issue)
redirect_to :back
end
end
Loading