Changeset 856
- Timestamp:
- 03/21/08 18:06:18 (5 months ago)
- Files:
-
- edge/streamlined/CHANGELOG (modified) (1 diff)
- edge/streamlined/lib/streamlined/column/active_record.rb (modified) (3 diffs)
- edge/streamlined/lib/streamlined/view/show_views.rb (modified) (1 diff)
- edge/streamlined/templates/relationships/show_views/_enumeration.rhtml (added)
- edge/streamlined/test/unit/streamlined/column/active_record_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
edge/streamlined/CHANGELOG
r854 r856 3 3 - added CSS IDs to each item table row on the list view (MJB) 4 4 - now outputting flash notices on the list view (MJB) 5 - fixed enumeration editing bugs (MJB) 5 6 6 7 1.0RC02 -- 02/22/08 edge/streamlined/lib/streamlined/column/active_record.rb
r847 r856 35 35 end 36 36 37 def show_view 38 Streamlined::View::ShowViews.create_summary(:enumeration) 39 end 40 37 41 def render_td_show(view, item) 38 42 if enumeration 39 43 content = item.send(self.name) 40 44 if enumeration.first.is_a?(Array) 41 key_value_pair = enumeration .detect { |e| e.last == content }45 key_value_pair = enumeration_key_for(content) 42 46 content = key_value_pair.first if key_value_pair 43 47 end … … 54 58 end 55 59 60 def enumeration_key_for(value) 61 enumeration.detect { |e| e.last == value } 62 end 63 56 64 def render_td_list(view, item) 57 65 id = relationship_div_id(name, item) … … 59 67 div = div_wrapper(id) { div } if enumeration 60 68 div += view.link_to_function("Edit", "Streamlined.Enumerations." << 61 "open_enumeration('#{id}', this, '/#{view.controller_ name}')") if enumeration && editable69 "open_enumeration('#{id}', this, '/#{view.controller_path}')") if enumeration && editable 62 70 div 63 71 end edge/streamlined/lib/streamlined/view/show_views.rb
r688 r856 38 38 end 39 39 40 # Renders the enumeration value. 41 class Enumeration < Streamlined::View::Base 42 43 end 44 40 45 class Graph < Streamlined::View::Base 41 46 def must_have_sparklines! edge/streamlined/test/unit/streamlined/column/active_record_test.rb
r847 r856 257 257 258 258 def setup_mocks(item_attrs={}) 259 @view = flexmock(:controller_ name => 'controller_name', :link_to_function => 'link')259 @view = flexmock(:controller_path => 'controller_path', :link_to_function => 'link') 260 260 @item = flexmock(item_attrs.reverse_merge(:id => 123, :column => 'render')) 261 261 end
