Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #22 from openSUSE/review_121220_some_fixes

[Review] Request from 'digitaltom' @ 'openSUSE/software-o-o/review_121220_some_fixes'
  • Loading branch information...
commit e8b73883d806ea6df3a042bd8394b3e3eecab647 2 parents c2a6e6a + 8190712
@coolo coolo authored
View
2  app/controllers/application_controller.rb
@@ -108,7 +108,7 @@ def required_parameters(*parameters)
def valid_package_name? name
- name =~ /^[[:alnum:]][-_+\w\.:]*$/
+ name =~ /^[[:alnum:]][-+\w\.:\@]*$/
end
def valid_pattern_name? name
View
2  app/views/main/release.html.erb
@@ -160,7 +160,7 @@
<h2 class="box-header centered"><%= _("Language") %></h2>
<form action="<%= url_for :controller => :main, :action => :index %>" method="get" class="centered">
<select name="locale" onChange="this.form.submit();">
- <option value="<%= @lang %>" selected="true"><%= link_to(LANGUAGE_NAMES[@lang.sub('_', '-')] || @lang, :controller => :main, :action => :index, :locale => "#{@lang}") %></option>
+ <option value="<%= @lang %>" selected="true"><%= link_to(LANGUAGE_NAMES[@lang] || @lang, :controller => :main, :action => :index, :locale => "#{@lang}") %></option>
<% LANGUAGES.each do |lang| %>
<option value="<%= lang %>"><%= link_to(LANGUAGE_NAMES[lang] || lang, :controller => :main, :action => :index, :locale => "#{lang}") %></option>
<% end -%>
View
8 app/views/search/_find_form.html.erb
@@ -39,10 +39,12 @@
success: function(html){
$('#search-messages').hide();
},
- error: function(jqXHR, textStatus, errorThrown) {
- $('#msg').html("<%= _("An internal error happened :-(") %>");
- $('#search-messages').show();
+ error:function (jqXHR, textStatus, errorThrown) {
+ if (textStatus != 'abort') {
+ $('#msg').html("<%= _("An internal error happened :-(") %>");
+ $('#search-messages').show();
}
+ }
})
} else if (search_term.length > 0 ) {
View
2  config/initializers/languages.rb
@@ -14,7 +14,7 @@
'km' => 'ភាសាខ្មែរ', 'ko' => '한국어 [韓國語]', 'lt' => 'lietuvių kalba', 'nb' => 'Bokmål',
'nl' => 'Nederlands', 'pl' => 'polski', 'ro' => 'român', 'ru' => 'Русский язык',
'sk' => 'slovenčina', 'th' => 'ภาษาไทย', 'uk' => 'Українська', 'wa' => 'walon',
- 'pt_BR' => 'português', 'z_-TW' => '台語', 'zh_CN' => '简体中文' }
+ 'pt_BR' => 'português', 'zh_TW' => '台語', 'zh_CN' => '简体中文' }
FastGettext.add_text_domain 'software', :path => Rails.root.join('locale')
FastGettext.available_locales = LANGUAGES #all you want to allow
View
14 config/routes.rb
@@ -7,15 +7,15 @@
match 'main/download' => :download
match '121' => :release, :release => "121", :outdated => true
- match '121/:locale' => :release, :release => "121", :outdated => true
+ match '121/:locale' => :release, :release => "121", :outdated => true, :constraints => { :locale => /[\w]+/ }
match ':release' => :release, :constraints => { :release => /[\d]+/ }, :format => false
- match ':release/:locale' => :release, :constraints => { :release => /[\d]+/ }, :format => false
- match 'developer/:locale' => :release, :release => "developer", :format => false
+ match ':release/:locale' => :release, :constraints => { :release => /[\d]+/, :locale => /[\w]+/ }, :format => false
+ match 'developer/:locale' => :release, :release => "developer", :format => false, :constraints => { :locale => /[\w]+/ }
match 'change_install' => :change_install
match 'ymp/:project/:repository/:package.ymp' => :ymp_without_arch_and_version,
- :constraints => { :project => /[\w\-\.:\+]+/, :repository => /[\w\-\.:\+]+/, :package => /[\w\-\.:\+]+/ }
+ :constraints => { :project => /[\w\-\.:\+]+/, :repository => /[\w\-\.:\+]+/, :package => /[-+\w\.:\@]+/ }
match 'ymp/:project/:repository/:arch/:binary.ymp' => :ymp_with_arch_and_version,
:constrains => { :project => /[\w\-\.:]+/, :repository => /[\w\-\.:]+/, :arch => /[\w\-\.:]+/, :binary => /[\w\-\.:\+]+/ }
end
@@ -26,9 +26,9 @@
end
controller :package do
- match 'package/:package' => :show # , :constraints => { :package => /[\w\-\.:\+]+/ }
- match 'package/thumbnail/:package.png' => :thumbnail, :constraints => { :package => /[\w\-\.:\+]+/ }
- match 'package/screenshot/:package.png' => :screenshot, :constraints => { :package => /[\w\-\.:\+]+/ }
+ match 'package/:package' => :show, :constraints => { :package => /[-+\w\.:\@]+/ }
+ match 'package/thumbnail/:package.png' => :thumbnail, :constraints => { :package => /[-+\w\.:\@]+/ }
+ match 'package/screenshot/:package.png' => :screenshot, :constraints => { :package => /[-+\w\.:\@]+/ }
match 'packages' => :categories
match 'appstore' => :categories
Please sign in to comment.
Something went wrong with that request. Please try again.