2012-03-28 00:58:03 +01:00
|
|
|
- platforms = Platform.main.opened.where(:distrib_type => APP_CONFIG['distr_types'].first).order('name ASC')
|
2012-03-19 15:16:35 +00:00
|
|
|
|
2012-03-27 17:51:34 +01:00
|
|
|
- if platforms.count > 0
|
|
|
|
.command_select
|
|
|
|
%h3= t("layout.platforms.sys_repos_header")
|
2012-03-19 15:16:35 +00:00
|
|
|
|
2012-03-27 17:51:34 +01:00
|
|
|
.leftlist= label_tag :platform, t("layout.platforms.target_platform")
|
|
|
|
.rightlist= select_tag :platform, options_from_collection_for_select(platforms, :name, :name, platforms.first.id)
|
|
|
|
.both
|
2012-03-19 15:16:35 +00:00
|
|
|
|
2012-03-27 17:51:34 +01:00
|
|
|
- arches = Arch.order('name ASC')
|
|
|
|
.leftlist= label_tag :arch, t("layout.platforms.target_architecture")
|
|
|
|
.rightlist= select_tag :arch, options_from_collection_for_select(arches, :name, :name, arches.first.id)
|
|
|
|
.both
|
2012-03-19 15:16:35 +00:00
|
|
|
|
2012-03-27 17:51:34 +01:00
|
|
|
.rightlist
|
|
|
|
%textarea{:id => 'command_string', :readonly => 'readonly'}
|
|
|
|
.both
|
2012-03-19 15:16:35 +00:00
|
|
|
|
2012-03-27 17:51:34 +01:00
|
|
|
:javascript
|
|
|
|
$(document).ready(function(){
|
|
|
|
var path_getter = function() {
|
|
|
|
var list = #{@platform.urpmi_list(request.host).to_json};
|
|
|
|
var $platform = $("select#platform");
|
|
|
|
var $arch = $("select#arch");
|
|
|
|
|
|
|
|
$('#command_string').val(list[$platform.val()][$arch.val()]);
|
|
|
|
// alert('hello');
|
|
|
|
}
|
|
|
|
$("select#platform").live('change', path_getter);
|
|
|
|
$("select#arch").live('change', path_getter);
|
|
|
|
$("textarea#command_string").live('click', function() {
|
|
|
|
this.select();
|
|
|
|
});
|
|
|
|
path_getter();
|
2012-03-19 15:16:35 +00:00
|
|
|
});
|
|
|
|
|