Merge remote-tracking branch 'upstream/pull/3489'

This commit is contained in:
Tom Hughes 2022-03-05 10:08:53 +00:00
commit 5110b1c706
9 changed files with 32 additions and 27 deletions

View file

@ -7,10 +7,12 @@
<% if @applications.length > 0 %>
<table class="table table-borderless table-striped">
<thead>
<tr>
<th><%= t ".name" %></th>
<th><%= t ".permissions" %></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<%= render :partial => "application", :collection => @applications %>

View file

@ -48,4 +48,4 @@
<div>
<%= link_to t(".edit"), edit_oauth_application_path(@application), :class => "btn btn-outline-primary" %>
<%= link_to t(".delete"), oauth_application_path(@application), { :method => :delete, :class => "btn btn-outline-danger", :data => { :confirm => t(".confirm_delete") } } %>
</td>
</div>

View file

@ -7,9 +7,11 @@
<% if @applications.length > 0 %>
<table class="table table-borderless table-striped">
<thead>
<tr>
<th><%= t ".application" %></th>
<th><%= t ".permissions" %></th>
<th></th>
</tr>
</thead>
<tbody>
<%= render :partial => "application", :collection => @applications %>

View file

@ -1,10 +1,10 @@
<%= javascript_include_tag "edit/id" %>
<div id="map">
<% data = { :key => Settings.id_key } -%>
<% data[:lat] = @lat if @lat -%>
<% data[:lon] = @lon if @lon -%>
<% data[:gpx] = trace_data_url(params[:gpx], :format => :xml) if params[:gpx] -%>
<% data[:url] = id_url(:locale => params[:locale]) -%>
<% data = { :key => Settings.id_key }
data[:lat] = @lat if @lat
data[:lon] = @lon if @lon
data[:gpx] = trace_data_url(params[:gpx], :format => :xml) if params[:gpx]
data[:url] = id_url(:locale => params[:locale]) %>
<%= tag.iframe "", :frameBorder => 0, :id => "id-embed", :class => "id-embed", :allowfullscreen => "", :data => data %>
</div>

View file

@ -16,7 +16,7 @@
<a href='<%= t ".#{site}.url" %>'>
<%= t ".#{site}.title" %>
</a>
</h3>
</h6>
<p class='card-text'><%= t ".#{site}.description" %></p>
</div>
<div class="card-footer">

View file

@ -8,16 +8,16 @@
<!-- <![endif]-->
</head>
<body>
<% data = {} -%>
<% if Settings.key?(:id_key) %>
<% token = current_user.access_token(Settings.id_key) %>
<% data[:token] = token.token -%>
<% data[:token_secret] = token.secret -%>
<% data[:consumer_key] = token.client_application.key -%>
<% data[:consumer_secret] = token.client_application.secret -%>
<% end %>
<% data[:locale] = ID::LOCALES.preferred(preferred_languages).to_s -%>
<% data[:asset_map] = assets("iD").to_json -%>
<% data = {}
if Settings.key?(:id_key)
token = current_user.access_token(Settings.id_key)
data[:token] = token.token
data[:token_secret] = token.secret
data[:consumer_key] = token.client_application.key
data[:consumer_secret] = token.client_application.secret
end
data[:locale] = ID::LOCALES.preferred(preferred_languages).to_s
data[:asset_map] = assets("iD").to_json %>
<%= tag.div "", :id => "id-container", :data => data %>
</body>
</html>

View file

@ -2,6 +2,7 @@
<% content_for :heading do %>
<h1><%= t(".heading_html", :name => link_to(@user.display_name, user_path(@user))) %></h1>
<% end %>
<% unless @user_blocks.empty? %>
<%= render :partial => "blocks", :locals => { :show_revoke_link => can?(:revoke, UserBlock), :show_user_name => false, :show_creator_name => true } %>
<% else %>

View file

@ -51,7 +51,7 @@ class Oauth2ApplicationsControllerTest < ActionDispatch::IntegrationTest
get oauth_applications_path
assert_response :success
assert_template "oauth2_applications/index"
assert_select "tr", 2
assert_select "tbody tr", 2
end
def test_new

View file

@ -33,7 +33,7 @@ class Oauth2AuthorizedApplicationsControllerTest < ActionDispatch::IntegrationTe
get oauth_authorized_applications_path
assert_response :success
assert_template "oauth2_authorized_applications/index"
assert_select "tr", 2
assert_select "tbody tr", 2
end
def test_destroy
@ -58,6 +58,6 @@ class Oauth2AuthorizedApplicationsControllerTest < ActionDispatch::IntegrationTe
get oauth_authorized_applications_path
assert_response :success
assert_template "oauth2_authorized_applications/index"
assert_select "tr", 1
assert_select "tbody tr", 1
end
end