Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions app/views/case_studies/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
- type: group
title: people
contents:
- type: numeric
noun: designer
source: num_of_designers
icon: user
- type: numeric
noun: user
source: num_of_users
icon: user
- type: group
title: tools
contents:
- type: tags
source: tools
icon: pencil
- type: group
title: tags
contents:
- type: tags
source: tags
- type: group
title: characteristics
contents:
- type: text
title: development cycle
source: development_cycle
icon: pencil
- type: text
title: design phase
source: design_phase
icon: pencil
- type: text
title: privacy level
source: privacy_level
icon: pencil
- type: text
title: social setting
source: social_setting
icon: pencil
- type: boolean
title: customer is user
source: remote_project
icon0: remove
icon1: ok
- type: boolean
title: remote project
source: remote_project
icon0: remove
icon1: ok
- type: group
title: project details
contents:
- type: text
title: project domain
source: project_domain
icon: pencil
- type: text
title: customer type
source: customer_type
icon: pencil
- type: group
title: time
contents:
- type: tags
source: time_period
icon: time
69 changes: 69 additions & 0 deletions app/views/design_methods/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
- type: group
title: people
contents:
- type: numeric
noun: designer
source: num_of_designers
icon: user
- type: numeric
noun: user
source: num_of_users
icon: user
- type: group
title: tools
contents:
- type: tags
source: tools
icon: pencil
- type: group
title: tags
contents:
- type: tags
source: tags
- type: group
title: characteristics
contents:
- type: text
title: development cycle
source: development_cycle
icon: pencil
- type: text
title: design phase
source: design_phase
icon: pencil
- type: text
title: privacy level
source: privacy_level
icon: pencil
- type: text
title: social setting
source: social_setting
icon: pencil
- type: boolean
title: customer is user
source: remote_project
icon0: remove
icon1: ok
- type: boolean
title: remote project
source: remote_project
icon0: remove
icon1: ok
- type: group
title: project details
contents:
- type: text
title: project domain
source: project_domain
icon: pencil
- type: text
title: customer type
source: customer_type
icon: pencil
- type: group
title: time
contents:
- type: tags
source: time_period
icon: time
17 changes: 17 additions & 0 deletions config/info/case_studies.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<group title="people">
<numeric noun="designer" source="num_of_designers" icon="user" />
<numeric noun="user" source="num_of_users" icon="user" />
</group>
<group title="tools">
<tags icon="pencil" source="tools" />
</group>
<group title="tools">
<numeric noun="time" source="time_period" icon="time" />
</group>

- type: group
title: tags
contents:
- {source: tags, type: tags}

- type: group
23 changes: 23 additions & 0 deletions config/info/design_methods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
production:
solr:
hostname: localhost
port: 8983
log_level: WARNING
path: /solr/production
# read_timeout: 2
# open_timeout: 0.5

development:
solr:
hostname: localhost
port: 8982
log_level: INFO
path: /solr/development

test:
solr:
hostname: localhost
port: 8981
log_level: WARNING
path: /solr/test

39 changes: 39 additions & 0 deletions config/info/parser.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
require 'representable/yaml'
require 'hash_control'
require 'yaml'

class Comment
include ::HashControl::Model
require_key :author, :body, :date
permit_key :image
end
comment = Comment.new(author: 'me', body: 'interesting stuff', date: Time.now)

puts comment.author
puts comment.body
puts comment.date.class
puts comment.image

class User
include ::HashControl::Model
require_key :name, :age
permit_key :image
end
user = User.new(name: "hi", age: "over 18")

puts user.name
puts user.age

# module UserRepresenter
# include Representable::YAML

# collection :hash, :style => :flow

# def hash
# [name, age]
# end
# end

# user.extend(UserRepresenter).to_yaml
# #=> ---
# # hash: [Andrew, over 18]
41 changes: 23 additions & 18 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
DesignExchange::Application.routes.draw do

get "autocomplete_search", to: "application#search"

resources :companies do
resources :companies do
resources :contacts
end

resources :characteristics do
resources :design_methods, only: [:index], shallow: true
end

resources :tags
resources :method_case_studies
root "application#index"

resources :case_studies do
collection do
get "related_methods", to: "case_studies#related_methods"
case_studies = "studies"
resources "#{case_studies}", as: :case_studies, controller: :case_studies do
collection do
get "related", to: "case_studies#related_methods"
match "related_methods" => redirect("related"), via: [:get, :post]
get "search/:query", to: "application#search"
get "search", to: "application#search", :as => "search"
end
member do
get "related_methods", to: "case_studies#related_methods", :as => "related_methods"
member do
get "related", to: "case_studies#related_methods", :as => "related_methods"
match "related_methods" => redirect("related"), via: [:get, :post]
end
end
resources :design_methods do
collection do
# TODO: legacy redirect; remove these eventually
match "case_studies" => redirect("#{case_studies}"), via: [:get, :post]
match "case_studies/:suffix" => redirect("#{case_studies}/%{suffix}"), via: [:get, :post]

design_methods = "methods"
resources "#{design_methods}", as: :design_methods, controller: :design_methods do
collection do
get "search/:query", to: "application#search"
get "search", to: "application#search", :as => "search"
get "method_category/:category_id", to: "application#search", :as => "search_category"
end
end
# TODO: legacy redirect; remove these eventually
match "design_methods" => redirect("#{design_methods}"), via: [:get, :post]
match "design_methods/:suffix" => redirect("#{design_methods}/%{suffix}"), via: [:get, :post]

resources :discussions do
collection do
collection do
get "search/:query", to: "application#search"
get "search", to: "application#search", :as => "search"
end
Expand All @@ -50,10 +60,6 @@
ActiveAdmin.routes(self)
devise_for :users





resources :method_categories, only: [:show]
resources :citations, only: [:show]

Expand All @@ -63,6 +69,5 @@

get 'search/(:query)', controller: 'design_methods', action: 'search', as: 'search'

get ":action", to:"application##{:action}"

get ":action", to: "application##{:action}"
end
Loading