Compare commits
203 commits
feature/co
...
develop
Author | SHA1 | Date | |
---|---|---|---|
|
98081097b4 | ||
|
f753392d49 | ||
|
38a209a970 | ||
|
bd7bf20810 | ||
|
955ebdd747 | ||
|
fdcd8a93f1 | ||
|
b5c52adf5e | ||
|
b7761a3627 | ||
|
e0d72fce14 | ||
|
139fdf8e2b | ||
|
4313f6eff8 | ||
|
91c004ebfd | ||
|
96056f43ef | ||
|
32e58fa8af | ||
|
5ebbd87afc | ||
|
006920b686 | ||
|
97448b389f | ||
|
f1ecc9eb0b | ||
|
ca2684fcf3 | ||
|
d9c53514fe | ||
|
e195b89bbd | ||
|
e66498a861 | ||
|
901eb4a513 | ||
|
cbf44e3dfe | ||
|
8b492d6dc8 | ||
|
b83f366284 | ||
|
1ac06d973c | ||
|
9af3754bc8 | ||
|
8169f24072 | ||
|
b9fb4a2829 | ||
|
9b52d0e081 | ||
|
14dc3687cd | ||
|
0a6e7918ef | ||
|
4a7595e76d | ||
|
e899179314 | ||
|
44fec58985 | ||
|
29a25c28a8 | ||
|
76c727cd61 | ||
|
693e6f5e10 | ||
|
a1d4c99ff6 | ||
|
55f2425501 | ||
|
f9c139c19e | ||
|
d51a22c5a9 | ||
|
567bc9d69d | ||
|
15f512efef | ||
|
5e6fb6290c | ||
|
8695297a0f | ||
|
216a19476b | ||
|
a0c9530c91 | ||
|
277644f59d | ||
|
0ffc01b3fb | ||
|
9471efb6bd | ||
|
fc8ac6eef1 | ||
|
9cc700c64d | ||
|
64ffc78f45 | ||
|
322da431eb | ||
|
3c7c8812a4 | ||
|
0d6963ebb0 | ||
|
c4d0bf8ce4 | ||
|
3406f2e04d | ||
|
a4c905df4e | ||
|
5f1fe4dc3f | ||
|
2515073393 | ||
|
a04cd0d395 | ||
|
da9e44afa0 | ||
|
e290244404 | ||
|
6e1878413f | ||
|
77846cfcb7 | ||
|
1ffc513617 | ||
|
3886e62a7b | ||
|
ad2ba33db6 | ||
|
cf9f54c738 | ||
|
f323796030 | ||
|
a080b82e7f | ||
|
1174123b60 | ||
|
35f77129ad | ||
|
a56991aede | ||
|
672b456193 | ||
|
21518c8696 | ||
|
29bf2a23e8 | ||
|
61eac509de | ||
|
4cc420eb63 | ||
|
ec3e09c578 | ||
|
3e03e0ebbf | ||
|
9ab7e7e170 | ||
|
5af2b8f216 | ||
|
8af66b1b2c | ||
|
9b2193ad8c | ||
|
1a8c7810be | ||
|
d87bb7c75c | ||
|
aceb3ff31e | ||
|
f26c6cf0b7 | ||
|
42f4ecb37b | ||
|
64f4249f44 | ||
|
958bd8c70c | ||
|
3830946723 | ||
|
3482e799fd | ||
|
e016b923a4 | ||
|
bb546779cd | ||
|
3829d32390 | ||
|
9783a5ee1e | ||
|
12fc0c71f6 | ||
|
c2cb8949eb | ||
|
4e7bf02749 | ||
|
3203c2b4d0 | ||
|
1ec9dc20e4 | ||
|
1af4728073 | ||
|
785e16eeae | ||
|
d08cb3f95e | ||
|
271fc7ebd0 | ||
|
9d590295cb | ||
|
dc4d44951e | ||
|
767414ad9f | ||
|
1ec897b8c8 | ||
|
00e2aefb4e | ||
|
aec0f104b8 | ||
|
db6d2e77da | ||
|
9585dce511 | ||
|
78acd7e0b0 | ||
|
328c1a14f3 | ||
|
10ac64c574 | ||
|
edce66c44d | ||
|
74df2559a4 | ||
|
a6694a3f72 | ||
|
8c7a657499 | ||
|
90f77cd4f7 | ||
|
af4dc869c0 | ||
|
2cae12e1ab | ||
|
49102ea474 | ||
|
f2a7cc1f19 | ||
|
a5d5cd6000 | ||
|
391a1d8b24 | ||
|
cc17c1ed38 | ||
|
eee1febbf9 | ||
|
c8f6374ac8 | ||
|
ed76162b63 | ||
|
1eb4187691 | ||
|
4a7dd54aca | ||
|
efd6258c7e | ||
|
f4d1b8ba35 | ||
|
47a74dd77b | ||
|
33276444c7 | ||
|
1124d76475 | ||
|
4ffa9460f5 | ||
|
44753dbfe1 | ||
|
77f76b1b5a | ||
|
e544d6a6db | ||
|
780e66632b | ||
|
de4f51bb5c | ||
|
5d0da4c5f1 | ||
|
9079d1bffc | ||
|
962881a35d | ||
|
8483b62603 | ||
|
e3b4dac1e1 | ||
|
8998e3858c | ||
|
ce51eeca8c | ||
|
3178f6e650 | ||
|
7ee96bf6c6 | ||
|
b740fef8fe | ||
|
55b031ccb7 | ||
|
9df389060e | ||
|
153cc38d1a | ||
|
4ff9619837 | ||
|
a6c1c0c730 | ||
|
529dec09a3 | ||
|
ddbaac513f | ||
|
ba943b20f1 | ||
|
4deb3f5ab9 | ||
|
47d0faadf2 | ||
|
9800cc27c6 | ||
|
7840e09e5f | ||
|
687b957737 | ||
|
9ce989eba5 | ||
|
2c85590d65 | ||
|
2b34d84715 | ||
|
013e3c7f21 | ||
|
8d771543d8 | ||
|
50639e8a0a | ||
|
9d52aa9c74 | ||
|
545706e17a | ||
|
95901e17e8 | ||
|
9dbbdf1150 | ||
|
4ee4aeaad2 | ||
|
bfdce21a66 | ||
|
53d4beddec | ||
|
d455ced683 | ||
|
d8698ef6f2 | ||
|
1374da35da | ||
|
2d0d0403b1 | ||
|
2d50f24be6 | ||
|
876c61a18e | ||
|
b0deafc53e | ||
|
a647d80efa | ||
|
559ad230ce | ||
|
26dfcbf823 | ||
|
915defcd1b | ||
|
dde097ea75 | ||
|
3706cd83e7 | ||
|
99b21be27b | ||
|
2c60d7335c | ||
|
b07941834c | ||
|
b914065bb3 | ||
|
00286fcc29 |
422 changed files with 8743 additions and 5278 deletions
1
.agignore
Normal file
1
.agignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
app/assets/javascripts/metamaps.secret.bundle.js
|
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
|
@ -1,4 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
============
|
|
||||||
100BD/C = (100)(__)(__)/(__)=__
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -15,6 +15,7 @@ app/assets/javascripts/webpacked
|
||||||
|
|
||||||
#secrets and config
|
#secrets and config
|
||||||
.env
|
.env
|
||||||
|
*.swp
|
||||||
|
|
||||||
# Ignore bundler config
|
# Ignore bundler config
|
||||||
.bundle
|
.bundle
|
||||||
|
@ -22,6 +23,7 @@ app/assets/javascripts/webpacked
|
||||||
# Ignore all logfiles and tempfiles.
|
# Ignore all logfiles and tempfiles.
|
||||||
log/*.log
|
log/*.log
|
||||||
tmp
|
tmp
|
||||||
|
.tmp
|
||||||
|
|
||||||
coverage
|
coverage
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ Rails:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Metrics/LineLength:
|
Metrics/LineLength:
|
||||||
Max: 100
|
Max: 120
|
||||||
|
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Max: 16
|
Max: 16
|
||||||
|
@ -22,3 +22,8 @@ Style/Documentation:
|
||||||
|
|
||||||
Style/EmptyMethod:
|
Style/EmptyMethod:
|
||||||
EnforcedStyle: expanded
|
EnforcedStyle: expanded
|
||||||
|
|
||||||
|
# I like this cop, but occasionally code is more readable without a guard clause,
|
||||||
|
# and I don't want to write rubocop:disable comments every time that happens
|
||||||
|
Style/GuardClause:
|
||||||
|
Enabled: false
|
||||||
|
|
11
Gemfile
11
Gemfile
|
@ -1,11 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
ruby '2.3.0'
|
ruby '2.3.0'
|
||||||
|
|
||||||
gem 'rails', '~> 5.0.0'
|
gem 'rails', '~> 5.0.0'
|
||||||
|
|
||||||
gem 'active_model_serializers'
|
gem 'active_model_serializers'
|
||||||
gem 'aws-sdk'
|
gem 'aws-sdk', '~> 2.7.0'
|
||||||
gem 'best_in_place'
|
gem 'best_in_place'
|
||||||
gem 'delayed_job'
|
gem 'delayed_job'
|
||||||
gem 'delayed_job_active_record'
|
gem 'delayed_job_active_record'
|
||||||
|
@ -24,7 +25,7 @@ gem 'pundit'
|
||||||
gem 'pundit_extra'
|
gem 'pundit_extra'
|
||||||
gem 'rack-attack'
|
gem 'rack-attack'
|
||||||
gem 'rack-cors'
|
gem 'rack-cors'
|
||||||
gem 'redis'
|
gem 'redis', '~> 3.3.3'
|
||||||
gem 'slack-notifier'
|
gem 'slack-notifier'
|
||||||
gem 'snorlax'
|
gem 'snorlax'
|
||||||
gem 'sucker_punch'
|
gem 'sucker_punch'
|
||||||
|
@ -37,7 +38,7 @@ gem 'uglifier'
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'brakeman', require: false
|
gem 'brakeman', require: false
|
||||||
gem 'factory_girl_rails'
|
gem 'factory_bot_rails'
|
||||||
gem 'json-schema'
|
gem 'json-schema'
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails'
|
||||||
gem 'shoulda-matchers'
|
gem 'shoulda-matchers'
|
||||||
|
@ -47,8 +48,10 @@ end
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'better_errors'
|
gem 'better_errors'
|
||||||
gem 'binding_of_caller'
|
gem 'binding_of_caller'
|
||||||
|
gem 'faker'
|
||||||
gem 'pry-byebug'
|
gem 'pry-byebug'
|
||||||
gem 'pry-rails'
|
gem 'pry-rails'
|
||||||
gem 'rubocop'
|
gem 'rubocop', '~> 0.48.1' # match code climate https://github.com/tootsuite/mastodon/issues/1758
|
||||||
|
gem 'timecop'
|
||||||
gem 'tunemygc'
|
gem 'tunemygc'
|
||||||
end
|
end
|
||||||
|
|
291
Gemfile.lock
291
Gemfile.lock
|
@ -1,50 +1,50 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (5.0.1)
|
actioncable (5.0.5)
|
||||||
actionpack (= 5.0.1)
|
actionpack (= 5.0.5)
|
||||||
nio4r (~> 1.2)
|
nio4r (>= 1.2, < 3.0)
|
||||||
websocket-driver (~> 0.6.1)
|
websocket-driver (~> 0.6.1)
|
||||||
actionmailer (5.0.1)
|
actionmailer (5.0.5)
|
||||||
actionpack (= 5.0.1)
|
actionpack (= 5.0.5)
|
||||||
actionview (= 5.0.1)
|
actionview (= 5.0.5)
|
||||||
activejob (= 5.0.1)
|
activejob (= 5.0.5)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (5.0.1)
|
actionpack (5.0.5)
|
||||||
actionview (= 5.0.1)
|
actionview (= 5.0.5)
|
||||||
activesupport (= 5.0.1)
|
activesupport (= 5.0.5)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0)
|
||||||
rack-test (~> 0.6.3)
|
rack-test (~> 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actionview (5.0.1)
|
actionview (5.0.5)
|
||||||
activesupport (= 5.0.1)
|
activesupport (= 5.0.5)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||||
active_model_serializers (0.10.4)
|
active_model_serializers (0.10.6)
|
||||||
actionpack (>= 4.1, < 6)
|
actionpack (>= 4.1, < 6)
|
||||||
activemodel (>= 4.1, < 6)
|
activemodel (>= 4.1, < 6)
|
||||||
case_transform (>= 0.2)
|
case_transform (>= 0.2)
|
||||||
jsonapi (= 0.1.1.beta6)
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.2)
|
||||||
activejob (5.0.1)
|
activejob (5.0.5)
|
||||||
activesupport (= 5.0.1)
|
activesupport (= 5.0.5)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (5.0.1)
|
activemodel (5.0.5)
|
||||||
activesupport (= 5.0.1)
|
activesupport (= 5.0.5)
|
||||||
activerecord (5.0.1)
|
activerecord (5.0.5)
|
||||||
activemodel (= 5.0.1)
|
activemodel (= 5.0.5)
|
||||||
activesupport (= 5.0.1)
|
activesupport (= 5.0.5)
|
||||||
arel (~> 7.0)
|
arel (~> 7.0)
|
||||||
activesupport (5.0.1)
|
activesupport (5.0.5)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (~> 0.7)
|
i18n (~> 0.7)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
addressable (2.5.0)
|
addressable (2.5.2)
|
||||||
public_suffix (~> 2.0, >= 2.0.2)
|
public_suffix (>= 2.0.2, < 4.0)
|
||||||
arel (7.1.4)
|
arel (7.1.4)
|
||||||
ast (2.3.0)
|
ast (2.3.0)
|
||||||
aws-sdk (2.7.0)
|
aws-sdk (2.7.0)
|
||||||
|
@ -54,81 +54,82 @@ GEM
|
||||||
jmespath (~> 1.0)
|
jmespath (~> 1.0)
|
||||||
aws-sdk-resources (2.7.0)
|
aws-sdk-resources (2.7.0)
|
||||||
aws-sdk-core (= 2.7.0)
|
aws-sdk-core (= 2.7.0)
|
||||||
aws-sigv4 (1.0.0)
|
aws-sigv4 (1.0.2)
|
||||||
bcrypt (3.1.11)
|
bcrypt (3.1.11)
|
||||||
best_in_place (3.1.0)
|
best_in_place (3.1.1)
|
||||||
actionpack (>= 3.2)
|
actionpack (>= 3.2)
|
||||||
railties (>= 3.2)
|
railties (>= 3.2)
|
||||||
better_errors (2.1.1)
|
better_errors (2.3.0)
|
||||||
coderay (>= 1.0.0)
|
coderay (>= 1.0.0)
|
||||||
erubis (>= 2.6.6)
|
erubi (>= 1.0.0)
|
||||||
rack (>= 0.9.0)
|
rack (>= 0.9.0)
|
||||||
binding_of_caller (0.7.2)
|
binding_of_caller (0.7.2)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
brakeman (3.4.1)
|
brakeman (3.7.2)
|
||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
byebug (9.0.6)
|
byebug (9.1.0)
|
||||||
carrierwave (1.0.0)
|
carrierwave (1.1.0)
|
||||||
activemodel (>= 4.0.0)
|
activemodel (>= 4.0.0)
|
||||||
activesupport (>= 4.0.0)
|
activesupport (>= 4.0.0)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
case_transform (0.2)
|
case_transform (0.2)
|
||||||
activesupport
|
activesupport
|
||||||
climate_control (0.1.0)
|
climate_control (0.2.0)
|
||||||
cocaine (0.5.8)
|
cocaine (0.5.8)
|
||||||
climate_control (>= 0.0.3, < 1.0)
|
climate_control (>= 0.0.3, < 1.0)
|
||||||
coderay (1.1.1)
|
coderay (1.1.2)
|
||||||
concurrent-ruby (1.0.4)
|
concurrent-ruby (1.0.5)
|
||||||
debug_inspector (0.0.2)
|
debug_inspector (0.0.3)
|
||||||
delayed_job (4.1.2)
|
delayed_job (4.1.3)
|
||||||
activesupport (>= 3.0, < 5.1)
|
activesupport (>= 3.0, < 5.2)
|
||||||
delayed_job_active_record (4.1.1)
|
delayed_job_active_record (4.1.2)
|
||||||
activerecord (>= 3.0, < 5.1)
|
activerecord (>= 3.0, < 5.2)
|
||||||
delayed_job (>= 3.0, < 5)
|
delayed_job (>= 3.0, < 5)
|
||||||
devise (4.2.0)
|
devise (4.3.0)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
railties (>= 4.1.0, < 5.1)
|
railties (>= 4.1.0, < 5.2)
|
||||||
responders
|
responders
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
diff-lcs (1.3)
|
diff-lcs (1.3)
|
||||||
docile (1.1.5)
|
docile (1.1.5)
|
||||||
doorkeeper (4.2.0)
|
doorkeeper (4.2.6)
|
||||||
railties (>= 4.2)
|
railties (>= 4.2)
|
||||||
dotenv (2.1.2)
|
dotenv (2.2.1)
|
||||||
dotenv-rails (2.1.2)
|
dotenv-rails (2.2.1)
|
||||||
dotenv (= 2.1.2)
|
dotenv (= 2.2.1)
|
||||||
railties (>= 3.2, < 5.1)
|
railties (>= 3.2, < 5.2)
|
||||||
|
erubi (1.6.1)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
exception_notification (4.2.1)
|
exception_notification (4.2.2)
|
||||||
actionmailer (>= 4.0, < 6)
|
actionmailer (>= 4.0, < 6)
|
||||||
activesupport (>= 4.0, < 6)
|
activesupport (>= 4.0, < 6)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
factory_girl (4.8.0)
|
factory_bot (4.8.2)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
factory_girl_rails (4.8.0)
|
factory_bot_rails (4.8.2)
|
||||||
factory_girl (~> 4.8.0)
|
factory_bot (~> 4.8.2)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
globalid (0.3.7)
|
faker (1.8.4)
|
||||||
activesupport (>= 4.1.0)
|
i18n (~> 0.5)
|
||||||
httparty (0.14.0)
|
ffi (1.9.18)
|
||||||
|
globalid (0.4.0)
|
||||||
|
activesupport (>= 4.2.0)
|
||||||
|
httparty (0.15.6)
|
||||||
multi_xml (>= 0.5.2)
|
multi_xml (>= 0.5.2)
|
||||||
i18n (0.7.0)
|
i18n (0.9.3)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
jmespath (1.3.1)
|
jmespath (1.3.1)
|
||||||
jquery-rails (4.2.2)
|
jquery-rails (4.3.1)
|
||||||
rails-dom-testing (>= 1, < 3)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
jquery-ui-rails (6.0.1)
|
jquery-ui-rails (6.0.1)
|
||||||
railties (>= 3.2.16)
|
railties (>= 3.2.16)
|
||||||
json (2.0.3)
|
json (2.1.0)
|
||||||
json-schema (2.7.0)
|
json-schema (2.8.0)
|
||||||
addressable (>= 2.4)
|
addressable (>= 2.4)
|
||||||
jsonapi (0.1.1.beta6)
|
jsonapi-renderer (0.1.3)
|
||||||
jsonapi-parser (= 0.1.1.beta3)
|
|
||||||
jsonapi-renderer (= 0.1.1.beta1)
|
|
||||||
jsonapi-parser (0.1.1.beta3)
|
|
||||||
jsonapi-renderer (0.1.1.beta1)
|
|
||||||
kaminari (1.0.1)
|
kaminari (1.0.1)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
kaminari-actionview (= 1.0.1)
|
kaminari-actionview (= 1.0.1)
|
||||||
|
@ -143,144 +144,154 @@ GEM
|
||||||
kaminari-core (1.0.1)
|
kaminari-core (1.0.1)
|
||||||
loofah (2.0.3)
|
loofah (2.0.3)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.6.4)
|
mail (2.6.6)
|
||||||
mime-types (>= 1.16, < 4)
|
mime-types (>= 1.16, < 4)
|
||||||
mailboxer (0.14.0)
|
mailboxer (0.15.1)
|
||||||
carrierwave (>= 0.5.8)
|
carrierwave (>= 0.5.8)
|
||||||
rails (>= 4.2.0)
|
rails (>= 5.0.0)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (3.1)
|
mime-types (3.1)
|
||||||
mime-types-data (~> 3.2015)
|
mime-types-data (~> 3.2015)
|
||||||
mime-types-data (3.2016.0521)
|
mime-types-data (3.2016.0521)
|
||||||
mimemagic (0.3.2)
|
mimemagic (0.3.2)
|
||||||
mini_portile2 (2.1.0)
|
mini_portile2 (2.3.0)
|
||||||
minitest (5.10.1)
|
minitest (5.11.1)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
nio4r (1.2.1)
|
nio4r (2.1.0)
|
||||||
nokogiri (1.7.0.1)
|
nokogiri (1.8.1)
|
||||||
mini_portile2 (~> 2.1.0)
|
mini_portile2 (~> 2.3.0)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
paperclip (5.1.0)
|
paperclip (5.2.0)
|
||||||
activemodel (>= 4.2.0)
|
activemodel (>= 4.2.0)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
cocaine (~> 0.5.5)
|
cocaine (~> 0.5.5)
|
||||||
mime-types
|
mime-types
|
||||||
mimemagic (~> 0.3.0)
|
mimemagic (~> 0.3.0)
|
||||||
parser (2.3.3.1)
|
parser (2.4.0.2)
|
||||||
ast (~> 2.2)
|
ast (~> 2.3)
|
||||||
pg (0.19.0)
|
pg (0.21.0)
|
||||||
powerpack (0.1.1)
|
powerpack (0.1.1)
|
||||||
pry (0.10.4)
|
pry (0.10.4)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
pry-byebug (3.4.2)
|
pry-byebug (3.5.0)
|
||||||
byebug (~> 9.0)
|
byebug (~> 9.1)
|
||||||
pry (~> 0.10)
|
pry (~> 0.10)
|
||||||
pry-rails (0.3.4)
|
pry-rails (0.3.6)
|
||||||
pry (>= 0.9.10)
|
pry (>= 0.10.4)
|
||||||
public_suffix (2.0.5)
|
public_suffix (3.0.0)
|
||||||
puma (3.6.2)
|
puma (3.10.0)
|
||||||
pundit (1.1.0)
|
pundit (1.1.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
pundit_extra (0.3.0)
|
pundit_extra (0.3.0)
|
||||||
rack (2.0.1)
|
rack (2.0.3)
|
||||||
rack-attack (5.0.1)
|
rack-attack (5.0.1)
|
||||||
rack
|
rack
|
||||||
rack-cors (0.4.0)
|
rack-cors (1.0.1)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (5.0.1)
|
rails (5.0.5)
|
||||||
actioncable (= 5.0.1)
|
actioncable (= 5.0.5)
|
||||||
actionmailer (= 5.0.1)
|
actionmailer (= 5.0.5)
|
||||||
actionpack (= 5.0.1)
|
actionpack (= 5.0.5)
|
||||||
actionview (= 5.0.1)
|
actionview (= 5.0.5)
|
||||||
activejob (= 5.0.1)
|
activejob (= 5.0.5)
|
||||||
activemodel (= 5.0.1)
|
activemodel (= 5.0.5)
|
||||||
activerecord (= 5.0.1)
|
activerecord (= 5.0.5)
|
||||||
activesupport (= 5.0.1)
|
activesupport (= 5.0.5)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0)
|
||||||
railties (= 5.0.1)
|
railties (= 5.0.5)
|
||||||
sprockets-rails (>= 2.0.0)
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-dom-testing (2.0.2)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0, < 6.0)
|
activesupport (>= 4.2.0)
|
||||||
nokogiri (~> 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.0.3)
|
rails-html-sanitizer (1.0.3)
|
||||||
loofah (~> 2.0)
|
loofah (~> 2.0)
|
||||||
railties (5.0.1)
|
railties (5.0.5)
|
||||||
actionpack (= 5.0.1)
|
actionpack (= 5.0.5)
|
||||||
activesupport (= 5.0.1)
|
activesupport (= 5.0.5)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rainbow (2.2.1)
|
rainbow (2.2.2)
|
||||||
rake (12.0.0)
|
rake
|
||||||
redis (3.3.2)
|
rake (12.3.0)
|
||||||
responders (2.3.0)
|
rb-fsevent (0.10.2)
|
||||||
railties (>= 4.2.0, < 5.1)
|
rb-inotify (0.9.10)
|
||||||
rspec-core (3.5.4)
|
ffi (>= 0.5.0, < 2)
|
||||||
rspec-support (~> 3.5.0)
|
redis (3.3.3)
|
||||||
rspec-expectations (3.5.0)
|
responders (2.4.0)
|
||||||
|
actionpack (>= 4.2.0, < 5.3)
|
||||||
|
railties (>= 4.2.0, < 5.3)
|
||||||
|
rspec-core (3.6.0)
|
||||||
|
rspec-support (~> 3.6.0)
|
||||||
|
rspec-expectations (3.6.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.5.0)
|
rspec-support (~> 3.6.0)
|
||||||
rspec-mocks (3.5.0)
|
rspec-mocks (3.6.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.5.0)
|
rspec-support (~> 3.6.0)
|
||||||
rspec-rails (3.5.2)
|
rspec-rails (3.6.1)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
rspec-core (~> 3.5.0)
|
rspec-core (~> 3.6.0)
|
||||||
rspec-expectations (~> 3.5.0)
|
rspec-expectations (~> 3.6.0)
|
||||||
rspec-mocks (~> 3.5.0)
|
rspec-mocks (~> 3.6.0)
|
||||||
rspec-support (~> 3.5.0)
|
rspec-support (~> 3.6.0)
|
||||||
rspec-support (3.5.0)
|
rspec-support (3.6.0)
|
||||||
rubocop (0.47.1)
|
rubocop (0.48.1)
|
||||||
parser (>= 2.3.3.1, < 3.0)
|
parser (>= 2.3.3.1, < 3.0)
|
||||||
powerpack (~> 0.1)
|
powerpack (~> 0.1)
|
||||||
rainbow (>= 1.99.1, < 3.0)
|
rainbow (>= 1.99.1, < 3.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (~> 1.0, >= 1.0.1)
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||||
ruby-progressbar (1.8.1)
|
ruby-progressbar (1.9.0)
|
||||||
sass (3.4.23)
|
sass (3.5.1)
|
||||||
|
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.6)
|
||||||
railties (>= 4.0.0, < 6)
|
railties (>= 4.0.0, < 6)
|
||||||
sass (~> 3.1)
|
sass (~> 3.1)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
tilt (>= 1.1, < 3)
|
tilt (>= 1.1, < 3)
|
||||||
shoulda-matchers (3.1.1)
|
shoulda-matchers (3.1.2)
|
||||||
activesupport (>= 4.0.0)
|
activesupport (>= 4.0.0)
|
||||||
simplecov (0.12.0)
|
simplecov (0.15.0)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1.0)
|
||||||
json (>= 1.8, < 3)
|
json (>= 1.8, < 3)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.10.0)
|
simplecov-html (0.10.2)
|
||||||
slack-notifier (2.0.0)
|
slack-notifier (2.3.1)
|
||||||
slop (3.6.0)
|
slop (3.6.0)
|
||||||
snorlax (0.1.6)
|
snorlax (0.1.6)
|
||||||
rails (> 4.1)
|
rails (> 4.1)
|
||||||
sprockets (3.7.1)
|
sprockets (3.7.1)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (3.2.0)
|
sprockets-rails (3.2.1)
|
||||||
actionpack (>= 4.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
sucker_punch (2.0.2)
|
sucker_punch (2.0.3)
|
||||||
concurrent-ruby (~> 1.0.0)
|
concurrent-ruby (~> 1.0.0)
|
||||||
thor (0.19.4)
|
thor (0.20.0)
|
||||||
thread_safe (0.3.5)
|
thread_safe (0.3.6)
|
||||||
tilt (2.0.5)
|
tilt (2.0.8)
|
||||||
|
timecop (0.9.1)
|
||||||
tunemygc (1.0.69)
|
tunemygc (1.0.69)
|
||||||
tzinfo (1.2.2)
|
tzinfo (1.2.4)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (3.0.4)
|
uglifier (3.2.0)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
unicode-display_width (1.1.3)
|
unicode-display_width (1.3.0)
|
||||||
warden (1.2.6)
|
warden (1.2.7)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
websocket-driver (0.6.4)
|
websocket-driver (0.6.5)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.2)
|
websocket-extensions (0.1.2)
|
||||||
|
|
||||||
|
@ -289,7 +300,7 @@ PLATFORMS
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
active_model_serializers
|
active_model_serializers
|
||||||
aws-sdk
|
aws-sdk (~> 2.7.0)
|
||||||
best_in_place
|
best_in_place
|
||||||
better_errors
|
better_errors
|
||||||
binding_of_caller
|
binding_of_caller
|
||||||
|
@ -300,7 +311,8 @@ DEPENDENCIES
|
||||||
doorkeeper
|
doorkeeper
|
||||||
dotenv-rails
|
dotenv-rails
|
||||||
exception_notification
|
exception_notification
|
||||||
factory_girl_rails
|
factory_bot_rails
|
||||||
|
faker
|
||||||
httparty
|
httparty
|
||||||
jquery-rails
|
jquery-rails
|
||||||
jquery-ui-rails
|
jquery-ui-rails
|
||||||
|
@ -318,15 +330,16 @@ DEPENDENCIES
|
||||||
rack-attack
|
rack-attack
|
||||||
rack-cors
|
rack-cors
|
||||||
rails (~> 5.0.0)
|
rails (~> 5.0.0)
|
||||||
redis
|
redis (~> 3.3.3)
|
||||||
rspec-rails
|
rspec-rails
|
||||||
rubocop
|
rubocop (~> 0.48.1)
|
||||||
sass-rails
|
sass-rails
|
||||||
shoulda-matchers
|
shoulda-matchers
|
||||||
simplecov
|
simplecov
|
||||||
slack-notifier
|
slack-notifier
|
||||||
snorlax
|
snorlax
|
||||||
sucker_punch
|
sucker_punch
|
||||||
|
timecop
|
||||||
tunemygc
|
tunemygc
|
||||||
uglifier
|
uglifier
|
||||||
|
|
||||||
|
@ -334,4 +347,4 @@ RUBY VERSION
|
||||||
ruby 2.3.0p0
|
ruby 2.3.0p0
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.13.7
|
1.16.1
|
||||||
|
|
41
README.md
41
README.md
|
@ -28,39 +28,19 @@ Metamaps is developed and maintained by a distributed, nomadic community compris
|
||||||
- If you would like to report a bug, please check the [issues][contributing-issues] section in our [contributing instructions][contributing].
|
- If you would like to report a bug, please check the [issues][contributing-issues] section in our [contributing instructions][contributing].
|
||||||
- If you would like to get set up as a developer, that's great! Read on for help getting your development environment set up.
|
- If you would like to get set up as a developer, that's great! Read on for help getting your development environment set up.
|
||||||
|
|
||||||
## Installation
|
## Installation for local use or development of Metamaps
|
||||||
|
|
||||||
If you are on Mac or Ubuntu you can use the following instructions to quickly get a local copy of metamaps up and running using a Vagrant virtualbox. Don't be intimidated, it's easy!
|
First off is getting the code downloaded to your computer. You can download a zip file from github, but if you've got `git` you can just run `git clone https://github.com/metamaps/metamaps` in your terminal.
|
||||||
```
|
|
||||||
git clone git@github.com:metamaps/metamaps.git
|
|
||||||
```
|
|
||||||
Now ensure you have VirtualBox and Vagrant installed on your computer
|
|
||||||
```
|
|
||||||
cd metamaps
|
|
||||||
./bin/configure.sh
|
|
||||||
```
|
|
||||||
This will do all the setup steps to make Metamaps work with a bit of behind the scenes ninja magick.
|
|
||||||
|
|
||||||
To start servers which will run metamaps you can then run:
|
There are instructions for setup on various platforms, with particular support for Mac and Ubuntu, which can be found here:
|
||||||
```
|
- [Mac Install Walkthrough][mac-installation]
|
||||||
./bin/start
|
- [Ubuntu Install Walkthrough][ubuntu-installation]
|
||||||
```
|
|
||||||
To stop them:
|
|
||||||
```
|
|
||||||
./bin/stop
|
|
||||||
```
|
|
||||||
With your webservers running, open a web browser and go to `http://localhost:3000`
|
|
||||||
|
|
||||||
You can sign in with the default account
|
If you prefer to isolate your install in a virtual machine, you may find it simpler to setup using Vagrant:
|
||||||
email: `user@user.com`
|
- [Vagrant installation][vagrant-installation]
|
||||||
password: `toolsplusconsciousness`
|
|
||||||
OR create a new account at `/join`, and use access code `qwertyui`
|
|
||||||
|
|
||||||
Start mapping and programming!
|
We don't promise support for Windows, but at one point we had it running and we've kept those docs available for reference
|
||||||
|
- [Outdated Windows Walkthrough][windows-installation]
|
||||||
We haven't set up instructions for using Vagrant on Windows, but there are instructions for a manual setup here:
|
|
||||||
|
|
||||||
- [For Windows][windows-installation]
|
|
||||||
|
|
||||||
## Licensing information
|
## Licensing information
|
||||||
|
|
||||||
|
@ -76,4 +56,7 @@ Copyright (c) 2017 Connor Turland
|
||||||
[license]: https://github.com/metamaps/metamaps/blob/develop/LICENSE
|
[license]: https://github.com/metamaps/metamaps/blob/develop/LICENSE
|
||||||
[contributing]: https://github.com/metamaps/metamaps/blob/develop/doc/CONTRIBUTING.md
|
[contributing]: https://github.com/metamaps/metamaps/blob/develop/doc/CONTRIBUTING.md
|
||||||
[contributing-issues]: https://github.com/metamaps/metamaps/blob/develop/doc/CONTRIBUTING.md#reporting-bugs-and-other-issues
|
[contributing-issues]: https://github.com/metamaps/metamaps/blob/develop/doc/CONTRIBUTING.md#reporting-bugs-and-other-issues
|
||||||
|
[mac-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/MacInstallation.md
|
||||||
|
[ubuntu-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/UbuntuInstallation.md
|
||||||
|
[vagrant-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/VagrantInstallation.md
|
||||||
[windows-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/WindowsInstallation.md
|
[windows-installation]: https://github.com/metamaps/metamaps/blob/develop/doc/WindowsInstallation.md
|
||||||
|
|
1
Rakefile
Normal file → Executable file
1
Rakefile
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env rake
|
#!/usr/bin/env rake
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||||
|
|
||||||
|
|
2
Vagrantfile
vendored
2
Vagrantfile
vendored
|
@ -37,7 +37,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
config.vm.box = 'trusty64'
|
config.vm.box = 'trusty64'
|
||||||
config.vm.box_url = 'http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box'
|
config.vm.box_url = 'http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box'
|
||||||
config.vm.network :forwarded_port, guest: 3000, host: 3000
|
config.vm.network :forwarded_port, guest: 3000, host: 3000
|
||||||
config.vm.network :forwarded_port, guest: 5001, host: 5001
|
config.vm.network :forwarded_port, guest: 5000, host: 5000
|
||||||
config.vm.network 'private_network', ip: '10.0.1.11'
|
config.vm.network 'private_network', ip: '10.0.1.11'
|
||||||
config.vm.synced_folder '.', '/vagrant', nfs: true
|
config.vm.synced_folder '.', '/vagrant', nfs: true
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 543 B |
|
@ -10,6 +10,9 @@ Metamaps.ServerData['topic_link_signifier.png'] = '<%= asset_path('topic_link_si
|
||||||
Metamaps.ServerData['synapse16.png'] = '<%= asset_path('synapse16.png') %>'
|
Metamaps.ServerData['synapse16.png'] = '<%= asset_path('synapse16.png') %>'
|
||||||
Metamaps.ServerData['sounds/MM_sounds.mp3'] = '<%= asset_path 'sounds/MM_sounds.mp3' %>'
|
Metamaps.ServerData['sounds/MM_sounds.mp3'] = '<%= asset_path 'sounds/MM_sounds.mp3' %>'
|
||||||
Metamaps.ServerData['sounds/MM_sounds.ogg'] = '<%= asset_path 'sounds/MM_sounds.ogg' %>'
|
Metamaps.ServerData['sounds/MM_sounds.ogg'] = '<%= asset_path 'sounds/MM_sounds.ogg' %>'
|
||||||
|
Metamaps.ServerData['exploremaps_sprite.png'] = '<%= asset_path 'exploremaps_sprite.png' %>'
|
||||||
|
Metamaps.ServerData['map_control_sprite.png'] = '<%= asset_path 'map_control_sprite.png' %>'
|
||||||
|
Metamaps.ServerData['user_sprite.png'] = '<%= asset_path 'user_sprite.png' %>'
|
||||||
Metamaps.ServerData.Metacodes = <%= Metacode.all.to_json.gsub(%r[(icon.*?)(\"},)], '\1?purple=stupid\2').html_safe %>
|
Metamaps.ServerData.Metacodes = <%= Metacode.all.to_json.gsub(%r[(icon.*?)(\"},)], '\1?purple=stupid\2').html_safe %>
|
||||||
Metamaps.ServerData.REALTIME_SERVER = '<%= ENV['REALTIME_SERVER'] %>'
|
Metamaps.ServerData.REALTIME_SERVER = '<%= ENV['REALTIME_SERVER'] %>'
|
||||||
Metamaps.ServerData.RAILS_ENV = '<%= ENV['RAILS_ENV'] %>'
|
Metamaps.ServerData.RAILS_ENV = '<%= ENV['RAILS_ENV'] %>'
|
||||||
|
|
|
@ -4,11 +4,11 @@ $(document).ready(function() {
|
||||||
if (window.location.pathname === '/') {
|
if (window.location.pathname === '/') {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'https://player.vimeo.com',
|
url: 'https://i.vimeocdn.com/video/',
|
||||||
error: function(e) {
|
error: function(e) {
|
||||||
$('.homeVideo').hide()
|
$('.homeVideo').hide()
|
||||||
$('.homeVideo').replaceWith($('<video/>', {
|
$('.homeVideo').replaceWith($('<video/>', {
|
||||||
poster: '/assets/metamaps-intro-poster.webp',
|
poster: '<%= asset_path('metamaps-intro-poster.webp') %>',
|
||||||
width: '560',
|
width: '560',
|
||||||
height: '315',
|
height: '315',
|
||||||
class: 'homeVideo',
|
class: 'homeVideo',
|
|
@ -56,16 +56,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
li.toggledOff {
|
li.toggledOff {
|
||||||
opacity: 0.4;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.blackBox {
|
.centerContent {
|
||||||
width: 760px;
|
width: 760px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 80px 0 60px 20px;
|
padding: 80px 0 60px 20px;
|
||||||
background: rgba(0, 0, 0, 0.4);
|
background: rgba(125, 125, 125, 0.4);
|
||||||
color: white;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@ -85,10 +84,10 @@
|
||||||
display: table-row;
|
display: table-row;
|
||||||
}
|
}
|
||||||
tr:nth-child(odd) {
|
tr:nth-child(odd) {
|
||||||
background: rgba(0, 0, 0, 0.2);
|
background: rgba(125, 125, 125, 0.2);
|
||||||
}
|
}
|
||||||
tr:nth-child(even) {
|
tr:nth-child(even) {
|
||||||
background: rgba(0, 0, 0, 0.3);
|
background: rgba(125, 125, 125, 0.3);
|
||||||
}
|
}
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
|
|
|
@ -193,10 +193,6 @@ button.button.btn-no:hover {
|
||||||
display: block;
|
display: block;
|
||||||
width: 830px;
|
width: 830px;
|
||||||
}
|
}
|
||||||
.requestInvite {
|
|
||||||
display: block;
|
|
||||||
margin: -720px auto 0;
|
|
||||||
}
|
|
||||||
.new_session,
|
.new_session,
|
||||||
.new_user,
|
.new_user,
|
||||||
.edit_user,
|
.edit_user,
|
||||||
|
@ -672,9 +668,21 @@ label {
|
||||||
position: relative;
|
position: relative;
|
||||||
/*overflow:hidden; */
|
/*overflow:hidden; */
|
||||||
}
|
}
|
||||||
.main.compressed {
|
.compressed {
|
||||||
width: calc(100% - 300px);
|
.upperRightUI {
|
||||||
|
right: 324px;
|
||||||
|
}
|
||||||
|
.upperRightMapButtons {
|
||||||
|
right: 434px;
|
||||||
|
}
|
||||||
|
.mapControls {
|
||||||
|
right: 324px;
|
||||||
|
}
|
||||||
|
.infoAndHelp {
|
||||||
|
right: 370px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#infovis-canvas {
|
#infovis-canvas {
|
||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
|
@ -775,9 +783,9 @@ label {
|
||||||
}
|
}
|
||||||
.sidebarAccountIcon img {
|
.sidebarAccountIcon img {
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
|
width: 32px;
|
||||||
}
|
}
|
||||||
.sidebarAccountBox {
|
.sidebarAccountBox {
|
||||||
display: none;
|
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
.authenticated .sidebarAccountBox {
|
.authenticated .sidebarAccountBox {
|
||||||
|
@ -818,6 +826,7 @@ label {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
color: #757575;
|
color: #757575;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.accountListItem:hover {
|
.accountListItem:hover {
|
||||||
color: #424242;
|
color: #424242;
|
||||||
|
@ -1039,7 +1048,6 @@ label[for="user_remember_me"] {
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebarFilterBox {
|
.sidebarFilterBox {
|
||||||
display:none;
|
|
||||||
width: 319px;
|
width: 319px;
|
||||||
padding: 16px 0;
|
padding: 16px 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
@ -1250,7 +1258,7 @@ h3.filterBox {
|
||||||
box-shadow: 0px 3px 3px rgba(0,0,0,0.12), 0 3px 3px rgba(0,0,0,0.24);
|
box-shadow: 0px 3px 3px rgba(0,0,0,0.12), 0 3px 3px rgba(0,0,0,0.24);
|
||||||
}
|
}
|
||||||
.rightclickmenu .rc-permission:hover > ul,
|
.rightclickmenu .rc-permission:hover > ul,
|
||||||
.rightclickmenu .rc-metacode:hover > ul,
|
.rightclickmenu .rc-metacode:hover #metacodeOptions > ul,
|
||||||
.rightclickmenu .rc-siblings:hover > ul {
|
.rightclickmenu .rc-siblings:hover > ul {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
@ -1279,7 +1287,7 @@ h3.filterBox {
|
||||||
.rightclickmenu li.toPrivate .rc-perm-icon {
|
.rightclickmenu li.toPrivate .rc-perm-icon {
|
||||||
background-position: -24px 0;
|
background-position: -24px 0;
|
||||||
}
|
}
|
||||||
.rightclickmenu .rc-metacode > ul > li,
|
.rightclickmenu .rc-metacode #metacodeOptions > ul > li,
|
||||||
.rightclickmenu .rc-siblings > ul > li {
|
.rightclickmenu .rc-siblings > ul > li {
|
||||||
padding: 6px 24px 6px 8px;
|
padding: 6px 24px 6px 8px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@ -1907,14 +1915,10 @@ input.collaboratorSearchField {
|
||||||
background-position: -32px 0;
|
background-position: -32px 0;
|
||||||
}
|
}
|
||||||
.yourMap .mapPermission:hover {
|
.yourMap .mapPermission:hover {
|
||||||
background-image: url(<%= asset_data_uri('arrowperms_sprite.png') %>);
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-position: -32px 0;
|
|
||||||
}
|
}
|
||||||
.yourMap .mapPermission.minimize {
|
.yourMap .mapPermission.minimize {
|
||||||
background-image: url(<%= asset_data_uri('arrowperms_sprite.png') %>) !important;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-position: 0 0;
|
|
||||||
}
|
}
|
||||||
.mapInfoBox .mapPermission .permissionSelect {
|
.mapInfoBox .mapPermission .permissionSelect {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
@ -2311,6 +2315,9 @@ and it won't be important on password protected instances */
|
||||||
}
|
}
|
||||||
/* switch metacode set */
|
/* switch metacode set */
|
||||||
|
|
||||||
|
#switchMetacodes > p {
|
||||||
|
margin: 16px 0 16px 0;
|
||||||
|
}
|
||||||
#metacodeSwitchTabs {
|
#metacodeSwitchTabs {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
|
@ -2318,28 +2325,43 @@ and it won't be important on password protected instances */
|
||||||
border: none;
|
border: none;
|
||||||
background: none;
|
background: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
|
||||||
#metacodeSwitchTabs .setDesc {
|
.setDesc,
|
||||||
margin-bottom: 5px;
|
.selectAll,
|
||||||
font-family: 'din-medium', helvetica, sans-serif;
|
.selectNone {
|
||||||
color: #424242;
|
margin-bottom: 5px;
|
||||||
font-size: 14px;
|
font-family: 'din-medium', helvetica, sans-serif;
|
||||||
text-align: justify;
|
color: #424242;
|
||||||
padding-right: 16px;
|
font-size: 14px;
|
||||||
}
|
text-align: justify;
|
||||||
#switchMetacodes > p {
|
padding-right: 16px;
|
||||||
margin: 16px 0 16px 0;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
#metacodeSwitchTabs > ul {
|
|
||||||
width: 130px;
|
.selectAll,
|
||||||
}
|
.selectNone {
|
||||||
#metacodeSwitchTabs > ul li {
|
float: right;
|
||||||
font-size: 14px;
|
cursor: pointer;
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
&:hover,
|
||||||
#metacodeSwitchTabs li.ui-state-active a {
|
&.selected {
|
||||||
color: #00BCD4;
|
color: #00bcd4;
|
||||||
cursor: pointer;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > ul {
|
||||||
|
width: 130px;
|
||||||
|
|
||||||
|
li {
|
||||||
|
font-size: 14px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
li.ui-state-active a {
|
||||||
|
color: #00BCD4;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.metacodeSwitchTab {
|
.metacodeSwitchTab {
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
|
@ -2908,146 +2930,18 @@ and it won't be important on password protected instances */
|
||||||
color: #424242;
|
color: #424242;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Admin Pages */
|
|
||||||
|
|
||||||
.blackBox {
|
|
||||||
width: 760px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 20px 0 60px 20px;
|
|
||||||
background: rgba(0, 0, 0, 0.4);
|
|
||||||
color: white;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.blackBox .metacodeSetsDescription {
|
|
||||||
width: 314px;
|
|
||||||
}
|
|
||||||
.blackBox td.metacodeSetDesc {
|
|
||||||
width: 314px;
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
|
||||||
.blackBox .metacodeSetImage {
|
|
||||||
width: 36px;
|
|
||||||
height: 36px;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
.blackBox tr {
|
|
||||||
display: table-row;
|
|
||||||
}
|
|
||||||
.blackBox tr:nth-child(odd) {
|
|
||||||
background: rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
.blackBox tr:nth-child(even) {
|
|
||||||
background: rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
.blackBox th,
|
|
||||||
.blackBox td {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.blackBox td.iconURL {
|
|
||||||
max-width: 415px;
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
|
||||||
.blackBox td.iconColor {
|
|
||||||
|
|
||||||
}
|
|
||||||
.blackBox .field {
|
|
||||||
margin: 15px 0 5px;
|
|
||||||
}
|
|
||||||
.blackBox label {
|
|
||||||
float: left;
|
|
||||||
width: 100px;
|
|
||||||
margin-right: 15px;
|
|
||||||
}
|
|
||||||
.blackBox input[type="text"] {
|
|
||||||
width: 336px;
|
|
||||||
height: 32px;
|
|
||||||
font-size: 15px;
|
|
||||||
direction: ltr;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
appearance: none;
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 8px;
|
|
||||||
background: #fff;
|
|
||||||
border: 1px solid #d9d9d9;
|
|
||||||
border-top: 1px solid #c0c0c0;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
-webkit-border-radius: 1px;
|
|
||||||
-moz-border-radius: 1px;
|
|
||||||
border-radius: 1px;
|
|
||||||
font: -webkit-small-control;
|
|
||||||
color: initial;
|
|
||||||
letter-spacing: normal;
|
|
||||||
word-spacing: normal;
|
|
||||||
text-transform: none;
|
|
||||||
text-indent: 0px;
|
|
||||||
text-shadow: none;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: start;
|
|
||||||
font-family: arial;
|
|
||||||
}
|
|
||||||
.blackBox input[type="text"]:hover,
|
|
||||||
.blackBox textarea:hover {
|
|
||||||
border: 1px solid #b9b9b9;
|
|
||||||
border-top: 1px solid #a0a0a0;
|
|
||||||
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
||||||
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
||||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
.blackBox textarea {
|
|
||||||
padding: 8px;
|
|
||||||
border: 1px solid #d9d9d9;
|
|
||||||
border-top: 1px solid #c0c0c0;
|
|
||||||
resize: none;
|
|
||||||
font: -webkit-small-control;
|
|
||||||
letter-spacing: normal;
|
|
||||||
word-spacing: normal;
|
|
||||||
text-transform: none;
|
|
||||||
text-indent: 0px;
|
|
||||||
text-shadow: none;
|
|
||||||
text-align: start;
|
|
||||||
font-family: arial;
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 17px;
|
|
||||||
width: 318px;
|
|
||||||
}
|
|
||||||
.blackBox .allMetacodes {
|
|
||||||
padding: 5px 0;
|
|
||||||
}
|
|
||||||
.blackBox a.button {
|
|
||||||
margin-right: 20px;
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
.blackBox a.button,
|
|
||||||
.blackBox input.add {
|
|
||||||
float: left;
|
|
||||||
margin-top: 5px;
|
|
||||||
height: 40px;
|
|
||||||
font-size: 17px;
|
|
||||||
width: auto;
|
|
||||||
padding: 0 30px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.blackBox a.button:hover,
|
|
||||||
.blackBox input.add:hover {
|
|
||||||
-webkit-box-shadow: none;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* request */
|
/* request */
|
||||||
|
|
||||||
#wrapper .requestInvite {
|
.requestInvite {
|
||||||
width: 700px;
|
width: 700px;
|
||||||
margin: 0 auto;
|
|
||||||
padding: 0 0 60px 0;
|
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
color: white;
|
color: white;
|
||||||
height: 100%;
|
height: calc(100% - 52px);
|
||||||
overflow: hidden;
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -350px;
|
||||||
|
margin-top: 52px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.home_bg {
|
.home_bg {
|
||||||
|
@ -3121,3 +3015,17 @@ script.data-gratipay-username {
|
||||||
.inline {
|
.inline {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.topicFollow {
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-family: helvetica, sans-serif;
|
||||||
|
float: left;
|
||||||
|
width: 72px;
|
||||||
|
text-align: right;
|
||||||
|
padding: 12px 0;
|
||||||
|
color: #4fb5c0;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
|
@ -1,11 +1,19 @@
|
||||||
|
$mid-gray: #8A8A8A;
|
||||||
|
$mid-gray-opacity: rgba(66, 66, 66, 0.6);
|
||||||
|
|
||||||
.nameCounter {
|
.nameCounter {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1px;
|
bottom: 1px;
|
||||||
right: 2px;
|
right: 2px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
font-family: helvetica;
|
font-family: helvetica, sans-serif;
|
||||||
color: #727272;
|
color: #727272;
|
||||||
line-height: 11px;
|
line-height: 11px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.riek-editing + .nameCounter {
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nameCounter.forMap {
|
.nameCounter.forMap {
|
||||||
|
@ -14,21 +22,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.nameCounter.forTopic {
|
.nameCounter.forTopic {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#center-container {
|
#center-container {
|
||||||
position:relative;
|
position:relative;
|
||||||
height:100%;
|
height:100%;
|
||||||
width:100%;
|
width:100%;
|
||||||
|
|
||||||
/* background-color:#031924; */
|
/* background-color:#031924; */
|
||||||
color:#444;
|
color:#444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.showcard {
|
.showcard {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
display:none;
|
|
||||||
top:100px;
|
top:100px;
|
||||||
left:100px;
|
left:100px;
|
||||||
width:300px;
|
width:300px;
|
||||||
|
@ -38,7 +45,7 @@
|
||||||
z-index:2;
|
z-index:2;
|
||||||
color: #424242;
|
color: #424242;
|
||||||
border-radius:2px;
|
border-radius:2px;
|
||||||
box-shadow: 0px 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16);
|
box-shadow: 2px 3px 3px rgba(125, 125, 125, 0.23), -2px -1px 3px rgba(125, 125, 125, 0.16);
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
@ -49,7 +56,6 @@
|
||||||
width:100%;
|
width:100%;
|
||||||
height:100%;
|
height:100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.showcard .permission {
|
.showcard .permission {
|
||||||
|
@ -61,7 +67,6 @@
|
||||||
display:block;
|
display:block;
|
||||||
position:relative;
|
position:relative;
|
||||||
width:100%;
|
width:100%;
|
||||||
min-height:360px;
|
|
||||||
z-index: 25;
|
z-index: 25;
|
||||||
}
|
}
|
||||||
.CardOnGraph.hasAttachment {
|
.CardOnGraph.hasAttachment {
|
||||||
|
@ -70,11 +75,10 @@
|
||||||
|
|
||||||
.CardOnGraph .title {
|
.CardOnGraph .title {
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
font-size: 18px;
|
font-size: 20px;
|
||||||
line-height: 22px;
|
line-height: 24px;
|
||||||
display: table;
|
display: table;
|
||||||
padding: 8px 0 16px;
|
padding: 20px 0;
|
||||||
height: 80px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: 'din-regular', sans-serif;
|
font-family: 'din-regular', sans-serif;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
|
@ -93,12 +97,11 @@
|
||||||
cursor: text;
|
cursor: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.showcard .best_in_place_name textarea, .showcard .best_in_place_name input {
|
.showcard .title .riek-editing {
|
||||||
font-family: 'din-regular', sans-serif;
|
font-family: 'din-regular', sans-serif;
|
||||||
color: #424242;
|
color: #424242;
|
||||||
font-size: 18px;
|
font-size: 20px;
|
||||||
line-height: 22px;
|
line-height: 24px;
|
||||||
height: 15px;
|
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -112,30 +115,40 @@
|
||||||
.CardOnGraph .scroll {
|
.CardOnGraph .scroll {
|
||||||
display:block;
|
display:block;
|
||||||
padding: 8px 0 8px 16px;
|
padding: 8px 0 8px 16px;
|
||||||
height: 152px;
|
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height:15px;
|
line-height:15px;
|
||||||
font-family: helvetica, sans-serif;
|
font-family: helvetica, sans-serif;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
|
p.emptyDesc {
|
||||||
|
color: $mid-gray-opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.mdSupport {
|
||||||
|
color: #4fb5c0;
|
||||||
|
font-size: 11px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.riek-editing + .mdSupport {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.CardOnGraph.hasAttachment .scroll {
|
.CardOnGraph.hasAttachment .scroll {
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .best_in_place_desc textarea {
|
.CardOnGraph .desc .riek-editing {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height:15px;
|
line-height:15px;
|
||||||
font-family: helvetica, sans-serif;
|
font-family: helvetica, sans-serif;
|
||||||
color: #424242;
|
color: #424242;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 100%;
|
width: 258px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
outline: none;
|
outline: none;
|
||||||
font-size: 12px;
|
|
||||||
line-height: 15px;
|
|
||||||
background: none;
|
background: none;
|
||||||
resize: none;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -167,13 +180,11 @@
|
||||||
* End Markdown styling
|
* End Markdown styling
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.CardOnGraph .best_in_place_desc {
|
.CardOnGraph .riek_desc {
|
||||||
display:block;
|
display:block;
|
||||||
margin-top:2px;
|
padding-right: 26px;
|
||||||
padding-right: 18px;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
}
|
||||||
.canEdit .CardOnGraph .best_in_place_desc:hover {
|
.canEdit .CardOnGraph .riek_desc:not(.riek-editing):hover {
|
||||||
background-image: url(<%= asset_data_uri('edit.png') %>);
|
background-image: url(<%= asset_data_uri('edit.png') %>);
|
||||||
background-position: top right;
|
background-position: top right;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
@ -185,155 +196,215 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .links {
|
.CardOnGraph .links {
|
||||||
position:relative;
|
|
||||||
border-bottom: 1px solid #BDBDBD;
|
|
||||||
border-top: 1px solid #BDBDBD;
|
|
||||||
background-color: #e0e0e0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.linkItem {
|
|
||||||
float:left;
|
|
||||||
height:46px;
|
|
||||||
z-index: 1;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #424242;
|
z-index: 2;
|
||||||
font-size: 14px;
|
|
||||||
line-height:14px;
|
.linkItem {
|
||||||
height:12px;
|
float: left;
|
||||||
padding:17px 0;
|
z-index: 1;
|
||||||
}
|
position: relative;
|
||||||
.linkItem a {
|
color: #424242;
|
||||||
color: #424242;
|
font-size: 14px;
|
||||||
|
line-height: 14px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #424242;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
padding: 0;
|
||||||
|
height: 48px;
|
||||||
|
margin-right: 10px;
|
||||||
|
|
||||||
|
.metacodeImage {
|
||||||
|
cursor: move;
|
||||||
|
position: absolute;
|
||||||
|
left: -18px;
|
||||||
|
top: 6px;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
background-size:36px 36px;
|
||||||
|
background-position:0 0;
|
||||||
|
background-repeat:no-repeat;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .icon {
|
.CardOnGraph .info {
|
||||||
position:absolute;
|
|
||||||
width:100%;
|
|
||||||
z-index:1;
|
|
||||||
padding: 0;
|
|
||||||
height: 48px;
|
|
||||||
}
|
|
||||||
.linkItem.contributor {
|
|
||||||
margin-left:40px;
|
|
||||||
z-index:1;
|
|
||||||
padding:17px 16px 17px 30px;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
|
||||||
.contributor .contributorIcon {
|
|
||||||
position: absolute;
|
|
||||||
top: 8px;
|
|
||||||
left: 0;
|
|
||||||
border-radius: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contributor:hover .contributorName {
|
.linkItem {
|
||||||
display: block;
|
float: left;
|
||||||
}
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
color: $mid-gray-opacity;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 14px;
|
||||||
|
|
||||||
.contributorName {
|
a {
|
||||||
display: none;
|
color: $mid-gray-opacity;
|
||||||
position: absolute;
|
}
|
||||||
background: black;
|
}
|
||||||
text-align: center;
|
|
||||||
color: white;
|
|
||||||
border-radius: 2px;
|
|
||||||
font-family: din-regular;
|
|
||||||
line-height: 15px;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 3px 5px 2px;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin-top: 36px;
|
|
||||||
margin-left: -32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contributor div:before {
|
.contributor {
|
||||||
content: '';
|
bottom: 7px;
|
||||||
position: absolute;
|
margin-left: 16px;
|
||||||
top: 128%;
|
|
||||||
left: 13px;
|
|
||||||
margin-top: -30px;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border-bottom: 4px solid #000000;
|
|
||||||
border-left: 5px solid transparent;
|
|
||||||
border-right: 5px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.linkItem.mapCount {
|
.contributorIcon {
|
||||||
margin-left: 12px;
|
position: relative;
|
||||||
width: 24px;
|
display: inline-block;
|
||||||
padding:17px 0 17px 36px;
|
vertical-align: middle;
|
||||||
}
|
border-radius: 16px;
|
||||||
.linkItem.mapCount .mapCountIcon {
|
margin: 5px 5px 5px 0;
|
||||||
position: absolute;
|
top: 11px;
|
||||||
top: 8px;
|
left: 0;
|
||||||
left: 0;
|
}
|
||||||
width: 32px;
|
|
||||||
height: 32px;
|
|
||||||
background-image: url(<%= asset_data_uri('map32_sprite.png') %>);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: 0 0;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.linkItem.mapCount:hover .mapCountIcon {
|
|
||||||
background-position: 0 -32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.linkItem.mapCount:hover .hoverTip {
|
span {
|
||||||
display: block;
|
font-family: 'din-regular', sans-serif;
|
||||||
}
|
font-size: 14px;
|
||||||
.CardOnGraph .mapCount .tip, .CardonGraph .mapCount .hoverTip {
|
}
|
||||||
top: 44px;
|
|
||||||
left: 0px;
|
|
||||||
font-size: 12px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hoverTip {
|
.contributorName {
|
||||||
white-space: nowrap;
|
font-family: din-regular;
|
||||||
font-family: 'din-regular';
|
margin-top: 20px;
|
||||||
top: 44px;
|
display: inline-block;
|
||||||
left: 0px;
|
vertical-align: middle;
|
||||||
font-size: 12px !important;
|
width: 97px;
|
||||||
display: none;
|
padding: 0 8px 0 4px;
|
||||||
position: absolute;
|
white-space: nowrap;
|
||||||
background: black;
|
overflow: hidden;
|
||||||
color: white;
|
text-overflow: ellipsis;
|
||||||
border-radius: 4px;
|
}
|
||||||
line-height: 17px;
|
}
|
||||||
padding: 3px 5px 2px;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.mapCount {
|
||||||
|
padding:17px 38px 17px 0;
|
||||||
|
width: 22px;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
.CardOnGraph .mapCount .tip:before, .CardOnGraph .mapCount .hoverTip:before {
|
.mapCountIcon {
|
||||||
content: '';
|
position: absolute;
|
||||||
position: absolute;
|
top: 8px;
|
||||||
top: 26px;
|
right: 0;
|
||||||
left: 10px;
|
width: 32px;
|
||||||
margin-top: -30px;
|
height: 32px;
|
||||||
width: 0;
|
background-image: url(<%= asset_data_uri('map32_sprite.png') %>);
|
||||||
height: 0;
|
background-repeat: no-repeat;
|
||||||
border-bottom: 4px solid #000000;
|
background-position: 0 0;
|
||||||
border-left: 5px solid transparent;
|
cursor: pointer;
|
||||||
border-right: 5px solid transparent;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .mapCount .tip li {
|
&:hover .mapCountIcon {
|
||||||
list-style-type: none;
|
background-position: 0 -32px;
|
||||||
white-space: nowrap;
|
}
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
padding: 6px 10px;
|
|
||||||
display: block;
|
|
||||||
height: 14px;
|
|
||||||
font-family: 'din-regular', helvetica, sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 14px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CardOnGraph .mapCount li.hideExtra {
|
.tip, .hoverTip {
|
||||||
display: none;
|
top: 44px;
|
||||||
|
right: 0px;
|
||||||
|
font-size: 12px !important;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 26px;
|
||||||
|
right: 10px;
|
||||||
|
margin-top: -30px;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-bottom: 4px solid $mid-gray;
|
||||||
|
border-left: 5px solid transparent;
|
||||||
|
border-right: 5px solid transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.hoverTip {
|
||||||
|
white-space: nowrap;
|
||||||
|
font-family: 'din-regular';
|
||||||
|
top: 44px;
|
||||||
|
font-size: 12px !important;
|
||||||
|
position: absolute;
|
||||||
|
background: $mid-gray;
|
||||||
|
color: white;
|
||||||
|
border-radius: 4px;
|
||||||
|
line-height: 17px;
|
||||||
|
padding: 3px 5px 2px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip a:hover {
|
||||||
|
color: #757575;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip li {
|
||||||
|
list-style-type: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
padding: 6px 10px;
|
||||||
|
display: block;
|
||||||
|
height: 14px;
|
||||||
|
font-family: 'din-regular', helvetica, sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 14px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.synapseCount {
|
||||||
|
width: 22px;
|
||||||
|
padding:17px 38px 17px 0;
|
||||||
|
text-align: right;
|
||||||
|
margin-right: 4px;
|
||||||
|
|
||||||
|
.synapseCountIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 0;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
background-image: url(<%= asset_data_uri('synapse32_sprite.png') %>);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: 0 0;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
hover .synapseCountIcon {
|
||||||
|
background-position: 0 -32px;
|
||||||
|
}
|
||||||
|
.tip {
|
||||||
|
position: absolute;
|
||||||
|
background: $mid-gray;
|
||||||
|
width: auto;
|
||||||
|
top: 44px;
|
||||||
|
right: 0px;
|
||||||
|
color: white;
|
||||||
|
white-space: nowrap;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: 12px !important;
|
||||||
|
font-family: 'din-regular';
|
||||||
|
line-height: 12px;
|
||||||
|
padding: 4px 4px 4px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
margin-top: -8px;
|
||||||
|
right: 12px;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-bottom: 4px solid $mid-gray;
|
||||||
|
border-left: 5px solid transparent;
|
||||||
|
border-right: 5px solid transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.showMore {
|
.showMore {
|
||||||
|
@ -341,66 +412,10 @@
|
||||||
color: #4FC059;
|
color: #4FC059;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mapCount .tip a {
|
.linkItem.mapPerm {
|
||||||
color: white;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mapCount .tip a:hover {
|
|
||||||
color: #757575;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.linkItem.synapseCount {
|
|
||||||
margin-left: 2px;
|
|
||||||
width: 24px;
|
|
||||||
padding:17px 0 17px 32px;
|
|
||||||
}
|
|
||||||
.linkItem.synapseCount .synapseCountIcon {
|
|
||||||
position: absolute;
|
|
||||||
top: 8px;
|
|
||||||
left: 0;
|
|
||||||
width: 32px;
|
|
||||||
height: 32px;
|
|
||||||
background-image: url(<%= asset_data_uri('synapse32_sprite.png') %>);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: 0 0;
|
|
||||||
}
|
|
||||||
.linkItem.synapseCount:hover .synapseCountIcon {
|
|
||||||
background-position: 0 -32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CardOnGraph .synapseCount .tip {
|
|
||||||
position: absolute;
|
|
||||||
background: black;
|
|
||||||
width: auto;
|
|
||||||
top: 44px;
|
|
||||||
color: white;
|
|
||||||
white-space: nowrap;
|
|
||||||
border-radius: 2px;
|
|
||||||
font-size: 12px !important;
|
|
||||||
font-family: 'din-regular';
|
|
||||||
line-height: 12px;
|
|
||||||
padding: 4px 4px 4px;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CardOnGraph .synapseCount:hover .tip {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CardOnGraph .synapseCount .tip:before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
margin-top: -8px;
|
|
||||||
margin-left: 6px;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border-bottom: 4px solid black;
|
|
||||||
border-left: 5px solid transparent;
|
|
||||||
border-right: 5px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.mapPerm {
|
.mapPerm {
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
@ -422,14 +437,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.yourTopic .mapPerm:hover, .yourEdge .mapPerm:hover {
|
.yourTopic .mapPerm:hover, .yourEdge .mapPerm:hover {
|
||||||
background-image: url(<%= asset_data_uri('arrowperms_sprite.png') %>);
|
|
||||||
background-position: -32px 0;
|
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
.yourTopic .mapPerm.minimize, .yourEdge .mapPerm.minimize {
|
.yourTopic .mapPerm.minimize, .yourEdge .mapPerm.minimize {
|
||||||
background-image: url(<%= asset_data_uri('arrowperms_sprite.png') %>) !important;
|
cursor: pointer;
|
||||||
background-position: 0 0;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
.mapPerm .permissionSelect {
|
.mapPerm .permissionSelect {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
@ -465,63 +476,55 @@ cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .metacodeTitle {
|
.CardOnGraph .metacodeTitle {
|
||||||
font-style: italic;
|
font-family: 'din-regular';
|
||||||
font-family: 'vinyl';
|
|
||||||
text-transform: uppercase;
|
|
||||||
position: absolute;
|
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
height:24px;
|
height: 26px;
|
||||||
font-size: 24px;
|
font-size: 18px;
|
||||||
display: none;
|
padding: 13px 24px 9px 24px;
|
||||||
width: 90%;
|
|
||||||
padding: 13px 0 9px 10%;
|
|
||||||
background-color: #E0E0E0;
|
|
||||||
color: #424242;
|
color: #424242;
|
||||||
|
width: 120px;
|
||||||
|
max-width: 120px;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.permission.canEdit .metacodeTitle {
|
.permission.canEdit .metacodeTitle {
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.permission.canEdit .expandMetacodeSelect {
|
.permission.canEdit .expandMetacodeSelect {
|
||||||
position: absolute;
|
position: relative;
|
||||||
top: 16px;
|
top: 2px;
|
||||||
right: 16px;
|
left: 4px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
background-image: url(<%= asset_data_uri('arrowright_sprite.png') %>);
|
background-image: url(<%= asset_data_uri('arrowright_sprite.png') %>);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: 0 -32px;
|
background-position: 0 -32px;
|
||||||
|
display: inline-block;
|
||||||
|
-webkit-transform: rotate(90deg);
|
||||||
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
.permission.canEdit .minimize .expandMetacodeSelect {
|
.permission.canEdit .minimize .expandMetacodeSelect {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .metacodeImage {
|
.CardOnGraph .metacodeName {
|
||||||
cursor:move;
|
display: inline-block;
|
||||||
width:46px;
|
|
||||||
height:46px;
|
|
||||||
position:absolute;
|
|
||||||
left:-23px;
|
|
||||||
top:0;
|
|
||||||
background-size:46px 46px;
|
|
||||||
background-position:0 0;
|
|
||||||
background-repeat:no-repeat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#metacodeOptions {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
.CardOnGraph .metacodeSelect {
|
.CardOnGraph .metacodeSelect {
|
||||||
display:none;
|
display:none;
|
||||||
width:auto;
|
width:auto;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
position: absolute;
|
|
||||||
background: #EAEAEA;
|
background: #EAEAEA;
|
||||||
left: 300px;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
position: absolute;
|
||||||
|
top: 48px;
|
||||||
|
box-shadow: 2px 2px 2px rgba(125, 125, 125, 0.23), -2px -1px 3px rgba(125, 125, 125, 0.16);
|
||||||
}
|
}
|
||||||
.CardOnGraph .metacodeSelect ul {
|
.CardOnGraph .metacodeSelect ul {
|
||||||
position: relative;
|
position: relative;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: helvetica, sans-serif;
|
font-family: helvetica, sans-serif;
|
||||||
|
@ -610,11 +613,10 @@ background-color: #E0E0E0;
|
||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
.CardOnGraph .tip {
|
.CardOnGraph .tip {
|
||||||
display:none;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: black;
|
background: $mid-gray;
|
||||||
top: 35px;
|
top: 35px;
|
||||||
left: 0;
|
right: 0;
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-size:15px !important;
|
font-size:15px !important;
|
||||||
|
@ -623,26 +625,23 @@ background-color: #E0E0E0;
|
||||||
z-index:100;
|
z-index:100;
|
||||||
}
|
}
|
||||||
|
|
||||||
#embedlyLink {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#embedlyLinkLoader {
|
#embedlyLinkLoader {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 28px;
|
width: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CardOnGraph .attachments {
|
.CardOnGraph .link-adder {
|
||||||
border-top: 1px solid #BDBDBD;
|
|
||||||
width:100%;
|
width:100%;
|
||||||
height:47px;
|
height:47px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachments a {
|
.link-adder a {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: block;
|
display: block;
|
||||||
margin-left: 40px;
|
margin-left: 40px;
|
||||||
padding-top:9px;
|
padding-top:9px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
|
@ -652,7 +651,7 @@ background-color: #E0E0E0;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 102px;
|
width: 102px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 18px 0 18px 48px;
|
padding: 18px 0 18px 48px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #9e9e9e;
|
color: #9e9e9e;
|
||||||
|
@ -696,9 +695,9 @@ background-color: #E0E0E0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#addLinkInput input{
|
#addLinkInput input{
|
||||||
padding: 9px 7px 9px 31px;
|
padding: 9px 27px 9px 31px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
width: 198px;
|
width: 210px;
|
||||||
margin: 0 0 0 0;
|
margin: 0 0 0 0;
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
@ -752,7 +751,6 @@ font-family: 'din-regular', helvetica, sans-serif;
|
||||||
-moz-border-radius-bottomright: 8px;
|
-moz-border-radius-bottomright: 8px;
|
||||||
-webkit-border-bottom-right-radius: 8px;
|
-webkit-border-bottom-right-radius: 8px;
|
||||||
border-bottom-right-radius: 8px;
|
border-bottom-right-radius: 8px;
|
||||||
display: none;
|
|
||||||
margin: 8px;
|
margin: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -839,10 +837,10 @@ font-family: 'din-regular', helvetica, sans-serif;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.canEdit #edit_synapse_desc:hover {
|
.canEdit span.titleWrapper:hover {
|
||||||
background-image: url(<%= asset_data_uri('edit.png') %>);
|
background-image: url(<%= asset_data_uri('edit.png') %>);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: 164px center;
|
background-position: 95% 95%;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,11 +948,11 @@ font-family: 'din-regular', helvetica, sans-serif;
|
||||||
}
|
}
|
||||||
#edit_synapse_right {
|
#edit_synapse_right {
|
||||||
background-image: url(<%= asset_data_uri('synapsedirectionright_sprite.png') %>);
|
background-image: url(<%= asset_data_uri('synapsedirectionright_sprite.png') %>);
|
||||||
right: 16px;
|
right: 16px;
|
||||||
}
|
}
|
||||||
#edit_synapse_left {
|
#edit_synapse_left {
|
||||||
background-image: url(<%= asset_data_uri('synapsedirectionleft_sprite.png') %>);
|
background-image: url(<%= asset_data_uri('synapsedirectionleft_sprite.png') %>);
|
||||||
right: 56px;
|
right: 56px;
|
||||||
}
|
}
|
||||||
#edit_synapse_left.checked, #edit_synapse_right.checked {
|
#edit_synapse_left.checked, #edit_synapse_right.checked {
|
||||||
background-position: 0 -48px;
|
background-position: 0 -48px;
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-top: 92px;
|
padding-top: 92px;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*.animations {
|
/*.animations {
|
||||||
|
@ -46,26 +47,9 @@
|
||||||
transition-timing-function: ease-in-out;
|
transition-timing-function: ease-in-out;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
.mapElement {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.mapPage .mapElement,
|
|
||||||
.topicPage .mapElement {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.mapPage .mapElementHidden,
|
|
||||||
.topicPage .mapElement.mapInfoBox,
|
|
||||||
.topicPage .mapElement.importDialog {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
.topicPage .starMap {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* loading */
|
/* loading */
|
||||||
|
|
||||||
#loading {
|
#loading {
|
||||||
display: none;
|
|
||||||
width: 28px;
|
width: 28px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -184,10 +168,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.upperRightMapButtons {
|
.upperRightMapButtons {
|
||||||
top: -42px; /* puts it just offscreen */
|
right: 138px;
|
||||||
|
padding-right: 7px;
|
||||||
|
border-right: 1px solid #747474;
|
||||||
}
|
}
|
||||||
.mapPage .upperRightMapButtons, .topicPage .upperRightMapButtons {
|
.unauthenticated .upperRightMapButtons {
|
||||||
top: 0;
|
right: 115px;
|
||||||
|
padding-right: 0;
|
||||||
|
border-right: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upperRightIcon {
|
.upperRightIcon {
|
||||||
|
@ -197,13 +185,7 @@
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.mapPage .mapElement .importDialog {
|
|
||||||
display: none;
|
|
||||||
background-position: 0 0;
|
|
||||||
}
|
|
||||||
.mapPage.canEditMap .mapElement .importDialog {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.sidebarFilterIcon {
|
.sidebarFilterIcon {
|
||||||
background-position: -32px 0;
|
background-position: -32px 0;
|
||||||
}
|
}
|
||||||
|
@ -236,6 +218,14 @@
|
||||||
|
|
||||||
/* end upperRightUI */
|
/* end upperRightUI */
|
||||||
|
|
||||||
|
/* map wrapper */
|
||||||
|
.mapWrapper {
|
||||||
|
position:absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* end map wrapper */
|
||||||
|
|
||||||
/* yield */
|
/* yield */
|
||||||
|
|
||||||
|
@ -356,22 +346,15 @@
|
||||||
|
|
||||||
/* infoAndHelp */
|
/* infoAndHelp */
|
||||||
|
|
||||||
.mapPage .infoAndHelp, .topicPage .infoAndHelp {
|
.openCheatsheet .tooltipsAbove {
|
||||||
right: 70px;
|
|
||||||
}
|
|
||||||
.mapPage .openCheatsheet .tooltipsAbove, .topicPage .openCheatsheet .tooltipsAbove {
|
|
||||||
right: 1px;
|
right: 1px;
|
||||||
left: auto;
|
left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unauthenticated .homePage .infoAndHelp {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.infoAndHelp {
|
.infoAndHelp {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
right: 20px;
|
right: 70px;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
width: auto;
|
width: auto;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
@ -392,16 +375,12 @@
|
||||||
}
|
}
|
||||||
.mapInfoIcon {
|
.mapInfoIcon {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 56px; /* puts it just offscreen */
|
background-image: url(<%= asset_path('mapinfo_sprite.png') %>);
|
||||||
background-image: url(<%= asset_path('mapinfo_sprite.png') %>);
|
background-repeat:no-repeat;
|
||||||
background-repeat:no-repeat;
|
|
||||||
}
|
}
|
||||||
.mapInfoIcon:hover {
|
.mapInfoIcon:hover {
|
||||||
background-position: 0 -32px;
|
background-position: 0 -32px;
|
||||||
}
|
}
|
||||||
.mapPage .mapInfoIcon {
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.starMap {
|
.starMap {
|
||||||
background-image: url(<%= asset_path('starmap_sprite.png') %>);
|
background-image: url(<%= asset_path('starmap_sprite.png') %>);
|
||||||
|
@ -419,9 +398,6 @@
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unauthenticated .mapPage .starMap {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
/* end infoAndHelp */
|
/* end infoAndHelp */
|
||||||
|
|
||||||
|
|
||||||
|
@ -430,24 +406,17 @@
|
||||||
.mapControls {
|
.mapControls {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 24px;
|
bottom: 24px;
|
||||||
right:-32px; /* puts it just offscreen */
|
right:24px;
|
||||||
width:32px;
|
width:32px;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
.mapPage .mapControls, .topicPage .mapControls {
|
|
||||||
right: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.topicPage .zoomExtents {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mapControl {
|
.mapControl {
|
||||||
width:32px;
|
width:32px;
|
||||||
height:32px;
|
height:32px;
|
||||||
background-color: #424242;
|
background-color: #424242;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,19 +424,6 @@
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.takeScreenshot {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
background-image: url(<%= asset_path 'screenshot_sprite.png' %>);
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.takeScreenshot:hover {
|
|
||||||
background-position: -32px 0;
|
|
||||||
}
|
|
||||||
.canEditMap .takeScreenshot {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.zoomExtents {
|
.zoomExtents {
|
||||||
margin-bottom:5px;
|
margin-bottom:5px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
@ -478,7 +434,7 @@
|
||||||
background-position: -32px 0;
|
background-position: -32px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.zoomExtents:hover .tooltips, .zoomIn:hover .tooltips, .zoomOut:hover .tooltips, .takeScreenshot:hover .tooltips, .sidebarFilterIcon:hover .tooltipsUnder, .sidebarForkIcon:hover .tooltipsUnder, .notificationsIcon:hover .tooltipsUnder, .addMap:hover .tooltipsUnder, .authenticated .sidebarAccountIcon:hover .tooltipsUnder,
|
.zoomExtents:hover .tooltips, .zoomIn:hover .tooltips, .zoomOut:hover .tooltips, .sidebarFilterIcon:hover .tooltipsUnder, .sidebarForkIcon:hover .tooltipsUnder, .notificationsIcon:hover .tooltipsUnder, .addMap:hover .tooltipsUnder, .authenticated .sidebarAccountIcon:hover .tooltipsUnder,
|
||||||
.mapInfoIcon:hover .tooltipsAbove, .openCheatsheet:hover .tooltipsAbove, .chat-button:hover .tooltips, .importDialog:hover .tooltipsUnder, .starMap:hover .tooltipsAbove, .openMetacodeSwitcher:hover .tooltipsAbove, .pinCarousel:not(.isPinned):hover .tooltipsAbove.helpPin, .pinCarousel.isPinned:hover .tooltipsAbove.helpUnpin {
|
.mapInfoIcon:hover .tooltipsAbove, .openCheatsheet:hover .tooltipsAbove, .chat-button:hover .tooltips, .importDialog:hover .tooltipsUnder, .starMap:hover .tooltipsAbove, .openMetacodeSwitcher:hover .tooltipsAbove, .pinCarousel:not(.isPinned):hover .tooltipsAbove.helpPin, .pinCarousel.isPinned:hover .tooltipsAbove.helpUnpin {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
@ -600,16 +556,12 @@
|
||||||
left: -8px;
|
left: -8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.openCheatsheet .tooltipsAbove {
|
|
||||||
left: -4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebarAccountIcon .tooltipsUnder {
|
.sidebarAccountIcon .tooltipsUnder {
|
||||||
margin-left: -12px;
|
margin-left: -12px;
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.zoomExtents div::after, .zoomIn div::after, .zoomOut div::after, .takeScreenshot div:after, .chat-button div.tooltips::after {
|
.zoomExtents div::after, .zoomIn div::after, .zoomOut div::after, .chat-button div.tooltips::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 57%;
|
top: 57%;
|
||||||
|
@ -684,8 +636,11 @@
|
||||||
|
|
||||||
/* explore maps */
|
/* explore maps */
|
||||||
|
|
||||||
#explore {
|
#react-app {
|
||||||
display: none;
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#exploreMaps {
|
#exploreMaps {
|
||||||
|
@ -704,23 +659,28 @@
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.appsPage #exploreMapsHeader {
|
.requestInviteHeader {
|
||||||
display: block;
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
z-index:2;
|
||||||
|
background-color:#FAFAFA;
|
||||||
|
height: 52px;
|
||||||
|
box-shadow: 0px 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16);
|
||||||
}
|
}
|
||||||
|
|
||||||
#exploreMapsHeader {
|
#navBar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exploreMapsBar {
|
.navBarContainer {
|
||||||
z-index:2;
|
z-index:2;
|
||||||
background-color:#FAFAFA;
|
background-color:#FAFAFA;
|
||||||
height: 42px;
|
height: 42px;
|
||||||
padding-top: 52px;
|
padding-top: 52px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exploreMapsMenu {
|
.navBarMenu {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height:42px;
|
height:42px;
|
||||||
|
@ -729,30 +689,29 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exploreMapsCenter {
|
.navBarCenter {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exploreMapsButton {
|
.navBarButton {
|
||||||
color: #757575;
|
color: #757575;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-family: 'din-medium';
|
font-family: 'din-medium';
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
height: 14px;
|
padding: 0 8px;
|
||||||
padding: 14px 8px 12px 40px;
|
border-bottom: 2px solid rgba(0,0,0,0);
|
||||||
border-bottom: 2px solid rgba(0,0,0,0);
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position:relative;
|
position:relative;
|
||||||
}
|
}
|
||||||
.exploreMapsButton:hover, .exploreMapsButton.active {
|
.navBarButton:hover, .navBarButton.active {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #424242;
|
color: #424242;
|
||||||
border-bottom: 2px solid #00BCD4;
|
border-bottom: 2px solid #00BCD4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exploreMapsButton.mapperButton {
|
.navBarButton.mapperButton {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
@ -769,62 +728,69 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.exploreMapsButton .exploreMapsIcon {
|
.navBarButton .navBarIcon {
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
width:32px;
|
width:32px;
|
||||||
height:32px;
|
height:32px;
|
||||||
position:absolute;
|
margin-top:5px;
|
||||||
top:5px;
|
margin-left:5px;
|
||||||
left:5px;
|
margin-right: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exploreMapsCenter .authedApps .exploreMapsIcon {
|
.navBarLinkText {
|
||||||
|
padding: 11px 0 12px 0;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navBarCenter .authedApps .navBarIcon {
|
||||||
background-image: url(<%= asset_path('user_sprite.png') %>);
|
background-image: url(<%= asset_path('user_sprite.png') %>);
|
||||||
background-position: 0 -32px;
|
background-position: 0 -32px;
|
||||||
}
|
}
|
||||||
.exploreMapsCenter .myMaps .exploreMapsIcon {
|
.navBarCenter .myMaps .navBarIcon {
|
||||||
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
||||||
background-position: -32px 0;
|
background-position: -32px 0;
|
||||||
}
|
}
|
||||||
.exploreMapsCenter .sharedMaps .exploreMapsIcon {
|
.navBarCenter .sharedMaps .navBarIcon {
|
||||||
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
||||||
background-position: -128px 0;
|
background-position: -128px 0;
|
||||||
}
|
}
|
||||||
.exploreMapsCenter .activeMaps .exploreMapsIcon {
|
.navBarCenter .activeMaps .navBarIcon {
|
||||||
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
.exploreMapsCenter .featuredMaps .exploreMapsIcon {
|
.navBarCenter .featuredMaps .navBarIcon {
|
||||||
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
||||||
background-position: -96px 0;
|
background-position: -96px 0;
|
||||||
}
|
}
|
||||||
.exploreMapsCenter .starredMaps .exploreMapsIcon {
|
.navBarCenter .starredMaps .navBarIcon {
|
||||||
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
background-image: url(<%= asset_path 'exploremaps_sprite.png' %>);
|
||||||
background-position: -96px 0;
|
background-position: -96px 0;
|
||||||
}
|
}
|
||||||
.exploreMapsCenter .notificationsLink .exploreMapsIcon {
|
.navBarCenter .notificationsLink .navBarIcon {
|
||||||
background-image: url(<%= asset_path 'topright_sprite.png' %>);
|
background-image: url(<%= asset_path 'topright_sprite.png' %>);
|
||||||
background-position: -128px 0;
|
background-position: -128px 0;
|
||||||
}
|
}
|
||||||
.authedApps:hover .exploreMapsIcon, .authedApps.active .exploreMapsIcon {
|
.authedApps:hover .navBarIcon, .authedApps.active .navBarIcon {
|
||||||
background-position-x: -32px;
|
background-position-x: -32px;
|
||||||
}
|
}
|
||||||
.myMaps:hover .exploreMapsIcon, .myMaps.active .exploreMapsIcon {
|
.myMaps:hover .navBarIcon, .myMaps.active .navBarIcon {
|
||||||
background-position: -32px -32px;
|
background-position: -32px -32px;
|
||||||
}
|
}
|
||||||
.activeMaps:hover .exploreMapsIcon, .activeMaps.active .exploreMapsIcon {
|
.activeMaps:hover .navBarIcon, .activeMaps.active .navBarIcon {
|
||||||
background-position: 0 -32px;
|
background-position: 0 -32px;
|
||||||
}
|
}
|
||||||
.featuredMaps:hover .exploreMapsIcon, .featuredMaps.active .exploreMapsIcon {
|
.featuredMaps:hover .navBarIcon, .featuredMaps.active .navBarIcon {
|
||||||
background-position: -96px -32px;
|
background-position: -96px -32px;
|
||||||
}
|
}
|
||||||
.starredMaps:hover .exploreMapsIcon, .starredMaps.active .exploreMapsIcon {
|
.starredMaps:hover .navBarIcon, .starredMaps.active .navBarIcon {
|
||||||
background-position: -96px -32px;
|
background-position: -96px -32px;
|
||||||
}
|
}
|
||||||
.sharedMaps:hover .exploreMapsIcon, .sharedMaps.active .exploreMapsIcon {
|
.sharedMaps:hover .navBarIcon, .sharedMaps.active .navBarIcon {
|
||||||
background-position: -128px -32px;
|
background-position: -128px -32px;
|
||||||
}
|
}
|
||||||
.notificationsLink:hover .exploreMapsIcon, .notificationsLink.active .exploreMapsIcon {
|
.notificationsLink:hover .navBarIcon, .notificationsLink.active .navBarIcon {
|
||||||
background-position-y: -32px;
|
background-position-y: -32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -842,7 +808,6 @@
|
||||||
height: 80px;
|
height: 80px;
|
||||||
font-family: 'din-regular', helvetica, sans-serif;
|
font-family: 'din-regular', helvetica, sans-serif;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
display: none;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
@ -858,7 +823,6 @@
|
||||||
/* toast */
|
/* toast */
|
||||||
|
|
||||||
.toast {
|
.toast {
|
||||||
display: none;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
left: 20px;
|
left: 20px;
|
||||||
|
|
|
@ -98,21 +98,21 @@
|
||||||
top: 72px;
|
top: 72px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-box-wrapper {
|
|
||||||
height: 100%;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-box {
|
.chat-box {
|
||||||
position: relative;
|
position: absolute;
|
||||||
display: flex;
|
right: 0;
|
||||||
flex-direction: column;
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
width: 300px;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #424242;
|
background: #424242;
|
||||||
box-shadow: -8px 0px 16px 2px rgba(0, 0, 0, 0.23);
|
box-shadow: -8px 0px 16px 2px rgba(0, 0, 0, 0.23);
|
||||||
|
|
||||||
|
.chat-panel {
|
||||||
|
width: 300px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.chat-button {
|
.chat-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
#mobile_header {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width : 752px) and (min-width : 504px) {
|
@media only screen and (max-width : 752px) and (min-width : 504px) {
|
||||||
.sidebarSearch .tt-hint, .sidebarSearch .sidebarSearchField {
|
.sidebarSearch .tt-hint, .sidebarSearch .sidebarSearchField {
|
||||||
width: 160px !important;
|
width: 160px !important;
|
||||||
|
@ -36,7 +32,7 @@
|
||||||
|
|
||||||
/* Smartphones (portrait and landscape) ----------- the minimum space that two map cards can fit side by side */
|
/* Smartphones (portrait and landscape) ----------- the minimum space that two map cards can fit side by side */
|
||||||
@media only screen and (max-width : 504px) {
|
@media only screen and (max-width : 504px) {
|
||||||
.upperLeftUI, .upperRightUI, .openCheatsheet, .mapInfoIcon, .feedback-icon, .chat-box, #exploreMapsHeader {
|
.upperLeftUI, .upperRightUI, .openCheatsheet, .mapInfoIcon, .feedback-icon, .chat-box, #navBar {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,10 +47,6 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mobile_header {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.homeWrapper {
|
.homeWrapper {
|
||||||
width: 96%;
|
width: 96%;
|
||||||
padding: 0 2%;
|
padding: 0 2%;
|
||||||
|
@ -72,7 +64,7 @@
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
.homeVideo {
|
.homeVideo {
|
||||||
width: 100%;
|
width: 100% !important;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
.fullWidthWrapper.withPartners {
|
.fullWidthWrapper.withPartners {
|
||||||
|
@ -108,15 +100,23 @@
|
||||||
max-width: 360px;
|
max-width: 360px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wrapper .requestInvite {
|
.requestInviteHeader {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.requestInvite {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0;
|
height: calc(100% - 50px);
|
||||||
|
z-index: 1;
|
||||||
|
position: relative;
|
||||||
|
left: 0;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#exploreMaps > div {
|
#exploreMaps > div {
|
||||||
margin-top: 70px;
|
margin-top: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mapper {
|
.mapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 0 30px 0;
|
margin: 0 0 30px 0;
|
||||||
|
@ -217,6 +217,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-shadow: 0px 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16);
|
box-shadow: 0px 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu_icon {
|
#menu_icon {
|
||||||
|
@ -249,7 +250,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#mobile_menu {
|
#mobile_menu {
|
||||||
display: none;
|
|
||||||
background: #EEE;
|
background: #EEE;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
|
@ -257,10 +257,19 @@
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
box-shadow: 3px 3px 3px rgba(0,0,0,0.23), 3px 3px 3px rgba(0,0,0,0.16);
|
box-shadow: 3px 3px 3px rgba(0,0,0,0.23), 3px 3px 3px rgba(0,0,0,0.16);
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
padding: 10px;
|
padding: 7px 10px;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
font-family: 'din-regular', arial, sans-serif;
|
||||||
|
|
||||||
|
.sprite {
|
||||||
|
margin-right: 6px;
|
||||||
|
margin-top: -2px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
&.notifications {
|
&.notifications {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -274,16 +283,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* the mobile menu, even if it's been opened by a user, should
|
|
||||||
* not show up if they resize their browser back to full size
|
|
||||||
*/
|
|
||||||
@media only screen and (max-width : 504px) {
|
|
||||||
#mobile_menu.visible {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
li.mobileMenuUser {
|
li.mobileMenuUser {
|
||||||
border-bottom: 1px solid #BBB;
|
border-bottom: 1px solid #BBB;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
$notifications-border-color: #DDDDDD;
|
||||||
|
$notifications-hover-color: #F6F6F6;
|
||||||
$unread_notifications_dot_size: 8px;
|
$unread_notifications_dot_size: 8px;
|
||||||
|
|
||||||
.unread-notifications-dot {
|
.unread-notifications-dot {
|
||||||
width: $unread_notifications_dot_size;
|
width: $unread_notifications_dot_size;
|
||||||
height: $unread_notifications_dot_size;
|
height: $unread_notifications_dot_size;
|
||||||
|
@ -13,13 +16,72 @@ $unread_notifications_dot_size: 8px;
|
||||||
.notificationsIcon {
|
.notificationsIcon {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notificationsBox {
|
||||||
|
position: absolute;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 2px;
|
||||||
|
width: 350px;
|
||||||
|
right: 0;
|
||||||
|
top: 50px;
|
||||||
|
box-shadow: 0 3px 6px rgba(0,0,0,0.16);
|
||||||
|
border: 1px solid $notifications-border-color;
|
||||||
|
|
||||||
|
.notificationsBoxTriangle {
|
||||||
|
min-width: 0 !important;
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
right: 48px;
|
||||||
|
width: 20px !important;
|
||||||
|
height: 20px !important;
|
||||||
|
margin-left: -10px;
|
||||||
|
top: -11px;
|
||||||
|
border-left: 1px solid $notifications-border-color;
|
||||||
|
border-top: 1px solid $notifications-border-color;
|
||||||
|
border-bottom: 0 !important;
|
||||||
|
border-right: 0 !important;
|
||||||
|
background-color: #fff;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
-webkit-transform: rotate(45deg);
|
||||||
|
-ms-transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.notifications {
|
||||||
|
max-height: 500px;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
.notification {
|
||||||
|
font-size: 13px;
|
||||||
|
|
||||||
|
.notification-body {
|
||||||
|
border-bottom: 1px solid $notifications-border-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notificationsEmpty {
|
||||||
|
font-family: din-regular, helvetica, sans-serif;
|
||||||
|
margin: 50px 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notificationsBoxSeeAll {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
padding: 6px 0;
|
||||||
|
font-family: din-regular, helvetica, sans-serif;
|
||||||
|
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #333;
|
||||||
|
background: $notifications-hover-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.controller-notifications {
|
.controller-notifications {
|
||||||
ul.notifications {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notificationPage,
|
.notificationPage,
|
||||||
.notificationsPage {
|
.notificationsPage {
|
||||||
font-family: 'din-regular', Sans-Serif;
|
font-family: 'din-regular', Sans-Serif;
|
||||||
|
@ -47,92 +109,129 @@ $unread_notifications_dot_size: 8px;
|
||||||
.emptyInbox {
|
.emptyInbox {
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.notification {
|
|
||||||
padding: 10px;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: #F6F6F6;
|
|
||||||
|
|
||||||
.notification-read-unread {
|
.notificationPage {
|
||||||
display:block;
|
.thirty-two-avatar {
|
||||||
}
|
display: inline-block;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 16px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
.notification-date {
|
.button {
|
||||||
display: none;
|
line-height: 32px;
|
||||||
}
|
|
||||||
|
img {
|
||||||
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > a {
|
&.decline {
|
||||||
float: left;
|
background: #DB5D5D;
|
||||||
width: 85%;
|
&:hover {
|
||||||
box-sizing: border-box;
|
background: #DC4B4B;
|
||||||
padding-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-actor {
|
|
||||||
float: left;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 32px;
|
|
||||||
height: 32px;
|
|
||||||
border-radius: 16px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification-body {
|
|
||||||
margin-left: 50px;
|
|
||||||
|
|
||||||
.in-bold {
|
|
||||||
font-family: 'din-medium', Sans-Serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action {
|
|
||||||
background: #4fb5c0;
|
|
||||||
color: #FFF;
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 3px;
|
|
||||||
display: inline-block;
|
|
||||||
margin: 5px 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-date {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
right: 10px;
|
|
||||||
color: #607d8b;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 13px;
|
|
||||||
margin-top: -6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-read-unread {
|
|
||||||
display: none;
|
|
||||||
float: left;
|
|
||||||
width: 15%;
|
|
||||||
|
|
||||||
a {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
margin-top: -10px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.unread {
|
|
||||||
background: #EEE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
.notification-body {
|
||||||
|
p, div {
|
||||||
|
margin: 1em auto;
|
||||||
|
line-height: 20px;
|
||||||
.notificationPage .notification-body {
|
}
|
||||||
p, div {
|
}
|
||||||
margin: 1em auto;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.notifications {
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
|
li:nth-last-child(2) {
|
||||||
|
.notification-body {
|
||||||
|
border-bottom: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification {
|
||||||
|
padding: 10px 10px 0 10px;
|
||||||
|
position: relative;
|
||||||
|
font-family: 'din-regular', Sans-Serif;
|
||||||
|
|
||||||
|
&.unread {
|
||||||
|
background: #EEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: $notifications-hover-color;
|
||||||
|
|
||||||
|
.notification-read-unread {
|
||||||
|
display:block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-date {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > a {
|
||||||
|
float: left;
|
||||||
|
width: 85%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-actor {
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-body {
|
||||||
|
margin-left: 50px;
|
||||||
|
line-height: 20px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
|
||||||
|
.in-bold {
|
||||||
|
font-family: 'din-medium', Sans-Serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action {
|
||||||
|
background: #4fb5c0;
|
||||||
|
color: #FFF;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 3px;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 5px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-date {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: 10px;
|
||||||
|
color: #607d8b;
|
||||||
|
margin-top: -6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-read-unread {
|
||||||
|
display: none;
|
||||||
|
float: left;
|
||||||
|
width: 15%;
|
||||||
|
|
||||||
|
a, div {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -10px;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
.viewOnly {
|
.viewOnly {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
display: none;
|
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border: 1px solid #BDBDBD;
|
border: 1px solid #BDBDBD;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
@ -23,7 +22,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.requestNotice {
|
.requestNotice {
|
||||||
display: none;
|
display: inline-block;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,16 +41,6 @@
|
||||||
.requestNotAccepted {
|
.requestNotAccepted {
|
||||||
background-color: #c04f4f;
|
background-color: #c04f4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.sendRequest .requestAccess {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
&.sentRequest .requestPending {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
&.requestDenied .requestNotAccepted {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.request_access {
|
.request_access {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ApplicationCable
|
module ApplicationCable
|
||||||
class Channel < ActionCable::Channel::Base
|
class Channel < ActionCable::Channel::Base
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ApplicationCable
|
module ApplicationCable
|
||||||
class Connection < ActionCable::Connection::Base
|
class Connection < ActionCable::Connection::Base
|
||||||
identified_by :current_user
|
identified_by :current_user
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MapChannel < ApplicationCable::Channel
|
class MapChannel < ApplicationCable::Channel
|
||||||
# Called when the consumer has successfully
|
# Called when the consumer has successfully
|
||||||
# become a subscriber of this channel.
|
# become a subscriber of this channel.
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class AccessController < ApplicationController
|
class AccessController < ApplicationController
|
||||||
before_action :require_user, only: [:access, :access_request,
|
before_action :require_user, only: %i[access access_request
|
||||||
:approve_access, :approve_access_post,
|
approve_access approve_access_post
|
||||||
:deny_access, :deny_access_post, :request_access]
|
deny_access deny_access_post request_access]
|
||||||
before_action :set_map, only: [:access, :access_request,
|
before_action :set_map, only: %i[access access_request
|
||||||
:approve_access, :approve_access_post,
|
approve_access approve_access_post
|
||||||
:deny_access, :deny_access_post, :request_access]
|
deny_access deny_access_post request_access]
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
|
|
||||||
# GET maps/:id/request_access
|
# GET maps/:id/request_access
|
||||||
|
@ -20,9 +21,7 @@ class AccessController < ApplicationController
|
||||||
|
|
||||||
# POST maps/:id/access_request
|
# POST maps/:id/access_request
|
||||||
def access_request
|
def access_request
|
||||||
request = AccessRequest.create(user: current_user, map: @map)
|
AccessRequest.create(user: current_user, map: @map)
|
||||||
NotificationService.access_request(request)
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json { head :ok }
|
format.json { head :ok }
|
||||||
end
|
end
|
||||||
|
@ -32,12 +31,7 @@ class AccessController < ApplicationController
|
||||||
def access
|
def access
|
||||||
user_ids = params[:access].to_a.map(&:to_i) || []
|
user_ids = params[:access].to_a.map(&:to_i) || []
|
||||||
|
|
||||||
@map.add_new_collaborators(user_ids).each do |user_id|
|
@map.add_new_collaborators(user_ids)
|
||||||
# add_new_collaborators returns array of added users,
|
|
||||||
# who we then send a notification to
|
|
||||||
user = User.find(user_id)
|
|
||||||
NotificationService.invite_to_edit(@map, current_user, user)
|
|
||||||
end
|
|
||||||
@map.remove_old_collaborators(user_ids)
|
@map.remove_old_collaborators(user_ids)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -68,6 +62,7 @@ class AccessController < ApplicationController
|
||||||
request = AccessRequest.find(params[:request_id])
|
request = AccessRequest.find(params[:request_id])
|
||||||
request.approve
|
request.approve
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
format.json do
|
format.json do
|
||||||
head :ok
|
head :ok
|
||||||
end
|
end
|
||||||
|
@ -79,6 +74,7 @@ class AccessController < ApplicationController
|
||||||
request = AccessRequest.find(params[:request_id])
|
request = AccessRequest.find(params[:request_id])
|
||||||
request.deny
|
request.deny
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
format.json do
|
format.json do
|
||||||
head :ok
|
head :ok
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V1
|
module V1
|
||||||
class DeprecatedController < ApplicationController
|
class DeprecatedController < ApplicationController
|
||||||
|
|
|
@ -1,31 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class MappingsController < RestfulController
|
class MappingsController < WithUpdatesController
|
||||||
def searchable_columns
|
def searchable_columns
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
|
||||||
instantiate_resource
|
|
||||||
resource.user = current_user if current_user.present?
|
|
||||||
resource.updated_by = current_user if current_user.present?
|
|
||||||
authorize resource
|
|
||||||
create_action
|
|
||||||
respond_with_resource
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
resource.updated_by = current_user if current_user.present?
|
|
||||||
update_action
|
|
||||||
respond_with_resource
|
|
||||||
end
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
resource.updated_by = current_user if current_user.present?
|
|
||||||
destroy_action
|
|
||||||
head :no_content
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class MapsController < RestfulController
|
class MapsController < WithUpdatesController
|
||||||
def searchable_columns
|
def searchable_columns
|
||||||
[:name, :desc]
|
%i[name desc]
|
||||||
end
|
end
|
||||||
|
|
||||||
def apply_filters(collection)
|
def apply_filters(collection)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class MetacodesController < RestfulController
|
class MetacodesController < RestfulController
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class RestfulController < ActionController::Base
|
class RestfulController < ActionController::Base
|
||||||
include Pundit
|
include Pundit
|
||||||
include PunditExtra
|
include PunditExtra
|
||||||
|
|
||||||
protect_from_forgery with: :exception
|
|
||||||
snorlax_used_rest!
|
snorlax_used_rest!
|
||||||
|
|
||||||
before_action :load_resource, only: [:show, :update, :destroy]
|
before_action :load_resource, only: %i[show update destroy]
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -46,7 +46,7 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_user
|
def current_user
|
||||||
token_user || doorkeeper_user || super
|
token_user || doorkeeper_user
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_resource
|
def load_resource
|
||||||
|
@ -92,7 +92,7 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def doorkeeper_user
|
def doorkeeper_user
|
||||||
return unless doorkeeper_token.present?
|
return if doorkeeper_token.blank?
|
||||||
doorkeeper_render_error unless valid_doorkeeper_token?
|
doorkeeper_render_error unless valid_doorkeeper_token?
|
||||||
@doorkeeper_user ||= User.find(doorkeeper_token.resource_owner_id)
|
@doorkeeper_user ||= User.find(doorkeeper_token.resource_owner_id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class SessionsController < ApplicationController
|
class SessionsController < ApplicationController
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class StarsController < RestfulController
|
class StarsController < RestfulController
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class SynapsesController < RestfulController
|
class SynapsesController < WithUpdatesController
|
||||||
def searchable_columns
|
def searchable_columns
|
||||||
[:desc]
|
[:desc]
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class TokensController < RestfulController
|
class TokensController < RestfulController
|
||||||
|
protect_from_forgery
|
||||||
|
|
||||||
def searchable_columns
|
def searchable_columns
|
||||||
[:description]
|
[:description]
|
||||||
end
|
end
|
||||||
|
@ -18,6 +21,12 @@ module Api
|
||||||
create_action
|
create_action
|
||||||
respond_with_resource
|
respond_with_resource
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def current_user
|
||||||
|
token_user || doorkeeper_user || method(:current_user).super_method.super_method.call
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class TopicsController < RestfulController
|
class TopicsController < WithUpdatesController
|
||||||
def searchable_columns
|
def searchable_columns
|
||||||
[:name, :desc, :link]
|
%i[name desc link]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Api
|
module Api
|
||||||
module V2
|
module V2
|
||||||
class UsersController < RestfulController
|
class UsersController < RestfulController
|
||||||
def current
|
def current
|
||||||
|
raise Pundit::NotAuthorizedError if current_user.nil?
|
||||||
@user = current_user
|
@user = current_user
|
||||||
authorize @user
|
authorize @user
|
||||||
show # delegate to the normal show function
|
show # delegate to the normal show function
|
||||||
|
|
28
app/controllers/api/v2/with_updates_controller.rb
Normal file
28
app/controllers/api/v2/with_updates_controller.rb
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Api
|
||||||
|
module V2
|
||||||
|
class WithUpdatesController < RestfulController
|
||||||
|
def create
|
||||||
|
instantiate_resource
|
||||||
|
resource.user = current_user if current_user.present?
|
||||||
|
resource.updated_by = current_user if current_user.present?
|
||||||
|
authorize resource
|
||||||
|
create_action
|
||||||
|
respond_with_resource
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
resource.updated_by = current_user if current_user.present?
|
||||||
|
update_action
|
||||||
|
respond_with_resource
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
resource.updated_by = current_user if current_user.present?
|
||||||
|
destroy_action
|
||||||
|
head :no_content
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
include Pundit
|
include Pundit
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ExploreController < ApplicationController
|
class ExploreController < ApplicationController
|
||||||
before_action :require_authentication, only: [:mine, :shared, :starred]
|
before_action :require_authentication, only: %i[mine shared starred]
|
||||||
before_action :authorize_explore
|
before_action :authorize_explore
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
after_action :verify_policy_scoped
|
after_action :verify_policy_scoped
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# bad code that should be checked over before entering one of the
|
# bad code that should be checked over before entering one of the
|
||||||
# nice files from the right side of this repo
|
# nice files from the right side of this repo
|
||||||
class HacksController < ApplicationController
|
class HacksController < ApplicationController
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MainController < ApplicationController
|
class MainController < ApplicationController
|
||||||
before_action :authorize_main
|
before_action :authorize_main
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MappingsController < ApplicationController
|
class MappingsController < ApplicationController
|
||||||
before_action :require_user, only: [:create, :update, :destroy]
|
before_action :require_user, only: %i[create update destroy]
|
||||||
after_action :verify_authorized, except: :index
|
after_action :verify_authorized, except: :index
|
||||||
after_action :verify_policy_scoped, only: :index
|
after_action :verify_policy_scoped, only: :index
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ class MappingsController < ApplicationController
|
||||||
@mapping = Mapping.find(params[:id])
|
@mapping = Mapping.find(params[:id])
|
||||||
authorize @mapping
|
authorize @mapping
|
||||||
@mapping.updated_by = current_user
|
@mapping.updated_by = current_user
|
||||||
|
@mapping.map.updated_by = current_user
|
||||||
@mapping.assign_attributes(mapping_params)
|
@mapping.assign_attributes(mapping_params)
|
||||||
|
|
||||||
if @mapping.save
|
if @mapping.save
|
||||||
|
@ -47,6 +49,7 @@ class MappingsController < ApplicationController
|
||||||
@mapping = Mapping.find(params[:id])
|
@mapping = Mapping.find(params[:id])
|
||||||
authorize @mapping
|
authorize @mapping
|
||||||
@mapping.updated_by = current_user
|
@mapping.updated_by = current_user
|
||||||
|
@mapping.map.updated_by = current_user
|
||||||
@mapping.destroy
|
@mapping.destroy
|
||||||
|
|
||||||
head :no_content
|
head :no_content
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MapsController < ApplicationController
|
class MapsController < ApplicationController
|
||||||
before_action :require_user, only: [:create, :update, :destroy, :events]
|
before_action :require_user, only: %i[create update destroy events follow unfollow]
|
||||||
before_action :set_map, only: [:show, :conversation, :update, :destroy, :contains, :events, :export]
|
before_action :set_map, only: %i[show conversation update destroy
|
||||||
|
contains events export
|
||||||
|
follow unfollow unfollow_from_email]
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
|
|
||||||
# GET maps/:id
|
# GET maps/:id
|
||||||
|
@ -23,7 +26,7 @@ class MapsController < ApplicationController
|
||||||
format.ttl { redirect_to action: :export, format: :ttl }
|
format.ttl { redirect_to action: :export, format: :ttl }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET maps/:id/conversation
|
# GET maps/:id/conversation
|
||||||
def conversation
|
def conversation
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -59,6 +62,7 @@ class MapsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@map = Map.new(create_map_params)
|
@map = Map.new(create_map_params)
|
||||||
@map.user = current_user
|
@map.user = current_user
|
||||||
|
@map.updated_by = current_user
|
||||||
@map.arranged = false
|
@map.arranged = false
|
||||||
authorize @map
|
authorize @map
|
||||||
|
|
||||||
|
@ -79,8 +83,11 @@ class MapsController < ApplicationController
|
||||||
|
|
||||||
# PUT maps/:id
|
# PUT maps/:id
|
||||||
def update
|
def update
|
||||||
|
@map.updated_by = current_user
|
||||||
|
@map.assign_attributes(update_map_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @map.update_attributes(update_map_params)
|
if @map.save
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
format.json { render json: @map.errors, status: :unprocessable_entity }
|
format.json { render json: @map.errors, status: :unprocessable_entity }
|
||||||
|
@ -90,7 +97,8 @@ class MapsController < ApplicationController
|
||||||
|
|
||||||
# DELETE maps/:id
|
# DELETE maps/:id
|
||||||
def destroy
|
def destroy
|
||||||
@map.delete
|
@map.updated_by = current_user
|
||||||
|
@map.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json do
|
format.json do
|
||||||
|
@ -133,6 +141,43 @@ class MapsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# POST maps/:id/follow
|
||||||
|
def follow
|
||||||
|
follow = FollowService.follow(@map, current_user, 'followed')
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.json do
|
||||||
|
if follow
|
||||||
|
head :ok
|
||||||
|
else
|
||||||
|
head :bad_request
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# POST maps/:id/unfollow
|
||||||
|
def unfollow
|
||||||
|
FollowService.unfollow(@map, current_user)
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.json do
|
||||||
|
head :ok
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET maps/:id/unfollow_from_email
|
||||||
|
def unfollow_from_email
|
||||||
|
FollowService.unfollow(@map, current_user)
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html do
|
||||||
|
redirect_to map_path(@map), notice: 'You are no longer following this map'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_map
|
def set_map
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MessagesController < ApplicationController
|
class MessagesController < ApplicationController
|
||||||
before_action :require_user, except: [:show]
|
before_action :require_user, except: [:show]
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MetacodeSetsController < ApplicationController
|
class MetacodeSetsController < ApplicationController
|
||||||
before_action :require_admin
|
before_action :require_admin
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MetacodesController < ApplicationController
|
class MetacodesController < ApplicationController
|
||||||
before_action :require_admin, except: [:index, :show]
|
before_action :require_admin, except: %i[index show]
|
||||||
before_action :set_metacode, only: [:edit, :update]
|
before_action :set_metacode, only: %i[edit update]
|
||||||
|
|
||||||
# GET /metacodes
|
# GET /metacodes
|
||||||
# GET /metacodes.json
|
# GET /metacodes.json
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class NotificationsController < ApplicationController
|
class NotificationsController < ApplicationController
|
||||||
before_action :set_receipts, only: [:index, :show, :mark_read, :mark_unread]
|
before_action :set_receipts, only: %i[index show mark_read mark_unread]
|
||||||
before_action :set_notification, only: [:show, :mark_read, :mark_unread]
|
before_action :set_notification, only: %i[show mark_read mark_unread]
|
||||||
before_action :set_receipt, only: [:show, :mark_read, :mark_unread]
|
before_action :set_receipt, only: %i[show mark_read mark_unread]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@notifications = current_user.mailbox.notifications.page(params[:page]).per(25)
|
@notifications = current_user.mailbox.notifications.page(params[:page]).per(25)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.json do
|
format.json do
|
||||||
render json: @notifications.map do |notification|
|
notifications = @notifications.map do |notification|
|
||||||
receipt = @receipts.find_by(notification_id: notification.id)
|
receipt = @receipts.find_by(notification_id: notification.id)
|
||||||
notification.as_json.merge(is_read: receipt.is_read)
|
NotificationDecorator.decorate(notification, receipt)
|
||||||
|
end
|
||||||
|
if !notifications.empty?
|
||||||
|
render json: notifications
|
||||||
|
else
|
||||||
|
render json: [].to_json
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -21,11 +26,20 @@ class NotificationsController < ApplicationController
|
||||||
def show
|
def show
|
||||||
@receipt.update(is_read: true)
|
@receipt.update(is_read: true)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html do
|
||||||
|
case @notification.notification_code
|
||||||
|
when MAP_ACCESS_APPROVED, MAP_INVITE_TO_EDIT
|
||||||
|
redirect_to map_path(@notification.notified_object.map)
|
||||||
|
when TOPIC_ADDED_TO_MAP
|
||||||
|
redirect_to map_path(@notification.notified_object.map)
|
||||||
|
when TOPIC_CONNECTED_1
|
||||||
|
redirect_to topic_path(@notification.notified_object.topic1)
|
||||||
|
when TOPIC_CONNECTED_2
|
||||||
|
redirect_to topic_path(@notification.notified_object.topic2)
|
||||||
|
end
|
||||||
|
end
|
||||||
format.json do
|
format.json do
|
||||||
render json: @notification.as_json.merge(
|
render json: NotificationDecorator.decorate(@notification, @receipt)
|
||||||
is_read: @receipt.is_read
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -35,9 +49,7 @@ class NotificationsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
format.json do
|
format.json do
|
||||||
render json: @notification.as_json.merge(
|
render json: NotificationDecorator.decorate(@notification, @receipt)
|
||||||
is_read: @receipt.is_read
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -47,9 +59,7 @@ class NotificationsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
format.json do
|
format.json do
|
||||||
render json: @notification.as_json.merge(
|
render json: NotificationDecorator.decorate(@notification, @receipt)
|
||||||
is_read: @receipt.is_read
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class SearchController < ApplicationController
|
class SearchController < ApplicationController
|
||||||
include TopicsHelper
|
include TopicsHelper
|
||||||
include MapsHelper
|
include MapsHelper
|
||||||
|
@ -7,7 +8,7 @@ class SearchController < ApplicationController
|
||||||
|
|
||||||
before_action :authorize_search
|
before_action :authorize_search
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
after_action :verify_policy_scoped, only: [:maps, :mappers, :synapses, :topics]
|
after_action :verify_policy_scoped, only: %i[maps mappers synapses topics]
|
||||||
|
|
||||||
# get /search/topics?term=SOMETERM
|
# get /search/topics?term=SOMETERM
|
||||||
def topics
|
def topics
|
||||||
|
@ -140,13 +141,13 @@ class SearchController < ApplicationController
|
||||||
topic1id = params[:topic1id]
|
topic1id = params[:topic1id]
|
||||||
topic2id = params[:topic2id]
|
topic2id = params[:topic2id]
|
||||||
|
|
||||||
if term && !term.empty?
|
if term.present?
|
||||||
@synapses = policy_scope(Synapse)
|
@synapses = policy_scope(Synapse)
|
||||||
.where('LOWER("desc") like ?', '%' + term.downcase.strip + '%')
|
.where('LOWER("desc") like ?', '%' + term.downcase.strip + '%')
|
||||||
.order('"desc"')
|
.order('"desc"')
|
||||||
|
|
||||||
@synapses = @synapses.uniq(&:desc)
|
@synapses = @synapses.uniq(&:desc)
|
||||||
elsif topic1id && !topic1id.empty?
|
elsif topic1id.present?
|
||||||
one = policy_scope(Synapse).where(topic1_id: topic1id, topic2_id: topic2id)
|
one = policy_scope(Synapse).where(topic1_id: topic1id, topic2_id: topic2id)
|
||||||
two = policy_scope(Synapse).where(topic2_id: topic1id, topic1_id: topic2id)
|
two = policy_scope(Synapse).where(topic2_id: topic1id, topic1_id: topic2id)
|
||||||
@synapses = one + two
|
@synapses = one + two
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class StarsController < ApplicationController
|
class StarsController < ApplicationController
|
||||||
before_action :require_user
|
before_action :require_user
|
||||||
before_action :set_map
|
before_action :set_map
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class SynapsesController < ApplicationController
|
class SynapsesController < ApplicationController
|
||||||
include TopicsHelper
|
include TopicsHelper
|
||||||
|
|
||||||
before_action :require_user, only: [:create, :update, :destroy]
|
before_action :require_user, only: %i[create update destroy]
|
||||||
after_action :verify_authorized, except: :index
|
after_action :verify_authorized, except: :index
|
||||||
after_action :verify_policy_scoped, only: :index
|
after_action :verify_policy_scoped, only: :index
|
||||||
|
|
||||||
|
@ -22,6 +23,8 @@ class SynapsesController < ApplicationController
|
||||||
@synapse = Synapse.new(synapse_params)
|
@synapse = Synapse.new(synapse_params)
|
||||||
@synapse.desc = '' if @synapse.desc.nil?
|
@synapse.desc = '' if @synapse.desc.nil?
|
||||||
@synapse.desc.strip! # no trailing/leading whitespace
|
@synapse.desc.strip! # no trailing/leading whitespace
|
||||||
|
@synapse.user = current_user
|
||||||
|
@synapse.updated_by = current_user
|
||||||
|
|
||||||
# we want invalid params to return :unprocessable_entity
|
# we want invalid params to return :unprocessable_entity
|
||||||
# so we have to authorize AFTER saving. But if authorize
|
# so we have to authorize AFTER saving. But if authorize
|
||||||
|
@ -47,9 +50,11 @@ class SynapsesController < ApplicationController
|
||||||
@synapse = Synapse.find(params[:id])
|
@synapse = Synapse.find(params[:id])
|
||||||
@synapse.desc = '' if @synapse.desc.nil?
|
@synapse.desc = '' if @synapse.desc.nil?
|
||||||
authorize @synapse
|
authorize @synapse
|
||||||
|
@synapse.updated_by = current_user
|
||||||
|
@synapse.assign_attributes(synapse_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @synapse.update_attributes(synapse_params)
|
if @synapse.save
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
format.json { render json: @synapse.errors, status: :unprocessable_entity }
|
format.json { render json: @synapse.errors, status: :unprocessable_entity }
|
||||||
|
@ -61,6 +66,7 @@ class SynapsesController < ApplicationController
|
||||||
def destroy
|
def destroy
|
||||||
@synapse = Synapse.find(params[:id])
|
@synapse = Synapse.find(params[:id])
|
||||||
authorize @synapse
|
authorize @synapse
|
||||||
|
@synapse.updated_by = current_user
|
||||||
@synapse.destroy
|
@synapse.destroy
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -72,7 +78,7 @@ class SynapsesController < ApplicationController
|
||||||
|
|
||||||
def synapse_params
|
def synapse_params
|
||||||
params.require(:synapse).permit(
|
params.require(:synapse).permit(
|
||||||
:id, :desc, :category, :weight, :permission, :topic1_id, :topic2_id, :user_id
|
:id, :desc, :category, :weight, :permission, :topic1_id, :topic2_id
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
10
app/controllers/tokens_controller.rb
Normal file
10
app/controllers/tokens_controller.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class TokensController < ApplicationController
|
||||||
|
before_action :require_user, only: [:new]
|
||||||
|
|
||||||
|
def new
|
||||||
|
@token = Token.new(user: current_user)
|
||||||
|
render :new, layout: false
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,8 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TopicsController < ApplicationController
|
class TopicsController < ApplicationController
|
||||||
include TopicsHelper
|
include TopicsHelper
|
||||||
|
|
||||||
before_action :require_user, only: [:create, :update, :destroy]
|
before_action :require_user, only: %i[create update destroy follow unfollow]
|
||||||
|
before_action :set_topic, only: %i[show update relative_numbers
|
||||||
|
relatives network destroy
|
||||||
|
follow unfollow unfollow_from_email]
|
||||||
after_action :verify_authorized, except: :autocomplete_topic
|
after_action :verify_authorized, except: :autocomplete_topic
|
||||||
|
|
||||||
respond_to :html, :js, :json
|
respond_to :html, :js, :json
|
||||||
|
@ -10,7 +14,7 @@ class TopicsController < ApplicationController
|
||||||
# GET /topics/autocomplete_topic
|
# GET /topics/autocomplete_topic
|
||||||
def autocomplete_topic
|
def autocomplete_topic
|
||||||
term = params[:term]
|
term = params[:term]
|
||||||
if term && !term.empty?
|
if term.present?
|
||||||
topics = policy_scope(Topic)
|
topics = policy_scope(Topic)
|
||||||
.where('LOWER("name") like ?', term.downcase + '%')
|
.where('LOWER("name") like ?', term.downcase + '%')
|
||||||
.order('"name"')
|
.order('"name"')
|
||||||
|
@ -31,9 +35,6 @@ class TopicsController < ApplicationController
|
||||||
|
|
||||||
# GET topics/:id
|
# GET topics/:id
|
||||||
def show
|
def show
|
||||||
@topic = Topic.find(params[:id])
|
|
||||||
authorize @topic
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html do
|
format.html do
|
||||||
@alltopics = [@topic].concat(policy_scope(Topic.relatives(@topic.id, current_user)).to_a)
|
@alltopics = [@topic].concat(policy_scope(Topic.relatives(@topic.id, current_user)).to_a)
|
||||||
|
@ -49,9 +50,6 @@ class TopicsController < ApplicationController
|
||||||
|
|
||||||
# GET topics/:id/network
|
# GET topics/:id/network
|
||||||
def network
|
def network
|
||||||
@topic = Topic.find(params[:id])
|
|
||||||
authorize @topic
|
|
||||||
|
|
||||||
@alltopics = [@topic].concat(policy_scope(Topic.relatives(@topic.id, current_user)).to_a)
|
@alltopics = [@topic].concat(policy_scope(Topic.relatives(@topic.id, current_user)).to_a)
|
||||||
@allsynapses = policy_scope(Synapse.for_topic(@topic.id))
|
@allsynapses = policy_scope(Synapse.for_topic(@topic.id))
|
||||||
|
|
||||||
|
@ -71,9 +69,6 @@ class TopicsController < ApplicationController
|
||||||
|
|
||||||
# GET topics/:id/relative_numbers
|
# GET topics/:id/relative_numbers
|
||||||
def relative_numbers
|
def relative_numbers
|
||||||
@topic = Topic.find(params[:id])
|
|
||||||
authorize @topic
|
|
||||||
|
|
||||||
topics_already_has = params[:network] ? params[:network].split(',').map(&:to_i) : []
|
topics_already_has = params[:network] ? params[:network].split(',').map(&:to_i) : []
|
||||||
|
|
||||||
alltopics = policy_scope(Topic.relatives(@topic.id, current_user)).to_a
|
alltopics = policy_scope(Topic.relatives(@topic.id, current_user)).to_a
|
||||||
|
@ -94,9 +89,6 @@ class TopicsController < ApplicationController
|
||||||
|
|
||||||
# GET topics/:id/relatives
|
# GET topics/:id/relatives
|
||||||
def relatives
|
def relatives
|
||||||
@topic = Topic.find(params[:id])
|
|
||||||
authorize @topic
|
|
||||||
|
|
||||||
topics_already_has = params[:network] ? params[:network].split(',').map(&:to_i) : []
|
topics_already_has = params[:network] ? params[:network].split(',').map(&:to_i) : []
|
||||||
|
|
||||||
alltopics = policy_scope(Topic.relatives(@topic.id, current_user)).to_a
|
alltopics = policy_scope(Topic.relatives(@topic.id, current_user)).to_a
|
||||||
|
@ -134,6 +126,8 @@ class TopicsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@topic = Topic.new(topic_params)
|
@topic = Topic.new(topic_params)
|
||||||
authorize @topic
|
authorize @topic
|
||||||
|
@topic.user = current_user
|
||||||
|
@topic.updated_by = current_user
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @topic.save
|
if @topic.save
|
||||||
|
@ -147,11 +141,11 @@ class TopicsController < ApplicationController
|
||||||
# PUT /topics/1
|
# PUT /topics/1
|
||||||
# PUT /topics/1.json
|
# PUT /topics/1.json
|
||||||
def update
|
def update
|
||||||
@topic = Topic.find(params[:id])
|
@topic.updated_by = current_user
|
||||||
authorize @topic
|
@topic.assign_attributes(topic_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @topic.update_attributes(topic_params)
|
if @topic.save
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
format.json { render json: @topic.errors, status: :unprocessable_entity }
|
format.json { render json: @topic.errors, status: :unprocessable_entity }
|
||||||
|
@ -161,18 +155,58 @@ class TopicsController < ApplicationController
|
||||||
|
|
||||||
# DELETE topics/:id
|
# DELETE topics/:id
|
||||||
def destroy
|
def destroy
|
||||||
@topic = Topic.find(params[:id])
|
@topic.updated_by = current_user
|
||||||
authorize @topic
|
|
||||||
|
|
||||||
@topic.destroy
|
@topic.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# POST topics/:id/follow
|
||||||
|
def follow
|
||||||
|
follow = FollowService.follow(@topic, current_user, 'followed')
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.json do
|
||||||
|
if follow
|
||||||
|
head :ok
|
||||||
|
else
|
||||||
|
head :bad_request
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# POST topics/:id/unfollow
|
||||||
|
def unfollow
|
||||||
|
FollowService.unfollow(@topic, current_user)
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.json do
|
||||||
|
head :ok
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET topics/:id/unfollow_from_email
|
||||||
|
def unfollow_from_email
|
||||||
|
FollowService.unfollow(@topic, current_user)
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html do
|
||||||
|
redirect_to topic_path(@topic), notice: 'You are no longer following this topic'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def set_topic
|
||||||
|
@topic = Topic.find(params[:id])
|
||||||
|
authorize @topic
|
||||||
|
end
|
||||||
|
|
||||||
def topic_params
|
def topic_params
|
||||||
params.require(:topic).permit(:id, :name, :desc, :link, :permission, :user_id, :metacode_id, :defer_to_map_id)
|
params.require(:topic).permit(:id, :name, :desc, :link, :permission, :metacode_id, :defer_to_map_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Users
|
module Users
|
||||||
class PasswordsController < Devise::PasswordsController
|
class PasswordsController < Devise::PasswordsController
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Users
|
module Users
|
||||||
class RegistrationsController < Devise::RegistrationsController
|
class RegistrationsController < Devise::RegistrationsController
|
||||||
before_action :configure_sign_up_params, only: [:create]
|
before_action :configure_sign_up_params, only: [:create]
|
||||||
|
@ -29,7 +30,7 @@ module Users
|
||||||
end
|
end
|
||||||
|
|
||||||
def configure_sign_up_params
|
def configure_sign_up_params
|
||||||
devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :joinedwithcode])
|
devise_parameter_sanitizer.permit(:sign_up, keys: %i[name joinedwithcode])
|
||||||
end
|
end
|
||||||
|
|
||||||
def configure_account_update_params
|
def configure_account_update_params
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Users
|
module Users
|
||||||
class SessionsController < Devise::SessionsController
|
class SessionsController < Devise::SessionsController
|
||||||
after_action :store_location, only: [:new]
|
after_action :store_location, only: [:new]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
before_action :require_user, only: [:edit, :update, :updatemetacodes, :update_metacode_focus]
|
before_action :require_user, only: %i[edit update updatemetacodes update_metacode_focus]
|
||||||
|
|
||||||
respond_to :html, :json
|
respond_to :html, :json
|
||||||
|
|
||||||
|
@ -23,14 +24,15 @@ class UsersController < ApplicationController
|
||||||
if user_params[:password] == '' && user_params[:password_confirmation] == ''
|
if user_params[:password] == '' && user_params[:password_confirmation] == ''
|
||||||
# not trying to change the password
|
# not trying to change the password
|
||||||
if @user.update_attributes(user_params.except(:password, :password_confirmation))
|
if @user.update_attributes(user_params.except(:password, :password_confirmation))
|
||||||
|
update_follow_settings(@user, params[:settings])
|
||||||
@user.image = nil if params[:remove_image] == '1'
|
@user.image = nil if params[:remove_image] == '1'
|
||||||
@user.save
|
@user.save
|
||||||
sign_in(@user, bypass: true)
|
bypass_sign_in(@user)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to root_url, notice: 'Account updated!' }
|
format.html { redirect_to root_url, notice: 'Settings updated' }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
sign_in(@user, bypass: true)
|
bypass_sign_in(@user)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to edit_user_path(@user), notice: @user.errors.to_a[0] }
|
format.html { redirect_to edit_user_path(@user), notice: @user.errors.to_a[0] }
|
||||||
end
|
end
|
||||||
|
@ -40,11 +42,12 @@ class UsersController < ApplicationController
|
||||||
correct_pass = @user.valid_password?(params[:current_password])
|
correct_pass = @user.valid_password?(params[:current_password])
|
||||||
|
|
||||||
if correct_pass && @user.update_attributes(user_params)
|
if correct_pass && @user.update_attributes(user_params)
|
||||||
|
update_follow_settings(@user, params[:settings])
|
||||||
@user.image = nil if params[:remove_image] == '1'
|
@user.image = nil if params[:remove_image] == '1'
|
||||||
@user.save
|
@user.save
|
||||||
sign_in(@user, bypass: true)
|
sign_in(@user, bypass: true)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to root_url, notice: 'Account updated!' }
|
format.html { redirect_to root_url, notice: 'Settings updated' }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -98,15 +101,22 @@ class UsersController < ApplicationController
|
||||||
@user.settings.metacode_focus = params[:value]
|
@user.settings.metacode_focus = params[:value]
|
||||||
@user.save
|
@user.save
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json { render json: { success: "success" }}
|
format.json { render json: { success: 'success' } }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def update_follow_settings(user, settings)
|
||||||
|
user.settings.follow_topic_on_created = settings[:follow_topic_on_created]
|
||||||
|
user.settings.follow_topic_on_contributed = settings[:follow_topic_on_contributed]
|
||||||
|
user.settings.follow_map_on_created = settings[:follow_map_on_created]
|
||||||
|
user.settings.follow_map_on_contributed = settings[:follow_map_on_contributed]
|
||||||
|
end
|
||||||
|
|
||||||
def user_params
|
def user_params
|
||||||
params.require(:user).permit(
|
params.require(:user).permit(
|
||||||
:name, :email, :image, :password, :password_confirmation, :emails_allowed
|
:name, :email, :image, :password, :password_confirmation, :emails_allowed, :settings
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
51
app/decorators/notification_decorator.rb
Normal file
51
app/decorators/notification_decorator.rb
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class NotificationDecorator
|
||||||
|
class << self
|
||||||
|
def decorate(notification, receipt)
|
||||||
|
result = {
|
||||||
|
id: notification.id,
|
||||||
|
type: notification.notification_code,
|
||||||
|
subject: notification.subject,
|
||||||
|
is_read: receipt.is_read,
|
||||||
|
created_at: notification.created_at,
|
||||||
|
actor: notification.sender,
|
||||||
|
data: {
|
||||||
|
object: notification.notified_object
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case notification.notification_code
|
||||||
|
when MAP_ACCESS_APPROVED, MAP_ACCESS_REQUEST, MAP_INVITE_TO_EDIT
|
||||||
|
map = notification.notified_object&.map
|
||||||
|
result[:data][:map] = {
|
||||||
|
id: map&.id,
|
||||||
|
name: map&.name
|
||||||
|
}
|
||||||
|
when TOPIC_ADDED_TO_MAP
|
||||||
|
topic = notification.notified_object&.eventable
|
||||||
|
map = notification.notified_object&.map
|
||||||
|
result[:data][:topic] = {
|
||||||
|
id: topic&.id,
|
||||||
|
name: topic&.name
|
||||||
|
}
|
||||||
|
result[:data][:map] = {
|
||||||
|
id: map&.id,
|
||||||
|
name: map&.name
|
||||||
|
}
|
||||||
|
when TOPIC_CONNECTED_1, TOPIC_CONNECTED_2
|
||||||
|
topic1 = notification.notified_object&.topic1
|
||||||
|
topic2 = notification.notified_object&.topic2
|
||||||
|
result[:data][:topic1] = {
|
||||||
|
id: topic1&.id,
|
||||||
|
name: topic1&.name
|
||||||
|
}
|
||||||
|
result[:data][:topic2] = {
|
||||||
|
id: topic2&.id,
|
||||||
|
name: topic2&.name
|
||||||
|
}
|
||||||
|
end
|
||||||
|
result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,55 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def metacodeset
|
|
||||||
metacodes = current_user.settings.metacodes
|
|
||||||
|
|
||||||
return false unless metacodes[0].include?('metacodeset')
|
|
||||||
return 'Most' if metacodes[0].sub('metacodeset-', '') == 'Most'
|
|
||||||
return 'Recent' if metacodes[0].sub('metacodeset-', '') == 'Recent'
|
|
||||||
|
|
||||||
MetacodeSet.find(metacodes[0].sub('metacodeset-', '').to_i)
|
|
||||||
end
|
|
||||||
|
|
||||||
def user_metacodes
|
|
||||||
@m = current_user.settings.metacodes
|
|
||||||
set = metacodeset
|
|
||||||
@metacodes = if set && set == 'Most'
|
|
||||||
Metacode.where(id: current_user.most_used_metacodes).to_a
|
|
||||||
elsif set && set == 'Recent'
|
|
||||||
Metacode.where(id: current_user.recent_metacodes).to_a
|
|
||||||
elsif set
|
|
||||||
set.metacodes.to_a
|
|
||||||
else
|
|
||||||
Metacode.where(id: @m).to_a
|
|
||||||
end
|
|
||||||
|
|
||||||
focus_code = user_metacode()
|
|
||||||
if focus_code != nil && @metacodes.index{|m| m.id == focus_code.id} == nil
|
|
||||||
@metacodes.push(focus_code)
|
|
||||||
end
|
|
||||||
|
|
||||||
@metacodes
|
|
||||||
.sort! { |m1, m2| m2.name.downcase <=> m1.name.downcase }
|
|
||||||
|
|
||||||
if focus_code != nil
|
|
||||||
@metacodes.rotate!(@metacodes.index{|m| m.id == focus_code.id})
|
|
||||||
else
|
|
||||||
@metacodes.rotate!(-1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def user_metacode
|
|
||||||
current_user.settings.metacode_focus ? Metacode.find(current_user.settings.metacode_focus.to_i) : nil
|
|
||||||
end
|
|
||||||
|
|
||||||
def user_most_used_metacodes
|
|
||||||
@metacodes = current_user.most_used_metacodes.map { |id| Metacode.find(id) }
|
|
||||||
end
|
|
||||||
|
|
||||||
def user_recent_metacodes
|
|
||||||
@metacodes = current_user.recent_metacodes.map { |id| Metacode.find(id) }
|
|
||||||
end
|
|
||||||
|
|
||||||
def invite_link
|
def invite_link
|
||||||
"#{request.base_url}/join" + (current_user ? "?code=#{current_user.code}" : '')
|
"#{request.base_url}/join" + (current_user ? "?code=#{current_user.code}" : '')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module ContentHelper
|
module ContentHelper
|
||||||
def resource_name
|
def resource_name
|
||||||
:user
|
:user
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module DeviseHelper
|
module DeviseHelper
|
||||||
def devise_error_messages!
|
def devise_error_messages!
|
||||||
resource.errors.to_a[0]
|
resource.errors.to_a[0]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module InMetacodeSetsHelper
|
module InMetacodeSetsHelper
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module MainHelper
|
module MainHelper
|
||||||
end
|
end
|
||||||
|
|
15
app/helpers/map_mailer_helper.rb
Normal file
15
app/helpers/map_mailer_helper.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module MapMailerHelper
|
||||||
|
def access_approved_subject(map)
|
||||||
|
map.name + ' - access approved'
|
||||||
|
end
|
||||||
|
|
||||||
|
def access_request_subject(map)
|
||||||
|
map.name + ' - request to edit'
|
||||||
|
end
|
||||||
|
|
||||||
|
def invite_to_edit_subject(map)
|
||||||
|
map.name + ' - invited to edit'
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,3 +1,4 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module MappingHelper
|
module MappingHelper
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module MapsHelper
|
module MapsHelper
|
||||||
# JSON autocomplete format for typeahead
|
# JSON autocomplete format for typeahead
|
||||||
def autocomplete_map_array_json(maps)
|
def autocomplete_map_array_json(maps)
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
module MetacodeSetsHelper
|
|
||||||
end
|
|
|
@ -1,3 +1,79 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module MetacodesHelper
|
module MetacodesHelper
|
||||||
|
def metacodeset
|
||||||
|
metacodes = current_user.settings.metacodes
|
||||||
|
|
||||||
|
return false unless metacodes[0].include?('metacodeset')
|
||||||
|
return 'Most' if metacodes[0].sub('metacodeset-', '') == 'Most'
|
||||||
|
return 'Recent' if metacodes[0].sub('metacodeset-', '') == 'Recent'
|
||||||
|
|
||||||
|
MetacodeSet.find(metacodes[0].sub('metacodeset-', '').to_i)
|
||||||
|
end
|
||||||
|
|
||||||
|
def user_metacodes
|
||||||
|
@m = current_user.settings.metacodes
|
||||||
|
set = metacodeset
|
||||||
|
@metacodes = if set && set == 'Most'
|
||||||
|
Metacode.where(id: current_user.most_used_metacodes).to_a
|
||||||
|
elsif set && set == 'Recent'
|
||||||
|
Metacode.where(id: current_user.recent_metacodes).to_a
|
||||||
|
elsif set
|
||||||
|
set.metacodes.to_a
|
||||||
|
else
|
||||||
|
Metacode.where(id: @m).to_a
|
||||||
|
end
|
||||||
|
|
||||||
|
focus_code = user_metacode
|
||||||
|
if !focus_code.nil? && @metacodes.index { |m| m.id == focus_code.id }.nil?
|
||||||
|
@metacodes.push(focus_code)
|
||||||
|
end
|
||||||
|
|
||||||
|
@metacodes.sort! { |m1, m2| m2.name.downcase <=> m1.name.downcase }
|
||||||
|
|
||||||
|
if !focus_code.nil?
|
||||||
|
@metacodes.rotate!(@metacodes.index { |m| m.id == focus_code.id })
|
||||||
|
else
|
||||||
|
@metacodes.rotate!(-1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def user_metacode
|
||||||
|
current_user.settings.metacode_focus ? Metacode.find(current_user.settings.metacode_focus.to_i) : nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def user_most_used_metacodes
|
||||||
|
@metacodes = current_user.most_used_metacodes.map { |id| Metacode.find(id) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def user_recent_metacodes
|
||||||
|
@metacodes = current_user.recent_metacodes.map { |id| Metacode.find(id) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def metacode_sets_json
|
||||||
|
metacode_sets = []
|
||||||
|
metacode_sets << {
|
||||||
|
name: 'Recently Used',
|
||||||
|
metacodes: user_recent_metacodes
|
||||||
|
.map { |m| { id: m.id, icon_path: asset_path(m.icon), name: m.name } }
|
||||||
|
}
|
||||||
|
metacode_sets << {
|
||||||
|
name: 'Most Used',
|
||||||
|
metacodes: user_most_used_metacodes
|
||||||
|
.map { |m| { id: m.id, icon_path: asset_path(m.icon), name: m.name } }
|
||||||
|
}
|
||||||
|
metacode_sets += MetacodeSet.order('name').all.map do |set|
|
||||||
|
{
|
||||||
|
name: set.name,
|
||||||
|
metacodes: set.metacodes.order('name')
|
||||||
|
.map { |m| { id: m.id, icon_path: asset_path(m.icon), name: m.name } }
|
||||||
|
}
|
||||||
|
end
|
||||||
|
metacode_sets << {
|
||||||
|
name: 'All',
|
||||||
|
metacodes: Metacode.order('name').all
|
||||||
|
.map { |m| { id: m.id, icon_path: asset_path(m.icon), name: m.name } }
|
||||||
|
}
|
||||||
|
metacode_sets.to_json
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module SynapsesHelper
|
module SynapsesHelper
|
||||||
## this one is for building our custom JSON autocomplete format for typeahead
|
## this one is for building our custom JSON autocomplete format for typeahead
|
||||||
def autocomplete_synapse_generic_json(unique)
|
def autocomplete_synapse_generic_json(unique)
|
||||||
|
|
11
app/helpers/topic_mailer_helper.rb
Normal file
11
app/helpers/topic_mailer_helper.rb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module TopicMailerHelper
|
||||||
|
def added_to_map_subject(topic, map)
|
||||||
|
topic.name + ' was added to map ' + map.name
|
||||||
|
end
|
||||||
|
|
||||||
|
def connected_subject(topic)
|
||||||
|
'new synapse to topic ' + topic.name
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module TopicsHelper
|
module TopicsHelper
|
||||||
## this one is for building our custom JSON autocomplete format for typeahead
|
## this one is for building our custom JSON autocomplete format for typeahead
|
||||||
def autocomplete_array_json(topics)
|
def autocomplete_array_json(topics)
|
||||||
|
@ -16,7 +17,7 @@ module TopicsHelper
|
||||||
|
|
||||||
rtype: is_map ? 'map' : 'topic',
|
rtype: is_map ? 'map' : 'topic',
|
||||||
inmaps: is_map ? [] : t.inmaps(current_user),
|
inmaps: is_map ? [] : t.inmaps(current_user),
|
||||||
inmapsLinks: is_map ? [] : t.inmapsLinks(current_user),
|
inmapsLinks: is_map ? [] : t.inmaps_links(current_user),
|
||||||
type: is_map ? metamap_metacode.name : t.metacode.name,
|
type: is_map ? metamap_metacode.name : t.metacode.name,
|
||||||
typeImageURL: is_map ? metamap_metacode.icon : t.metacode.icon,
|
typeImageURL: is_map ? metamap_metacode.icon : t.metacode.icon,
|
||||||
mapCount: is_map ? 0 : t.maps.count,
|
mapCount: is_map ? 0 : t.maps.count,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module UsersHelper
|
module UsersHelper
|
||||||
# build custom json autocomplete for typeahead
|
# build custom json autocomplete for typeahead
|
||||||
def autocomplete_user_array_json(users)
|
def autocomplete_user_array_json(users)
|
||||||
|
|
|
@ -1,23 +1,30 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ApplicationMailer < ActionMailer::Base
|
class ApplicationMailer < ActionMailer::Base
|
||||||
default from: 'team@metamaps.cc'
|
default from: 'team@metamaps.cc'
|
||||||
layout 'mailer'
|
layout 'mailer'
|
||||||
|
|
||||||
def deliver
|
|
||||||
raise NotImplementedError('Please use Mailboxer to send your emails.')
|
|
||||||
end
|
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def mail_for_notification(notification)
|
def mail_for_notification(notification)
|
||||||
if notification.notification_code == MAILBOXER_CODE_ACCESS_REQUEST
|
case notification.notification_code
|
||||||
|
when MAP_ACCESS_REQUEST
|
||||||
request = notification.notified_object
|
request = notification.notified_object
|
||||||
MapMailer.access_request_email(request)
|
MapMailer.access_request(request)
|
||||||
elsif notification.notification_code == MAILBOXER_CODE_ACCESS_APPROVED
|
when MAP_ACCESS_APPROVED
|
||||||
request = notification.notified_object
|
request = notification.notified_object
|
||||||
MapMailer.access_approved_email(request)
|
MapMailer.access_approved(request)
|
||||||
elsif notification.notification_code == MAILBOXER_CODE_INVITE_TO_EDIT
|
when MAP_INVITE_TO_EDIT
|
||||||
user_map = notification.notified_object
|
user_map = notification.notified_object
|
||||||
MapMailer.invite_to_edit_email(user_map.map, user_map.map.user, user_map.user)
|
MapMailer.invite_to_edit(user_map)
|
||||||
|
when TOPIC_ADDED_TO_MAP
|
||||||
|
event = notification.notified_object
|
||||||
|
TopicMailer.added_to_map(event, notification.recipients[0])
|
||||||
|
when TOPIC_CONNECTED_1
|
||||||
|
synapse = notification.notified_object
|
||||||
|
TopicMailer.connected(synapse, synapse.topic1, notification.recipients[0])
|
||||||
|
when TOPIC_CONNECTED_2
|
||||||
|
synapse = notification.notified_object
|
||||||
|
TopicMailer.connected(synapse, synapse.topic2, notification.recipients[0])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
12
app/mailers/map_activity_mailer.rb
Normal file
12
app/mailers/map_activity_mailer.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class MapActivityMailer < ApplicationMailer
|
||||||
|
default from: 'team@metamaps.cc'
|
||||||
|
|
||||||
|
def daily_summary(user, map, summary_data)
|
||||||
|
@user = user
|
||||||
|
@map = map
|
||||||
|
@summary_data = summary_data
|
||||||
|
mail(to: user.email, subject: MapActivityService.subject_line(map))
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,22 +1,24 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MapMailer < ApplicationMailer
|
class MapMailer < ApplicationMailer
|
||||||
|
include MapMailerHelper
|
||||||
default from: 'team@metamaps.cc'
|
default from: 'team@metamaps.cc'
|
||||||
|
|
||||||
def access_request_email(request)
|
def access_approved(request)
|
||||||
@request = request
|
@request = request
|
||||||
@map = request.map
|
@map = request.map
|
||||||
mail(to: @map.user.email, subject: request.requested_text)
|
mail(to: request.user.email, subject: access_approved_subject(@map))
|
||||||
end
|
end
|
||||||
|
|
||||||
def access_approved_email(request)
|
def access_request(request)
|
||||||
@request = request
|
@request = request
|
||||||
@map = request.map
|
@map = request.map
|
||||||
mail(to: request.user, subject: request.approved_text)
|
mail(to: @map.user.email, subject: access_request_subject(@map))
|
||||||
end
|
end
|
||||||
|
|
||||||
def invite_to_edit_email(map, inviter, invitee)
|
def invite_to_edit(user_map)
|
||||||
@inviter = inviter
|
@inviter = user_map.map.user
|
||||||
@map = map
|
@map = user_map.map
|
||||||
mail(to: invitee.email, subject: map.invited_text)
|
mail(to: user_map.user.email, subject: invite_to_edit_subject(@map))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
18
app/mailers/topic_mailer.rb
Normal file
18
app/mailers/topic_mailer.rb
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class TopicMailer < ApplicationMailer
|
||||||
|
include TopicMailerHelper
|
||||||
|
default from: 'team@metamaps.cc'
|
||||||
|
|
||||||
|
def added_to_map(event, user)
|
||||||
|
@entity = event.eventable
|
||||||
|
@event = event
|
||||||
|
mail(to: user.email, subject: added_to_map_subject(@entity, event.map))
|
||||||
|
end
|
||||||
|
|
||||||
|
def connected(synapse, topic, user)
|
||||||
|
@entity = topic
|
||||||
|
@event = synapse
|
||||||
|
mail(to: user.email, subject: connected_subject(topic))
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,7 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class AccessRequest < ApplicationRecord
|
class AccessRequest < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :map
|
belongs_to :map
|
||||||
|
has_one :user_map
|
||||||
|
|
||||||
|
after_create :after_created_async
|
||||||
|
|
||||||
def approve
|
def approve
|
||||||
self.approved = true
|
self.approved = true
|
||||||
|
@ -12,8 +16,7 @@ class AccessRequest < ApplicationRecord
|
||||||
Mailboxer::Receipt.where(notification: notification).update_all(is_read: true)
|
Mailboxer::Receipt.where(notification: notification).update_all(is_read: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
UserMap.create(user: user, map: map)
|
UserMap.create(user: user, map: map, access_request: self)
|
||||||
NotificationService.access_approved(self)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def deny
|
def deny
|
||||||
|
@ -26,11 +29,10 @@ class AccessRequest < ApplicationRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def requested_text
|
protected
|
||||||
map.name + ' - request to edit'
|
|
||||||
end
|
|
||||||
|
|
||||||
def approved_text
|
def after_created_async
|
||||||
map.name + ' - access approved'
|
NotificationService.access_request(self)
|
||||||
end
|
end
|
||||||
|
handle_asynchronously :after_created_async
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ApplicationRecord < ActiveRecord::Base
|
class ApplicationRecord < ActiveRecord::Base
|
||||||
self.abstract_class = true
|
self.abstract_class = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Attachment < ApplicationRecord
|
class Attachment < ApplicationRecord
|
||||||
belongs_to :attachable, polymorphic: true
|
belongs_to :attachable, polymorphic: true
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Attachable
|
module Attachable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Routing
|
module Routing
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
include Rails.application.routes.url_helpers
|
include Rails.application.routes.url_helpers
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Event < ApplicationRecord
|
class Event < ApplicationRecord
|
||||||
KINDS = %w(user_present_on_map user_not_present_on_map
|
KINDS = %w[user_present_on_map user_not_present_on_map
|
||||||
conversation_started_on_map
|
conversation_started_on_map
|
||||||
topic_added_to_map topic_moved_on_map topic_removed_from_map
|
topic_added_to_map topic_moved_on_map topic_removed_from_map
|
||||||
synapse_added_to_map synapse_removed_from_map
|
synapse_added_to_map synapse_removed_from_map
|
||||||
topic_updated synapse_updated).freeze
|
topic_updated synapse_updated].freeze
|
||||||
|
|
||||||
belongs_to :eventable, polymorphic: true
|
belongs_to :eventable, polymorphic: true
|
||||||
belongs_to :map
|
belongs_to :map
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
scope :chronologically, -> { order('created_at asc') }
|
scope :chronologically, (-> { order('created_at asc') })
|
||||||
|
|
||||||
after_create :notify_webhooks!, if: :map
|
after_create :notify_webhooks!, if: :map
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class ConversationStartedOnMap < Event
|
class ConversationStartedOnMap < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class SynapseAddedToMap < Event
|
class SynapseAddedToMap < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class SynapseRemovedFromMap < Event
|
class SynapseRemovedFromMap < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class SynapseUpdated < Event
|
class SynapseUpdated < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class TopicAddedToMap < Event
|
class TopicAddedToMap < Event
|
||||||
# after_create :notify_users!
|
after_create :notify_users!
|
||||||
|
|
||||||
def self.publish!(topic, map, user, meta)
|
def self.publish!(topic, map, user, meta)
|
||||||
create!(kind: 'topic_added_to_map',
|
create!(kind: 'topic_added_to_map',
|
||||||
|
@ -10,5 +11,12 @@ module Events
|
||||||
user: user,
|
user: user,
|
||||||
meta: meta)
|
meta: meta)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def notify_users!
|
||||||
|
# in the future, notify followers of both the topic, and the map
|
||||||
|
NotificationService.notify_followers(eventable, TOPIC_ADDED_TO_MAP, self)
|
||||||
|
# NotificationService.notify_followers(map, MAP_RECEIVED_TOPIC, self)
|
||||||
|
end
|
||||||
|
handle_asynchronously :notify_users!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class TopicMovedOnMap < Event
|
class TopicMovedOnMap < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class TopicRemovedFromMap < Event
|
class TopicRemovedFromMap < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class TopicUpdated < Event
|
class TopicUpdated < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
@ -9,5 +10,9 @@ module Events
|
||||||
user: user,
|
user: user,
|
||||||
meta: meta)
|
meta: meta)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def notify_users!
|
||||||
|
NotificationService.notify_followers(eventable, 'topic_updated', self)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class UserNotPresentOnMap < Event
|
class UserNotPresentOnMap < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Events
|
module Events
|
||||||
class UserPresentOnMap < Event
|
class UserPresentOnMap < Event
|
||||||
# after_create :notify_users!
|
# after_create :notify_users!
|
||||||
|
|
21
app/models/follow.rb
Normal file
21
app/models/follow.rb
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class Follow < ApplicationRecord
|
||||||
|
belongs_to :user
|
||||||
|
belongs_to :followed, polymorphic: true
|
||||||
|
has_one :follow_reason, dependent: :destroy
|
||||||
|
|
||||||
|
validates :user, presence: true
|
||||||
|
validates :followed, presence: true
|
||||||
|
validates :user, uniqueness: { scope: :followed, message: 'This entity is already followed by this user' }
|
||||||
|
|
||||||
|
after_create :add_subsetting
|
||||||
|
|
||||||
|
scope :active, (-> { where(muted: false) })
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def add_subsetting
|
||||||
|
FollowReason.create!(follow: self)
|
||||||
|
end
|
||||||
|
end
|
13
app/models/follow_reason.rb
Normal file
13
app/models/follow_reason.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class FollowReason < ApplicationRecord
|
||||||
|
REASONS = %w[created commented contributed followed shared_on starred].freeze
|
||||||
|
|
||||||
|
belongs_to :follow
|
||||||
|
|
||||||
|
validates :follow, presence: true
|
||||||
|
|
||||||
|
def has_reason
|
||||||
|
created || commented || contributed || followed || shared_on || starred
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class InMetacodeSet < ApplicationRecord
|
class InMetacodeSet < ApplicationRecord
|
||||||
belongs_to :metacode, class_name: 'Metacode', foreign_key: 'metacode_id'
|
belongs_to :metacode, class_name: 'Metacode', foreign_key: 'metacode_id'
|
||||||
belongs_to :metacode_set, class_name: 'MetacodeSet', foreign_key: 'metacode_set_id'
|
belongs_to :metacode_set, class_name: 'MetacodeSet', foreign_key: 'metacode_set_id'
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Map < ApplicationRecord
|
class Map < ApplicationRecord
|
||||||
|
ATTRS_TO_WATCH = %w[name desc permission].freeze
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :source, class_name: :Map
|
belongs_to :source, class_name: :Map
|
||||||
|
belongs_to :updated_by, class_name: 'User'
|
||||||
|
|
||||||
has_many :topicmappings, -> { Mapping.topicmapping },
|
has_many :topicmappings, -> { Mapping.topicmapping },
|
||||||
class_name: :Mapping, dependent: :destroy
|
class_name: :Mapping, dependent: :destroy
|
||||||
|
@ -10,7 +14,9 @@ class Map < ApplicationRecord
|
||||||
has_many :topics, through: :topicmappings, source: :mappable, source_type: 'Topic'
|
has_many :topics, through: :topicmappings, source: :mappable, source_type: 'Topic'
|
||||||
has_many :synapses, through: :synapsemappings, source: :mappable, source_type: 'Synapse'
|
has_many :synapses, through: :synapsemappings, source: :mappable, source_type: 'Synapse'
|
||||||
has_many :messages, as: :resource, dependent: :destroy
|
has_many :messages, as: :resource, dependent: :destroy
|
||||||
has_many :stars
|
has_many :stars, dependent: :destroy
|
||||||
|
has_many :follows, as: :followed, dependent: :destroy
|
||||||
|
has_many :followers, through: :follows, source: :user
|
||||||
|
|
||||||
has_many :access_requests, dependent: :destroy
|
has_many :access_requests, dependent: :destroy
|
||||||
has_many :user_maps, dependent: :destroy
|
has_many :user_maps, dependent: :destroy
|
||||||
|
@ -34,8 +40,10 @@ class Map < ApplicationRecord
|
||||||
# Validate the attached image is image/jpg, image/png, etc
|
# Validate the attached image is image/jpg, image/png, etc
|
||||||
validates_attachment_content_type :screenshot, content_type: %r{\Aimage/.*\Z}
|
validates_attachment_content_type :screenshot, content_type: %r{\Aimage/.*\Z}
|
||||||
|
|
||||||
|
after_create :after_created
|
||||||
after_update :after_updated
|
after_update :after_updated
|
||||||
after_save :update_deferring_topics_and_synapses, if: :permission_changed?
|
after_save :update_deferring_topics_and_synapses, if: :permission_changed?
|
||||||
|
before_destroy :before_destroyed
|
||||||
|
|
||||||
delegate :count, to: :topics, prefix: :topic # same as `def topic_count; topics.count; end`
|
delegate :count, to: :topics, prefix: :topic # same as `def topic_count; topics.count; end`
|
||||||
delegate :count, to: :synapses, prefix: :synapse
|
delegate :count, to: :synapses, prefix: :synapse
|
||||||
|
@ -82,10 +90,10 @@ class Map < ApplicationRecord
|
||||||
|
|
||||||
def as_json(_options = {})
|
def as_json(_options = {})
|
||||||
json = super(
|
json = super(
|
||||||
methods: [:user_name, :user_image, :star_count, :topic_count, :synapse_count,
|
methods: %i[user_name user_image star_count topic_count synapse_count
|
||||||
:contributor_count, :collaborator_ids, :screenshot_url],
|
contributor_count collaborator_ids screenshot_url],
|
||||||
except: [:screenshot_content_type, :screenshot_file_size, :screenshot_file_name,
|
except: %i[screenshot_content_type screenshot_file_size screenshot_file_name
|
||||||
:screenshot_updated_at]
|
screenshot_updated_at]
|
||||||
)
|
)
|
||||||
json[:created_at_clean] = created_at_str
|
json[:created_at_clean] = created_at_str
|
||||||
json[:updated_at_clean] = updated_at_str
|
json[:updated_at_clean] = updated_at_str
|
||||||
|
@ -127,18 +135,34 @@ class Map < ApplicationRecord
|
||||||
removed.compact
|
removed.compact
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_updated
|
|
||||||
attrs = %w(name desc permission)
|
|
||||||
return unless attrs.any? { |k| changed_attributes.key?(k) }
|
|
||||||
ActionCable.server.broadcast 'map_' + id.to_s, type: 'mapUpdated'
|
|
||||||
end
|
|
||||||
|
|
||||||
def update_deferring_topics_and_synapses
|
def update_deferring_topics_and_synapses
|
||||||
Topic.where(defer_to_map_id: id).update(permission: permission)
|
Topic.where(defer_to_map_id: id).update(permission: permission)
|
||||||
Synapse.where(defer_to_map_id: id).update(permission: permission)
|
Synapse.where(defer_to_map_id: id).update(permission: permission)
|
||||||
end
|
end
|
||||||
|
|
||||||
def invited_text
|
protected
|
||||||
name + ' - invited to edit'
|
|
||||||
|
def after_created
|
||||||
|
FollowService.follow(self, user, 'created')
|
||||||
|
# notify users following the map creator
|
||||||
|
end
|
||||||
|
|
||||||
|
def after_updated
|
||||||
|
return unless ATTRS_TO_WATCH.any? { |k| changed_attributes.key?(k) }
|
||||||
|
ActionCable.server.broadcast 'map_' + id.to_s, type: 'mapUpdated'
|
||||||
|
end
|
||||||
|
|
||||||
|
def after_updated_async
|
||||||
|
return unless ATTRS_TO_WATCH.any? { |k| changed_attributes.key?(k) }
|
||||||
|
FollowService.follow(self, updated_by, 'contributed')
|
||||||
|
# NotificationService.notify_followers(self, 'map_updated', changed_attributes)
|
||||||
|
# or better yet publish an event
|
||||||
|
end
|
||||||
|
handle_asynchronously :after_updated_async
|
||||||
|
|
||||||
|
def before_destroyed
|
||||||
|
Map.where(source_id: id).find_each do |forked_map|
|
||||||
|
forked_map.update(source_id: nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Mapping < ApplicationRecord
|
class Mapping < ApplicationRecord
|
||||||
scope :topicmapping, -> { where(mappable_type: :Topic) }
|
scope :topicmapping, (-> { where(mappable_type: :Topic) })
|
||||||
scope :synapsemapping, -> { where(mappable_type: :Synapse) }
|
scope :synapsemapping, (-> { where(mappable_type: :Synapse) })
|
||||||
|
|
||||||
belongs_to :mappable, polymorphic: true
|
belongs_to :mappable, polymorphic: true
|
||||||
belongs_to :map, class_name: 'Map', foreign_key: 'map_id', touch: true
|
belongs_to :map, class_name: 'Map', foreign_key: 'map_id', touch: true
|
||||||
|
@ -14,7 +15,9 @@ class Mapping < ApplicationRecord
|
||||||
delegate :name, to: :user, prefix: true
|
delegate :name, to: :user, prefix: true
|
||||||
|
|
||||||
after_create :after_created
|
after_create :after_created
|
||||||
|
after_create :after_created_async
|
||||||
after_update :after_updated
|
after_update :after_updated
|
||||||
|
after_update :after_updated_async
|
||||||
before_destroy :before_destroyed
|
before_destroy :before_destroyed
|
||||||
|
|
||||||
def user_image
|
def user_image
|
||||||
|
@ -22,34 +25,47 @@ class Mapping < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json(_options = {})
|
def as_json(_options = {})
|
||||||
super(methods: [:user_name, :user_image])
|
super(methods: %i[user_name user_image])
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_created
|
def after_created
|
||||||
if mappable_type == 'Topic'
|
if mappable_type == 'Topic'
|
||||||
|
ActionCable.server.broadcast 'map_' + map.id.to_s, type: 'topicAdded', topic: mappable.filtered, mapping_id: id
|
||||||
meta = { 'x': xloc, 'y': yloc, 'mapping_id': id }
|
meta = { 'x': xloc, 'y': yloc, 'mapping_id': id }
|
||||||
Events::TopicAddedToMap.publish!(mappable, map, user, meta)
|
Events::TopicAddedToMap.publish!(mappable, map, user, meta)
|
||||||
ActionCable.server.broadcast 'map_' + map.id.to_s, type: 'topicAdded', topic: mappable.filtered, mapping_id: id
|
|
||||||
elsif mappable_type == 'Synapse'
|
elsif mappable_type == 'Synapse'
|
||||||
Events::SynapseAddedToMap.publish!(mappable, map, user, meta)
|
|
||||||
ActionCable.server.broadcast(
|
ActionCable.server.broadcast(
|
||||||
'map_' + map.id.to_s,
|
'map_' + map.id.to_s,
|
||||||
type: 'synapseAdded',
|
type: 'synapseAdded',
|
||||||
synapse: mappable.filtered,
|
synapse: mappable.filtered,
|
||||||
topic1: mappable.topic1.filtered,
|
topic1: mappable.topic1&.filtered,
|
||||||
topic2: mappable.topic2.filtered,
|
topic2: mappable.topic2&.filtered,
|
||||||
mapping_id: id
|
mapping_id: id
|
||||||
)
|
)
|
||||||
|
meta = { 'mapping_id': id }
|
||||||
|
Events::SynapseAddedToMap.publish!(mappable, map, user, meta)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_updated
|
def after_created_async
|
||||||
if (mappable_type == 'Topic') && (xloc_changed? || yloc_changed?)
|
FollowService.follow(map, user, 'contributed')
|
||||||
meta = { 'x': xloc, 'y': yloc, 'mapping_id': id }
|
|
||||||
Events::TopicMovedOnMap.publish!(mappable, map, updated_by, meta)
|
|
||||||
ActionCable.server.broadcast 'map_' + map.id.to_s, type: 'topicMoved', id: mappable.id, mapping_id: id, x: xloc, y: yloc
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
handle_asynchronously :after_created_async
|
||||||
|
|
||||||
|
def after_updated
|
||||||
|
return unless (mappable_type == 'Topic') && (xloc_changed? || yloc_changed?)
|
||||||
|
meta = { 'x': xloc, 'y': yloc, 'mapping_id': id }
|
||||||
|
Events::TopicMovedOnMap.publish!(mappable, map, updated_by, meta)
|
||||||
|
ActionCable.server.broadcast('map_' + map.id.to_s, type: 'topicMoved',
|
||||||
|
id: mappable.id, mapping_id: id,
|
||||||
|
x: xloc, y: yloc)
|
||||||
|
end
|
||||||
|
|
||||||
|
def after_updated_async
|
||||||
|
return unless (mappable_type == 'Topic') && (xloc_changed? || yloc_changed?)
|
||||||
|
FollowService.follow(map, updated_by, 'contributed')
|
||||||
|
end
|
||||||
|
handle_asynchronously :after_updated_async
|
||||||
|
|
||||||
def before_destroyed
|
def before_destroyed
|
||||||
if mappable.defer_to_map
|
if mappable.defer_to_map
|
||||||
|
@ -66,5 +82,6 @@ class Mapping < ApplicationRecord
|
||||||
Events::SynapseRemovedFromMap.publish!(mappable, map, updated_by, meta)
|
Events::SynapseRemovedFromMap.publish!(mappable, map, updated_by, meta)
|
||||||
ActionCable.server.broadcast 'map_' + map.id.to_s, type: 'synapseRemoved', id: mappable.id, mapping_id: id
|
ActionCable.server.broadcast 'map_' + map.id.to_s, type: 'synapseRemoved', id: mappable.id, mapping_id: id
|
||||||
end
|
end
|
||||||
|
FollowService.follow(map, updated_by, 'contributed')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Message < ApplicationRecord
|
class Message < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :resource, polymorphic: true
|
belongs_to :resource, polymorphic: true
|
||||||
|
@ -6,17 +7,24 @@ class Message < ApplicationRecord
|
||||||
delegate :name, to: :user, prefix: true
|
delegate :name, to: :user, prefix: true
|
||||||
|
|
||||||
after_create :after_created
|
after_create :after_created
|
||||||
|
# after_create :after_created_async
|
||||||
|
|
||||||
def user_image
|
def user_image
|
||||||
user.image.url
|
user.image.url
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json(_options = {})
|
def as_json(_options = {})
|
||||||
json = super(methods: [:user_name, :user_image])
|
json = super(methods: %i[user_name user_image])
|
||||||
json
|
json
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_created
|
def after_created
|
||||||
ActionCable.server.broadcast 'map_' + resource.id.to_s, type: 'messageCreated', message: as_json
|
ActionCable.server.broadcast 'map_' + resource.id.to_s, type: 'messageCreated', message: as_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def after_created_async
|
||||||
|
FollowService.follow(resource, user, 'commented')
|
||||||
|
NotificationService.notify_followers(resource, 'map_message', self)
|
||||||
|
end
|
||||||
|
handle_asynchronously :after_created_async
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Metacode < ApplicationRecord
|
class Metacode < ApplicationRecord
|
||||||
has_many :in_metacode_sets
|
has_many :in_metacode_sets
|
||||||
has_many :metacode_sets, through: :in_metacode_sets
|
has_many :metacode_sets, through: :in_metacode_sets
|
||||||
has_many :topics
|
has_many :topics
|
||||||
|
|
||||||
# This method associates the attribute ":aws_icon" with a file attachment
|
# This method associates the attribute ":aws_icon" with a file attachment
|
||||||
has_attached_file :aws_icon, styles: {
|
has_attached_file :aws_icon, styles: { ninetysix: ['96x96#', :png] },
|
||||||
ninetysix: ['96x96#', :png]
|
|
||||||
},
|
|
||||||
default_url: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_wildcard.png'
|
default_url: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_wildcard.png'
|
||||||
|
|
||||||
# Validate the attached icon is image/jpg, image/png, etc
|
# Validate the attached icon is image/jpg, image/png, etc
|
||||||
validates_attachment_content_type :aws_icon, content_type: /\Aimage\/.*\Z/
|
validates_attachment_content_type :aws_icon, content_type: %r{\Aimage/.*\Z}
|
||||||
|
|
||||||
validate :aws_xor_manual_icon
|
validate :aws_xor_manual_icon
|
||||||
validate :manual_icon_https
|
validate :manual_icon_https
|
||||||
|
@ -30,15 +29,13 @@ class Metacode < ApplicationRecord
|
||||||
def as_json(options = {})
|
def as_json(options = {})
|
||||||
default = super(options)
|
default = super(options)
|
||||||
default[:icon] = icon
|
default[:icon] = icon
|
||||||
default.except('aws_icon_file_name', 'aws_icon_content_type', 'aws_icon_file_size', 'aws_icon_updated_at', 'manual_icon')
|
default.except(
|
||||||
|
'aws_icon_file_name', 'aws_icon_content_type', 'aws_icon_file_size', 'aws_icon_updated_at',
|
||||||
|
'manual_icon'
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def hasSelected(user)
|
def in_metacode_set(metacode_set)
|
||||||
return true if user.settings.metacodes.include? id.to_s
|
|
||||||
false
|
|
||||||
end
|
|
||||||
|
|
||||||
def inMetacodeSet(metacode_set)
|
|
||||||
return true if metacode_sets.include? metacode_set
|
return true if metacode_sets.include? metacode_set
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
@ -55,10 +52,9 @@ class Metacode < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def manual_icon_https
|
def manual_icon_https
|
||||||
if manual_icon.present?
|
return if manual_icon.blank?
|
||||||
unless manual_icon.starts_with? 'https'
|
unless manual_icon.starts_with? 'https'
|
||||||
errors.add(:base, 'Manual icon must begin with https')
|
errors.add(:base, 'Manual icon must begin with https')
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MetacodeSet < ApplicationRecord
|
class MetacodeSet < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
has_many :in_metacode_sets
|
has_many :in_metacode_sets
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
class PermittedParams < Struct.new(:params)
|
|
||||||
%w(map synapse topic mapping token).each do |kind|
|
class PermittedParams
|
||||||
|
%w[map synapse topic mapping token].each do |kind|
|
||||||
define_method(kind) do
|
define_method(kind) do
|
||||||
permitted_attributes = send("#{kind}_attributes")
|
permitted_attributes = send("#{kind}_attributes")
|
||||||
params.require(kind).permit(*permitted_attributes)
|
@params.require(kind).permit(*permitted_attributes)
|
||||||
end
|
end
|
||||||
alias_method :"api_#{kind}", kind.to_sym
|
alias_method :"api_#{kind}", kind.to_sym
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def initialize(params)
|
||||||
|
@params = params
|
||||||
|
end
|
||||||
|
|
||||||
alias read_attribute_for_serialization send
|
alias read_attribute_for_serialization send
|
||||||
|
|
||||||
def token_attributes
|
def token_attributes
|
||||||
|
@ -15,18 +20,18 @@ class PermittedParams < Struct.new(:params)
|
||||||
end
|
end
|
||||||
|
|
||||||
def map_attributes
|
def map_attributes
|
||||||
[:name, :desc, :permission, :arranged]
|
%i[name desc permission arranged]
|
||||||
end
|
end
|
||||||
|
|
||||||
def synapse_attributes
|
def synapse_attributes
|
||||||
[:desc, :category, :weight, :permission, :topic1_id, :topic2_id]
|
%i[desc category weight permission topic1_id topic2_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
def topic_attributes
|
def topic_attributes
|
||||||
[:name, :desc, :link, :permission, :metacode_id]
|
%i[name desc link permission metacode_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
def mapping_attributes
|
def mapping_attributes
|
||||||
[:xloc, :yloc, :map_id, :mappable_type, :mappable_id]
|
%i[xloc yloc map_id mappable_type mappable_id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,22 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
class Star < ActiveRecord::Base
|
|
||||||
|
class Star < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :map
|
belongs_to :map
|
||||||
validates :map, uniqueness: { scope: :user, message: 'You have already starred this map' }
|
validates :map, uniqueness: { scope: :user, message: 'You have already starred this map' }
|
||||||
|
|
||||||
|
# after_create :after_created_async
|
||||||
|
# before_destroy :before_destroyed
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def after_created_async
|
||||||
|
FollowService.follow(map, user, 'starred')
|
||||||
|
NotificationService.notify_followers(map, 'map_starred', self, 'created')
|
||||||
|
end
|
||||||
|
handle_asynchronously :after_created_async
|
||||||
|
|
||||||
|
def before_destroyed
|
||||||
|
FollowService.remove_reason(map, user, 'starred')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue