{
  "Branch_History_Public_Listing": {
    "layout":"grid",
    "table":"{schema}.branch",
    "caption":["Release","Releases"],
    "title":"Release Maintenance",
    "menu":"jsHarmonyCMS/Branch_History_Public_Listing",
    "breadcrumbs":"#CMS_SITE_BREADCRUMBS",
    "oninit": "jsh.System.RequireSite(xmodel);",
    "actions":"BU",
    "roles": { "*": "B", "PUBLISHER": "*" },
    "sqlwhere":"branch_type='PUBLIC' and (site_id={schema}.my_current_site_id())",
    "sort":["vbranch_data_mtstmp_fmt"],
    "buttons":[
      { "name":"addBranch", "link":"update:Branch_Add_Empty","icon":"add","text":"New Empty Release", "bindings": {} },
    ],
    "hide_system_buttons":["export"],
    "rowlimit":1000,
    "tablestyle":"min-width:600px;",
    "noresultsmessage":"No releases.",
    "rowclass": "<%=xejs.iif(datarow['branch_is_checked_out']==1,'branch_checked_out')%>",
    "css":[
      ".xform<%=model.class%> .branch_checked_out .branch_checkout_button a { color:#333; cursor:default; pointer-events:none; }",
    ],
    "fields": [
      {"name":"branch_id","control":"hidden","disable_search": true},
      {"name":"branch_is_checked_out","control":"hidden","sqlselect":"(select branch_is_checked_out from {schema}.v_my_branch_desc where branch_id={schema}.branch.branch_id)"},
      {"name":"branch_desc","caption":"Name","cellstyle":"min-width:200px;","sqlselect":"(select branch_desc from {schema}.v_my_branch_desc where branch_id={schema}.branch.branch_id)","link":"update:Branch_Summary"},
      {"name":"branch_sts","caption":"Status","lov":{"sql":"select code_val,code_txt from {schema}.code_branch_sts where (code_val<>'REVIEW') and (code_end_dt is null or code_end_dt>jsharmony.my_now()) order by code_seq,code_txt"}},
      {"name":"branch_data_mtstmp_fmt","type":"datetime","caption":"Last Modified","sqlselect":"$ifnull(branch_data_mtstmp,branch_mtstmp)","control":"label","actions":"B","format":["date","MM/DD/YYYY h:mm a"]},
      {"name":"branch_data_muser_fmt","caption":"Modified By","sqlselect":"(jsharmony.my_db_user_fmt($ifnull(branch_data_muser,branch_muser)))","control":"label","actions":"B"},
      {"caption":"Details","control":"html","link":"update:Branch_Summary","captionstyle":"text-align:center;","cellstyle":"text-align:center;",
        "value":"<img src='/images/icon_browse.png' class='xicon' />"},
      {"caption":"Checkout","control":"html","link":"js:jsh.System.CheckoutBranch(xmodel, xmodel.get('branch_id', this), 'PUBLIC')","captionstyle":"text-align:center;","cellstyle":"text-align:center;",
        "value":"<%=xejs.iif(datarow['branch_is_checked_out']==1,'(Checked Out)','Checkout')%>",
        "cellclass":"branch_checkout_button"},
      {"caption":"Clone","control":"linkbutton","link":"update:Branch_Clone&branch_id","captionstyle":"text-align:center;","cellstyle":"text-align:center;","roles":{"PUBLISHER":"*","AUTHOR":"*"}}
    ]
  }
}