Re: [mezzanine-users] Extra CSS for Pages

2015-10-13 Thread Stephen McDonald
I think the main point here is that while this would certainly be very
useful for some, many others might make no use of it, at worst cluttering
the UI for them - the criteria for adding it should be that it's broadly
applicable to most users.

That's somewhat of a subjective measurement, but hopefully it provides some
clarity.

On Wed, Oct 14, 2015 at 4:10 PM,  wrote:

> Perhaps that's one difference in how we look at this. If the content
> editors have any technical inclination at all, like you'll find at a small
> startup (and let's be honest, CSS isn't rocket science, you can learn the
> basics before lunch on Codecademy) then they can edit the CSS themselves.
>
> With the 'draft' mode for pages this means they can do all the changes of
> "Hmm, maybe that text there should be a little bigger" or "Can the section
> headers be dark grey?" without requiring a developer or designer to sit
> there and use two peoples time to tweak minor things. And if anything more
> technical comes up ("Can the bullet points be smiley faces?") then instead
> of requiring a new push to the server to tweak a template, it takes 30
> seconds to say "Sure" and change the CSS for the page.
>
> At the end of the day it really doesn't matter to me if it's in mainline
> Mezzanine, it's easy enough to hack in with the EXTRA_MODEL_FIELDS setting.
> I was just pointing out a feature that I've found to be a force-multiplier
> for faster development and more efficient use of everyone's time (which is
> what we all want at the end of the day, unless you're a consultant getting
> paid by the hour) that I thought would be a useful feature out of the box
> for those designers who aren't inclined to dig into the code.
>
> - David
>
>
> On Tuesday, October 13, 2015 at 9:30:51 PM UTC-7, Eduardo Rivas wrote:
>>
>> I tend to follow a different approach with my client projects. With
>> frameworks like Bootstrap you get a UI kit you can customize and provide
>> that to your users. For example, when the content editors want to modify
>> the style of a button, they can add a modifier class to it. The same goes
>> for pretty much any other element. This has the added benefit of being a
>> composable approach, allowing to stack multiple modifier clases that are
>> available through out the site, not only specific pages.
>>
>> It also feels weird to store style information in the database. At least
>> in my experience, it is not the content author's responsibility to tweak
>> styling. It is the designer and the developer who have to provide the tools
>> necessary to give the content writers enough flexibility but staying within
>> the design spec. Hence the approach I explained above (using modifier
>> classes).
>>
>> Now, that's just an opinion, not really an objective argument. If a
>> custom CSS field gains traction, I would ask it to be disabled/enabled via
>> a setting, just like the blog post featured image. Definitely not a level
>> of control I want to give to the users.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Extra CSS for Pages

2015-10-13 Thread dmsanders221
Perhaps that's one difference in how we look at this. If the content 
editors have any technical inclination at all, like you'll find at a small 
startup (and let's be honest, CSS isn't rocket science, you can learn the 
basics before lunch on Codecademy) then they can edit the CSS themselves.

With the 'draft' mode for pages this means they can do all the changes of 
"Hmm, maybe that text there should be a little bigger" or "Can the section 
headers be dark grey?" without requiring a developer or designer to sit 
there and use two peoples time to tweak minor things. And if anything more 
technical comes up ("Can the bullet points be smiley faces?") then instead 
of requiring a new push to the server to tweak a template, it takes 30 
seconds to say "Sure" and change the CSS for the page.

At the end of the day it really doesn't matter to me if it's in mainline 
Mezzanine, it's easy enough to hack in with the EXTRA_MODEL_FIELDS setting. 
I was just pointing out a feature that I've found to be a force-multiplier 
for faster development and more efficient use of everyone's time (which is 
what we all want at the end of the day, unless you're a consultant getting 
paid by the hour) that I thought would be a useful feature out of the box 
for those designers who aren't inclined to dig into the code.

- David

On Tuesday, October 13, 2015 at 9:30:51 PM UTC-7, Eduardo Rivas wrote:
>
> I tend to follow a different approach with my client projects. With 
> frameworks like Bootstrap you get a UI kit you can customize and provide 
> that to your users. For example, when the content editors want to modify 
> the style of a button, they can add a modifier class to it. The same goes 
> for pretty much any other element. This has the added benefit of being a 
> composable approach, allowing to stack multiple modifier clases that are 
> available through out the site, not only specific pages.
>
> It also feels weird to store style information in the database. At least 
> in my experience, it is not the content author's responsibility to tweak 
> styling. It is the designer and the developer who have to provide the tools 
> necessary to give the content writers enough flexibility but staying within 
> the design spec. Hence the approach I explained above (using modifier 
> classes). 
>
> Now, that's just an opinion, not really an objective argument. If a custom 
> CSS field gains traction, I would ask it to be disabled/enabled via a 
> setting, just like the blog post featured image. Definitely not a level of 
> control I want to give to the users.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Changing admin inline to "Orderable"

2015-10-13 Thread Christian Hoffmann
Hello,
How to enable direct access to the _order field in the admin? 
Thanks a lot...


-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Extra CSS for Pages

2015-10-13 Thread Eduardo Rivas
I tend to follow a different approach with my client projects. With
frameworks like Bootstrap you get a UI kit you can customize and provide
that to your users. For example, when the content editors want to modify
the style of a button, they can add a modifier class to it. The same goes
for pretty much any other element. This has the added benefit of being a
composable approach, allowing to stack multiple modifier clases that are
available through out the site, not only specific pages.

It also feels weird to store style information in the database. At least in
my experience, it is not the content author's responsibility to tweak
styling. It is the designer and the developer who have to provide the tools
necessary to give the content writers enough flexibility but staying within
the design spec. Hence the approach I explained above (using modifier
classes).

Now, that's just an opinion, not really an objective argument. If a custom
CSS field gains traction, I would ask it to be disabled/enabled via a
setting, just like the blog post featured image. Definitely not a level of
control I want to give to the users.

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Extra CSS for Pages

2015-10-13 Thread dmsanders221
Originally posted as a GitHub issue:

This is just a suggestion for something that I've found extremely useful.

In my own private fork of Mezzanine I've added an 'extra_css' field to 
RichTextPage and Form so that new CSS can be injected via the admin panel. 
This has proven to be very valuable as it makes it much easier for admins 
to do minor CSS tweaks to a new page (color changes for headers, image 
margins, etc) without requiring a custom template to be rolled and deployed.

Is there any interest in adding this to Mezzanine? The changes are pretty 
minor, just an extra field on the models and a change to the templates to 
include an extra style section if the extra CSS exists and inject it (after 
escaping).

I know there is RICHTEXT_ALLOWED_STYLES to allow inline styles, but for any 
page with a decent amount of content (FAQ page, About Us page, etc) this is 
a painful and fragile way to apply CSS. It also doesn't allow tweaking 
elements in the template itself (like button color on a Form).

And stephenmcd's response:

I just don't think it belongs on the model - it's a template level thing 
> that can already be customised per model/instance (via custom templates).
>
 

Probably better to post this to the mailing list though.


To continue the discussion, in which way is this a template level thing? 
Are you saying the custom CSS should be directly included in a custom 
template for the model/instance?

The point of adding it to the model is so it can be customized via the 
admin, and not require a developer and site push to change some CSS. 
Shouldn't require developer access to tweak some CSS on a new RichTextPage 
being added to the site, unless I'm missing an easy way to add custom 
templates from the admin?

Anyone else have thoughts?

- David

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Can I add a videos to the built in Mezzanine 4.0.1 image gallery?

2015-10-13 Thread spam . pcc
Oh there is a bug in that snippet.

.mp4 should have its type defined once. Either image or video but not both.
See comment.


FILEBROWSER_EXTENSIONS = { 
'Folder': [''],
'Image': ['.jpg', '.jpeg', '.gif', '.png', '.tif', '.tiff', '.svg', 
'.mp4'], # <--- added video!
'Video': ['.mov', '.wmv', '.mpeg', '.mpg', '.avi', '.rm'], #<--You must 
remove mp4 from here so its type is not defined back to Video.
'Document': ['.pdf', '.doc', '.rtf', '.txt', '.xls', '.csv', '.docx'],
'Audio': ['.mp3', '.wav', '.aiff', '.midi', '.m4p'],
'Code': ['.html', '.py', '.js', '.css']
}


On Monday, October 5, 2015 at 9:24:12 AM UTC+13, spam...@gmail.com wrote:
>
> Thank you Josh. I found a work around.
>
> The clue is here on line 43
>
> https://github.com/stephenmcd/filebrowser-safe/blob/master/filebrowser_safe/settings.py
>
> If I add a setting FILEBROWSER_EXTENSIONS to my mezzanine project 
> settings.py I can redefine what the gallery calls an "Image"
> e.g.
>
> FILEBROWSER_EXTENSIONS = { 
> 'Folder': [''],
> 'Image': ['.jpg', '.jpeg', '.gif', '.png', '.tif', '.tiff', '.svg', 
> '.mp4'], # <--- added video!
> 'Video': ['.mov', '.wmv', '.mpeg', '.mpg', '.avi', '.rm', '.mp4'],
> 'Document': ['.pdf', '.doc', '.rtf', '.txt', '.xls', '.csv', '.docx'],
> 'Audio': ['.mp3', '.wav', '.aiff', '.midi', '.m4p'],
> 'Code': ['.html', '.py', '.js', '.css']
> }
>
> I just have to modify the gallery template to handle the .mp4 file in a 
> different way. It is not appropriate to auto thumbnail obviously.
>
> I got this working and then realised hosting my videos on youtube in a 
> better solution for videos anyway.
>
> Thank you.
>
>
>
> On Friday, October 2, 2015 at 9:15:50 AM UTC+13, Josh Cartmell wrote:
>>
>> The image gallery only handles images.  I would recommend building your 
>> own page type that also handles videos, looking at the implementation of 
>> the image gallery as inspiration, it probably won't be super difficult to 
>> handle videos as well!
>>
>> Good luck
>>
>> On Tue, Sep 29, 2015 at 6:22 PM,  wrote:
>>
>>> Images are no problem.
>>>
>>> .mov and mp4 files upload to the media library but can't be added to an 
>>> image gallery (the select button is disabled).
>>>
>>> Is this works as designed?
>>>
>>> See attached screenshot please.
>>>
>>> Cheers.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Mezzanine Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to mezzanine-use...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Changing admin inline to "Orderable"

2015-10-13 Thread Eduardo Rivas
That's a great idea too. If you don't have a huge number of items, you 
can just enable direct access to the _order field in the admin, and 
manually enter the order for the existing items, then switch back to 
drag and drop, and it should work.


--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Changing admin inline to "Orderable"

2015-10-13 Thread Danny

On 14/10/2015 5:26 AM, Neum Schmickrath wrote:
A few years ago I added several inline classes to Cartridge products. 
After upgrading to the latest Mezzanine and Cartridge versions I want 
to be able to use the drag and drop functionality in Orderable to be 
able to set the order of these inlines. Following the example in the 
Forms app I've set it to use the Orderable class and then created the 
database migration to add the _order field to the inline. The arrows 
now show up in the Admin interface and I can drag and drop them just 
like images and other inlines that use Orderable. But when I save the 
product it doesn't do anything. Looking into it further it's apparent 
that's because there are no numbers assigned in the database on the 
_order column. I'm sure this is because these products already exist 
so it's not assigning them order values on save.


I'm wondering what the best way would be to get the initial sort order 
on these inlines? I'm thinking of maybe a custom migration that loops 
through the products and sets the order? Any ideas what the best way 
to approach it would be?




I've added an 'order' field to Product in my fork of Cartridge, but 
never managed to get the drag-and-drop functionality to work, so I ended 
up just making the order field editable on the summary page as an integer.


Sorry I can't help more.

Seeya. Danny.

--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Changing admin inline to "Orderable"

2015-10-13 Thread Eduardo Rivas
Yep, a data migration sounds like a good way to populate the _order 
fields in existing models.


--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] I want all my website account holders to be able to put their products on sale.

2015-10-13 Thread Awantik Das
Hi Experts,


I want all my website account holders to be able to sell their products. 
Only after admin approves, the products will be available for sale to 
public.

How do I do this with Mezzanine ?


Thanks
Awantik
+91 7022251144 

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Need a marketplace model: anyone can sell, manage Items, like eBay. Does mezzanine + Cartridge work?

2015-10-13 Thread Awantik Das
Hi Prajwal,

I am new to Django & Mezzanine. Can you please help me understand how you 
achieved your target ?

Thanks
Awantik 

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Integrating Reversion w/ Mezzanine

2015-10-13 Thread Ken Bolton
Hi Corey,

This thread

contains the answer you seek.

best,
ken

On Tue, Oct 13, 2015 at 2:45 PM, Corey  wrote:

> Hello everyone, is there a particular why Mezzanine didn't implement
> reversion in order to get revision support? I'm trying to add it
> after-the-fact and I got it to work for the blog module but the pages
> module doesn't seem to play nice with reversion.
>
> I used patch_admin() to add the RichTextPage model to reversion but it
> fails with this error:
>
> TypeError: change_view() takes 3 positional arguments but 5 were given
>
>
> Does anyone know how to integrate django-reversion with Mezzanine's pages
> correctly?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Changing admin inline to "Orderable"

2015-10-13 Thread Neum Schmickrath
A few years ago I added several inline classes to Cartridge products. After 
upgrading to the latest Mezzanine and Cartridge versions I want to be able 
to use the drag and drop functionality in Orderable to be able to set the 
order of these inlines. Following the example in the Forms app I've set it 
to use the Orderable class and then created the database migration to add 
the _order field to the inline. The arrows now show up in the Admin 
interface and I can drag and drop them just like images and other inlines 
that use Orderable. But when I save the product it doesn't do anything. 
Looking into it further it's apparent that's because there are no numbers 
assigned in the database on the _order column. I'm sure this is because 
these products already exist so it's not assigning them order values on 
save. 

I'm wondering what the best way would be to get the initial sort order on 
these inlines? I'm thinking of maybe a custom migration that loops through 
the products and sets the order? Any ideas what the best way to approach it 
would be?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Integrating Reversion w/ Mezzanine

2015-10-13 Thread Corey
Hello everyone, is there a particular why Mezzanine didn't implement 
reversion in order to get revision support? I'm trying to add it 
after-the-fact and I got it to work for the blog module but the pages 
module doesn't seem to play nice with reversion.

I used patch_admin() to add the RichTextPage model to reversion but it 
fails with this error:

TypeError: change_view() takes 3 positional arguments but 5 were given


Does anyone know how to integrate django-reversion with Mezzanine's pages 
correctly?

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Where is the "admin-title" in the HTML templates?

2015-10-13 Thread Ken Bolton
Hi Zak,

The file you seek is indeed in grappelli-safe:
https://github.com/stephenmcd/grappelli-safe/blob/master/grappelli_safe/templates/admin/includes_grappelli/header.html#L6
.

-ken

On Tue, Oct 13, 2015 at 12:38 AM, Zak CythonUser  wrote:

> Hello All,
>
> When the templates are fully rendered, I see this HTML corresponding to
> the upper left-hand corner of the Admin Console:
>
> Mezzanine
>
> I did a multi-file search of the templates, but I absolutely cannot find
> where this comes from. I wanted to replace "Mezzanine" with "My Site Name",
> but I eventually had to use jQuery to modify the DIV on page load.
>
> I am guessing it may be defined by Grappelli and thus not present in any
> HTML template file. If so, where is the setting that tells Grappelli what
> to write there?
>
> Also, why is this a JavaScript link and not an HTML A tag (anchor)? That
> just seems weird.
>
> Thanks,
>
> Zak
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Why don't ManyToManyField's support validators?

2015-10-13 Thread Eduardo Rivas

That's not specifically related to Mezzanine. Try the Django mailing list.

--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Why don't ManyToManyField's support validators?

2015-10-13 Thread Mike Herring
Doc here:
https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.ManyToManyField

ManyToManyField does not support validators.


Is there a particular reason that ManyToManyField doesn't support 
validators? I would like to add a validator to require the user to select 
at least 3 options, but it seems the field simply doesn't run validators. I 
attempted to add one in like this:

from django.core.exceptions import ValidationError

def validate_three(value):

if len(value) < 3:

raise ValidationError("Must choose three related posts")


BlogPost._meta.get_field('related_posts').validators.append(validate_three)

But when it validates the field later, it says that self.validators == []

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Where from "USER": "ProjectName" in local_settings on server?

2015-10-13 Thread Nkansah Rexford
Thanks. 

On Monday, October 12, 2015 at 4:30:22 PM UTC, Eduardo Rivas wrote:
>
> You can set it to a custom name in deploy/local_settings.py.template. 
> That file is the template that gets uploaded to the server every time 
> you deploy. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Configuring a site to use Akismet

2015-10-13 Thread Christian Hill
Dear Mezzaniners,
I've started to get the same comment spam repeatedly submitted to one of my
pages, so I tried to configure Akismet on my Mezzanine site. I've added the
API key in my settings, but I don't see how or where to tell Akismet my
domain. The documentation about registering/activating the API key on the
Akismet site seems to be devoted to Wordpress sites.

Is there something further I need to do to activate my API key? I get the
response "invalid" when I use their REST service to validate the key, and
the spam is still coming.

Thanks for any help you can give,
Christian

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.