started implementing user

This commit is contained in:
Thomas Buchöster
2011-06-29 22:39:37 +02:00
parent ab9a4a2b59
commit bc94691d8d
8 changed files with 38 additions and 12 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ GEM
faraday (0.6.1) faraday (0.6.1)
addressable (~> 2.2.4) addressable (~> 2.2.4)
multipart-post (~> 1.1.0) multipart-post (~> 1.1.0)
rack (>= 1.1.0, < 2) rack (< 2, >= 1.1.0)
gem_plugin (0.2.3) gem_plugin (0.2.3)
haml (3.1.2) haml (3.1.2)
haml-rails (0.3.4) haml-rails (0.3.4)
+6 -2
View File
@@ -1,8 +1,12 @@
class UsersController < ApplicationController class UsersController < ApplicationController
def show def show
@user = User.find params[:id] @user = User.find params[:user]
puts @user.inspect
render :partial => "show", :locals => { :user => @user } render :partial => "show", :locals => { :user => @user }
end end
def edit
@user = User.find params[:user]
render :partial => "edit", :locals => { :user => @user }
end
end end
+5 -5
View File
@@ -27,13 +27,13 @@
#block #block
#bg_stripe #bg_stripe
#site #site
#uuser{:style=>"display:none;"} #uuser{:style=>"display:block; color:#ddd;"}
- if user_signed_in? - if user_signed_in?
%span.bold= "YEAH! ICH BIN DRIN!" =link_to "Profile", "/#!/users/#{current_user.id}"
=link_to "Logout", "/#!/logout"
- else - else
=link_to "Sign In", new_user_session_path =link_to "Login", "/#!/login"
=link_to "Sign Up", new_user_registration_path =link_to "Register", "/#!/register"
=link_to "Sign Out", destroy_user_session_path
#head #head
%h1= link_to image_tag("nine-minutes.png"), "/#!/home" %h1= link_to image_tag("nine-minutes.png"), "/#!/home"
= render :partial=>"layouts/player" = render :partial=>"layouts/player"
+12 -2
View File
@@ -1,2 +1,12 @@
%h1 Users#edit #user_left
%p Find me in app/views/users/edit.html.haml =image_tag validate_avatar_url(user.avatar.url), :class => "picture"
.information
%p{:style=>"display:block; color:#ddd;"}
%h1{:style=>"color:#ddd;"}= current_user.username || current_user.email
%br
.tabs.tabs_js.w02
%ul.nav
%li profile settings
.content
%div EDIT - bla bla bla
+3
View File
@@ -2,6 +2,9 @@
=image_tag validate_avatar_url(user.avatar.url), :class => "picture" =image_tag validate_avatar_url(user.avatar.url), :class => "picture"
.information .information
%h1= user.username %h1= user.username
%p{:style=>"display:block; color:#ddd;"}
=link_to "Profil editieren", "/#!/users/#{current_user.id}/edit"
%br
%ul.nav %ul.nav
%li=image_tag "icons/artist-info.png" %li=image_tag "icons/artist-info.png"
%li=image_tag "icons/artist-links.png" %li=image_tag "icons/artist-links.png"
+4 -2
View File
@@ -19,7 +19,9 @@ Nineminutes::Application.routes.draw do
match "/more_albums", :to => "artists#more_albums" match "/more_albums", :to => "artists#more_albums"
match "/more_artists", :to => "search#more_artists" match "/more_artists", :to => "search#more_artists"
match "/more_charts", :to => "charts#more" match "/more_charts", :to => "charts#more"
get "artists/", :to => "artists#index" #get "artists/", :to => "artists#index"
match "/users/:user", :to => "users#show"
match "/users/:user/edit", :to => "users#edit"
match "/autocomplete", :to => "search#autocomplete" match "/autocomplete", :to => "search#autocomplete"
match "/album_info", :to => "artists#album_info" match "/album_info", :to => "artists#album_info"
@@ -27,7 +29,7 @@ Nineminutes::Application.routes.draw do
#resources :artists, :constraints => { :id => /.*/ } #resources :artists, :constraints => { :id => /.*/ }
resources :search resources :search
resources :users, :only => [ :show ] #resources :users, :only => [ :show ]
get "home/", :to => "home#show" get "home/", :to => "home#show"
get "charts/", :to => "charts#index" get "charts/", :to => "charts#index"
+1
View File
@@ -9,6 +9,7 @@
# you'll amass, the slower it'll run and the greater likelihood for issues). # you'll amass, the slower it'll run and the greater likelihood for issues).
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110606000240) do ActiveRecord::Schema.define(:version => 20110606000240) do
create_table "artists", :force => true do |t| create_table "artists", :force => true do |t|
+6
View File
@@ -47,4 +47,10 @@ $(document).ready(function(){
show_flash(false); show_flash(false);
load_site_request(user_path, this.params['user']); load_site_request(user_path, this.params['user']);
}); });
// User Edit Page
Path.map(hashbang+user_path+":user/edit").to(function(){
show_flash(false);
load_site_request(user_path, this.params['user'] + "/edit");
});
}); });