Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMSF thumbnails support #40

Closed
dinya opened this issue Aug 1, 2017 · 28 comments
Closed

DMSF thumbnails support #40

dinya opened this issue Aug 1, 2017 · 28 comments
Assignees
Milestone

Comments

@dinya
Copy link

dinya commented Aug 1, 2017

Thanks a lot for amazing plugin!

The question

  1. Thumbnail with internal redmine macros
{{thumbnail(fig.png, size=300)}}
  1. Thumbnail with DMSF macros
{{dmsftn(777, size=300)}}

The first works well with redmine_lightbox2 (I use v0.3.2) --- the figure is opened in the current tab as window. The second doesn't work --- it's opened in the new tab like without redmine_lightbox2.

Is it possible to add DMSF thumbnails support?

@tofi86
Copy link
Collaborator

tofi86 commented Aug 1, 2017

This should be doable. I will try to have a look in the next couple of days...

@tofi86 tofi86 added this to the Version 0.4.1 milestone Aug 1, 2017
@tofi86
Copy link
Collaborator

tofi86 commented Aug 6, 2017

Note: In Redmine 3.4 the DMFS plugin seems to have a bug with the size parameter: danmunn/redmine_dmsf#746 It does not get evaluated.

@tofi86 tofi86 closed this as completed in 5942a8a Aug 6, 2017
@tofi86
Copy link
Collaborator

tofi86 commented Aug 6, 2017

Alright, this has been resolved with new version 0.4.1 for Redmine 3.4

@tofi86 tofi86 self-assigned this Aug 6, 2017
tofi86 added a commit that referenced this issue Aug 6, 2017
Adds the `thumbnail` class to DMSF thumbnails created by the DMSF thumbnail macro: `{{dmsftn(123)}}`

# Conflicts solved by tofi86
#	assets/javascripts/lightbox.js
@tofi86
Copy link
Collaborator

tofi86 commented Aug 6, 2017

This has been backported to Redmine 3.3 branch without testing and made available as version 0.3.4 for Redmine 3.3

@dinya
Copy link
Author

dinya commented Aug 7, 2017

Thanks for the work done!

But v0.3.4 doesn't work with {{dmsftn}} under Redmine 3.3.1 + DMSF 1.5.9 (from master) + Ruby 2.3.3-p222 (Ubuntu 16.04 x64): the figure is opened in the new tab like in the original Redmine.

@tofi86
Copy link
Collaborator

tofi86 commented Aug 7, 2017

Unfortunately I don't have a Redmine 3.3 around here for testing. I could set up a dev installation but that would take a while.

Can you please copy the HTML a element including img child element of the thumbnail and insert here?

And then please disable the lightbox plugin and copy the same, original element once again and insert here. This is the original element and I have to see what I have to modify.

@tofi86 tofi86 reopened this Aug 7, 2017
@dinya
Copy link
Author

dinya commented Aug 7, 2017

Can you please copy the HTML a element including img child element of the thumbnail and insert here?

And then please disable the lightbox plugin and copy the same, original element once again and insert here. This is the original element and I have to see what I have to modify.

With redmine_lightbox2 v0.3.4

<a target="_blank" title="" data-downloadurl="image/png:TEST_IMAGE.png:/dmsf/files/351/view" href="/dmsf/files/351/view"><img alt="TEST_IMAGE" width="auto" height="200" src="/dmsf/files/351/view" /></a>

Without redmine_lightbox2 v0.3.4 (redmine_lightbox2 was deleted with bundle exec rake redmine:plugins:migrate NAME=redmine_lightbox2 VERSION=0 RAILS_ENV=production and plugin directory was removed from plugins)

<a target="_blank" title="" data-downloadurl="image/png:TEST_IMAGE.png:/dmsf/files/351/view" href="/dmsf/files/351/view"><img alt="TEST_IMAGE" width="auto" height="200" src="/dmsf/files/351/view" /></a>

They are seem identically?

@tofi86
Copy link
Collaborator

tofi86 commented Aug 7, 2017

Thanks! Indeed they look the same, but with the lightbox it should look different...

Which browser do you use?

Where did you use the thumbnail macro? On a wiki page or in an issue description/comment? Or somewhere else?

Can you reinstall the plugin and make sure you run the plugin migration? And also make sure to clear the browser cache for your redmine site after that so that JavaScript files get a fresh reload...

@dinya
Copy link
Author

dinya commented Aug 7, 2017

And also make sure to clear the browser cache for your redmine site after that so that JavaScript files get a fresh reload...

This helped. Thanks!

btw, {{dmsf_image(8)}} macros inserts image too. Will you add it's support?

@dinya
Copy link
Author

dinya commented Aug 7, 2017

... and description from dmsf file.

I mean adding the result of {{dmsfdesc(351)}} to the file name in the figure subscription (like for ordinary attachments)

@tofi86
Copy link
Collaborator

tofi86 commented Aug 7, 2017

This helped. Thanks!

Great! Glad it works now! :-)

@tofi86 tofi86 closed this as completed Aug 7, 2017
@tofi86
Copy link
Collaborator

tofi86 commented Aug 7, 2017

btw, {{dmsf_image(8)}} macros inserts image too. Will you add it's support?

I had a look at this as well, but it does not generate a Thumbnail Link (a element) which I could use as an anchor for the lightbox. So no, this will not be supported.

@tofi86
Copy link
Collaborator

tofi86 commented Aug 7, 2017

... and description from dmsf file.

I mean adding the result of {{dmsfdesc(351)}} to the file name in the figure subscription (like for ordinary attachments)

This is not doable because the description does not exist in the html code when {{dmsftn()}} macro was executed. I only add lightbox effect with javascript when page is loaded but in that stage I cannot pull the description with a macro anymore. Sorry.

@dinya
Copy link
Author

dinya commented Aug 11, 2017

I have filename.doc (ms office) file with id 100 in DMSF. I linked to the file with {{dmsf(100)}} on the wiki page.

When I click to corresdoning link the redmine_lightbox2 tries to render the dmsf document and shows popup window titled with filename.doc:

The requested content cannot be loaded.
Please try again later.

@tofi86
Copy link
Collaborator

tofi86 commented Aug 14, 2017

Thanks for reporting this. I will try to have a look this week...

@tofi86
Copy link
Collaborator

tofi86 commented Aug 15, 2017

I pushed a fix to the master branch for Redmine 3.4 and to the redmine-3.3 branch for Redmine 3.3

Can you please test it? It should work.

doc documents will not show in a lightbox, other documents will not as well, but PDF documents inserted with {{dmsf(100)}} will show in a preview lightbox.

Is this okay? If so, please tell me and I will release a new version in the next couple of days...

@dinya
Copy link
Author

dinya commented Aug 16, 2017

Unfortunately without any changes.

May be I made a mistake while update? I use redmine 3.3 and I made

git fetch
git checkout redmine-3.3
bundle exec rake redmine:plugins:migrate RAILS_ENV=production 

What I noted. After saving the text with {{dmsf(100)}} (docx) the plugin works: download -- not preview. But if I reload the page the plugin tries to show the preview window again

@tofi86
Copy link
Collaborator

tofi86 commented Aug 16, 2017

I assume you have already cloned the repository and checked out the branch redmine-3.3. In that case you only fetched the changes, but did not pull them:

git fetch
git checkout redmine-3.3
git pull
bundle exec rake redmine:plugins:migrate RAILS_ENV=production

Try again and reload the page without cache (clear browser cache first or e.g. with Firefox use Ctrl+Shift+R).

@dinya
Copy link
Author

dinya commented Aug 17, 2017

@tofi86

It's ok now. Thanks!

@tofi86
Copy link
Collaborator

tofi86 commented Aug 17, 2017

Perfect! Glad it works! Enjoy!

@dinya
Copy link
Author

dinya commented Sep 5, 2017

@tofi86

*.bmp files are not avalible in preview.

@tofi86
Copy link
Collaborator

tofi86 commented Sep 10, 2017

As far as I know, bmp is also not supported as thumbnail in Redmine. The plugin never supported bmp files for preview, only JPG, JPEG, PNG, GIF.

@dinya
Copy link
Author

dinya commented Apr 19, 2018

Dear @tofi86,

Redmine DMSF 1.6.x allows documents attachements to issue.

Is it doable to add preview thumbnails of DMS section with preview lightbox?

Current variant

current

Attachments section

<div class="attachments">
<div class="contextual">
  <a title="Edit attached files" class="icon-only icon-edit" href="/attachments/issues/562/edit">Edit attached files</a>
</div>
<table>
<tbody><tr>
  <td>
      <a class="icon icon-attachment lightbox_preview" href="/attachments/download/820/test_image0.jpg">test_image0.jpg</a>      </td>
      <td class="alignrigth">
      <a class="icon-only icon-magnifier lightbox_preview jpg" rel="attachments" title="test_image0.jpg" href="/attachments/download/820/test_image0.jpg">View</a>

    <a class="icon-only icon-download" title="Download" href="/attachments/download/820/test_image0.jpg">test_image0.jpg</a>  </td>
  <td class="alignrigth">
    <span class="size">763 KB</span>
  </td>
  <td></td>
  <td>
      <span class="author">Redmine Admin, 04/19/2018 12:16 PM</span>
  </td>
  <td>
      <a data-confirm="Are you sure?" class="delete icon-only icon-del" title="Delete" rel="nofollow" data-method="delete" href="/attachments/820">Delete</a>
  </td>
</tr>
</tbody></table>
	  <div class="images">
	      <a class="lightbox" rel="thumbnails" title="test_image0.jpg" href="/attachments/download/820/test_image0.jpg"><img src="/attachments/download/820/test_image0.jpg" alt="Test image0" width="180"></a>
	  </div>
</div>

DMS section

<div class="attachments dmsf_parent_container">
          <p>
  <a class="thumbnail" title="test_image1.jpg" href="/dmsf/files/1329/view" data-fancybox-type="image">test image1</a>
      <a class="icon-only icon-magnifier" title="View" href="/dmsf/files/1329/view">View</a>
  
  <span class="size">(760 KB)</span>
  <span class="author">Redmine Admin, 04/19/2018 12:17 PM</span>
  <span class="dmsf_upload_select">
      <a title="test image1 details" class="icon-only icon-edit" href="/dmsf/files/1329"></a>
    <a title="Send documents by email" class="icon-only icon-email-disabled" rel="nofollow" data-method="post" href="/projects/5/dmsf/entries?email_entries=email&amp;files%5B%5D=1329"></a>
      <a title="Lock to prevent changes for other members" class="icon-only icon-lock" href="/dmsf/files/1329/lock"></a>
        <a title="Notifications not active: Activate" class="icon-only icon-email-add" href="/dmsf/files/1329/notify/activate"></a>
        <a data-confirm="Are you sure?" title="Delete" class="icon-only icon-del" rel="nofollow" data-method="delete" href="/dmsf/files/1329?commit=yes"></a>
    
            <span class="icon-only"></span>

  </span>
</p>

          <p>
  <a target="_blank" class="icon icon-file filetype-docx dmsf-icon-file" title="" data-downloadurl="application/vnd.openxmlformats-officedocument.wordprocessingml.document:test ms word document.docx:/dmsf/files/1330/view" href="/dmsf/files/1330/view">test ms word document</a>
  
  <span class="size">(24.1 KB)</span>
  <span class="author">Redmine Admin, 04/19/2018 12:38 PM</span>
  <span class="dmsf_upload_select">
      <a title="test ms word document details" class="icon-only icon-edit" href="/dmsf/files/1330"></a>
    <a title="Send documents by email" class="icon-only icon-email-disabled" rel="nofollow" data-method="post" href="/projects/5/dmsf/entries?email_entries=email&amp;files%5B%5D=1330"></a>
      <a title="Lock to prevent changes for other members" class="icon-only icon-lock" href="/dmsf/files/1330/lock"></a>
        <a title="Notifications not active: Activate" class="icon-only icon-email-add" href="/dmsf/files/1330/notify/activate"></a>
        <a data-confirm="Are you sure?" title="Delete" class="icon-only icon-del" rel="nofollow" data-method="delete" href="/dmsf/files/1330?commit=yes"></a>
    
            <span class="icon-only"></span>

  </span>
</p>

    

  </div>

Want

want

DMS section like this

<div class="attachments dmsf_parent_container">
          <p>
  <a class="thumbnail" title="test_image1.jpg" href="/dmsf/files/1329/view" data-fancybox-type="image">test image1</a>
      <a class="icon-only icon-magnifier" title="View" href="/dmsf/files/1329/view">View</a>
  
  <span class="size">(760 KB)</span>
  <span class="author">Redmine Admin, 04/19/2018 12:17 PM</span>
  <span class="dmsf_upload_select">
      <a title="test image1 details" class="icon-only icon-edit" href="/dmsf/files/1329"></a>
    <a title="Send documents by email" class="icon-only icon-email-disabled" rel="nofollow" data-method="post" href="/projects/5/dmsf/entries?email_entries=email&amp;files%5B%5D=1329"></a>
      <a title="Lock to prevent changes for other members" class="icon-only icon-lock" href="/dmsf/files/1329/lock"></a>
        <a title="Notifications not active: Activate" class="icon-only icon-email-add" href="/dmsf/files/1329/notify/activate"></a>
        <a data-confirm="Are you sure?" title="Delete" class="icon-only icon-del" rel="nofollow" data-method="delete" href="/dmsf/files/1329?commit=yes"></a>
    
            <span class="icon-only"></span>

  </span>
</p>

          <p>
  <a target="_blank" class="icon icon-file filetype-docx dmsf-icon-file" title="" data-downloadurl="application/vnd.openxmlformats-officedocument.wordprocessingml.document:test ms word document.docx:/dmsf/files/1330/view" href="/dmsf/files/1330/view">test ms word document</a>
  
  <span class="size">(24.1 KB)</span>
  <span class="author">Redmine Admin, 04/19/2018 12:38 PM</span>
  <span class="dmsf_upload_select">
      <a title="test ms word document details" class="icon-only icon-edit" href="/dmsf/files/1330"></a>
    <a title="Send documents by email" class="icon-only icon-email-disabled" rel="nofollow" data-method="post" href="/projects/5/dmsf/entries?email_entries=email&amp;files%5B%5D=1330"></a>
      <a title="Lock to prevent changes for other members" class="icon-only icon-lock" href="/dmsf/files/1330/lock"></a>
        <a title="Notifications not active: Activate" class="icon-only icon-email-add" href="/dmsf/files/1330/notify/activate"></a>
        <a data-confirm="Are you sure?" title="Delete" class="icon-only icon-del" rel="nofollow" data-method="delete" href="/dmsf/files/1330?commit=yes"></a>
    
            <span class="icon-only"></span>

  </span>
</p>

	  <div class="images">
	      <a class="lightbox" rel="thumbnails" title="test_image1.jpg" href="/dmsf/files/1329/view"><img src="/dmsf/files/1329/view" alt="test image1" width="180"></a>
	  </div>    

  </div>

My environment

My environment

Environment:
  Redmine version                3.4.5.stable
  Ruby version                   2.3.3-p222 (2016-11-21) [x86_64-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
...
  redmine_dmsf                   1.6.1
...
  redmine_lightbox2              0.4.3
...

@tofi86
Copy link
Collaborator

tofi86 commented Apr 20, 2018

The dmsf project needs to fix severe bug danmunn/redmine_dmsf#845 first before I can do this.

Anyways, how is it possible to attach dmsf files to an issue? Haven't found a solution (but also couldn't access projects settings due to bug mentioned above).

@dinya
Copy link
Author

dinya commented Apr 20, 2018

Anyways, how is it possible to attach dmsf files to an issue? Haven't found a solution (but also couldn't access projects settings due to bug mentioned above).

Look at redmine_dmsf plugin settings in Administration. According to changelog this feature since 1.6.0. It looks like checkbox named smth like "Attach*issue*" (sorry, haven't Redmine with dmsf v1.6.x onboard near at hand).

@tofi86
Copy link
Collaborator

tofi86 commented Apr 20, 2018

found it, thanks! "act as attachable"

@tofi86
Copy link
Collaborator

tofi86 commented Apr 21, 2018

added a separate issue for this request => #53

@dinya please always open a new issue for requests in the future...

@dinya
Copy link
Author

dinya commented Apr 22, 2018

@tofi86

please always open a new issue for requests in the future...

Okay. Pardon, I just thought the request is in this issue context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants