<%= @page.image.label%>
+diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 3559cd5..44d968b 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -101,6 +101,11 @@ class CmsController < MyProfileController record_coming if request.post? @article.image = nil if params[:remove_image] == 'true' + if @article.image.present? && params[:article][:image_builder] && + params[:article][:image_builder][:label] + @article.image.label = params[:article][:image_builder][:label] + @article.image.save! + end @article.last_changed_by = user if @article.update_attributes(params[:article]) if !continue diff --git a/app/models/image.rb b/app/models/image.rb index 2cf4ecd..5a78449 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -23,7 +23,7 @@ class Image < ActiveRecord::Base postgresql_attachment_fu - attr_accessible :uploaded_data + attr_accessible :uploaded_data, :label def current_data File.file?(full_filename) ? File.read(full_filename) : nil diff --git a/app/views/content_viewer/_article_title.html.erb b/app/views/content_viewer/_article_title.html.erb new file mode 100644 index 0000000..7ab4502 --- /dev/null +++ b/app/views/content_viewer/_article_title.html.erb @@ -0,0 +1,33 @@ +<% if @page.belongs_to_blog? || @page.belongs_to_forum?%> + <% unless no_link %> +
<%= @page.image.label%>
+