-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
22 changed files
with
322 additions
and
156 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
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,25 +1,29 @@ | ||
<h1>Listing projects</h1> | ||
|
||
<table> | ||
<table class="table table-striped"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Description</th> | ||
<th></th> | ||
<th></th> | ||
<th></th> | ||
<th><%= t('name', :scope => 'activerecord.attributes.project') %></th> | ||
<th><%= t('description', :scope => 'activerecord.attributes.project') %></th> | ||
<th colspan="2"><%= t('actions', :scope => 'application') %></th> | ||
</tr> | ||
|
||
<% @projects.each do |project| %> | ||
<tr> | ||
<tr data-url="<%= url_for([:admin, project]) %>" style="cursor: pointer"> | ||
<td><%= project.name %></td> | ||
<td><%= project.description %></td> | ||
<td><%= link_to 'Show', [:admin, project] %></td> | ||
<td><%= link_to 'Edit', edit_admin_project_path(project) %></td> | ||
<td><%= link_to 'Destroy', [:admin, project], confirm: 'Are you sure?', method: :delete %></td> | ||
<td><%= link_to t('edit', :scope => 'application'), edit_admin_project_path(project) %></td> | ||
<td><%= link_to t('destroy', :scope => 'application'), | ||
[:admin, project], confirm: 'Are you sure?', method: :delete %></td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
|
||
<br /> | ||
|
||
<%= link_to 'New Project', new_admin_project_path %> | ||
<script type="text/javascript"> | ||
$('tr').dblclick(function() { | ||
window.location.href = $(this).data('url'); | ||
}); | ||
</script> | ||
|
||
<%= link_to t('new_obj', :scope => 'application', :obj => t('activerecord.models.project')), new_admin_project_path %> |
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
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,16 +1,20 @@ | ||
<h1>Login</h1> | ||
<%= form_tag login_path do %> | ||
<p> | ||
<%= label_tag :login %> | ||
<%= text_field_tag :login %> | ||
</p> | ||
<%= form_tag login_path, :class => 'form-horizontal' do %> | ||
<div class="control-group"> | ||
<%= label_tag :login, t('.login'), :class => 'control-label' %> | ||
<div class="controls"> | ||
<%= text_field_tag :login %> | ||
</div> | ||
</div> | ||
|
||
<p> | ||
<%= label_tag :password %> | ||
<%= password_field_tag :password %> | ||
</p> | ||
<div class="control-group"> | ||
<%= label_tag :password, t('.password'), :class => 'control-label' %> | ||
<div class="controls"> | ||
<%= password_field_tag :password %> | ||
</div> | ||
</div> | ||
|
||
<p> | ||
<%= submit_tag :login %> | ||
</p> | ||
<div class="form-actions"> | ||
<%= submit_tag :login, :class => 'btn btn-primary' %> | ||
</div> | ||
<% 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<% if object.errors.any? %> | ||
<div id="error_explanation"> | ||
<% # TODO internacionalização aki %> | ||
<h2><%= pluralize(object.errors.count, "erro") %> impediram esse objeto de ser salvo:</h2> | ||
<ul> | ||
<% object.errors.full_messages.each do |msg| %> | ||
<li><%= msg %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% 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,33 +1,13 @@ | ||
<h1><%= t('.title') %></h1> | ||
<br> | ||
|
||
<%= form_for(@user) do |f| %> | ||
<% if @user.errors.any? %> | ||
<div id="error_explanation"> | ||
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2> | ||
<%= simple_form_for(@user, :html => { :class => 'form-horizontal' } ) do |f| %> | ||
|
||
<%= f.input :name %> | ||
<%= f.input :password %> | ||
<%= f.input :password_confirmation %> | ||
|
||
<ul> | ||
<% @user.errors.full_messages.each do |msg| %> | ||
<li><%= msg %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div class="field"> | ||
<%= f.label :name %> | ||
<%= f.text_field :name %> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :password %> | ||
<%= f.password_field :password %> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :password_confirmation %> | ||
<%= f.password_field :password_confirmation %> | ||
<div class="form-actions"> | ||
<%= f.button :submit, :class => 'btn-primary' %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= f.submit %> | ||
</div> | ||
|
||
<% 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,17 +1,26 @@ | ||
<h1><%= t('.title') %></h1> | ||
|
||
<table> | ||
<table class="table table-striped"> | ||
<tr> | ||
<th>Nome</th> | ||
<th>Papel</th> | ||
<th>Email</th> | ||
</tr> | ||
|
||
<% @users.each do |user| %> | ||
<tr> | ||
<% attrs = "data-url='#{url_for(edit_admin_user_path(user))}' style='cursor: pointer'" if current_user.admin? %> | ||
<tr <%= attrs %>> | ||
<td><%= user.name %></td> | ||
<td><%= user.role.try(:name) %></td> | ||
<td><%= user.email %></td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
|
||
<% if current_user.admin? %> | ||
<script type="text/javascript"> | ||
$('tr').click(function() { | ||
window.location.href = $(this).data('url'); | ||
}); | ||
</script> | ||
<% 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,39 +1,14 @@ | ||
<h1>Cadastro de Usuário</h1> | ||
|
||
<%= form_for @user do |f| %> | ||
<% if @user.errors.any? %> | ||
<div id="error_explanation"> | ||
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2> | ||
<%= simple_form_for(@user, :html => {:class => 'form-horizontal'}) do |f| %> | ||
|
||
<ul> | ||
<% @user.errors.full_messages.each do |msg| %> | ||
<li><%= msg %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
<%= f.input :login %> | ||
<%= f.input :name %> | ||
<%= f.input :email %> | ||
<%= f.input :password %> | ||
<%= f.input :password_confirmation %> | ||
|
||
<div class="field"> | ||
<%= f.label :login %> | ||
<%= f.text_field :login %> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :name %> | ||
<%= f.text_field :name %> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :email %> | ||
<%= f.text_field :email %> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :password %> | ||
<%= f.password_field :password %> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :password_confirmation %> | ||
<%= f.password_field :password_confirmation %> | ||
</div> | ||
<div class="actions"> | ||
<%= f.submit %> | ||
<div class="form-actions"> | ||
<%= f.button :submit, :class => 'btn-primary' %> | ||
</div> | ||
<% end %> |
Oops, something went wrong.