Refactor Survivor Sheet epithets (back-end and front-end) #221

toconnell opened this Issue Feb 5, 2017 · 0 comments


None yet

1 participant

toconnell commented Feb 5, 2017 edited

All of this needs to die:

1307         if return_type == "html_angular":
1308             js_epithets = []
1309             for e in epithets:
1310                 e_bgcolor = None
1311                 e_color = None
1312                 if e in game_assets.epithets:
1313                     e_dict = game_assets.epithets[e]
1314                     if "bgcolor" in e_dict:
1315                         e_bgcolor = e_dict["bgcolor"]
1316                     if "color" in e_dict:
1317                         e_color = e_dict["color"]
1318                 js_epithets.append("{'name':'%s', 'bgcolor':'%s', 'color':'%s'}" % (e, e_bgcolor, e_color))
1320             return html.survivor.epithet_angular_controls.safe_substitute(
1321                 survivor_id = self.survivor["_id"],
1322                 current_epithets = ",".join(js_epithets),
1323                 epithet_options = Epithets.render_as_html_dropdown(
1324                     select_type="angularjs",
1325                     survivor_id = self.survivor["_id"],
1326 #                    exclude=self.survivor["epithets"], # the .js app prevents dupes
1327                     Settlement=self.Settlement,
1328                     submit_on_change=False,
1329                 ),
1330             )
  • create a custom epithets dictionary on the settlement (add this in models.settlements.normalize_data() method when we add admins and expansions and what not)
  • create modal controls for adding/managing custom epithets; save custom epithets at the settlement level. The controls should have a color picker for the background and then a black/white toggle for the font.
  • migrate legacy survivors from names to handles; add unknown/custom epithets to settlement custom epithets
  • port epithets from the legacy file to the API
  • create and develop assetCollection and gameAsset class initialization methods
  • punch up API-side epithets to include all of their "flair" (e.g. bg color, font color, expansion, etc.)
  • update models.settlements.serialize() to create an "epithets" element under "game_assets"
  • touch up the campaigns definitions to use epithet handles (rather than names)
  • check so-called "expansion attributes" to make sure that they use handles instead of names
  • update legacy A&I definitions to use handles instead of names
  • create add_epithet and rm_epithet routes to do updates versus individual survivors
  • add_epithet route needs to de-dupe and sort on save
  • deprecate the legacy app code for creating pseudo-JSON to be used by ng-init (see above)
  • deprecate legacy app support (assets.Survivor.modify() method) for adding/removing epithets
  • add an epithets popularity contest to the dashboard
@toconnell toconnell added this to the Campaign Summary Refactor milestone Feb 5, 2017
@toconnell toconnell self-assigned this Feb 5, 2017
@toconnell toconnell removed this from the Campaign Summary Refactor milestone Feb 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment