diff --git a/Gemfile b/Gemfile index 6a82dc4..a3f22bf 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,8 @@ gem 'delayed_job' gem 'lastfm', :git => 'git://github.com/magnolia-fan/ruby-lastfm.git' gem 'musicbrainz', '~> 0.4.3' +gem 'bitmask_attributes' + group :development do gem 'sqlite3' end diff --git a/Gemfile.lock b/Gemfile.lock index 71c3ca3..fb40a56 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,26 +43,28 @@ GEM awesome_print (0.4.0) barista (1.2.1) coffee-script (~> 2.2) - bcrypt-ruby (3.0.0) + bcrypt-ruby (3.0.1) + bitmask_attributes (0.2.2) + activerecord (~> 3.0) builder (3.0.0) coffee-script (2.2.0) coffee-script-source execjs coffee-script-source (1.1.2) - crack (0.1.8) daemons (1.1.4) delayed_job (2.1.4) activesupport (~> 3.0) daemons erubis (2.7.0) - execjs (1.2.4) + execjs (1.2.6) multi_json (~> 1.0) haml (3.1.3) hike (1.2.1) - httparty (0.7.8) - crack (= 0.1.8) + httparty (0.8.0) + multi_json + multi_xml i18n (0.6.0) - json (1.5.4) + json (1.6.0) libv8 (3.3.10.2) mail (2.3.0) i18n (>= 0.4.0) @@ -70,6 +72,7 @@ GEM treetop (~> 1.4.8) mime-types (1.16) multi_json (1.0.3) + multi_xml (0.4.0) musicbrainz (0.4.3) nokogiri nokogiri (1.5.0) @@ -126,6 +129,7 @@ PLATFORMS DEPENDENCIES awesome_print barista + bitmask_attributes coffee-script delayed_job haml diff --git a/app/assets/javascripts/page.coffee b/app/assets/javascripts/page.coffee index 1f3b5dc..8e7504d 100644 --- a/app/assets/javascripts/page.coffee +++ b/app/assets/javascripts/page.coffee @@ -38,6 +38,7 @@ $ -> $('.dropdown-toggle, .menu').live 'click', -> $(this).parent('li').toggleClass('open') false - $('.dropdown-toggle li, .menu li').live 'click', -> - $(this).parent('li').toggleClass('open') + $('.dropdown-menu li a').live 'click', -> + console.log(1) + $(this).parent().parent().parent().toggleClass('open') false \ No newline at end of file diff --git a/app/models/user.rb b/app/models/user.rb index b3cd241..3321330 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,4 @@ class User < ActiveRecord::Base + bitmask :music, :as => [:album, :single, :live, :bootleg] has_one :session end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 10f133e..4c4b167 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -27,13 +27,13 @@ = image_tag "artist_loader.gif" %ul.nav.secondary-nav %li.dropdown - %a.dropdown-toggle#username{ :href => "#" } %username% + %a.dropdown-toggle#username{ :href => "#/" } %username% %ul.dropdown-menu %li - %a#preferences{ :href => "#" }= I18n.t 'global.settings' + %a#preferences{ :href => "#/settings/" }= I18n.t 'global.settings' %li.divider %li - %a#logout{ :href => "#" }= I18n.t 'global.logout' + %a#logout{ :href => "#/logout/" }= I18n.t 'global.logout' .popover-wrapper .popover.below#autocomplete-container diff --git a/app/views/user/_settings.html.haml b/app/views/user/_settings.html.haml index 9e5cbc3..8b97240 100644 --- a/app/views/user/_settings.html.haml +++ b/app/views/user/_settings.html.haml @@ -1,4 +1,4 @@ -%h1 Settings +%h1= I18n.t 'settings.title' %ul.tabs#settings-tabs %li.active %a{ :href => "#", :'data-tab' => 'account' }= I18n.t 'settings.tab.account' diff --git a/config/locales/en.yml b/config/locales/en.yml index ab57e7a..62fd628 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -19,6 +19,7 @@ en: typo: "Misspelled?" settings: + title: "Settings" tab: account: "Account" site: "Site" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 41ed4ad..82f3f21 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -19,6 +19,7 @@ ru: typo: "Опечатались?" settings: + title: "Настройки" tab: account: "Аккаунт" site: "Сайт" diff --git a/db/migrate/20110915043009_add_music_to_user.rb b/db/migrate/20110915043009_add_music_to_user.rb new file mode 100644 index 0000000..943ef46 --- /dev/null +++ b/db/migrate/20110915043009_add_music_to_user.rb @@ -0,0 +1,5 @@ +class AddMusicToUser < ActiveRecord::Migration + def change + add_column :users, :music, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 52f0a0a..7c93aa6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110914163231) do +ActiveRecord::Schema.define(:version => 20110915043009) do create_table "albums", :force => true do |t| t.string "name" @@ -105,6 +105,7 @@ ActiveRecord::Schema.define(:version => 20110914163231) do t.string "lastfm_key" t.string "lastfm_username" t.string "lang" + t.integer "music" end end