Eighteen people have appeared in court in connection with protests in Cardiff in June against the war in Gaza.