Admin/users refactored.
This commit is contained in:
parent
ea6348bc5c
commit
a787b3cf24
10 changed files with 100 additions and 99 deletions
|
|
@ -4,7 +4,7 @@
|
|||
%td
|
||||
= pagination_links_remote @users
|
||||
%td{:style => "text-align:right"}
|
||||
- if @total > 20
|
||||
- if @users.size > 20
|
||||
= items_per_page
|
||||
%table.list
|
||||
%thead
|
||||
|
|
@ -25,7 +25,6 @@
|
|||
%td=h format_roles(user)
|
||||
%td=h format_time(user.last_login)
|
||||
%td
|
||||
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in bearbeiten', :title => 'Benutzer_in bearbeiten'), edit_admin_user_path(user))
|
||||
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in löschen', :title => 'Benutzer_in löschen'), |
|
||||
[:admin, user], |
|
||||
:confirm => 'Willst du ' + user.name + ' wirklich löschen?', :method => :delete) |
|
||||
= link_to icon(:edit), edit_admin_user_path(user)
|
||||
= link_to icon(:delete), [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?",
|
||||
:method => :delete
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
<h1>Benutzerin bearbeiten</h1>
|
||||
<div id="newUser" style="width:65em">
|
||||
<div class="box_title"><h2>Benutzerin bearbeiten</h2></div>
|
||||
<div class="column_content" id="userForm">
|
||||
<% form_for([:admin, @user]) do |@form| %>
|
||||
<%= render :partial => 'shared/user_form' %>
|
||||
<br style="clear:both" />
|
||||
<p>
|
||||
<%= submit_tag 'Speichern' %> | <%= link_to 'Abbrechen', admin_users_path %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
9
app/views/admin/users/edit.html.haml
Normal file
9
app/views/admin/users/edit.html.haml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
%h1 Benutzerin bearbeiten
|
||||
#newUser{:style => "width:65em"}
|
||||
.box_title
|
||||
%h2 Benutzerin bearbeiten
|
||||
#userForm.column_content
|
||||
- simple_form_for([:admin, @user]) do |f|
|
||||
= render :partial => 'shared/user_form_fields', :locals => {:f => f}
|
||||
= f.submit
|
||||
= link_to 'oder abbrechen', admin_users_path
|
||||
|
|
@ -1,28 +1,18 @@
|
|||
%h1 Admin/Benutzerinnen
|
||||
- title "Admin/Benutzerinnen"
|
||||
%p
|
||||
%i
|
||||
Hier kannst du Benutzer_innen
|
||||
= link_to 'neu Anlegen', new_admin_user_path
|
||||
, bearbeiten und natürlich auch löschen.
|
||||
#newUser{:style => "display:none;"}
|
||||
.box_title
|
||||
%h2 Neue Benutzerinn
|
||||
.column_content#userForm
|
||||
.left_column{:style => "width:100%"}
|
||||
.box_title
|
||||
%h2 Benutzerinnenübersicht
|
||||
.column_content
|
||||
#user_filter
|
||||
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
|
||||
%label{:for => 'article_name'} Suche in Name :
|
||||
= text_field_tag("query", params['query'], :size => 10 )
|
||||
|
||||
= observe_field 'query', :frequency => 2, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')", |
|
||||
:url => admin_users_path, |
|
||||
:with => 'query', |
|
||||
:method => :get |
|
||||
#table
|
||||
#user_filter{:style => "float:left; margin-right:2em;"}
|
||||
= form_tag admin_users_path, :method => :get, :style=>"display:inline;", :id => 'user_search',
|
||||
:remote => true, 'data-submit-onchange' => true do
|
||||
%label{:for => 'article_name'} Suche nach Name:
|
||||
= text_field_tag :query, params[:query], :size => 10
|
||||
#users
|
||||
= render :partial => "users"
|
||||
%p= link_to 'Neue Benutzerin', new_admin_user_path
|
||||
1
app/views/admin/users/index.js.erb
Normal file
1
app/views/admin/users/index.js.erb
Normal file
|
|
@ -0,0 +1 @@
|
|||
$('#users').html('<%= escape_javascript(render("users")) %>');
|
||||
|
|
@ -4,10 +4,8 @@
|
|||
.box_title
|
||||
%h2 Neue Benutzerin
|
||||
.column_content#userForm
|
||||
- form_for([:admin, @user]) do |@form|
|
||||
= render :partial => 'shared/user_form'
|
||||
%p{:style => "clear:both" }
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to('Abbrechen', admin_users_path )
|
||||
- simple_form_for([:admin, @user]) do |f|
|
||||
= render :partial => 'shared/user_form_fields', :locals => {:f => f}
|
||||
= f.submit
|
||||
= link_to 'oder abbrechen', admin_users_path
|
||||
%p= link_to 'Benutzerinnenübersicht', admin_users_path
|
||||
Loading…
Add table
Add a link
Reference in a new issue