anchor.diff:  	Body = wrq:req_body(ReqData),
   	{struct, Props} = mochijson2:decode(Body),
   	Name = proplists:get_value(<<"name">>, Props),
  -	case boss_db:find(rpgb_battlemap, [{name, equals, Name},{owner_id,equals,Userid}]) of
  +	Maps = case rpgb_data:get_battlemaps_by_owner(Userid) of
  +		{ok, L} -> L;
  +		_ -> []
  +	end,
  +	Recs = [M || #battlemap{name = FName} = M <- Maps, FName == Name],
  +	case Recs of
   		[] ->
   			BattleMap = boss_record:new(rpgb_battlemap, [{owner_id, Userid}]),
   			{ok, BattleMap0} = BattleMap:save(),
  
positive.code: %	end.
  
  generate_etag(ReqData, {battle, MapId, Session}) when is_list(MapId) ->
  	BattleMap = boss_db:find(MapId),
  	generate_etag(ReqData, {battle, BattleMap, Session});
  
  generate_etag(ReqData, {battle, BattleMap, Session} = Ctx) ->
  	Iolist = io_lib:format("~p:~p", [BattleMap:id(), BattleMap:updated_time()]),
  	IoBin = iolist_to_binary(Iolist),
  	Md5 = erlang:md5(IoBin),
  	Etag = mochihex:to_hex(Md5),
  
negative.code: 	{ok, Out} = battlemap_dtl:render(Templatevars),
  	{Out, ReqData, Ctx}.
  
  %finish_request(ReqData, {battle, _, Session} = Ctx) ->
  %	SessionUser = rpgb_session:get_user(Session),
  %	UserId = proplists:get_value(id, SessionUser),
  %	BadMaps = boss_db:find(rpgb_battlemap, [{name, equals, undefined}]),
  %	[boss_db:delete(BadMap:id()) || BadMap <- BadMaps],
  %	{true, ReqData, Ctx};
  %
  %finish_request(R, C) ->
  %	{true, R, C}.
  