Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paolotax committed Mar 30, 2012
1 parent 9398d78 commit 6235cd4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
3 changes: 1 addition & 2 deletions app/assets/stylesheets/my_bootstrap.scss
Expand Up @@ -16,8 +16,7 @@ table.pagamenti {
width: 100%;
td:first-child {
width: 40%;
font-size: 120%;

font-size: 120%;
}
td:nth-child(2) {
width: 40%;
Expand Down
11 changes: 2 additions & 9 deletions app/controllers/pagamenti_controller.rb
Expand Up @@ -9,8 +9,6 @@ def index
end
end

# GET /pagamenti/1
# GET /pagamenti/1.json
def show
@pagamento = Pagamento.find(params[:id])

Expand All @@ -26,19 +24,16 @@ def new
@pagamento = @serata.pagamenti.build(dipendente: @dipendente)
end

# GET /pagamenti/1/edit
def edit
@pagamento = Pagamento.find(params[:id])
end

# POST /pagamenti
# POST /pagamenti.json
def create
@pagamento = Pagamento.new(params[:pagamento])

respond_to do |format|
if @pagamento.save
format.html { redirect_to @pagamento, notice: 'Pagamento was successfully created.' }
format.html { redirect_to @pagamento.serata, notice: "Il baggiano e' stato pagato." }
format.json { render json: @pagamento, status: :created, location: @pagamento }
else
format.html { render action: "new" }
Expand All @@ -47,8 +42,6 @@ def create
end
end

# PUT /pagamenti/1
# PUT /pagamenti/1.json
def update
@pagamento = Pagamento.find(params[:id])

Expand All @@ -70,7 +63,7 @@ def destroy
@pagamento.destroy

respond_to do |format|
format.html { redirect_to pagamenti_url }
format.html { redirect_to @pagamento.serata }
format.json { head :no_content }
end
end
Expand Down
23 changes: 16 additions & 7 deletions app/views/pagamenti/_form.html.haml
@@ -1,11 +1,20 @@
= simple_form_for @pagamento, :html => {:class => 'form-horizontal' } do |f|
= f.hidden_field :serata_id
= f.hidden_field :dipendente_id
.well

%h2
= @dipendente.nome
%small= @dipendente.ruolo.nome
%p
= @serata.titolo

= simple_form_for @pagamento, :html => {:class => 'form-horizontal' } do |f|
= f.hidden_field :serata_id
= f.hidden_field :dipendente_id

= f.input :importo
= f.input :importo, :input_html => { :autofocus => true }

.control-group
.controls
= f.button :submit, 'Salva', class: "btn btn-primary btn-large"
.control-group
.controls
= f.button :submit, 'Salva', class: "btn btn-primary btn-large"
= link_to "Indietro", @serata, class: "btn btn-large"


13 changes: 8 additions & 5 deletions app/views/serate/show.html.haml
Expand Up @@ -15,24 +15,27 @@

= form_for @serata, html: { method: 'put', class: "crea-staff"} do |f|
= f.hidden_field :crea_staff, value: true
= f.submit "Crea Staff", class: 'btn btn-fullsize'
= f.submit "Aggiorna Staff", class: 'btn btn-fullsize'


%h3 Membri da pagare
%table.table{style: "width: 100%"}
%h2 Baggiani da pagare
%table.table.pagamenti{style: "width: 100%"}
- for p in @serata.pagamenti.non_pagato do
%tr
%td= p.dipendente.ruolo.nome
%td= p.dipendente.nome
%td= link_to "paga", new_pagamento_path(serata: @serata, dipendente: p.dipendente), class: 'btn btn-success'

%h3 Membri pagati
%table.table
%h2 Baggiani pagati
%table.table.pagamenti
- for p in @serata.pagamenti.pagato do
%tr
%td= p.dipendente.ruolo.nome
%td= p.dipendente.nome
%td= pretty_prezzo p.importo
%td
= link_to p, :method => :delete, class: "btn btn-danger" do
%i.icon-minus


/ = render 'staff'

0 comments on commit 6235cd4

Please sign in to comment.