← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands-website/more_latest_posts into lp:widelands-website

 

The change you mention is exactly what I would expect. Sorted by topics' last post date rather than each individual post's date.

The only reason we need this long list really is that we can't link to the first unread post.

Diff comments:

> 
> === modified file 'pybb/forms.py'
> --- pybb/forms.py	2018-12-21 11:26:08 +0000
> +++ pybb/forms.py	2019-03-18 21:30:36 +0000
> @@ -87,3 +87,17 @@
>          post.updated = datetime.now()
>          post.save(*args, **kwargs)
>          return post
> +
> +
> +class LastPostsDayForm(forms.Form):
> +    days = forms.IntegerField(
> +        max_value = 1000,
> +        min_value = 5,
> +        label = 'Show posts created these days before today:'

Is it possible to do it like this with Django?

Show posts created up to <form>n days ago</form>

I have had a look at phpBB and that's how they do it in their advanced search:

Limit results to previous: <form>n days</form>

vBulletin has a date range with 2 date pickers in their advanced search, but I think that's a bit overkill for our context here.

> +        )
> +    
> +    sort_by = forms.ChoiceField(
> +        #widget = forms.RadioSelect,
> +        choices = [('forum','Forum'),('topic', 'Topic'),],
> +        label = 'Sort by:',
> +        )


-- 
https://code.launchpad.net/~widelands-dev/widelands-website/more_latest_posts/+merge/364706
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands-website/more_latest_posts into lp:widelands-website.


References