Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Usability changes for view objects

  • Loading branch information...
commit 34edb23c1bc05db46fddd3efe2ddfa7fdf557168 1 parent d14d3ff
@adahmash adahmash authored
View
22 app/helpers/admin_helper.rb
@@ -7,7 +7,11 @@ def gen_index_page(collection, model, fields, options = {})
set_model_vars model
html = []
- html << "<br /><h1>#{@model_list_name} List</h1"
+ if model.name == "ViewObject"
+ html << "<br /><h1>Manage Widgets</h1"
+ else
+ html << "<br /><h1>#{@model_list_name} List</h1"
+ end
html << "<br />"
html << "<h2>#{gen_new_link model}</h2>"
@@ -40,7 +44,7 @@ def gen_show_page(item, fields, options = {})
def gen_new_link model
set_model_vars model
if model.name == "ViewObject"
- [link_to("New Automated View Object", new_admin_view_object_path), link_to("New Curated View Object", new_curated_admin_view_objects_path)].join(" | ")
+ [link_to("Create New Automated Widget", new_admin_view_object_path), link_to("Create New Curated Widget", new_curated_admin_view_objects_path)].join(" | ")
elsif model.name != 'Topic'
link_to "New #{@model_name}", new_polymorphic_path([:admin, model])
end
@@ -60,7 +64,13 @@ def gen_table(collection, model, fields, options = {})
html << "<table id='#{model_id}-table' class='admin-table'>"
html << "<thead>"
html << "<tr>"
- fields.each {|field| html << "<th>#{field.to_s.titleize}</th>" }
+ fields.each do |field|
+ if field.to_s == "view_object_template_id"
+ html << "<th>Template</th>"
+ else
+ html << "<th>#{field.to_s.titleize}</th>"
+ end
+ end
html << "<th>Actions</th>"
html << "</tr>"
html << "</thead>"
@@ -148,7 +158,11 @@ def field_value item, field, associations = nil
return item.send(field).to_s unless associations.present?
association = association_exists? field, associations
if association and item.send(association).present?
- "#{link_to h(item.send(association).to_s), [:admin, item.send(association)]}"
+ if field.to_s == "view_object_template_id"
+ "#{link_to h(item.send(association).send("pretty_name").to_s), [:admin, item.send(association)]}"
+ else
+ "#{link_to h(item.send(association).to_s), [:admin, item.send(association)]}"
+ end
else
item.send(field).to_s
end
View
6 app/views/layouts/new_admin.html.haml
@@ -64,10 +64,10 @@
- if not APP_CONFIG['use_view_objects']
%li= link_to 'Feature Stories', admin_featured_items_path
- if APP_CONFIG['use_view_objects']
- %li= link_to 'Build Layout', newer_widgets_admin_widgets_path
- %li= link_to 'Widgets', admin_view_objects_path
+ %li= link_to 'Arrange Layout', newer_widgets_admin_widgets_path
+ %li= link_to 'Manage Widgets', admin_view_objects_path
- else
- %li= link_to 'Build Layout', new_widgets_admin_widgets_path
+ %li= link_to 'Arrange Layout', new_widgets_admin_widgets_path
%li= link_to 'Custom Widgets', admin_metadata_custom_widgets_path
%li= link_to 'Flagged Items', admin_flags_path
%li= link_to 'Stories', admin_contents_path
Please sign in to comment.
Something went wrong with that request. Please try again.