<commit_before>define([ 
    "backbone",
    "data_list/DataList",
    "datum/Session",
    "datum/SessionEditView",
    "user/UserMask",
    "libs/Utils"
], function(
    Backbone,
    DataList,
    Session,
    SessionEditView,
    UserMask
) {
  var AppRouter = Backbone.Router.extend(
  /** @lends AppRouter.prototype */
  {
    /**
     * @class Routes URLs to different dashboard layouts and data.As backbone is
     *        a one page app, this shows and hides different "pages", for
     *        example it starts out with a full screen dashboard view, with
     *        datalist and a datum, but when the user clicks the full screen
     *        buttons or uses the navigation menu, and it also happens any time
     *        the URL changes it will make the component full screen by hiding
     *        and showing divs using jquery.
     * 
     * @extends Backbone.Router
     * @constructs
     */
    initialize : function() {
    },

    routes : {
      "corpus/:corpusid"                : "showFullscreenCorpus", 
      "corpus/:corpusname/datum/:id"    : "showEmbeddedDatum", //corpusname has to match the pouch of the datum
      "corpus/:corpusname/search"       : "showEmbeddedSearch",//corpusname has to match the pouch of the corpus
      "corpus/"                         : "showFullscreenCorpus", 
      "data/:dataListid"                : "showFullscreenDataList",
      "session/:sessionid"              : "showFullscreenSession",
      "user/:userid"                    : "showFullscreenUser",
      "import"                          : "showImport",
      "corpus/:corpusname/export"       : "showExport",
      ""                                : "showDashboard"
    },
    
    /**
     * Displays the dashboard view of the given corpusname, if one was given. Or
     * the blank dashboard view, otherwise.
     * 
     * @param {String}
     *          corpusname (Optional) The name of the corpus to display.
     */
    showDashboard : function() {
      Utils.debug("In showDashboard: " );
      //Re-render the dashboard, if either the corpus or the datalist read views arent already renderd on the side.
      if(window.appView.currentCorpusReadView.format != "leftSide" || window.appView.currentReadDataListView.format != "leftSide" ){
        window.appView.renderReadonlyDashboardViews();
      }
        //Just render the datums container
      window.appView.datumsEditView.format = "centerWell";
      window.appView.datumsEditView.render();
//      window.app.router.hideEverything(); //TODO there is a loss of this somewhere in the app, using the hardcoded varible is a workaround.
      this.hideEverything();
      $("#dashboard-view").show();
      $("#datums-embedded").show();
      window.location.href = "#"; //TODO this is to clear the parameters in the url
    },
    /**
     * Displays the public user page view of the given userid, if their public user is stored in this pouch.
     */
    showFullscreenUser : function(userid, corpusname) {
      Utils.debug("In showFullscreenUser: " + userid);

      if(userid){
        if(!corpusname){
          corpusname = app.get("corpus").get("corpusname");
        }
        //if it is someone different, then change the model.
        if(userid != window.appView.publicReadUserView.model.id){<commit_msg>putting rendering dashboard back to the way it was, somethign was wrong with conditionally rendering<commit_after>define([ 
    "backbone",
    "data_list/DataList",
    "datum/Session",
    "datum/SessionEditView",
    "user/UserMask",
    "libs/Utils"
], function(
    Backbone,
    DataList,
    Session,
    SessionEditView,
    UserMask
) {
  var AppRouter = Backbone.Router.extend(
  /** @lends AppRouter.prototype */
  {
    /**
     * @class Routes URLs to different dashboard layouts and data.As backbone is
     *        a one page app, this shows and hides different "pages", for
     *        example it starts out with a full screen dashboard view, with
     *        datalist and a datum, but when the user clicks the full screen
     *        buttons or uses the navigation menu, and it also happens any time
     *        the URL changes it will make the component full screen by hiding
     *        and showing divs using jquery.
     * 
     * @extends Backbone.Router
     * @constructs
     */
    initialize : function() {
    },

    routes : {
      "corpus/:corpusid"                : "showFullscreenCorpus", 
      "corpus/:corpusname/datum/:id"    : "showEmbeddedDatum", //corpusname has to match the pouch of the datum
      "corpus/:corpusname/search"       : "showEmbeddedSearch",//corpusname has to match the pouch of the corpus
      "corpus/"                         : "showFullscreenCorpus", 
      "data/:dataListid"                : "showFullscreenDataList",
      "session/:sessionid"              : "showFullscreenSession",
      "user/:userid"                    : "showFullscreenUser",
      "import"                          : "showImport",
      "corpus/:corpusname/export"       : "showExport",
      ""                                : "showDashboard"
    },
    
    /**
     * Displays the dashboard view of the given corpusname, if one was given. Or
     * the blank dashboard view, otherwise.
     * 
     * @param {String}
     *          corpusname (Optional) The name of the corpus to display.
     */
    showDashboard : function() {
      Utils.debug("In showDashboard: " );
      //Re-render the dashboard, if either the corpus or the datalist read views arent already renderd on the side.
//      if(window.appView.currentCorpusReadView.format != "leftSide" || window.appView.currentReadDataListView.format != "leftSide" ){
        window.appView.renderReadonlyDashboardViews();
//      }
        //Just render the datums container
//      window.appView.datumsEditView.format = "centerWell";
//      window.appView.datumsEditView.render();
//      window.app.router.hideEverything(); //TODO there is a loss of this somewhere in the app, using the hardcoded varible is a workaround.
      this.hideEverything();
      $("#dashboard-view").show();
      $("#datums-embedded").show();
      window.location.href = "#"; //TODO this is to clear the parameters in the url
    },
    /**
     * Displays the public user page view of the given userid, if their public user is stored in this pouch.
     */
    showFullscreenUser : function(userid, corpusname) {
      Utils.debug("In showFullscreenUser: " + userid);

      if(userid){
        if(!corpusname){
          corpusname = app.get("corpus").get("corpusname");
        }
        //if it is someone different, then change the model.
        if(userid != window.appView.publicReadUserView.model.id){
{'fraction_non_alphanumeric': 0.10498883097542815, 'fraction_numerical': 0.0, 'mean_word_length': 2.2428778367938196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2723869', 'n_tokens_mistral': 1931, 'n_tokens_neox': 1873, 'n_words': 555}