Save state when recently created

1.0
Fernando Blat 14 years ago
parent 4ef51ab8b5
commit 35c1fce8ef

@ -115,6 +115,10 @@ class Table < Sequel::Model(:user_tables)
save_changes save_changes
end end
def pending_to_save?
self.name =~ /^untitle_table/
end
# TODO: use the database field # TODO: use the database field
def rows_counted def rows_counted
owner.in_database do |user_database| owner.in_database do |user_database|

@ -10,7 +10,13 @@
<div class="inner_subheader"> <div class="inner_subheader">
<div class="left"> <div class="left">
<h2><a href="#change_title"><%= @table.name %></a></h2> <h2><a href="#change_title"><%= @table.name %></a></h2>
<p class="status"><a class="<%= table_privacy_text(@table).downcase %>" href="#change_privacy"><%= table_privacy_text(@table) %></a></p> <p class="status">
<% if @table.pending_to_save? %>
<a class="save" href="#change_privacy">SAVE</a>
<% else %>
<a class="<%= table_privacy_text(@table).downcase %>" href="#change_privacy"><%= table_privacy_text(@table) %></a>
<% end %>
</p>
<span class="tags"> <span class="tags">
<% unless @table.tags.blank? %> <% unless @table.tags.blank? %>
<% @table.tags.split(',').each do |tag_name| %> <% @table.tags.split(',').each do |tag_name| %>

@ -269,7 +269,7 @@ feature "Dashboard", %q{
page.find('div.create_window span.bottom input#create_table').click page.find('div.create_window span.bottom input#create_table').click
page.should have_css("h2", :text => 'untitle_table') page.should have_css("h2", :text => 'untitle_table')
page.should have_css("p.status", :text => 'PUBLIC') page.should have_css("p.status a.save", :text => 'SAVE')
end end
end end

Loading…
Cancel
Save