crowdAI / crowdai

Fighting for Open Science with Open Data
https://www.crowdai.org
GNU Affero General Public License v3.0
149 stars 32 forks source link

A "Featured Challenge" flag to have finegrained control over which challenges are displayed on front page #230

Closed spMohanty closed 7 years ago

scarroll32 commented 7 years ago

I propose we add an optional "sequence" field. At present a maximum of 5 challenges are displayed on the landing page.

If this field is populated, these challenges will sort ascending by whatever is in this field.

Any other challenges will sort by the existing sort order:

  default_scope { order("CASE status_cd
                          WHEN 'running' THEN 1
                          WHEN 'starting_soon' THEN 2
                          WHEN 'completed' THEN 3
                          WHEN 'cancelled' THEN 4
                          WHEN 'draft' THEN 5
                          ELSE 6
                        END, created_at DESC") }

@spMohanty your thoughts?

spMohanty commented 7 years ago

Sounds great to me !!

scarroll32 commented 7 years ago

Implemented https://github.com/crowdAI/crowdai/commit/124da205279721e5686fa4bf6f943d34ea1b437c

scarroll32 commented 7 years ago

Added. The Featured Sequence is a higher level sort, and defaults to zero. The higher the number the higher the challenge in the list.

screen shot 2017-07-31 at 15 49 30