Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some features #4

Merged
merged 1 commit into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ gem 'coffee-rails', '~> 4.2'
gem 'ffaker'
gem 'cancan'
gem 'carrierwave', '~> 0.9'
gem 'carrierwave-dropbox'
gem 'fog'
gem 'fog-aws'

gem 'rack-cors', require: 'rack/cors'
gem 'active_model_serializers'
gem 'devise_token_auth'
Expand Down
188 changes: 182 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.6)
actioncable (5.0.6)
actionpack (= 5.0.6)
nio4r (>= 1.2, < 3.0)
Expand Down Expand Up @@ -68,9 +69,6 @@ GEM
json (>= 1.7)
mime-types (>= 1.16)
mimemagic (>= 0.3.0)
carrierwave-dropbox (1.2.1)
carrierwave (~> 0.9)
dropbox-sdk (~> 1.6)
case_transform (0.2)
activesupport
choice (0.2.0)
Expand All @@ -96,15 +94,16 @@ GEM
devise (> 3.5.2, <= 4.3)
rails (< 6)
diff-lcs (1.3)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
drape (1.0.0.beta1)
actionpack (>= 5.0.0.beta1)
activemodel (>= 5.0.0.beta1)
activemodel-serializers-xml (>= 1.0)
activesupport (>= 5.0.0.beta1)
request_store (~> 1.0)
dropbox-sdk (1.6.5)
json
erubis (2.7.0)
excon (0.60.0)
execjs (2.7.0)
factory_girl (4.9.0)
activesupport (>= 3.0.0)
Expand All @@ -117,10 +116,164 @@ GEM
ffi (1.9.18)
figaro (1.1.1)
thor (~> 0.14)
fission (0.5.0)
CFPropertyList (~> 2.2)
fog (1.42.0)
fog-aliyun (>= 0.1.0)
fog-atmos
fog-aws (>= 0.6.0)
fog-brightbox (~> 0.4)
fog-cloudatcost (~> 0.1.0)
fog-core (~> 1.45)
fog-digitalocean (>= 0.3.0)
fog-dnsimple (~> 1.0)
fog-dynect (~> 0.0.2)
fog-ecloud (~> 0.1)
fog-google (<= 0.1.0)
fog-internet-archive
fog-joyent
fog-json
fog-local
fog-openstack
fog-ovirt
fog-powerdns (>= 0.1.1)
fog-profitbricks
fog-rackspace
fog-radosgw (>= 0.0.2)
fog-riakcs
fog-sakuracloud (>= 0.0.4)
fog-serverlove
fog-softlayer
fog-storm_on_demand
fog-terremark
fog-vmfusion
fog-voxel
fog-vsphere (>= 0.4.0)
fog-xenserver
fog-xml (~> 0.1.1)
ipaddress (~> 0.5)
json (~> 2.0)
fog-aliyun (0.2.0)
fog-core (~> 1.27)
fog-json (~> 1.0)
ipaddress (~> 0.8)
xml-simple (~> 1.1)
fog-atmos (0.1.0)
fog-core
fog-xml
fog-aws (2.0.0)
fog-core (~> 1.38)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-brightbox (0.14.0)
fog-core (~> 1.22)
fog-json
inflecto (~> 0.0.2)
fog-cloudatcost (0.1.2)
fog-core (~> 1.36)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-core (1.45.0)
builder
excon (~> 0.58)
formatador (~> 0.2)
fog-digitalocean (0.3.0)
fog-core (~> 1.42)
fog-json (>= 1.0)
fog-xml (>= 0.1)
ipaddress (>= 0.5)
fog-dnsimple (1.0.0)
fog-core (~> 1.38)
fog-json (~> 1.0)
fog-dynect (0.0.3)
fog-core
fog-json
fog-xml
fog-ecloud (0.3.0)
fog-core
fog-xml
fog-google (0.1.0)
fog-core
fog-json
fog-xml
fog-internet-archive (0.0.1)
fog-core
fog-json
fog-xml
fog-joyent (0.0.1)
fog-core (~> 1.42)
fog-json (>= 1.0)
fog-json (1.0.2)
fog-core (~> 1.0)
multi_json (~> 1.10)
fog-local (0.4.0)
fog-core (~> 1.27)
fog-openstack (0.1.22)
fog-core (>= 1.40)
fog-json (>= 1.0)
ipaddress (>= 0.8)
fog-ovirt (0.1.2)
fog-core (~> 1.45)
fog-json
fog-xml (~> 0.1.1)
rbovirt (~> 0.1.4)
fog-powerdns (0.1.1)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
fog-profitbricks (4.1.1)
fog-core (~> 1.42)
fog-json (~> 1.0)
fog-rackspace (0.1.5)
fog-core (>= 1.35)
fog-json (>= 1.0)
fog-xml (>= 0.1)
ipaddress (>= 0.8)
fog-radosgw (0.0.5)
fog-core (>= 1.21.0)
fog-json
fog-xml (>= 0.0.1)
fog-riakcs (0.1.0)
fog-core
fog-json
fog-xml
fog-sakuracloud (1.7.5)
fog-core
fog-json
fog-serverlove (0.1.2)
fog-core
fog-json
fog-softlayer (1.1.4)
fog-core
fog-json
fog-storm_on_demand (0.1.1)
fog-core
fog-json
fog-terremark (0.1.0)
fog-core
fog-xml
fog-vmfusion (0.1.0)
fission
fog-core
fog-voxel (0.1.0)
fog-core
fog-xml
fog-vsphere (1.13.1)
fog-core
rbvmomi (~> 1.9)
fog-xenserver (0.3.0)
fog-core
fog-xml
fog-xml (0.1.3)
fog-core
nokogiri (>= 1.5.11, < 2.0.0)
font-awesome-rails (4.7.0.2)
railties (>= 3.2, < 5.2)
foreman (0.84.0)
thor (~> 0.19.1)
formatador (0.2.5)
globalid (0.4.1)
activesupport (>= 4.2.0)
graphiql-rails (1.4.8)
Expand All @@ -130,8 +283,12 @@ GEM
temple (>= 0.8.0)
tilt
hashie (3.5.6)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
inflecto (0.0.2)
ipaddress (0.8.3)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
Expand Down Expand Up @@ -182,6 +339,7 @@ GEM
multi_xml (0.6.0)
multipart-post (2.0.0)
nested_form (0.3.2)
netrc (0.11.0)
nio4r (2.1.0)
nokogiri (1.8.1)
mini_portile2 (~> 2.3.0)
Expand Down Expand Up @@ -266,6 +424,14 @@ GEM
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rbovirt (0.1.5)
nokogiri
rest-client (> 1.7.0)
rbvmomi (1.11.6)
builder (~> 3.0)
json (>= 1.8)
nokogiri (~> 1.5)
trollop (~> 2.1)
redis (4.0.1)
redis-actionpack (5.0.2)
actionpack (>= 4.0, < 6)
Expand All @@ -288,6 +454,10 @@ GEM
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rest-client (2.0.2)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rspec-core (3.7.0)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
Expand Down Expand Up @@ -339,13 +509,17 @@ GEM
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.8)
trollop (2.1.2)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.3)
tzinfo (1.2.4)
thread_safe (~> 0.1)
uglifier (4.0.2)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
warden (1.2.7)
rack (>= 1.0)
web-console (3.5.1)
Expand All @@ -362,6 +536,7 @@ GEM
websocket-extensions (0.1.3)
with_model (2.0.0)
activerecord (>= 4.2)
xml-simple (1.1.5)
xpath (2.1.0)
nokogiri (~> 1.3)

Expand All @@ -374,14 +549,15 @@ DEPENDENCIES
cancan
capybara
carrierwave (~> 0.9)
carrierwave-dropbox
coffee-rails (~> 4.2)
database_cleaner
devise_token_auth
drape
factory_girl_rails
ffaker
figaro
fog
fog-aws
foreman
graphiql-rails
graphql (= 1.7.7)
Expand Down
1 change: 0 additions & 1 deletion app/decorators/rating_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ class RatingDecorator < Drape::Decorator
Rating.where(rate_type: type, city_id: object.city.id ).average(:rate).to_i || 0
end
end

end
32 changes: 24 additions & 8 deletions app/javascript/components/layout/navbar.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
<template>
<div class="navbar-fixed">
<v-dropdown id="dropdown">
<li v-for="lang in langs">
<a @click="changeLang(lang.key)">{{ lang.name }}</a>
</li>
</v-dropdown>
<nav class="cyan lighten-2" role="navigation">
<v-container>
<div class="nav-wrapper">
<a href="/" class="brand-logo">Nomad</a>

<a href="#" v-side-nav:mobile class="button-collapse"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<li><a v-dropdown:dropdown>{{ $t('user.lang') }}<i class="material-icons right">arrow_drop_down</i></a></li>
<li><a v-if="!logged" v-on:click="social('facebook')">{{ $t('user.fb_login') }}</a></li>
<li><router-link :to="{ name: 'user', params: { id: user_id }}" v-if="logged">{{ $t('user.profile') }}</router-link></li>
<li><a v-if="logged" v-on:click="logout()">{{ $t('user.exit') }}</a></li>
</ul>
<ul id="mobile" class="side-nav">
<li><a v-if="!logged" v-on:click="social('facebook')">{{ $t('user.fb_login') }}</a></li>
<li><router-link :to="{ name: 'user', params: { id: user_id }}" v-if="logged">{{ $t('user.profile') }}</router-link></li>
<li><a v-if="logged" v-on:click="logout()">{{ $t('user.exit') }}</a></li>
</ul>
<ul id="mobile" class="side-nav">
<li><a v-if="!logged" v-on:click="social('facebook')">{{ $t('user.fb_login') }}</a></li>
<li><router-link :to="{ name: 'user', params: { id: user_id }}" v-if="logged">{{ $t('user.profile') }}</router-link></li>
<li><a v-if="logged" v-on:click="logout()">{{ $t('user.exit') }}</a></li>
</ul>

</div>
</v-container>
</nav>
Expand All @@ -30,7 +35,11 @@ export default {
auth: this.$auth,
code: this.$route.query.code,
provider: 'facebook',
logged: this.$auth.check()
logged: this.$auth.check(),
langs: [
{ key: 'en', name: 'English'},
{ key: 'ua', name: 'Українська'},
],
};
},
mounted() {
Expand Down Expand Up @@ -64,6 +73,13 @@ export default {
this.logged = false;
}
},
changeLang(lang) {
let current = this.$i18n.locale;
if (current != lang) {
localStorage.setItem('lang', lang);
this.$i18n.locale = lang;
}
},
}
}
</script>
2 changes: 1 addition & 1 deletion app/javascript/components/tabs/forumTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</li>
</ul>
<div class="center-align" v-if="this.$auth.check()">
<router-link class="btn waves-effect waves-light" :to="'/city/' + this.city_id +'/topic/new'">Створити нову тему</router-link>
<router-link class="btn waves-effect waves-light" :to="'/city/' + this.city_id +'/topic/new'">{{ $t('topic.add') }}</router-link>
</div>
</div>
</template>
Expand Down
5 changes: 3 additions & 2 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const router = new VueRouter({
})

const i18n = new VueI18n({
locale: 'ua',
locale: localStorage.lang ? localStorage.lang : 'ua',
messages: Translate,
});

Expand All @@ -78,4 +78,5 @@ document.addEventListener('DOMContentLoaded', () => {
i18n: i18n,
apolloProvider,
})
})
})

Loading