-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e742c82
commit e21dd77
Showing
37 changed files
with
174 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
class Uniform < ActiveRecord::Base | ||
|
||
belongs_to :uniform_piece_type | ||
belongs_to :uniform_piece_group | ||
belongs_to :user | ||
|
||
validates :uniform_piece_type, :uniform_piece_group, :entry, :expiration, presence: true | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
class UniformPieceGroup < ActiveRecord::Base | ||
validate :group, required: true | ||
|
||
before_save { self.group = group.humanize } | ||
before_save { self.description = description.humanize } | ||
|
||
validates :group, presence: true, | ||
uniqueness: { case_sensitive: false } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
class UniformPieceType < ActiveRecord::Base | ||
validates :piece_type, presence: true | ||
|
||
before_save { self.piece_type = piece_type.humanize } | ||
|
||
validates :piece_type, presence: true, | ||
uniqueness: { case_sensitive: false } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,4 @@ class User < ActiveRecord::Base | |
has_secure_password | ||
|
||
mount_uploader :avatar, AvatarUploader | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$("#modal-window").html("<%= escape_javascript(render 'new') %>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$("#modal-window").html("<%= escape_javascript(render 'new') %>"); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
<h3 id="myModalLabel">Adionar novo</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<%= render "form" %> | ||
</div> | ||
<div class="modal-footer"> | ||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
<h1>Editing uniform</h1> | ||
|
||
<%= render 'form' %> | ||
|
||
<%= link_to 'Show', @uniform %> | | ||
<%= link_to 'Back', uniforms_path %> | ||
<div class="row clearfix"> | ||
<div class="col-md-2 column"> | ||
<%= render "admin/menu" %> | ||
</div> | ||
<div class="col-md-10 column"> | ||
<%= link_to 'Voltar', uniforms_path, class: "btn btn-primary" %> | ||
<hr> | ||
<h2>Editando peça de uniforme</h2> | ||
<%= render 'form' %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,43 @@ | ||
|
||
<h1>Listing uniforms</h1> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Uniform piece type</th> | ||
<th>Uniform piece group</th> | ||
<th>Entry</th> | ||
<th>Expiration</th> | ||
<th>User</th> | ||
<th colspan="3"></th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<% @uniforms.each do |uniform| %> | ||
<tr> | ||
<td><%= uniform.uniform_piece_type.piece_type %></td> | ||
<td><%= uniform.uniform_piece_group.group %></td> | ||
<td><%= uniform.entry %></td> | ||
<td><%= uniform.expiration %></td> | ||
<td><%= uniform.user unless uniform.user.nil? %></td> | ||
<td><%= link_to 'Show', uniform %></td> | ||
<td><%= link_to 'Edit', edit_uniform_path(uniform) %></td> | ||
<td><%= link_to 'Destroy', uniform, method: :delete, data: { confirm: 'Are you sure?' } %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
<br> | ||
|
||
<%= link_to 'New Uniform', new_uniform_path %> | ||
<div class="row clearfix"> | ||
<div class="col-md-2 column"> | ||
<%= render "admin/menu" %> | ||
</div> | ||
<div class="col-md-10 column"> | ||
<div class="row clearfix"> | ||
<div class="col-md-12 column"> | ||
<%= link_to 'Nova peça de uniforme', new_uniform_path, class: "btn btn-primary" %> | ||
<hr> | ||
</div> | ||
<div class="col-md-12 column"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th> </th> | ||
<th>Tipo</th> | ||
<th>Pertence ao grupo</th> | ||
<th>Data de entrada</th> | ||
<th>Data para troca</th> | ||
<th>Em mãos de</th> | ||
<th colspan="3"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @uniforms.each do |uniform| %> | ||
<tr> | ||
<td><%= image_tag(uniform.uniform_piece_type.picture, { width: 15, height: 15 } ) if uniform.uniform_piece_type.picture? %></td> | ||
<td><%= uniform.uniform_piece_type.piece_type %></td> | ||
<td><%= uniform.uniform_piece_group.group %></td> | ||
<td><%= uniform.entry %></td> | ||
<td><%= uniform.expiration %></td> | ||
<td><%= uniform.user.name unless uniform.user.nil? %></td> | ||
<td><%= link_to 'Detalhes', uniform %></td> | ||
<td><%= link_to 'Editar', edit_uniform_path(uniform) %></td> | ||
<td><%= link_to 'Apagar', uniform, method: :delete, data: { confirm: 'Você têm certeza?' } %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,36 @@ | ||
<p id="notice"><%= notice %></p> | ||
<div class="row clearfix"> | ||
<div class="col-md-2 column"> | ||
<%= render "admin/menu" %> | ||
</div> | ||
<div class="col-md-10 column"> | ||
<p id="notice"><%= notice %></p> | ||
|
||
<p> | ||
<strong>Uniform piece type:</strong> | ||
<%= @uniform.uniform_piece_type %> | ||
</p> | ||
<p> | ||
<strong>Tipo:</strong> | ||
<%= @uniform.uniform_piece_type.piece_type %> | ||
</p> | ||
|
||
<p> | ||
<strong>Uniform piece group:</strong> | ||
<%= @uniform.uniform_piece_group %> | ||
</p> | ||
<p> | ||
<strong>Grupo:</strong> | ||
<%= @uniform.uniform_piece_group.group %> | ||
</p> | ||
|
||
<p> | ||
<strong>Data de entrada:</strong> | ||
<%= @uniform.entry %> | ||
</p> | ||
|
||
<p> | ||
<strong>Entry:</strong> | ||
<%= @uniform.entry %> | ||
</p> | ||
<p> | ||
<strong>Data para troca:</strong> | ||
<%= @uniform.expiration %> | ||
</p> | ||
|
||
<p> | ||
<strong>Em mãos de:</strong> | ||
<!--%= link_to @uniform.user.name, user_path(@uniform.user) %--> | ||
</p> | ||
|
||
<p> | ||
<strong>Expiration:</strong> | ||
<%= @uniform.expiration %> | ||
</p> | ||
|
||
<p> | ||
<strong>User:</strong> | ||
<%= @uniform.user %> | ||
</p> | ||
|
||
<%= link_to 'Edit', edit_uniform_path(@uniform) %> | | ||
<%= link_to 'Back', uniforms_path %> | ||
<%= link_to 'Edit', edit_uniform_path(@uniform) %> | | ||
<%= link_to 'Back', uniforms_path %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.