From bdc4970cb2cd497b553a2ee26bfc516fc8a718ea Mon Sep 17 00:00:00 2001
From: jpl
Date: Thu, 4 Aug 2016 15:58:08 +0200
Subject: Refs #1295: convert erb to slim (users)
---
app/views/users/_form.html.erb | 10 ----------
app/views/users/_form.html.slim | 7 +++++++
app/views/users/_user.html.erb | 27 ---------------------------
app/views/users/_user.html.slim | 17 +++++++++++++++++
app/views/users/new.html.erb | 3 ---
app/views/users/new.html.slim | 3 +++
app/views/users/show.html.erb | 22 ----------------------
app/views/users/show.html.slim | 19 +++++++++++++++++++
8 files changed, 46 insertions(+), 62 deletions(-)
delete mode 100644 app/views/users/_form.html.erb
create mode 100644 app/views/users/_form.html.slim
delete mode 100644 app/views/users/_user.html.erb
create mode 100644 app/views/users/_user.html.slim
delete mode 100644 app/views/users/new.html.erb
create mode 100644 app/views/users/new.html.slim
delete mode 100644 app/views/users/show.html.erb
create mode 100644 app/views/users/show.html.slim
(limited to 'app/views/users')
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb
deleted file mode 100644
index ed9d3d0ad..000000000
--- a/app/views/users/_form.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-<%= simple_form_for [:organisation, @user], html: {class: 'form-horizontal' } do |form| %>
- <%= form.input :name %>
- <%= form.input :email %>
-
-
-
- <%= form.button :submit, :as => :button %>
- <%= link_to t("cancel"), organisation_path %>
-
-<% end %>
diff --git a/app/views/users/_form.html.slim b/app/views/users/_form.html.slim
new file mode 100644
index 000000000..d88910ad4
--- /dev/null
+++ b/app/views/users/_form.html.slim
@@ -0,0 +1,7 @@
+= simple_form_for [:organisation, @user], html: {class: 'form-horizontal' } do |form|
+ = form.input :name
+ = form.input :email
+
+ .form-actions
+ = form.button :submit, as: :button
+ = link_to t("cancel"), organisation_path
\ No newline at end of file
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb
deleted file mode 100644
index 7cd0cc17c..000000000
--- a/app/views/users/_user.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
- <% if false %>
- <% if user == current_user %>
- <%= link_to( edit_user_registration_path(user), :class => "btn btn-default btn-sm" ) do %>
-
- <% end %>
- <% end %>
- <%= link_to organisation_user_path(user), :method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %>
-
- <% end %>
- <% end %>
-
-
- <%= link_to( organisation_user_path(user), :class => "preview", :title => "#{User.model_name.human.capitalize} #{user.email}") do %>
- <%= user_gravatar_image_tag(user, 20) %>
-
- <%= truncate(user.name, :length => 15) %>
-
- <% end %>
-
-
-
-
diff --git a/app/views/users/_user.html.slim b/app/views/users/_user.html.slim
new file mode 100644
index 000000000..bcd568f6f
--- /dev/null
+++ b/app/views/users/_user.html.slim
@@ -0,0 +1,17 @@
+#index_item.panel.panel-default.user
+ .panel-heading
+ .panel-title.clearfix
+ span.pull-right
+ / FIXME ref #819
+ - if false
+ - if user == current_user
+ = link_to edit_user_registration_path(user), class: 'btn btn-default btn-sm' do
+ span.fa.fa-pencil
+
+ = link_to organisation_user_path(user), :method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do
+ span.fa.fa-trash-o
+
+ h5
+ = link_to( organisation_user_path(user), class: 'preview', title: "#{User.model_name.human.capitalize} #{user.email}") do
+ = user_gravatar_image_tag(user, 20)
+ span.name = truncate(user.name, :length => 15)
\ No newline at end of file
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
deleted file mode 100644
index 98986b4d6..000000000
--- a/app/views/users/new.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= title_tag t('.title') %>
-
-<%= render "form" %>
diff --git a/app/views/users/new.html.slim b/app/views/users/new.html.slim
new file mode 100644
index 000000000..cc5637bb6
--- /dev/null
+++ b/app/views/users/new.html.slim
@@ -0,0 +1,3 @@
+= title_tag t('.title')
+
+== render 'form'
\ No newline at end of file
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
deleted file mode 100644
index 6e1c3d089..000000000
--- a/app/views/users/show.html.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-<%= title_tag @user.email %>
-
-
-
-
-<%= @user.name %>
-
-
-
-<%= @user.email %>
-
-
-
-
-<% if false %>
- <% content_for(:sidebar) do %>
-
- - <%= link_to( t('users.actions.edit'), edit_user_registration_path, :class => "edit") if @user == current_user %>
- - <%= link_to t('users.actions.destroy'), organisation_user_path(@user),:method => :delete, :data => {:confirm => t('users.actions.destroy_confirm')}, :class => "remove" %>
-
- <% end %>
-<% end %>
diff --git a/app/views/users/show.html.slim b/app/views/users/show.html.slim
new file mode 100644
index 000000000..f884ae94e
--- /dev/null
+++ b/app/views/users/show.html.slim
@@ -0,0 +1,19 @@
+= title_tag @user.email
+
+.user
+ p
+ label = "#{User.human_attribute_name('name')} : "
+ = @user.name
+
+ p
+ label = "#{User.human_attribute_name('email')} : "
+ = @user.email
+
+/ FIXME ref #819
+- if false
+ - content_for(:sidebar) do
+ ul.actions
+ li
+ = link_to( t('users.actions.edit'), edit_user_registration_path, class: "edit") if @user == current_user
+ li
+ = link_to t('users.actions.destroy'), organisation_user_path(@user), method: :delete, data: {:confirm => t('users.actions.destroy_confirm')}, class: "remove"
\ No newline at end of file
--
cgit v1.2.3