oauth2_server/app/views/site/clients/show.html.erb in social_stream-2.1.1 vs oauth2_server/app/views/site/clients/show.html.erb in social_stream-2.2.0
- old
+ new
@@ -1,121 +1,119 @@
<section id="site_client">
<%= render partial: 'toolbar/home' %>
- <section class="site_client" id="<%= dom_id @client %>">
+ <section class="site_client" id="<%= dom_id resource %>">
<header>
- <h1>
- <%= @client.name %>
- <a class="go-more" href="#">
- ir a tus demás aplicaciones
- </a>
- </h1>
+ <h4>
+ <%= resource.name %>
+ <% if can?(:update, resource) %>
+ <%= link_to t('site.client.button.edit'), polymorphic_path(resource, action: 'edit'), class: "edit" %>
+ <% end %>
+ </h4>
+
<%= image_tag('logos/app-default.png', class: "logo-app pull-right") %>
</header>
<div class="content">
<div class="gereral-info">
<h4>
<%= Site::Client.human_attribute_name :description %>
</h4>
<div class="result">
- <%= @client.description%>
+ <%= resource.description%>
</div>
<h4>
<%= Site::Client.human_attribute_name :url %>
</h4>
<div class="result">
- <%= link_to @client.url, @client.url%>
+ <%= link_to resource.url, resource.url%>
</div>
- <% if can? :update, @client %>
+ <% if can? :update, resource %>
<h4>
<%= Site::Client.human_attribute_name :callback_url %>
</h4>
<div class="result">
- <%= @client.callback_url %>
+ <%= resource.callback_url %>
</div>
<% end %>
</div>
- <% if can? :update, @client %>
- <div class="btn-group">
- <a class="dropdown-toggle" data-toggle="dropdown" href="#">
- Credentials
- <span class="caret"></span>
- </a>
- <ul class="dropdown-menu">
- <li>
- <h6>
- <%= Site::Client.human_attribute_name :id %>
- </h6>
- <p>
- <%= @client.id %>
- </p>
- </li>
-
- <li class="client-secret">
- <h6>
- <%= Site::Client.human_attribute_name :secret %>
- <a href="#" class="pull-right">refresh</a>
- </h6>
- <p>
- <%= @client.secret %>
- </p>
- </li>
- </ul>
- </div>
+ <% if can? :update_secret, resource %>
+ <div class="accordion" id="accordion2">
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
+ <%= t 'site.client.oauth.credentials' %>
+ </a>
+ </div>
+ <div id="collapseOne" class="accordion-body collapse">
+ <div class="accordion-inner">
+ <div class="content settings_content collapse in">
+ <div class="result">
+ <div class="client-id">
+ <h6>
+ <%= Site::Client.human_attribute_name :id %>
+ </h6>
+ <p>
+ <%= resource.id %>
+ </p>
+ </div>
+ <div class="client-secret">
+ <h6>
+ <%= Site::Client.human_attribute_name :secret %>
+ <%= form_tag update_secret_site_client_path(resource, format: :json), class: "site-client-secret" do %>
+ <%= submit_tag t('site.client.oauth.secret.refresh'), class: 'pull-right' %>
+ <% end %>
+ </h6>
+ <p>
+ <span class="site-client-secret"><%= resource.secret %></span>
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
<% end %>
</div>
</section>
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li class="active"><a href="#authorized" data-toggle="tab">Authorized</a></li>
- <li><a href="#registered" data-toggle="tab">Registered</a></li>
- <li><a href="#stats" data-toggle="tab">Stats</a></li>
+ <li><a href="#registered" data-toggle="tab">Users</a></li>
</ul>
- <div class="search-nav hidden-phone">
- <%= form_tag search_path, method: 'get', class: "navbar-search pull-left" do %>
- <%= text_field_tag :q, nil, autocomplete: :off, class: 'search-query input-small', placeholder: t('search.name'), "data-min_query" => SocialStream::Search::MIN_QUERY %>
- <% end %>
- <%= javascript_tag do %>
- $(function() {
- SocialStream.SearchHeader.show();
- });
- <% end %>
+
+ <%= render partial: 'contacts/add_button',
+ locals: {
+ sender: resource,
+ type: [ :user, :group ]
+ }
+ %>
- <div class="mat">
- <%= render partial: 'layouts/loading' %>
-
- <div class="query_too_short">
- <%= t 'search.at_least', count: SocialStream::Search::MIN_QUERY %>
- </div>
-
- <div class="no_results">
- <%= t 'search.nothing' %>
- </div>
-
- <div class="results">
- </div>
- </div>
+ <div class="btn-group" data-toggle="buttons">
+ <button type="radio" name="options" id="option1">user</button>
+ <button type="radio" name="options" id="option2"">organization</button>
</div>
+ <%= text_field_tag "contact-filter", "", placeholder: "filter", autocomplete: "off" %>
<div class="tab-content">
<div class="tab-pane active" id="authorized">
<%= render partial: 'contacts/contact',
- collection: @client.sent_contacts.first(12) %>
+ collection: resource.sent_contacts.first(12) %>
</div>
<div class="tab-pane" id="registered">
</div>
-
- <div class="tab-pane" id="stats">
- </div>
</div>
</div>
+ <%= javascript_tag do %>
+ SocialStream.SiteClient.show();
+ <% end %>
</section>