# HG changeset patch # User nanaya # Date 1433612749 -32400 # Node ID 2ddd61aca2c8894fa6d10c897f134fbf53c82adc # Parent 2ad092e60975a85d647d82d9e18ab676c255e160 I18n. And refactor paste privacy settings form. diff -r 2ad092e60975 -r 2ddd61aca2c8 app/helpers/pastes_helper.rb --- a/app/helpers/pastes_helper.rb Sun Jun 07 02:35:12 2015 +0900 +++ b/app/helpers/pastes_helper.rb Sun Jun 07 02:45:49 2015 +0900 @@ -11,4 +11,8 @@ end end end + + def paste_privacy_options + { "public" => "0", "private" => "1" } + end end diff -r 2ad092e60975 -r 2ddd61aca2c8 app/views/pastes/_form.html.erb --- a/app/views/pastes/_form.html.erb Sun Jun 07 02:35:12 2015 +0900 +++ b/app/views/pastes/_form.html.erb Sun Jun 07 02:45:49 2015 +0900 @@ -8,28 +8,26 @@
- <%= f.label :key, "Deletion key", :class => "form-label" %> + <%= f.label :key, t(".deletion_key"), :class => "form-label" %> <%= f.text_field :key %>
-
Privacy
- +
<%= t(".privacy.label") %>
- + <% paste_privacy_options.each do |label, value| %> + + <% end %>
<%= f.button %> - <%= button_tag "Clear", :type => "button", :id => "reset_paste" %> + <%= button_tag t(".clear"), :type => "button", :id => "reset_paste" %>
<% end %> diff -r 2ad092e60975 -r 2ddd61aca2c8 config/locales/en.yml --- a/config/locales/en.yml Sun Jun 07 02:35:12 2015 +0900 +++ b/config/locales/en.yml Sun Jun 07 02:45:49 2015 +0900 @@ -2,4 +2,11 @@ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. en: - hello: "Hello world" + pastes: + form: + clear: Clear + deletion_key: Deletion key + privacy: + label: Privacy + private: Private + public: Public