[web2py] Re: built-in wiki

2016-04-22 Thread briannd81
Solution to this is pass in argument attachment=False when calling 
response.download inside media function from tools.py

On Tuesday, April 19, 2016 at 5:09:32 PM UTC-4, bria...@gmail.com wrote:
>
> I use the built-in wiki for my application. I created a page (slug) and 
> upload the image using the built-in media function. I created a link to 
> display the large image when user clicked on the thumbnail, but instead it 
> downloads the image.
>
> This is my code within the page.
>
> 
>
> Please advise how can I display the larger image when user click on the 
> link instead of saving the image.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: built-in wiki

2016-04-20 Thread briannd81
Can you elaborate more on both solutions? How can I get this to work when I 
create the image link inside the slug?

On Tuesday, April 19, 2016 at 5:09:32 PM UTC-4, bria...@gmail.com wrote:
>
> I use the built-in wiki for my application. I created a page (slug) and 
> upload the image using the built-in media function. I created a link to 
> display the large image when user clicked on the thumbnail, but instead it 
> downloads the image.
>
> This is my code within the page.
>
> 
>
> Please advise how can I display the larger image when user click on the 
> link instead of saving the image.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: built-in wiki

2016-04-20 Thread Dave S


On Wednesday, April 20, 2016 at 8:35:45 AM UTC-7, bria...@gmail.com wrote:
>
> I apologize. My initial question is not very clear so I'll rephrase it 
> more appropriately.
>
> The problem here is that when I link to the image it's saving it instead 
> of display it, and the latter is my intention.
>
> It looks like this feature is built into web2py. I think the following 
> HTTP header causes the image to be saved rather than display. How do I 
> change this default behavior?
>
>
> *Content-Disposition: attachment; filename="wirelessicon.jpg"*
>
> I appreciate any advise given.
>
>
> On Tuesday, April 19, 2016 at 5:09:32 PM UTC-4, bria...@gmail.com wrote:
>
>> I use the built-in wiki for my application. I created a page (slug) and 
>> upload the image using the built-in media function. I created a link to 
>> display the large image when user clicked on the thumbnail, but instead it 
>> downloads the image.
>>
>> This is my code within the page.
>>
>> 
>>
>> Please advise how can I display the larger image when user click on the 
>> link instead of saving the image.
>>
>
Instead of an anchor tag, you need an image tag.

Look at 
http://web2py.com/books/default/chapter/29/03/overview#An-image-blog>,
and scroll down to where the "show()" controller is defined, and then 
further down to where "show.html" is defined.

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: built-in wiki

2016-04-20 Thread Leonel Câmara
You can either make another download controller or use a request.vars to 
flag that you don't want the link to download, example making another 
controller function just for this:


@cache.action()
def download_noattach():
return response.download(request, db, attachment=False)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: built-in wiki

2016-04-20 Thread briannd81
I apologize. My initial question is not very clear so I'll rephrase it more 
appropriately.

The problem here is that when I link to the image it's saving it instead of 
display it, and the latter is my intention.

It looks like this feature is built into web2py. I think the following HTTP 
header causes the image to be saved rather than display. How do I change 
this default behavior?


*Content-Disposition: attachment; filename="wirelessicon.jpg"*

I appreciate any advise given.


On Tuesday, April 19, 2016 at 5:09:32 PM UTC-4, bria...@gmail.com wrote:

> I use the built-in wiki for my application. I created a page (slug) and 
> upload the image using the built-in media function. I created a link to 
> display the large image when user clicked on the thumbnail, but instead it 
> downloads the image.
>
> This is my code within the page.
>
> 
>
> Please advise how can I display the larger image when user click on the 
> link instead of saving the image.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: built-in wiki

2016-04-19 Thread Dave S
On Tuesday, April 19, 2016 at 3:36:18 PM UTC-7, Dave S wrote:
>
>
>
> On Tuesday, April 19, 2016 at 2:09:32 PM UTC-7, bria...@gmail.com wrote:
>>
>> I uploaded the image via the media function of the built-in wiki. I 
>> created a link to the larger image to display it when user click on 
>> the thumbnail. But instead, it downloads the larger image.
>>
>> Please advise how to display the image instead of download it through the 
>> anchor tag.
>>
>> > src="@21/wirelessicon-thumbnail.jpg" />
>>
>> Thanks,
>> CD
>>
>
>
> What you may want is an onclick() function that uses ajax to replace the 
> thumbnail image with the full image.  You'd wrap the img tag in a div with 
> an id (say, "target"), and the ajax call would replace the contents of the 
> div (with another img tag).
>
> If you want the thumbnail to still be displayed, you'd have it's img tag 
> outside the "target" div.
>
> See more detail at 
> http://web2py.com/books/default/chapter/29/11/jquery-and-ajax>
>
>
You may find the LOAD() helper easier to start with than the direct ajax:
http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components--LOAD-and-Ajax>

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: built-in wiki

2016-04-19 Thread Dave S


On Tuesday, April 19, 2016 at 2:09:32 PM UTC-7, bria...@gmail.com wrote:
>
> I uploaded the image via the media function of the built-in wiki. I 
> created a link to the larger image to display it when user click on 
> the thumbnail. But instead, it downloads the larger image.
>
> Please advise how to display the image instead of download it through the 
> anchor tag.
>
>  src="@21/wirelessicon-thumbnail.jpg" />
>
> Thanks,
> CD
>


What you may want is an onclick() function that uses ajax to replace the 
thumbnail image with the full image.  You'd wrap the img tag in a div with 
an id (say, "target"), and the ajax call would replace the contents of the 
div (with another img tag).

If you want the thumbnail to still be displayed, you'd have it's img tag 
outside the "target" div.

See more detail at 
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax>

/dps


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: built-in wiki

2015-01-11 Thread Niphlod
http://web2py.com/books/default/chapter/29/03/overview#Extending-the-auth-wiki-feature

On Sunday, January 11, 2015 at 5:50:24 PM UTC+1, mweissen wrote:
>
> I want to use the built-in wiki.
> Ok, it starts. But (silly question): where is the storage for the new 
> pages. Is it a database table? But there is no db.wiki... or 
> db.auth_wiki
>
> ​R​
> egar
> ​d​
> s, Martin
>
> 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: built-in wiki

2013-10-29 Thread 98ujko9
Thanks for reporting the issue.

On Tuesday, October 29, 2013 3:38:04 PM UTC-4, Alan Etkin wrote:
>
>  
>>
>> Note: The current markmin render engine requires a first line-break for 
>> multi-line code, otherwise it renders as single line. Try adding a leading 
>> line-break in the text box.
>>
>
> Nevermind that.
>
> http://code.google.com/p/web2py/issues/detail?id=1746 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: built-in wiki

2013-10-29 Thread Alan Etkin
 
>
> Note: The current markmin render engine requires a first line-break for 
> multi-line code, otherwise it renders as single line. Try adding a leading 
> line-break in the text box.
>

Nevermind that.

http://code.google.com/p/web2py/issues/detail?id=1746 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: built-in wiki

2013-10-29 Thread Alan Etkin
> Why is it that when I click the preview button the style for markmin 
items like ``this is some code`` looks OK (code is highlighted, break 
> lines are present) and when I click on submit a record I see a page where 
code text is in a different style (in red color and there is no line 
> breaks). My version of web2py: 2.7.4-stable+timestamp.2013.10.14.15.16.29

Note: The current markmin render engine requires a first line-break for 
multi-line code, otherwise it renders as single line. Try adding a leading 
line-break in the text box.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: built-in wiki

2013-10-29 Thread Alan Etkin

>
> Hello,
> I am new to web programming. I use web2py built-in wiki: auth.wiki(), the 
> simplest form. Why is it that when I click the preview button the style for 
> markmin items like ``this is some code`` looks OK (code is highlighted, 
> break lines are present) and when I click on submit a record I see a page 
> where code text is in a different style (in red color and there is no line 
> breaks). My version of web2py: 2.7.4-stable+timestamp.2013.10.14.15.16.29
> Any help will be appreciated. Thanks
>

This may be a bug in tools.py. Please file an issue in 
http://code.google.com/p/issues 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.