- Detabify views.
- Move translations to correct names.
- Make flash messages translatable.
def create
@client_application = @user.client_applications.build(params[:client_application])
if @client_application.save
- flash[:notice] = "Registered the information successfully"
+ flash[:notice] = t'oauth_clients.create.flash'
redirect_to :action => "show", :id => @client_application.id
else
render :action => "new"
def update
@client_application = @user.client_applications.find(params[:id])
if @client_application.update_attributes(params[:client_application])
- flash[:notice] = "Updated the client information successfully"
+ flash[:notice] = t'oauth_clients.update.flash'
redirect_to :action => "show", :id => @client_application.id
else
render :action => "edit"
def destroy
@client_application = @user.client_applications.find(params[:id])
@client_application.destroy
- flash[:notice] = "Destroyed the client application registration"
+ flash[:notice] = t'oauth_clients.destroy.flash'
redirect_to :action => "index"
end
end
@token = @user.oauth_tokens.find_by_token params[:token]
if @token
@token.invalidate!
- flash[:notice] = "You've revoked the token for #{@token.client_application.name}"
+ flash[:notice] = t('oauth.revoke.flash', :application => @token.client_application.name)
end
logger.info "about to redirect"
redirect_to :controller => 'oauth_clients', :action => 'index'
<h1>Authorize access to your account</h1>
-<p><%= t('oauth.client_application.request_access', :app_name => link_to(@token.client_application.name,@token.client_application.url)) %></p>
+<p><%= t('oauth.oauthorize.request_access', :app_name => link_to(@token.client_application.name,@token.client_application.url)) %></p>
<% form_tag authorize_url do %>
<%= hidden_field_tag "oauth_token", @token.token %>
<%- if params[:oauth_callback] -%>
- <%= hidden_field_tag "oauth_callback", params[:oauth_callback] %>
-<%- end -%>
-<p><%= t 'oauth.client_application.allow_to' %></p>
-<ul style="list-style:none">
-<% @token.client_application.permissions.each do |perm| %>
- <li><%= check_box_tag perm.to_s, "yes", @token.read_attribute(perm) %><%= t "oauth.client_application.#{perm}" %></li>
-<% end %>
-</ul>
-<p>
- <%= submit_tag %>
-</p>
+ <%= hidden_field_tag "oauth_callback", params[:oauth_callback] %>
+ <%- end -%>
+ <p><%= t 'oauth.oauthorize.allow_to' %></p>
+ <ul style="list-style:none">
+ <% @token.client_application.permissions.each do |perm| %>
+ <li><%= check_box_tag perm.to_s, "yes", @token.read_attribute(perm) %><%= t "oauth.oauthorize.#{perm}" %></li>
+ <% end %>
+ </ul>
+ <p><%= submit_tag %></p>
<% end %>
<div class="field">
- <label for="client_application_name"><%= t'oauth.client_application.form.name' %> (<%= t'oauth.client_application.form.required' %>)</label><br/>
- <%= f.text_field :name %>
+ <label for="client_application_name"><%= t'oauth_clients.form.name' %> (<%= t'oauth_clients.form.required' %>)</label><br/>
+ <%= f.text_field :name %>
</div>
<div class="field">
- <label for="client_application_url"><%= t'oauth.client_application.form.url' %> (<%= t'oauth.client_application.form.required' %>)</label><br/>
- <%= f.text_field :url %>
+ <label for="client_application_url"><%= t'oauth_clients.form.url' %> (<%= t'oauth_clients.form.required' %>)</label><br/>
+ <%= f.text_field :url %>
</div>
<div class="field">
- <label for="client_application_callback_url"><%= t'oauth.client_application.form.callback_url' %></label><br/>
- <%= f.text_field :callback_url %>
+ <label for="client_application_callback_url"><%= t'oauth_clients.form.callback_url' %></label><br/>
+ <%= f.text_field :callback_url %>
</div>
<div class="field">
- <label for="client_application_support_url"><%= t'oauth.client_application.form.support_url' %></label><br/>
- <%= f.text_field :support_url %>
+ <label for="client_application_support_url"><%= t'oauth_clients.form.support_url' %></label><br/>
+ <%= f.text_field :support_url %>
</div>
-<p><%= t'oauth.client_application.form.requests' %></p>
+<p><%= t'oauth_clients.form.requests' %></p>
<% ClientApplication.all_permissions.each do |perm| %>
<div class="field">
<%= f.check_box perm %>
- <label for="client_application_<%= perm.to_s %>"><%= t('oauth.client_application.form.' + perm.to_s) %></label><br/>
+ <label for="client_application_<%= perm.to_s %>"><%= t('oauth_clients.form.' + perm.to_s) %></label><br/>
</div>
<% end %>
-<h1><%= t'oauth.client_application.edit.title' %></h1>
+<h1><%= t'oauth_clients.edit.title' %></h1>
<% form_for :client_application, @client_application, :url => oauth_client_path(@client_application.user.display_name, @client_application), :html => { :method => :put } do |f| %>
- <%= render :partial => "form", :locals => { :f => f } %>
- <br/>
- <%= submit_tag t'oauth.client_application.edit.submit' %>
+ <%= render :partial => "form", :locals => { :f => f } %>
+ <br/>
+ <%= submit_tag t'oauth_clients.edit.submit' %>
<% end %>
-<h1><%= t'oauth.client_application.index.title' %></h1>
+<h1><%= t'oauth_clients.index.title' %></h1>
<% unless @tokens.empty? %>
-<h3><%= t'oauth.client_application.index.my_tokens' %></h3>
-<p><%= t'oauth.client_application.index.list_tokens' %></p>
+<h3><%= t'oauth_clients.index.my_tokens' %></h3>
+<p><%= t'oauth_clients.index.list_tokens' %></p>
<table>
- <tr><th><%= t'oauth.client_application.index.application' %></th>
- <th><%= t'oauth.client_application.index.issued_at' %></th><th> </th></tr>
+ <tr><th><%= t'oauth_clients.index.application' %></th>
+ <th><%= t'oauth_clients.index.issued_at' %></th><th> </th></tr>
<% @tokens.each do |token|%>
<% content_tag_for :tr, token do %>
<td><%= link_to token.client_application.name, token.client_application.url %></td>
<td>
<% form_tag :controller => 'oauth', :action => 'revoke' do %>
<%= hidden_field_tag 'token', token.token %>
- <%= submit_tag t('oauth.client_application.index.revoke') %>
+ <%= submit_tag t('oauth_clients.index.revoke') %>
<% end %>
</td>
<% end %>
<% end %>
</table>
<% end %>
-<h3><%= t'oauth.client_application.index.my_apps' %></h3>
+<h3><%= t'oauth_clients.index.my_apps' %></h3>
<% if @client_applications.empty? %>
-<p><%= t('oauth.client_application.index.no_apps', :oauth => "<a href=\"http://oauth.net\">OAuth</a>") %></p>
+<p><%= t('oauth_clients.index.no_apps', :oauth => "<a href=\"http://oauth.net\">OAuth</a>") %></p>
<% else %>
-<p><%= t'oauth.client_application.index.registered_apps' %></p>
+<p><%= t'oauth_clients.index.registered_apps' %></p>
<% @client_applications.each do |client|%>
<% div_for client do %>
<%= link_to client.name, :action => :show, :id => client.id %>
<% end %>
<% end %>
<% end %>
-<h3><%= link_to t('oauth.client_application.index.register_new'), :action => :new %></h3>
+<h3><%= link_to t('oauth_clients.index.register_new'), :action => :new %></h3>
-<h1><%= t'oauth.client_application.new.title' %></h1>
+<h1><%= t'oauth_clients.new.title' %></h1>
<% form_for :client_application, :url => { :action => :create } do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<br />
- <%= submit_tag t('oauth.client_application.new.submit') %>
+ <%= submit_tag t('oauth_clients.new.submit') %>
<% end %>
-<p><%= t('oauth.client_application.not_found', :type => @type) %></p>
+<p><%= t('oauth_clients.not_found.sorry', :type => @type) %></p>
-<h1><%= t('oauth.client_application.show.title', :app_name => @client_application.name) %></h1>
+<h1><%= t('oauth_clients.show.title', :app_name => @client_application.name) %></h1>
<p>
- <b><%= t'oauth.client_application.show.key' %></b> <%=@client_application.key %>
+ <b><%= t'oauth_clients.show.key' %></b> <%=@client_application.key %>
</p>
<p>
- <b><%= t'oauth.client_application.show.secret' %></b> <%=@client_application.secret %>
+ <b><%= t'oauth_clients.show.secret' %></b> <%=@client_application.secret %>
</p>
<p>
- <b><%= t'oauth.client_application.show.url' %></b> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.request_token_path %>
+ <b><%= t'oauth_clients.show.url' %></b> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.request_token_path %>
</p>
<p>
- <b><%= t'oauth.client_application.show.access_url' %></b> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.access_token_path %>
+ <b><%= t'oauth_clients.show.access_url' %></b> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.access_token_path %>
</p>
<p>
- <b><%= t'oauth.client_application.show.authorize_url' %></b> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.authorize_path %>
+ <b><%= t'oauth_clients.show.authorize_url' %></b> http<%='s' if request.ssl? %>://<%= request.host_with_port %><%=@client_application.oauth_server.authorize_path %>
</p>
-<p><%= t'oauth.client_application.show.requests' %></p>
+<p><%= t'oauth_clients.show.requests' %></p>
<ul><% @client_application.permissions.each do |perm| %>
<div class="field">
- <li><%= t('oauth.client_application.form.' + perm.to_s) %></li>
+ <li><%= t('oauth_clients.form.' + perm.to_s) %></li>
</div>
<% end %></ul>
-<p><%= t'oauth.client_application.show.support_notice' %></p>
-
-<p><%= link_to t('oauth.client_application.show.edit'), edit_oauth_client_url(@client_application.user.display_name, @client_application) %></p>
+<p><%= t'oauth_clients.show.support_notice' %></p>
+<p><%= link_to t('oauth_clients.show.edit'), edit_oauth_client_url(@client_application.user.display_name, @client_application) %></p>