Skip to content

Commit

Permalink
[webui] Rails now expects '<%=' in front of *_tag, *_for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
saschpe authored and coolo committed Jun 28, 2012
1 parent ced3de2 commit a021d61
Show file tree
Hide file tree
Showing 86 changed files with 140 additions and 141 deletions.
4 changes: 2 additions & 2 deletions src/webui/app/mobile_views/main/login.html.erb
Expand Up @@ -5,7 +5,7 @@
<% if PROXY_AUTH_MODE == :on %>
<div>
<% form_tag(PROXY_AUTH_LOGIN_PAGE, :method => :post, :id => 'login_form', :enctype => 'application/x-www-form-urlencoded') do %>
<%= form_tag(PROXY_AUTH_LOGIN_PAGE, :method => :post, :id => 'login_form', :enctype => 'application/x-www-form-urlencoded') do %>
<%= hidden_field_tag(:url, "#{@return_to_host}#{@return_to_path}") %>
<%= hidden_field_tag(:context, 'default') %>
<%= hidden_field_tag(:proxypath, 'reserve') %>
Expand Down Expand Up @@ -40,7 +40,7 @@
<% else %>

<div id="login-form">
<% form_tag( :controller => :user, :action => :do_login ) do %>
<%= form_tag( :controller => :user, :action => :do_login ) do %>
<%= hidden_field_tag(:return_to_path, @return_to_path) %>
<table class="vertical">
<tr>
Expand Down
10 changes: 6 additions & 4 deletions src/webui/app/models/bs_request.rb
Expand Up @@ -363,7 +363,8 @@ def events
end

def actions(with_diff = true)
return Rails.cache.fetch("request_#{value('id')}_actions", :expires_in => 7.days) do
#TODO: Fix!
#return Rails.cache.fetch("request_#{value('id')}_actions", :expires_in => 7.days) do
actions, action_index = [], 0
each_action do |xml|
action = {:type => xml.value('type'), :xml => xml}
Expand Down Expand Up @@ -438,11 +439,12 @@ def actions(with_diff = true)
actions << action
end
actions
end
#end
end

def actiondiffs
return Rails.cache.fetch("request_#{value('id')}_actiondiffs", :expires_in => 7.days) do
#TODO: Fix!
#return Rails.cache.fetch("request_#{value('id')}_actiondiffs", :expires_in => 7.days) do
actiondiffs = []
begin
transport ||= ActiveXML::Config::transport_for :bsrequest
Expand All @@ -457,7 +459,7 @@ def actiondiffs
rescue ActiveXML::Transport::NotFoundError, ActiveXML::Transport::Error => e
end
actiondiffs
end
#end
end

# Check if 'user' is maintainer in _all_ request targets:
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/attribute/edit.html.erb
Expand Up @@ -16,7 +16,7 @@

<h2><%= h @pagetitle %> <%= h @selected_attribute_name %></h2>

<% form_tag :action => "save" do %>
<%= form_tag :action => "save" do %>
<p>
<% if @selected_attribute_name %>
<% values = @selected_attribute_value %>
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/configuration/connect_instance.html.erb
@@ -1,4 +1,4 @@
<% content_for :head_javascript do %>
<%= content_for :head_javascript do %>
function useOpenSUSE(){
document.getElementById('name').value = "openSUSE.org";
document.getElementById('remoteurl').value = "https://api.opensuse.org/public";
Expand Down Expand Up @@ -36,7 +36,7 @@ function useMeeGo(){
</div>

<h3>Add custom OBS instance</h3>
<% form_tag :action => :save_instance do -%>
<%= form_tag :action => :save_instance do -%>
<table id="instance">
<tr>
<td><strong>Local Project Name:</strong></td>
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/configuration/index.html.erb
Expand Up @@ -19,7 +19,7 @@ as well as managing users and groups.
<div class="show_left box">
<h3>Available Scheduler Architectures</h3>
<p>You can recommended architectures to be selected by default when a new project or package is created. The new project or package will then build against this architecture (for it's configured repositories).</p>
<% form_tag(:action => 'update_architectures') do %>
<%= form_tag(:action => 'update_architectures') do %>
<table>
<thead>
<tr>
Expand Down Expand Up @@ -47,7 +47,7 @@ as well as managing users and groups.
<div class="grid_8 omega">
<div class="show_right box">
<h3>User Interface</h3>
<% form_tag(:action => 'update_configuration') do %>
<%= form_tag(:action => 'update_configuration') do %>
<p>
<%= label_tag :title, 'Title:' %><br/>
<%= text_field_tag :title, @configuration['title'].gsub(" Open Build Service", "") %> Open Build Service
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/driver_update/create.html.erb
Expand Up @@ -3,7 +3,7 @@
<% project_bread_crumb @package.name -%>
<%= render :partial => "package/tabs" %>
<% content_for :ready_function do %>
<%= content_for :ready_function do %>
$("#target_project").autocomplete({source: '<%= url_for :controller => 'project', :action => 'autocomplete_projects' %>', minLength: 2});

$('#target_project').result(function(event, data, formatted) {
Expand Down Expand Up @@ -138,7 +138,7 @@
your workstation when using osc.</p>


<% form_tag :controller => "driver_update", :action => "save" do %>
<%= form_tag :controller => "driver_update", :action => "save" do %>


<h2>General Configuration:</h2>
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/group/index.html.erb
Expand Up @@ -29,7 +29,7 @@
<p><i>There are no groups configured</i></p>
<% end %>
<% javascript_tag do %>
<%= javascript_tag do %>
$(document).ready(function() {
<% if @groups.length > 0 %>
$('#group_table').dataTable();
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/group/show.html.erb
Expand Up @@ -19,7 +19,7 @@

<p><%= link_to('Show all groups', groups_path) %></p>

<% javascript_tag do %>
<%= javascript_tag do %>
$(document).ready(function() {
$('#group_members_table').dataTable();
});
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/layouts/_personal_navigation.html.erb
Expand Up @@ -13,7 +13,7 @@
<% end %>
<%= link_to 'Login', { :controller => :user, :action => :login }, :id => "login-trigger" %>
<div id="login-form">
<% form_tag(PROXY_AUTH_LOGIN_PAGE, :method => :post, :id => 'login_form', :enctype => 'application/x-www-form-urlencoded') do %>
<%= form_tag(PROXY_AUTH_LOGIN_PAGE, :method => :post, :id => 'login_form', :enctype => 'application/x-www-form-urlencoded') do %>
<p>
<%= hidden_field_tag(:url, "#{@return_to_host}#{@return_to_path}") %>
<%= hidden_field_tag(:context, 'default') %>
Expand All @@ -37,7 +37,7 @@
<% end %>
<%= link_to 'Login', { :controller => :user, :action => :login }, :id => 'login-trigger' %>
<div id="login-form">
<% form_tag(:controller => :user, :action => :do_login) do %>
<%= form_tag(:controller => :user, :action => :do_login) do %>
<p>
<%= hidden_field_tag(:return_to_path, @return_to_path) %>
<%= label_tag(:username, 'Username') %>
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/layouts/_watch_and_search.html.erb
Expand Up @@ -32,7 +32,7 @@
<%- end -%>
<% form_tag({:controller => 'search', :action => 'search'}, {:method => :post, :id => "global-search-form", :class => "label-overlay"}) do -%>
<%= form_tag({:controller => 'search', :action => 'search'}, {:method => :post, :id => "global-search-form", :class => "label-overlay"}) do -%>
<div style="display: inline">
<label for="search">Search</label>
<%= text_field_tag 'search_text', '', :id => 'search'-%>
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/main/_add_news_dialog.html.erb
Expand Up @@ -3,7 +3,7 @@
<div class="dialog darkgrey_box">
<div class="box box-shadow">
<h2 class="box-header">Add New Message</h2>
<% form_tag({:controller => 'main', :action => 'add_news'}, :method => 'post') do %>
<%= form_tag({:controller => 'main', :action => 'add_news'}, :method => 'post') do %>
<p>
<%= label_tag(:message, 'Message:') %><br/>
<%= text_area_tag(:message, '', :size => '40x3') %><br/>
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/main/_delete_message_dialog.html.erb
Expand Up @@ -4,7 +4,7 @@
<div class="box box-shadow">
<h2 class="box-header">Delete Confirmation</h2>
<p>Really delete this message?</p>
<% form_tag({:controller => 'main', :action => 'delete_message'}, :method => 'post') do %>
<%= form_tag({:controller => 'main', :action => 'delete_message'}, :method => 'post') do %>
<%= hidden_field_tag(:message_id, params[:message_id]) %>
<div class="buttons">
<%= submit_tag('Ok') %>
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/main/_latest_updates.erb
@@ -1,4 +1,4 @@
<% content_for :content_for_head do %>
<%= content_for :content_for_head do %>
<%= auto_discovery_link_tag(:rss, {:controller => 'main', :action => 'latest_updates', :format => 'rss'}, {:title => 'Latest updates'}) %>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/main/_news.html.erb
@@ -1,4 +1,4 @@
<% content_for :content_for_head do %>
<%= content_for :content_for_head do %>
<%= auto_discovery_link_tag(:rss, {:controller => 'main', :action => 'news', :format => 'rss'}, {:title => 'News'}) %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/main/_systemstatus.html.erb
Expand Up @@ -8,7 +8,7 @@
currently <%= @workerstatus.elements("building").length %> of <%= @workerstatus["clients"] %> build hosts are busy building packages.
At the moment <%= @waiting_packages %> packages are waiting on the different architectures.
</p>
<% javascript_tag do %>
<%= javascript_tag do %>
$.plot($("#overallgraph"), [ { data: <%= MonitorHelper.print_statistics_array(@busy) %>, label: "Busy workers", color: 3} ],
{
series: { stack: true, lines: { show: true, steps: false, fill: true } },
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/main/index.html.erb
Expand Up @@ -30,7 +30,7 @@
<%= render :partial => 'news' %>

<div id="workerstatus_placeholder"></div>
<% javascript_tag do %>
<%= javascript_tag do %>
$.ajax({
url: '<%= url_for(:controller => 'main', :action => 'systemstatus') %>',
success: function(data) { $('#workerstatus_placeholder').html(data); }
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/monitor/_building_table.html.erb
Expand Up @@ -58,7 +58,7 @@
</tbody>
</table>

<% content_for :ready_function do %>
<%= content_for :ready_function do %>
$('#building_table').dataTable({
'aaSorting': [[3, 'desc']],
'bInfo': false,
Expand Down
6 changes: 3 additions & 3 deletions src/webui/app/views/monitor/_events.html.erb
Expand Up @@ -3,7 +3,7 @@
<div class="grid_7 prefix_1 alpha" >
<div class="box box-shadow">
<h2 class="box-header">Options</h2>
<% form_tag(:controller => "main", :action => "index") do %>
<%= form_tag(:controller => "main", :action => "index") do %>
<p>
<strong>Architecture:</strong>
<%= select_tag(:architecture_display, options_for_select(@available_arch_list)) %><br/>
Expand Down Expand Up @@ -37,7 +37,7 @@

<div class="clear"></div>

<% content_for :head_javascript do %>
<%= content_for :head_javascript do %>

var arch_to_show = "<%= @available_arch_list[0] %>"
var time_to_show = "24";
Expand Down Expand Up @@ -98,7 +98,7 @@
}
<% end %>
<% content_for :ready_function do %>
<%= content_for :ready_function do %>
/* plot an empty set */
plotValues({ 'building': [],
'idle': [],
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/monitor/_lights.html.erb
@@ -1,4 +1,4 @@
<% content_for :ready_function do %>
<%= content_for :ready_function do %>
monitor_ready();
<% end %>

Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/monitor/_workers_table.html.erb
@@ -1,4 +1,4 @@
<% content_for :head_javascript do %>
<%= content_for :head_javascript do %>

var logfileinfo = "package";
var container_width = -1;
Expand Down Expand Up @@ -52,7 +52,7 @@
}
<% end %>
<% content_for :ready_function do %>
<%= content_for :ready_function do %>
$("#worker_display option:selected").each(function() { logfileinfo=$(this).attr("value"); });

resizeMonitorBoxes();
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/_branch_dialog.html.erb
Expand Up @@ -6,7 +6,7 @@

<p>Do you really want to branch <%= render :partial => 'shared/project_or_package_link', :locals => {:project => @project.value('name'), :package => @package.value('name')} %>?</p>

<% form_tag({:controller => :package, :action => :branch}, :method => :post) do %>
<%= form_tag({:controller => :package, :action => :branch}, :method => :post) do %>
<%= hidden_field_tag(:project, @project) %>
<%= hidden_field_tag(:package, @package) %>
<div class="buttons">
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/_delete_dialog.html.erb
Expand Up @@ -5,7 +5,7 @@
<h2 class="box-header">Delete Confirmation</h2>
<p>Do you really want to delete <%= render :partial => 'shared/project_or_package_link', :locals => {:project => @project.value('name'), :package => @package.value('name')} %>?</p>

<% form_tag({:controller => :package, :action => :remove}, :method => :post) do %>
<%= form_tag({:controller => :package, :action => :remove}, :method => :post) do %>
<%= hidden_field_tag(:project, @project) %>
<%= hidden_field_tag(:package, @package) %>
<div class="buttons">
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/_files_view.html.erb
Expand Up @@ -36,7 +36,7 @@
<% end %>
</tbody>
</table>
<% javascript_tag do %>
<%= javascript_tag do %>
$(document).ready(function() {
$('#files_table').dataTable({
'aoColumns': [null, null, null, {'bSortable': false}],
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/_rpmlint_result.html.erb
Expand Up @@ -10,7 +10,7 @@

<pre style="font-size: 0.8em; max-height: 500px;" class="plain" id="rpmlint_display_<%= index %>"></pre>

<% javascript_tag do %>
<%= javascript_tag do %>
function update_arch_display(data) {
$('.rpmlint_arch_select_<%= index %>').hide();
$('#rpmlint_arch_select_<%= index %>_' + $('#rpmlint_repo_select_<%= index %>').attr('value')).show();
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/_service_parameters.html.erb
@@ -1,6 +1,6 @@
<div id="dialog_wrapper">

<% javascript_tag do %>
<%= javascript_tag do %>
$('#add_new_row').click(insertRow);
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/_set_url_form.html.erb
@@ -1,5 +1,5 @@
<% form_remote_tag :url => { :action => :set_url },
<%= form_remote_tag :url => { :action => :set_url },
:loading => "$('#url_form_spinner').show()",
:complete => "$('#url_form_spinner').hide()",
:update => 'url_area' do %>
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/package/_submit_request_dialog.html.erb
@@ -1,4 +1,4 @@
<% javascript_tag do %>
<%= javascript_tag do %>
function updateSupersedeAndDevelPackageDisplay() {
if ($('#targetproject')[0].value.length > 0) {
if ($('#targetproject')[0].value == $('#sourceproject')[0].value) {
Expand Down Expand Up @@ -72,7 +72,7 @@
<% tprj = @package.linkinfo.project if @package.linkinfo # fill in from linkinfo %>
<% tprj = params[:targetproject] if params[:targetproject] # allow to override by parameter %>
<% form_tag({:controller => "package", :action => "submit_request"}, :method => "post") do %>
<%= form_tag({:controller => "package", :action => "submit_request"}, :method => "post") do %>
<%= hidden_field_tag(:project, @project) %>
<%= hidden_field_tag(:package, @package) %>
<%= hidden_field_tag(:rev, @revision) %>
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/package/_tabs.html.erb
@@ -1,4 +1,4 @@
<% content_for :ready_function do %>
<%= content_for :ready_function do %>
$("#advanced_tabs_trigger").click(function() {
$("#advanced_tabs").show();
$("#advanced_tabs_trigger").remove();
Expand All @@ -19,7 +19,7 @@
<%= tab 'Users', :controller => 'package', :action => 'users' %>
<% end -%>
<% if is_advanced_tab? %>
<% content_for :ready_function do %>
<%= content_for :ready_function do %>
$("#advanced_tabs").show();
<% end %>
<% else %>
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/package/add_file.html.erb
Expand Up @@ -7,12 +7,12 @@

<p>The filename is taken from the uploaded file if none is provided. Alternatively, if only a filename is provided, a new empty file is created (i.e. touched).</p>

<% form_tag({:action => :save_file, :project => @project, :package => @package}, {:multipart => true}) do %>
<%= form_tag({:action => :save_file, :project => @project, :package => @package}, {:multipart => true}) do %>
<p>
<b>Filename (taken from uploaded file if empty):</b><br/>
<%= text_field_tag('filename', '', :size => 80) %><br/>
<b>Upload from</b> <%= select_tag('file_type', options_for_select([['local file', 'local'], ['remote URL', 'remote']])) %> :<br/>
<% javascript_tag do %>
<%= javascript_tag do %>
$('#file_type').change(function() {
if ($('#file_type option:selected').attr('value') == 'local') {
$('#file').show();
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/edit.html.erb
Expand Up @@ -6,7 +6,7 @@

<h2><%= @pagetitle %></h2>

<% form_tag :action => :save do %>
<%= form_tag :action => :save do %>
<p>
<strong>Title:</strong><br/>
<%= text_field_tag( 'title', @package.title, :size => 80 ) %><br/>
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/package/files.html.erb
Expand Up @@ -3,7 +3,7 @@
<%= render :partial => "tabs" %>
<% content_for :head_javascript do %>
<%= content_for :head_javascript do %>
function insertRow() {
var name = document.getElementById('add_new_parameter').value;
var service = document.getElementById('servicename').value;
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/views/package/live_build_log.html.erb
Expand Up @@ -5,7 +5,7 @@ package_bread_crumb 'Build Log'
<%= render :partial => "tabs" %>
<% content_for :head_javascript do %>
<%= content_for :head_javascript do %>

var scrollmode=0;
var offset=<%= @offset %>;
Expand Down Expand Up @@ -67,7 +67,7 @@ package_bread_crumb 'Build Log'
}
<% end -%>
<% content_for :ready_function do %>
<%= content_for :ready_function do %>
refresh(<%= @offset %>, 1);
$('.start_refresh').click(start_refresh);
$('.stop_refresh').click(stop_refresh);
Expand Down

0 comments on commit a021d61

Please sign in to comment.