diff options
| -rw-r--r-- | app/views/api_keys/_api_key.html.erb | 30 | ||||
| -rw-r--r-- | app/views/api_keys/_api_key.html.slim | 18 | ||||
| -rw-r--r-- | app/views/api_keys/_form.html.erb | 14 | ||||
| -rw-r--r-- | app/views/api_keys/_form.html.slim | 10 | ||||
| -rw-r--r-- | app/views/api_keys/edit.html.erb | 4 | ||||
| -rw-r--r-- | app/views/api_keys/edit.html.slim | 3 | ||||
| -rw-r--r-- | app/views/api_keys/new.html.erb | 4 | ||||
| -rw-r--r-- | app/views/api_keys/new.html.slim | 3 | ||||
| -rw-r--r-- | app/views/api_keys/show.html.erb | 24 | ||||
| -rw-r--r-- | app/views/api_keys/show.html.slim | 18 |
10 files changed, 52 insertions, 76 deletions
diff --git a/app/views/api_keys/_api_key.html.erb b/app/views/api_keys/_api_key.html.erb deleted file mode 100644 index c81953311..000000000 --- a/app/views/api_keys/_api_key.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -<div id="index_item" class="panel panel-default api_key"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_api_key_path(@referential, api_key), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_api_key_path(@referential, api_key), :method => :delete, :data => {:confirm => t('api_keys.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, api_key], :class => "preview", :title => "#{Chouette::StopArea.model_name.human.capitalize} #{api_key.name}") do %> - <span class="name"> - <%= truncate(api_key.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <%= api_key.class.human_attribute_name('token') %> <%= truncate(api_key.token, :length => 20) %> - </p> - <p> - <%= api_key.class.human_attribute_name('updated_at') %> <%= l(api_key.updated_at) %> - </p> - </div> -</div> - diff --git a/app/views/api_keys/_api_key.html.slim b/app/views/api_keys/_api_key.html.slim new file mode 100644 index 000000000..4cb07ef83 --- /dev/null +++ b/app/views/api_keys/_api_key.html.slim @@ -0,0 +1,18 @@ +#index_item.panel.panel-default.api_key + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_api_key_path(@referential, api_key), class: "btn btn-default btn-sm" do + span.fa.fa-pencil + + = link_to referential_api_key_path(@referential, api_key), :method => :delete, :data => {:confirm => t('api_keys.actions.destroy_confirm')}, class: "btn btn-danger btn-sm" do + span.fa.fa-trash-o + + h5 + = link_to([@referential, api_key], class: "preview", :title => "#{Chouette::StopArea.model_name.human.capitalize} #{api_key.name}") do + span.name = truncate(api_key.name, :length => 20) + + .panel-body + p = "#{api_key.class.human_attribute_name('token')} #{truncate(api_key.token, :length => 20)}" + + p = "#{api_key.class.human_attribute_name('updated_at')} #{l(api_key.updated_at)}"
\ No newline at end of file diff --git a/app/views/api_keys/_form.html.erb b/app/views/api_keys/_form.html.erb deleted file mode 100644 index 0adff4155..000000000 --- a/app/views/api_keys/_form.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<%= semantic_form_for [@referential, @api_key] do |form| %> - <%= form.inputs do %> - <%= form.input :name %> - <% unless @api_key.new_record? %> - <%= form.input :token, :input_html => { :readonly => true } %> - <% end %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - diff --git a/app/views/api_keys/_form.html.slim b/app/views/api_keys/_form.html.slim new file mode 100644 index 000000000..74b806677 --- /dev/null +++ b/app/views/api_keys/_form.html.slim @@ -0,0 +1,10 @@ += semantic_form_for [@referential, @api_key] do |form| + = form.inputs do + = form.input :name + + - unless @api_key.new_record? + = form.input :token, :input_html => { :readonly => true } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link
\ No newline at end of file diff --git a/app/views/api_keys/edit.html.erb b/app/views/api_keys/edit.html.erb deleted file mode 100644 index 7d367421e..000000000 --- a/app/views/api_keys/edit.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('api_keys.edit.title') %> - -<%= render "form" %> - diff --git a/app/views/api_keys/edit.html.slim b/app/views/api_keys/edit.html.slim new file mode 100644 index 000000000..110f0775d --- /dev/null +++ b/app/views/api_keys/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('api_keys.edit.title') + +== render 'form'
\ No newline at end of file diff --git a/app/views/api_keys/new.html.erb b/app/views/api_keys/new.html.erb deleted file mode 100644 index 40dd1a4fe..000000000 --- a/app/views/api_keys/new.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= title_tag t('api_keys.new.title') %> - -<%= render "form" %> - diff --git a/app/views/api_keys/new.html.slim b/app/views/api_keys/new.html.slim new file mode 100644 index 000000000..f7b1dd99b --- /dev/null +++ b/app/views/api_keys/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('api_keys.new.title') + +== render "form"
\ No newline at end of file diff --git a/app/views/api_keys/show.html.erb b/app/views/api_keys/show.html.erb deleted file mode 100644 index 1fb5236b3..000000000 --- a/app/views/api_keys/show.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<%= title_tag t('api_keys.show.title') %> - -<div class="api_keys_show"> - - <div class="summary"> - <p> - <label><%= @api_key.class.human_attribute_name("name") %>: </label> - <%= @api_key.name %> - </p> - <p> - <label><%= @api_key.class.human_attribute_name("token") %>: </label> - <%= @api_key.token %> - </p> - </div> -</div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('api_keys.actions.new'), new_referential_api_key_path(@referential), :class => "add" %></li> - <li><%= link_to t('api_keys.actions.edit'), edit_referential_api_key_path(@referential, @api_key), :class => "edit" %></li> - <li><%= link_to t('api_keys.actions.destroy'), referential_api_key_path(@referential, @api_key), :method => :delete, :data => {:confirm => t('api_keys.actions.destroy_confirm')}, :class => "remove" %></li> - <br> -</ul> -<% end %> diff --git a/app/views/api_keys/show.html.slim b/app/views/api_keys/show.html.slim new file mode 100644 index 000000000..b65717408 --- /dev/null +++ b/app/views/api_keys/show.html.slim @@ -0,0 +1,18 @@ += title_tag t('api_keys.show.title') + +.api_keys_show + .summary + p + label = "#{@api_key.class.human_attribute_name('name')} : " + = @api_key.name + + p + label = "#{@api_key.class.human_attribute_name('token')} : " + = @api_key.token + +- content_for :sidebar do + ul.actions + li = link_to t('api_keys.actions.new'), new_referential_api_key_path(@referential), class: "add" + li = link_to t('api_keys.actions.edit'), edit_referential_api_key_path(@referential, @api_key), class: "edit" + li = link_to t('api_keys.actions.destroy'), referential_api_key_path(@referential, @api_key), :method => :delete, :data => {:confirm => t('api_keys.actions.destroy_confirm')}, class: "remove" + br
\ No newline at end of file |
