Commit 90d67f8b authored by gwendal's avatar gwendal
Browse files

add easy copy-to-clipboard login and password for service

parent 4cf73958
......@@ -47,3 +47,4 @@ gem "cocoon"
gem 'rails-erd', group: :development
gem 'maildown'
gem 'select2-rails'
gem 'clipboard-rails'
......@@ -80,6 +80,7 @@ GEM
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
choice (0.2.0)
clipboard-rails (1.7.1)
cocoon (1.2.14)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
......@@ -384,6 +385,7 @@ DEPENDENCIES
cancancan (~> 1.10)
capybara (>= 1.1.2)
capybara-select2!
clipboard-rails
cocoon
coffee-rails
config
......
......@@ -21,6 +21,7 @@
//= require cocoon
//= require font_awesome5
//= require select2-full
//= require clipboard
//= require_tree .
$(document).ready(function() {
......@@ -37,3 +38,11 @@ $(document).ready(function() {
theme: "bootstrap"
});
});
/* activate clipboard */
$(document).ready(function(){
var clipboard = new Clipboard('.clipboard-btn');
console.log(clipboard);
});
......@@ -18,15 +18,22 @@
</ul>
</p>
<p>
<b><%= t(:member) %>:</b>
<b><%= t(:member) %> :</b>
<%= link_to @service.member.name, @service.member %>
</p>
<% if @service.authenticate_by_login_and_password? %>
<p class="technic_login">
<b><%= Service.human_attribute_name('technic_login') %> / <%= t('service.password') %> :</b>
<%= @service.technic_login %> / <span class="password"><%= @service.password%></span>
</p>
<b><%= Service.human_attribute_name('technic_login') %> :</b> <span id="login"><%= @service.technic_login %></span>
<button class="clipboard-btn btn btn-xs" data-clipboard-action="copy" data-clipboard-target="#login">
<%= fa_icon("clipboard", alt: "Copy to clipboard") %>
</button>
</br>
<b><%= Service.human_attribute_name('password') %> :</b> <span id="password", class="password"><%= @service.password%></span>
<button class="clipboard-btn btn btn-xs" data-clipboard-action="copy" data-clipboard-target="#password">
<%= fa_icon("clipboard", alt: "Copy to clipboard") %>
</button>
</p
<% end %>
<% if @service.authenticate_by_mac? %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment