<commit_before>package com.karasiq.shadowcloud.webapp.components

import com.karasiq.bootstrap.Bootstrap.default._
import scalaTags.all._

import com.karasiq.shadowcloud.webapp.components.common.AppIcons
import com.karasiq.shadowcloud.webapp.components.folder.{FoldersPanel, UploadForm}
import com.karasiq.shadowcloud.webapp.components.keys.KeysContext
import com.karasiq.shadowcloud.webapp.components.region.{RegionContext, RegionsStoragesPanel, RegionSwitcher}
import com.karasiq.shadowcloud.webapp.context.{AppContext, FolderContext}
import com.karasiq.shadowcloud.webapp.controllers.{FileController, FolderController}

object SCFrontend {
  def apply()(implicit appContext: AppContext): SCFrontend = {
    new SCFrontend()
  }
}

class SCFrontend()(implicit val appContext: AppContext) extends BootstrapComponent {
  implicit val regionContext = RegionContext()
  implicit val keysContext = KeysContext()

  val regionSwitcher = RegionSwitcher()

  val folderContextRx = regionSwitcher.regionSelector.selectedRegion.fold(None: Option[FolderContext]) { case (oldCtxOpt, newIdOpt) ⇒
    oldCtxOpt.foreach { oldContext ⇒
      oldContext.scope.kill()
      oldContext.selected.kill()
      oldContext.updates.kill()
    }
    newIdOpt.map(FolderContext(_))
  }

  def render(md: ModifierT*) = {
    renderNavigationBar().render(md:_*)
  }

  def renderNavigationBar(): NavigationBar = {
    NavigationBar()
      .withBrand("shadowcloud")
      .withContentContainer(GridSystem.containerFluid(_))
      .withStyles(NavigationBarStyle.default, NavigationBarStyle.staticTop)
      .withTabs(
        NavigationTab(appContext.locale.foldersView, "folders", AppIcons.foldersView, renderFoldersPanel()),
        NavigationTab(appContext.locale.regionsView, "regions", AppIcons.regionsView, renderRegionsPanel())
      )
  }

  def renderRegionsPanel(): Tag = {
    RegionsStoragesPanel()
  }
<commit_msg>Brand icon<commit_after>package com.karasiq.shadowcloud.webapp.components

import com.karasiq.bootstrap.Bootstrap.default._
import scalaTags.all._

import com.karasiq.shadowcloud.webapp.components.common.AppIcons
import com.karasiq.shadowcloud.webapp.components.folder.{FoldersPanel, UploadForm}
import com.karasiq.shadowcloud.webapp.components.keys.KeysContext
import com.karasiq.shadowcloud.webapp.components.region.{RegionContext, RegionsStoragesPanel, RegionSwitcher}
import com.karasiq.shadowcloud.webapp.context.{AppContext, FolderContext}
import com.karasiq.shadowcloud.webapp.controllers.{FileController, FolderController}

object SCFrontend {
  def apply()(implicit appContext: AppContext): SCFrontend = {
    new SCFrontend()
  }
}

class SCFrontend()(implicit val appContext: AppContext) extends BootstrapComponent {
  implicit val regionContext = RegionContext()
  implicit val keysContext = KeysContext()

  val regionSwitcher = RegionSwitcher()

  val folderContextRx = regionSwitcher.regionSelector.selectedRegion.fold(None: Option[FolderContext]) { case (oldCtxOpt, newIdOpt) ⇒
    oldCtxOpt.foreach { oldContext ⇒
      oldContext.scope.kill()
      oldContext.selected.kill()
      oldContext.updates.kill()
    }
    newIdOpt.map(FolderContext(_))
  }

  def render(md: ModifierT*) = {
    renderNavigationBar().render(md:_*)
  }

  def renderNavigationBar(): NavigationBar = {
    NavigationBar()
      .withBrand(img(src := "/favicon.png", maxHeight := 100.pct, display.inline, marginRight := 3.px), "shadowcloud")
      .withContentContainer(GridSystem.containerFluid(_))
      .withStyles(NavigationBarStyle.default, NavigationBarStyle.staticTop)
      .withTabs(
        NavigationTab(appContext.locale.foldersView, "folders", AppIcons.foldersView, renderFoldersPanel()),
        NavigationTab(appContext.locale.regionsView, "regions", AppIcons.regionsView, renderRegionsPanel())
      )
  }

  def renderRegionsPanel(): Tag = {
    RegionsStoragesPanel()
  }

{'fraction_non_alphanumeric': 0.10787847579814624, 'fraction_numerical': 0.0010298661174047373, 'mean_word_length': 5.07981220657277, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3527628', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1189, 'n_words': 188}