Permalink
Browse files

cleanup; polish user views

  • Loading branch information...
1 parent 0409983 commit 07df4681f5ae4c1c032508a64fabd58850d6050a @geraldb geraldb committed Mar 9, 2012
Deleted file not rendered
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,3 +0,0 @@
-# Place all the behaviors and hooks related to the matching controller here.
-# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -1,5 +0,0 @@
-class GameController < ApplicationController
- def index
- @games = Game.all
- end
-end
@@ -1,3 +1,4 @@
+## todo/fix: move require to startup env
require 'pp'
class PlayersController < ApplicationController
@@ -58,7 +59,7 @@ def update
tip.save!
end
- flash[:success] = 'Tipps Erfolgreich gespeichert.'
+ flash[:success] = 'Tipps erfolgreich gespeichert.'
redirect_to pool_player_path( @pool, @user )
end
@@ -4,11 +4,6 @@ class PoolsController < ApplicationController
def index
@pools = Pool.all
end
-
- # GET /pools/1
- def show
- @pool = Pool.find(params[:id])
- end
# GET /pools/new
def new
@@ -21,9 +16,9 @@ def create
@pool.user = current_user()
if @pool.save
- redirect_to @pool, notice: 'Pool erfolgreich gespeichert.'
+ redirect_to pools_path(), notice: 'Pool erfolgreich gespeichert.'
else
- render action: "new"
+ render action: 'new'
end
end
@@ -37,28 +32,31 @@ def update
@pool = Pool.find(params[:id])
if @pool.update_attributes(params[:pool])
- redirect_to @pool, notice: 'Pool was successfully updated.'
+ redirect_to pools_path(), notice: 'Pool erfolgreich gespeichert.'
else
- render action: "edit"
+ render action: 'edit'
end
- end
-
+ end
def play
@pool = Pool.find(params[:id])
@pool.players << current_user()
- flash[ :success ] = "Beim Pool dabei. Los geht's."
+ flash[ :success ] = "Willkommen im Wettpool. Los geht's."
redirect_to edit_pool_player_path( @pool, current_user() )
end
+ # GET /pools/1
+ def show
+ @pool = Pool.find(params[:id])
+ end
# DELETE /pools/1
def destroy
@pool = Pool.find(params[:id])
@pool.destroy
- redirect_to pools_url
+ redirect_to pools_path()
end
end # class PoolsController
@@ -10,20 +10,20 @@ def create
@user = User.find_by_email( params[:user][:email])
if @user.nil?
- flash.now[:error] = 'Unbekannte Email. Sorry.'
+ flash.now[:error] = 'Unbekannte Email. Tut leid.'
@user = User.new( params[:user] )
render :action => 'new'
else
session[:user_id] = @user.id
flash[:notice] = 'Anmeldung erfolgreich.'
- redirect_to pools_path
+ redirect_to pools_path()
end
end
def destroy
session[:user_id] = nil
- flash[:notice] = 'Tschüss'
- redirect_to signin_path
+ flash[:notice] = 'Tschüss.'
+ redirect_to signin_path()
end
end
@@ -1,83 +1,53 @@
class UsersController < ApplicationController
+
# GET /users
- # GET /users.json
def index
@users = User.all
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @users }
- end
- end
-
- # GET /users/1
- # GET /users/1.json
- def show
- @user = User.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @user }
- end
end
- # GET /users/new
- # GET /users/new.json
+ # GET /users/new
def new
@user = User.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @user }
- end
- end
-
- # GET /users/1/edit
- def edit
- @user = User.find(params[:id])
end
# POST /users
- # POST /users.json
def create
@user = User.new(params[:user])
- respond_to do |format|
- if @user.save
- format.html { redirect_to @user, notice: 'User was successfully created.' }
- format.json { render json: @user, status: :created, location: @user }
- else
- format.html { render action: "new" }
- format.json { render json: @user.errors, status: :unprocessable_entity }
- end
+ if @user.save
+ redirect_to users_path(), notice: 'Benutzer erfolgreich gespeichert.'
+ else
+ render action: 'new'
end
end
+ # GET /users/1/edit
+ def edit
+ @user = User.find(params[:id])
+ end
+
# PUT /users/1
- # PUT /users/1.json
def update
@user = User.find(params[:id])
- respond_to do |format|
- if @user.update_attributes(params[:user])
- format.html { redirect_to @user, notice: 'User was successfully updated.' }
- format.json { head :no_content }
- else
- format.html { render action: "edit" }
- format.json { render json: @user.errors, status: :unprocessable_entity }
- end
+ if @user.update_attributes(params[:user])
+ redirect_to users_path(), notice: 'Benutzer erfolgreich gespeichert.'
+ else
+ render action: 'edit'
end
end
+ # GET /users/1
+ def show
+ @user = User.find(params[:id])
+ end
+
# DELETE /users/1
- # DELETE /users/1.json
def destroy
@user = User.find(params[:id])
@user.destroy
- respond_to do |format|
- format.html { redirect_to users_url }
- format.json { head :no_content }
- end
+ redirect_to users_path()
end
-end
+
+end # class UsersController
@@ -1,2 +0,0 @@
-module PlayersHelper
-end
@@ -1,2 +0,0 @@
-module PoolsHelper
-end
@@ -1,2 +0,0 @@
-module SessionHelper
-end
@@ -1,2 +0,0 @@
-module SessionsHelper
-end
@@ -1,2 +0,0 @@
-module UsersHelper
-end
View
No changes.
View
@@ -1,6 +1,16 @@
-
-class Event < ActiveRecord::Base
-
- has_many :game_groups
-
-end
+# == Schema Information
+#
+# Table name: events
+#
+# id :integer not null, primary key
+# title :string(255) not null
+# created_at :datetime not null
+# updated_at :datetime not null
+#
+
+
+class Event < ActiveRecord::Base
+
+ has_many :game_groups
+
+end
View
@@ -4,9 +4,12 @@
#
# id :integer not null, primary key
# game_group_id :integer not null
+# pos :integer not null
# team1_id :integer not null
# team2_id :integer not null
# play_at :datetime not null
+# score1 :integer
+# score2 :integer
# created_at :datetime not null
# updated_at :datetime not null
#
@@ -3,7 +3,9 @@
# Table name: game_groups
#
# id :integer not null, primary key
+# event_id :integer not null
# title :string(255) not null
+# pos :integer not null
# created_at :datetime not null
# updated_at :datetime not null
#
View
@@ -3,8 +3,10 @@
# Table name: pools
#
# id :integer not null, primary key
+# event_id :integer not null
# title :string(255) not null
# user_id :integer not null
+# welcome :text
# created_at :datetime not null
# updated_at :datetime not null
#
View
@@ -5,6 +5,7 @@
# id :integer not null, primary key
# title :string(255) not null
# img :string(255)
+# calc :boolean default(FALSE), not null
# created_at :datetime not null
# updated_at :datetime not null
#
@@ -1,15 +0,0 @@
-<h1>Game Listing Game#index</h1>
-
-<ul>
-<% @games.each do |game| %>
- <li>
- Spiel <%= game.id %>
- <b><%= game.team1.title %></b> vs.
- <b><%= game.team2.title %></b>
-
- [<%= game.game_group.title %>]
-
- <%= game.play_at.to_s(:rfc822) %> // -:- (-:-)
- </li>
-<% end %>
-</ul>
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>Euro2012</title>
+ <title>Wettpool</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
@@ -23,7 +23,7 @@
<% if machmit %>
<%= link_to 'Mach mit! Mittippen!', play_pool_path( @pool ), :class => 'btn-primary' %>
<% else %>
- <%= link_to 'Tipps bearbeiten', edit_pool_player_path( @pool, current_user() ), :class => 'btn-primary' %>
+ <%= link_to 'Meine Tipps bearbeiten', edit_pool_player_path( @pool, current_user() ), :class => 'btn-primary' %>
<% end %>
<%= link_to 'Zurück', pools_path(), :class => 'btn' %>
@@ -11,11 +11,20 @@
</div>
<% end %>
- <div class="field">
- <%= f.label :name %><br />
- <%= f.text_field :name %>
- </div>
+
+ <table>
+ <tr>
+ <td><%= f.label :name, 'Name:' %></td>
+ <td><%= f.text_field :name, 'data-autofocus' => 'true' %></td>
+ </tr>
+ <tr>
+ <td><%= f.label :email, 'Email:' %></td>
+ <td><%= f.text_field :email %></td>
+ </tr>
+ </table>
+
<div class="actions">
- <%= f.submit %>
+ <%= f.submit 'Speichern', :class => 'btn-primary' %>
+ <%= link_to 'Zurück', users_path(), :class => 'btn' %>
</div>
<% end %>
@@ -1,6 +1,3 @@
-<h1>Editing user</h1>
+<h1>Benutzer</h1>
<%= render 'form' %>
-
-<%= link_to 'Show', @user %> |
-<%= link_to 'Back', users_path %>
Oops, something went wrong.

0 comments on commit 07df468

Please sign in to comment.