michalbcz / demagog-cz

Demagog.cz Quotes Collecting And Voting Platform Project aims to help demagog.cz (czech alternative of http://www.factcheck.org/) to find out what kind of facts their users would like to check - "truth or not?". We started this during Random Hack Of Kidness hackhaton in Prague on 2013 (#rhokprague with theme to support projects from #restartcesko competition. Demagog.cz wins 3rd place with this project.
http://overto.demagog.cz
1 stars 1 forks source link

when author field is empty don't show "Author:" label #42

Closed michalbcz closed 11 years ago

michalbcz commented 11 years ago

How to reproduce?

  1. create new quote with author field empty
  2. you get redirected to page with newly created quote
  3. you can see that there is label "Author:" and nothing

There shouldn't be label at all or something like " - " or "unknown" instead just an empty space.

michalbcz commented 11 years ago

I am not sure how to solve it. Maybe we should create author field required when admin is changing state from NEW to APPROVED_FOR_VOTING... otherwise it can happen by mistake that quote appear on the main page with an empty "Author:"

jan-krakora commented 11 years ago

Why just don't use a conditional statement? Something like

@if(StringUtils.isNotBlank(quote.author)) {
    <span>Author:...
}
jan-krakora commented 11 years ago

For now there is shown "Autor: neznámý" when the author field is null or blank. I think that's expected behavior.

michalbcz commented 11 years ago

I think it's ok right now. We will solve it by making Author field required (see #58)