Skip to content
Open

Linh #23

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e92c50f
Fix gem file
Feb 21, 2018
2ec4b7f
Fix admin page?
Mar 5, 2018
2bd4c16
Fixed admin page - Can edit operation, selling/growing methods
Mar 12, 2018
3cdae16
Added more information to farm modal
Mar 12, 2018
27c28b0
Added search by farm's name
Mar 12, 2018
4d45ed5
Fixed link to image, still bug in list of farm
Mar 12, 2018
0038b86
added logo and tab icon
Mar 14, 2018
6f6bd8e
Merge pull request #1 from linhpha/pratik
Mar 14, 2018
0694e27
Filtering farms by operation
Mar 31, 2018
e221e40
Merge branch 'master' into linh
Apr 3, 2018
2a67cd5
Merge pull request #2 from linhpha/linh
Apr 3, 2018
9f7035e
Added fiterling farm by operation
Apr 5, 2018
b7e44dc
Merge branch 'linh' of https://github.com/linhpha/LFC_Features into linh
Apr 5, 2018
bf57a01
Filtered farms by opertion show in cards
Apr 9, 2018
fea44f7
Can filter by multiple operations
Apr 9, 2018
c065e8d
Merge pull request #3 from linhpha/linh
Apr 9, 2018
d69fadb
Filtered by name search
saramarku2310-a11y Apr 9, 2018
12afa22
Dynamic search for farm name
saramarku2310-a11y Apr 9, 2018
f814122
Changed font
Apr 16, 2018
25effe2
Fixed gem
Apr 16, 2018
7416e5a
Tried to change sqlite3
Apr 16, 2018
e1b50da
Merge pull request #4 from linhpha/linh
Apr 16, 2018
2502240
tried working with deploying
Apr 16, 2018
3101cb6
website aesthetic
Apr 16, 2018
803540f
Merge branch 'master' into branch1
Apr 16, 2018
83062d7
Merge pull request #5 from linhpha/branch1
Apr 16, 2018
edca685
Outlining recipe filtering, adding icons
brodelis Apr 16, 2018
59ac93f
Adding filtering by dietary restrictions
brodelis Apr 16, 2018
586f19c
Commiting for heroku
saramarku2310-a11y Apr 16, 2018
41e70ef
Merge pull request #6 from linhpha/restaurant-filtering-practice
brodelis Apr 16, 2018
e87edc3
Merge branch 'master' of https://github.com/linhpha/LFC_Features into…
Apr 17, 2018
b8efd0a
Fixed search by health label, can do multiple search now
Apr 17, 2018
196b287
Merge pull request #7 from linhpha/linh
Apr 17, 2018
0ecd1a9
Grouped and filtered by the right food categories
saramarku2310-a11y Apr 18, 2018
3b5bfe2
Added more icons
saramarku2310-a11y Apr 18, 2018
5e970f7
Converted to postsql
Apr 20, 2018
03c4ea6
Merge pull request #8 from linhpha/linh
Apr 20, 2018
7cf0afb
Change gemfile.lock
Apr 20, 2018
dc0edd6
Front end work and added image
saramarku2310-a11y Apr 23, 2018
b39c0b1
Added header and banner
Apr 23, 2018
c4f39c1
Merge pull request #9 from linhpha/linh
Apr 23, 2018
f441391
Added Contact Us
Apr 23, 2018
657235b
Tried new repo
Apr 25, 2018
41c8e7c
Switched to pg in production, kept sqlite3 for development and test
Apr 25, 2018
df4aaa8
Removed unnecessary files
Apr 25, 2018
b94d99b
DRY code
saramarku2310-a11y Apr 25, 2018
6ceb5a5
Added dry code
saramarku2310-a11y Apr 25, 2018
ad29779
Merge branch 'master' into sara
Apr 25, 2018
87efac7
Merge pull request #10 from CSC322-Grinnell/sara
Apr 25, 2018
bf74202
Added primary operation and refactored base url
Apr 25, 2018
9622b15
Resolve conflict
saramarku2310-a11y Apr 25, 2018
37f7f2e
Changed icon and header
Apr 30, 2018
d7fae59
Fixed conflict
May 1, 2018
e87365b
Created static page for UI
May 1, 2018
3367126
Merge pull request #11 from CSC322-Grinnell/linh
May 1, 2018
2114672
Added Readme
May 1, 2018
523086e
Merge branch 'master' of https://github.com/linhpha/LFC_Features into…
May 1, 2018
ca89d7c
Moved css and js file into static pages
May 1, 2018
fe7d975
Fixed JS filed, now can work without base_url
May 1, 2018
ce2b2e3
Fixed checkbox alignment:
May 1, 2018
a49bbb7
Fixed undefined object in show_modal
May 2, 2018
4a5c181
Changed font size
May 2, 2018
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
Binary file modified .DS_Store
Binary file not shown.
9 changes: 7 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
source 'https://rubygems.org'

group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg', '~> 0.18'
end
gem 'jquery-rails'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.0.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Expand Down Expand Up @@ -41,7 +47,6 @@ gem 'cancan' # or cancancan
gem 'draper'
gem 'pundit'


# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

Expand Down
101 changes: 55 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ GEM
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activeadmin (1.1.0)
activeadmin (1.3.0)
arbre (>= 1.1.1)
coffee-rails
formtastic (~> 3.1)
formtastic_i18n
inherited_resources (~> 1.7)
jquery-rails
kaminari (>= 0.15, < 2.0)
railties (>= 4.2, < 5.2)
inherited_resources (>= 1.7.0)
jquery-rails (>= 4.2.0)
kaminari (>= 0.15)
railties (>= 4.2, < 5.3)
ransack (~> 1.3)
sass (~> 3.1)
sprockets (< 4.1)
Expand All @@ -58,10 +58,11 @@ GEM
activesupport (>= 3.0.0)
arel (7.1.4)
bcrypt (3.1.11)
binding_of_caller (0.7.2)
bcrypt (3.1.11-x86-mingw32)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
builder (3.2.3)
byebug (9.1.0)
byebug (10.0.2)
cancan (1.6.10)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
Expand All @@ -71,12 +72,12 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
crass (1.0.2)
crass (1.0.4)
debug_inspector (0.0.3)
devise (4.3.0)
devise (4.4.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.2)
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
draper (3.0.1)
Expand All @@ -87,7 +88,8 @@ GEM
request_store (~> 1.0)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.18)
ffi (1.9.23)
ffi (1.9.23-x86-mingw32)
formtastic (3.1.5)
actionpack (>= 3.2.13)
formtastic_i18n (0.6.0)
Expand All @@ -96,20 +98,20 @@ GEM
haml (5.0.4)
temple (>= 0.8.0)
tilt
has_scope (0.7.1)
actionpack (>= 4.1, < 5.2)
activesupport (>= 4.1, < 5.2)
i18n (0.9.1)
has_scope (0.7.2)
actionpack (>= 4.1)
activesupport (>= 4.1)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
inherited_resources (1.7.2)
actionpack (>= 3.2, < 5.2.x)
inherited_resources (1.8.0)
actionpack (>= 4.2, <= 5.2)
has_scope (~> 0.6)
railties (>= 3.2, < 5.2.x)
railties (>= 4.2, <= 5.2)
responders
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.1)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
Expand All @@ -126,25 +128,28 @@ GEM
activerecord
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
loofah (2.1.1)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mini_mime (>= 0.1.1)
method_source (0.9.0)
mini_mime (0.1.4)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.10.3)
multi_json (1.12.1)
nio4r (2.1.0)
nokogiri (1.8.1)
minitest (5.11.3)
multi_json (1.13.1)
nio4r (2.3.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
nokogiri (1.8.2-x86-mingw32)
mini_portile2 (~> 2.3.0)
orm_adapter (0.5.0)
polyamorous (1.3.1)
pg (0.21.0)
polyamorous (1.3.3)
activerecord (>= 3.0)
pundit (1.1.0)
activesupport (>= 3.0.0)
rack (2.0.3)
rack (2.0.5)
rack-cors (0.3.1)
rack-test (0.6.3)
rack (>= 1.0)
Expand All @@ -163,35 +168,36 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.0.2)
actionpack (= 5.0.2)
activesupport (= 5.0.2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.2.1)
ransack (1.8.4)
rake (12.3.1)
ransack (1.8.8)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.3)
rb-fsevent (0.10.2)
polyamorous (~> 1.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rdoc (4.3.0)
request_store (1.3.2)
request_store (1.4.1)
rack (>= 1.4)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
sass (3.5.1)
sass (3.5.6)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.6)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
Expand All @@ -200,9 +206,9 @@ GEM
sdoc (0.4.2)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
simple_form (3.5.0)
actionpack (> 4, < 5.2)
activemodel (> 4, < 5.2)
simple_form (4.0.0)
actionpack (> 4)
activemodel (> 4)
spring (2.0.2)
activesupport (>= 4.2)
sprockets (3.7.1)
Expand All @@ -213,16 +219,17 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
sqlite3 (1.3.13-x86-mingw32)
temple (0.8.0)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.3)
tzinfo (1.2.4)
turbolinks (5.1.1)
turbolinks-source (~> 5.1)
turbolinks-source (5.1.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (3.2.0)
uglifier (4.1.10)
execjs (>= 0.3.0, < 3)
warden (1.2.7)
rack (>= 1.0)
Expand All @@ -233,10 +240,11 @@ GEM
sprockets-rails (>= 2.0, < 4.0)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
websocket-extensions (0.1.3)

PLATFORMS
ruby
x86-mingw32

DEPENDENCIES
activeadmin
Expand All @@ -248,6 +256,7 @@ DEPENDENCIES
haml
jbuilder (~> 2.0)
jquery-rails
pg (~> 0.18)
pundit
rack-cors (~> 0.3.1)
rails (= 5.0.2)
Expand All @@ -261,4 +270,4 @@ DEPENDENCIES
web-console (~> 2.0)

BUNDLED WITH
1.16.0
1.16.1
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,54 @@
# LFC_Features
### Local Food Connection Application

LFC is a Grinnell farm directory service. It contains basic information of farms that are connected to Local Food Connection Organization. The goal of the app is to allow user to easily search for Grinnell's sustainable food system.

You can obtain the source with the following command:
```shell
git clone https://github.com/CSC322-Grinnell/LFC_Features.git
```

## Authors and Contributors

### Current Builds

- [Sara Marku](https://github.com/saramarku)
- [Linh Pham](https://github.com/linhpha)
- [Pratik Karki](https://github.com/karkipra)
- [Elise Brod](https://github.com/brodelis)
- [James Msekela]()

### Previous Builds

- Matt Murphy
- Thu Nguyen
- Minh Tran
- Alexandar Hrusanov
- Nick Roberson


### Project Structure


### How to build



### Things to do


## License
```
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
```
37 changes: 9 additions & 28 deletions app/admin/farm.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
ActiveAdmin.register Farm do
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# permit_params :list, :of, :attributes, :on, :model
#
# or
#
# permit_params do
# permitted = [:permitted, :attributes]
# permitted << :other if params[:action] == 'create' && current_user.admin?
# permitted
# end

controller do
before_filter :authorize_index, only: :index
def authorize_index
Expand All @@ -26,13 +13,9 @@ def authorize_index
end

# scope_to :current_farm, unless: proc{ :current_farm }

permit_params do
permitted = [:name, :address, :phone, :email, :url, :facebook, :instagram,
:password, :password_confirmation, :twitter]
permitted << :approved if current_farm.admin?
permitted
end
## Add strong parameters for admin to be able to edit these fields
permit_params :name, :address, :phone, :email, :url, :facebook, :instagram, :password, :password_confirmation, :primary_operation, :growth_promoter, :antibiotic, :why_farm, :fav_activity, :twitter, :approved,
operation_ids: [], selling_method_ids: [], growing_method_ids: [], market_ids: []

index do
selectable_column
Expand Down Expand Up @@ -69,15 +52,13 @@ def authorize_index
f.input :twitter
f.input :other_media

@ops = ['Fruit', 'Vegetables', 'Dairy', 'Pork', 'Chicken', 'Turkey', 'Lamb', 'Duck', 'Agitourism', 'Hay', 'Row Crop']
@grow = ['Certified Natural Grown', 'USDA Certified Organic', '100% Grass Fed', 'Grass Finished', 'Non-GMO', 'Regenerative Organic Certified', 'Integrated Pest Management', 'Pasture Raised', 'Corn Fed', 'Conventional']
@sell = ['CSA', 'Farmers Market', 'Wholesale', 'Grocery Stores', 'Grinnell Area Local Food Source', 'On-Farm', 'Iowa Food Coop', 'Institutions', 'Restaurants']
@market = ['Grinnell-Thursday', 'Grinnell-Saturday', "Des Moines Downtown-Saturday", "Cedar Rapids Downtown-Select Saturdays", "Iowa City-Saturday", "Tama-Toledo", "Brooklyn"]
f.input :operations, as: :check_boxes, collection: @ops
f.input :growing_methods, as: :check_boxes, collection: @grow

f.input :operations, as: :check_boxes, collection: Operation.all
f.input :primary_operation, as: :check_boxes, collection: PrimaryOperation.all
f.input :growing_methods, as: :check_boxes, collection: GrowingMethod.all
f.input :link_to_cert
f.input :selling_methods, as: :check_boxes, collection: @sell
f.input :markets, as: :check_boxes, collection: @market
f.input :selling_methods, as: :check_boxes, collection: SellingMethod.all
f.input :markets, as: :check_boxes, collection: Market.all

f.input :growth_promoter, as: :boolean, checked_value: true, unchecked_value: false
f.input :antibiotic, as: :boolean, checked_value: true, unchecked_value: false
Expand Down
Binary file added app/assets/icons/24apple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/24broccoli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/24chicken.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/24cow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/24dairy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/24pig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/24sheep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/64cow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/agricultural.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/carrot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/dairy_free.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/farm2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/gluten_free.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/kosher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/peanut_free.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/steak-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/tree_nut_free.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/icons/vegetarian.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/javascripts/active_admin.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#= require active_admin/base
Loading