Skip to content

Commit

Permalink
Merge branch 'master' of [email protected]:fireho/siga
Browse files Browse the repository at this point in the history
* 'master' of [email protected]:fireho/siga:
  Attachment funcionando
  Alterações para os attachments
  • Loading branch information
nofxx committed May 3, 2009
2 parents 50e3aff + 973c6a6 commit b187db2
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 70 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ public/rubyrun_rss/*
*.#*
config/deploy.rb
nbproject/*
public/system
5 changes: 3 additions & 2 deletions app/models/attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
#
#
class Attachment < ActiveRecord::Base
belongs_to :attachable, :polymorphic => true
has_attached_file :media,
:styles => { :medium => "300x300>",
:thumb => "100x100>" }
:styles => { :thumb => ["200x200#", :png] }
validates_attachment_presence :media

end

Expand Down
18 changes: 18 additions & 0 deletions app/views/attachments/_attachment.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<% form_for(@attachment, :html => {:multipart => true}) do |f| %>
<%= f.error_messages %>

<p>
<%= f.label :media %><br />
<%= f.file_field :media %>
</p>
<p>
<%= f.label :info %><br />
<%= f.text_area :info %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>

<%= link_to 'Show', @attachment %> |
<%= link_to 'Back', attachments_path %>
4 changes: 2 additions & 2 deletions app/views/attachments/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<%= f.error_messages %>

<p>
<%= f.label :attachable %><br />
<%= f.text_field :attachable %>
<%= f.label :media %><br />
<%= f.file_field :media %>
</p>
<p>
<%= f.label :info %><br />
Expand Down
2 changes: 1 addition & 1 deletion app/views/attachments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<% @attachments.each do |attachment| %>
<tr>
<td><%=h attachment.attachable %></td>
<td><%=image_tag attachment.media.url(:thumb)%></td>
<td><%=h attachment.info %></td>
<td><%= link_to 'Show', attachment %></td>
<td><%= link_to 'Edit', edit_attachment_path(attachment) %></td>
Expand Down
18 changes: 1 addition & 17 deletions app/views/attachments/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
<h1>New attachment</h1>

<% form_for(@attachment) do |f| %>
<%= f.error_messages %>

<p>
<%= f.label :attachable %><br />
<%= f.text_field :attachable %>
</p>
<p>
<%= f.label :info %><br />
<%= f.text_area :info %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>

<%= link_to 'Back', attachments_path %>
<%=render @attachment%>
4 changes: 2 additions & 2 deletions app/views/users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<fieldset>
<legend>Usuários</legend>

<% if session_user.adm == "SIM" %>
<% if user_session.adm == "SIM" %>
<% @menu = 'home/menuAdm' %>
<% end %>

Expand All @@ -27,7 +27,7 @@

<p align='right'>
<%= tooltip link_to(image_tag('novo.png', :border => 0), :action => "new" ), { :tooltip => 'Adicionar novo registro.' } %>
<%= tooltip link_to(image_tag('voltar.png', :border => 0), :controller => "home", :action => "menuAdm" ), { :tooltip => 'Retornar.' } %>
<%#= tooltip link_to(image_tag('voltar.png', :border => 0), :controller => "home", :action => "menuAdm" ), { :tooltip => 'Retornar.' } %>
</p>

</fieldset>
46 changes: 0 additions & 46 deletions config/database.yml.sample

This file was deleted.

Binary file added public/Relatorios/Usuários160309221952ADMIN.pdf
Binary file not shown.
Binary file added public/Relatorios/Usuários160309222020ADMIN.pdf
Binary file not shown.
Binary file added public/Relatorios/Usuários170309194517ADMIN.pdf
Binary file not shown.
Binary file added public/Relatorios/Usuários170309194839ADMIN.pdf
Binary file not shown.
Binary file added public/Relatorios/Usuários170309194929ADMIN.pdf
Binary file not shown.
Binary file added public/Relatorios/Usuários170309195032ADMIN.pdf
Binary file not shown.
Binary file added public/Relatorios/Usuários170309195811ADMIN.pdf
Binary file not shown.

0 comments on commit b187db2

Please sign in to comment.