[Git][noosfero/noosfero][master] 2 commits: Uses CMS links for media_panel images

Rodrigo Souto gitlab at mg.gitlab.com
Thu Jun 29 09:48:24 BRT 2017


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
ac6209f2 by Gabriel Silva at 2017-06-27T04:40:03+00:00
Uses CMS links for media_panel images

Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>

- - - - -
48db84b1 by Rodrigo Souto at 2017-06-29T12:47:20+00:00
Merge branch 'media_panel_imgs' into 'master'

Uses CMS links for media_panel images

Closes #223

See merge request !1257
- - - - -


2 changed files:

- app/views/cms/media_panel/_image.html.erb
- test/functional/cms_controller_test.rb


Changes:

=====================================
app/views/cms/media_panel/_image.html.erb
=====================================
--- a/app/views/cms/media_panel/_image.html.erb
+++ b/app/views/cms/media_panel/_image.html.erb
@@ -1,6 +1,6 @@
 <div class="item image" data-item="span" title="<%= @file.name %>">
   <span>
-    <%= image_tag(@file.public_filename(:uploaded)) %>
+    <%= image_tag(@file.full_path) %>
   </span>
   <div class="controls image-controls">
     <a class="button icon-add add-to-text" href="#"><span><%= _('Add to the text') %></span></a>


=====================================
test/functional/cms_controller_test.rb
=====================================
--- a/test/functional/cms_controller_test.rb
+++ b/test/functional/cms_controller_test.rb
@@ -2057,6 +2057,12 @@ class CmsControllerTest < ActionController::TestCase
     assert_equivalent [author1.id, author2.id], article.versions.map(&:last_changed_by_id)
   end
 
+  should 'display CMS links for media panel images' do
+    file = UploadedFile.create!(:profile => profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
+    get :published_media_items, profile: profile.identifier
+    assert_tag 'img', attributes: { src: file.full_path }
+  end
+
   protected
 
   # FIXME this is to avoid adding an extra dependency for a proper JSON parser.



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/930edc3335915a4f28aaaba80e8358b1d2f495b4...48db84b1d97f5537039f75bf136a956310094c89

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/930edc3335915a4f28aaaba80e8358b1d2f495b4...48db84b1d97f5537039f75bf136a956310094c89
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170629/ccbc4f23/attachment-0001.html>


More information about the Noosfero-dev mailing list