function FormatErrorMessage
{
    [CmdletBinding()]
    param(
        [Parameter(ValueFromPipeline=$true)]
        $ErrorRecord = $Error[0]
    )

    $currentConfig = GetCurrentConfigurationOrDefault
    if ($currentConfig.verboseError) {
        $error_message = "{0}: An Error Occurred. See Error Details Below: $($script:nl)" -f (Get-Date)
        $error_message += ("-" * 70) + $script:nl
        $error_message += "Error: {0}$($script:nl)" -f (ResolveError $_ -Short)
        $error_message += ("-" * 70) + $script:nl
        $error_message += ResolveError $_
        $error_message += ("-" * 70) + $script:nl
        $error_message += "Script Variables" + $script:nl
        $error_message += ("-" * 70) + $script:nl
        $error_message += get-variable -scope script | format-table | out-string
    } else {
        # ($_ | Out-String) gets error messages with source information included.
        $error_message = "Error: {0}: $($script:nl){1}" -f (Get-Date), (ResolveError $_ -Short)
}

    $error_message
}

Fix reference to error record

function FormatErrorMessage
{
    [CmdletBinding()]
    param(
        [Parameter(ValueFromPipeline=$true)]
        $ErrorRecord = $Error[0]
    )

    $currentConfig = GetCurrentConfigurationOrDefault
    if ($currentConfig.verboseError) {
        $error_message = "{0}: An Error Occurred. See Error Details Below: $($script:nl)" -f (Get-Date)
        $error_message += ("-" * 70) + $script:nl
        $error_message += "Error: {0}$($script:nl)" -f (ResolveError $ErrorRecord -Short)
        $error_message += ("-" * 70) + $script:nl
        $error_message += ResolveError $ErrorRecord
        $error_message += ("-" * 70) + $script:nl
        $error_message += "Script Variables" + $script:nl
        $error_message += ("-" * 70) + $script:nl
        $error_message += get-variable -scope script | format-table | out-string
    } else {
        # ($_ | Out-String) gets error messages with source information included.
        $error_message = "Error: {0}: $($script:nl){1}" -f (Get-Date), (ResolveError $ErrorRecord -Short)
}

    $error_message
}


$tools="$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Start-ChocolateyProcessAsAdmin "certutil -addstore 'TrustedPublisher' '$tools\sysprogs.cer'"

$packageName = '{{PackageName}}'
$fileType = 'exe'
$silentArgs = '/UNATTENDED'
# {\{DownloadUrlx64}\} gets “misused” here as 32-bit download link due to limitations of Ketarin/chocopkgup
$url = '{{DownloadUrlx64}}'

Install-ChocolateyPackage $packageName $fileType $silentArgs $url

Use correct URL for downloading wincdemu

$tools="$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Start-ChocolateyProcessAsAdmin "certutil -addstore 'TrustedPublisher' '$tools\sysprogs.cer'"

$packageName = '{{PackageName}}'
$fileType = 'exe'
$silentArgs = '/UNATTENDED'
$url = '{{DownloadUrl}}'

Install-ChocolateyPackage $packageName $fileType $silentArgs $url


# This PowerShel script appends AppVeyor build number to the package version.

$projects = Get-ChildItem .\src | ?{$_.PsIsContainer}

foreach($project in $projects) {
    cd src/$project
    npm install
    node project-version.js
    cd ../../
}

Update project versioning PS script

# This PowerShel script appends AppVeyor build number to the package version.

$projects = Get-ChildItem .\src | ?{$_.PsIsContainer}

foreach($project in $projects) {
    # Display project name
    $project

    # Move to the project
    cd src/$project

    # NPM install
    npm install

    # Run node.js script
    node project-version.js

    # Move back to the solution root
    cd ../../
}


$commandname = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
    Context "Command returns proper info" {
        $results = Get-DbaWaitStatistic -SqlInstance $script:instance2 -Threshold 100

        It "returns results" {
            $results.Count -gt 0 | Should Be $true
        }

        foreach ($result in $results) {
            It "returns a hyperlink" {
                $result.URL -match 'sqlskills.com' | Should Be $true
            }
        }
    }

    Context "Command returns proper info when using parameter IncludeIgnorable" {
        $results = Get-DbaWaitStatistic -SqlInstance $script:instance2 -Threshold 100 -IncludeIgnorable | Where-Object {
                $_.WaitType -eq 'SLEEP_TASK'
            }

        It "returns results" {
            $results.Count -gt 0 | Should Be $true
        }

        foreach ($result in $results) {
            It "returns a hyperlink" {
                $result.URL -match 'sqlskills.com' | Should Be $true
            }
        }
    }

    Context "Command stops when can't connect" {
        It "Should warn cannot connect to MadeUpServer" {
            { Get-DbaAgentJob -SqlInstance MadeUpServer -EnableException } | Should Throw "Can't connect to MadeUpServer"
        }
    }
}

Test coverage for Ignorable column being present for IncludeIgnorable

$commandname = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
    Context "Command returns proper info" {
        $results = Get-DbaWaitStatistic -SqlInstance $script:instance2 -Threshold 100

        It "returns results" {
            $results.Count -gt 0 | Should Be $true
        }

        foreach ($result in $results) {
            It "returns a hyperlink" {
                $result.URL -match 'sqlskills.com' | Should Be $true
            }
        }
    }

    Context "Command returns proper info when using parameter IncludeIgnorable" {
        $results = Get-DbaWaitStatistic -SqlInstance $script:instance2 -Threshold 100 -IncludeIgnorable | Where-Object {
                $_.WaitType -eq 'SLEEP_TASK'
            }

        It "returns results" {
            $results.Count -gt 0 | Should Be $true
        }

        It "results includes ignorable column" {
            $results[0].PSObject.Properties.Name.Contains('Ignorable') | Should Be $true
        }

        foreach ($result in $results) {
            It "returns a hyperlink" {
                $result.URL -match 'sqlskills.com' | Should Be $true
            }
        }
    }

    Context "Command stops when can't connect" {
        It "Should warn cannot connect to MadeUpServer" {
            { Get-DbaAgentJob -SqlInstance MadeUpServer -EnableException } | Should Throw "Can't connect to MadeUpServer"
        }
    }
}


$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
	BeforeAll {
		$server = Connect-DbaInstance -SqlInstance $script:instance2
		$systemhealth = Get-DbaXESession -SqlInstance $server -Session system_health
		$started = $systemhealth.IsRunning
		if (-not $started) {
			$systemhealth.Start()
		}
	}
	AfterAll {
		if (-not $started) {
			$systemhealth.Stop()
		}
	}

	Context "Verifying command works" {
		It "starts the system_health session" {
			# pipe didnt't work here, unsure why. Works regularly
			Stop-DbaXESession -SqlInstance $server -Session system_health
			(Get-DbaXESession -SqlInstance $server -Session system_health).IsRunning | Should Be $true
		}
	}
}

Fix test looking for session to be started instead of stopped.

$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
	BeforeAll {
		$server = Connect-DbaInstance -SqlInstance $script:instance2
		$systemhealth = Get-DbaXESession -SqlInstance $server -Session system_health
		$started = $systemhealth.IsRunning
		if (-not $started) {
			$systemhealth.Start()
		}
	}
	AfterAll {
		if (-not $started) {
			$systemhealth.Stop()
		}
	}

	Context "Verifying command works" {
		It "stops the system_health session" {
			# pipe didnt't work here, unsure why. Works regularly
			Stop-DbaXESession -SqlInstance $server -Session system_health
			(Get-DbaXESession -SqlInstance $server -Session system_health).IsRunning | Should Be $false
		}
	}
}


Add a PowerShell script to launch soyweb locally

# Unfortunately, plovr has a bug where we cannot override values in globals.json
# from the command line. Instead, we create a copy of globals.json with the
# modifications we need to run soyweb locally and use that.
try {
  $tempfile = "$env:TEMP\temp" + ("{0:d5}" -f (Get-Random)).Substring(0,5) +
    "globals.json"
  Get-Content docs/globals.json |
    ForEach-Object { $_ -replace '/buck', '' } |
    Out-File $tempfile -encoding ASCII
  java -jar docs\plovr-81ed862.jar soyweb --dir docs --globals $tempfile
}
finally {
  Remove-Item $tempfile
}


[CmdletBinding(PositionalBinding=$false)]
param ()

Set-StrictMode -version 2.0
$ErrorActionPreference = "Stop"

function MarkShipped([string]$dir) {
    $shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt"
    $shipped = Get-Content $shippedFilePath
    $unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt"
    $unshipped = Get-Content $unshippedFilePath
    $removed = @()
    $removedPrefix = "*REMOVED*";
    Write-Host "Processing $dir"

    foreach ($item in $unshipped) {
        if ($item.StartsWith($removedPrefix)) {
            $item = $item.Substring($removedPrefix.Length)
            $removed += $item
        }
        else {
            $shipped += $item
        }
    }

    $shipped | Sort-Object | ?{ -not $removed.Contains($_) } |  Out-File $shippedFilePath -Encoding Ascii
    "" | Out-File $unshippedFilePath -Encoding Ascii
}

try {
    . (Join-Path $PSScriptRoot "..\..\..\build\scripts\build-utils.ps1")
    Push-Location $repoDir

    foreach ($file in Get-ChildItem -re -in "PublicApi.Shipped.txt") {
        $dir = Split-Path -parent $file
        MarkShipped $dir
    }
}
catch {
    Write-Host $_
    Write-Host $_.Exception
    exit 1
}
finally {
    Pop-Location
}

Fix handling around empty PublicAPI.txt files

[CmdletBinding(PositionalBinding=$false)]
param ()

Set-StrictMode -version 2.0
$ErrorActionPreference = "Stop"

function MarkShipped([string]$dir) {
    $shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt"
    $shipped = Get-Content $shippedFilePath
    $unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt"
    $unshipped = Get-Content $unshippedFilePath
    $removed = @()
    $removedPrefix = "*REMOVED*";
    Write-Host "Processing $dir"

    foreach ($item in $unshipped) {
        if ($item.Length -gt 0) {
            if ($item.StartsWith($removedPrefix)) {
                $item = $item.Substring($removedPrefix.Length)
                $removed += $item
            }
            else {
                $shipped += $item
            }
        }
    }

    $shipped | Sort-Object | ?{ -not $removed.Contains($_) } | Out-File $shippedFilePath -Encoding Ascii
    "" | Out-File $unshippedFilePath -Encoding Ascii
}

try {
    . (Join-Path $PSScriptRoot "..\..\..\build\scripts\build-utils.ps1")
    Push-Location $repoDir

    foreach ($file in Get-ChildItem -re -in "PublicApi.Shipped.txt") {
        $dir = Split-Path -parent $file
        MarkShipped $dir
    }
}
catch {
    Write-Host $_
    Write-Host $_.Exception
    exit 1
}
finally {
    Pop-Location
}


Add pre-build script to install KRE and KPM

$kpmPath = Join-Path "$env:USERPROFILE" ".kpm"
$krePath = Join-Path "$env:USERPROFILE" ".kre"

$isKPMExist = Test-Path $kpmPath -PathType Container
$isKREExist = Test-Path $krePath -PathType Container

if ($isKPMExist -and $isKREExist)
{
    Write-Host "KPM [$kpmPath] and KRE [$krePath] exists."
    return;
}

& powershell -NoProfile -ExecutionPolicy Unrestricted -Command "Invoke-Expression ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"

$KREInstallPath = "$($env:USERPROFILE)\.kre\bin"
& powershell -NoProfile -ExecutionPolicy Unrestricted -Command "& $KREInstallPath\kvm.cmd upgrade"


#requires -version 3.0

Function Test-PSRemoting {
<#
Jeff Hicks
https://www.petri.com/test-network-connectivity-powershell-test-connection-cmdlet
#>
  [cmdletbinding()]

  Param(
    [Parameter(Position=0,Mandatory,HelpMessage = "Enter a computername",ValueFromPipeline)]
    [ValidateNotNullorEmpty()]
    [string]$Computername,
    $Credential = [System.Management.Automation.PSCredential]::Empty
  )

  Begin {
    Write-Verbose -Message "Starting $($MyInvocation.Mycommand)"
  } #begin

  Process {
    Write-Verbose -Message "Testing $computername"
    Try {
      $r = Test-WSMan -ComputerName $Computername -Credential $Credential -Authentication Default -ErrorAction Stop
      $True
    }
    Catch {
      Write-Verbose $_.Exception.Message
      $False

    }

  } #Process

  End {
    Write-Verbose -Message "Ending $($MyInvocation.Mycommand)"
  } #end

} #close function

Change Write-Exception for Stop-Function and change Write-Verbose for Write-Message to standarize messaging system

#requires -version 3.0

Function Test-PSRemoting {
<#
Jeff Hicks
https://www.petri.com/test-network-connectivity-powershell-test-connection-cmdlet
#>
  [cmdletbinding()]

  Param(
    [Parameter(Position=0,Mandatory,HelpMessage = "Enter a computername",ValueFromPipeline)]
    [ValidateNotNullorEmpty()]
    [string]$Computername,
    $Credential = [System.Management.Automation.PSCredential]::Empty
  )

  Begin {
    Write-Message -Level Verbose -Message "Starting $($MyInvocation.Mycommand)"
  } #begin

  Process {
    Write-Message -Level Verbose -Message "Testing $computername"
    Try {
      $r = Test-WSMan -ComputerName $Computername -Credential $Credential -Authentication Default -ErrorAction Stop
      $True
    }
    Catch {
      Stop-Function -Message "Remote testing failed for computer $ComputerName" -Target $ComputerName -ErrorRecord $_ -Continue
      return $false
    }

  } #Process

  End {
    Write-Message -Level Verbose -Message "Ending $($MyInvocation.Mycommand)"
  } #end

} #close function


function Upload-ChefPkgToAzure($publishSettingsFile, $storageAccount, $storageContainer) {
  trap [Exception] {echo $_.Exception.Message;exit 1}

  write-host "Upload-ChefPkgToAzure called with: $publishSettingsFile, $storageAccount, $storageContainer"

}

Export-ModuleMember -Function Upload-ChefPkgToAzure

Implement uploading zip pkg to azure storage using PS.

function Upload-ChefPkgToAzure($publishSettingsFile, $storageAccount, $storageContainer, $extensionPackageFile) {
  trap [Exception] {echo $_.Exception.Message;exit 1}

  write-host "Upload-ChefPkgToAzure called with: $publishSettingsFile, $storageAccount, $storageContainer, $extensionPackageFile"

  Import-AzurePublishSettingsFile -PublishSettingsFile $publishSettingsFile

  # If storageAccount does not exists, create it.
  Get-AzureStorageAccount -StorageAccountName $storageAccount
  if ($? -eq $false) {
    write-host "Creating $storageAccount storage account... "
    New-AzureStorageAccount -StorageAccountName  $storageAccount -Label 'ChefExtension' -Description "Store for azure chef extension packages." -Location 'West US'
  } else {
    write-host "$storageAccount storage account already exists."
  }

  # Get the storage key that needs to be used to create context
  $storageKey = Get-AzureStorageKey -StorageAccountName $storageAccount

  $storageContext = New-AzureStorageContext  -StorageAccountName $storageAccount  -StorageAccountKey $storageKey.Primary

  # Create a storage storageContainer if not present
  # with Blob access - read access to blob data but not container
  Get-AzureStorageContainer -Name $storageContainer -Context $storageContext
  if ($? -eq $false) {
    write-host "Creating $storageContainer storage container... "
    New-AzureStorageContainer $storageContainer -Permission Blob  -Context $storageContext
  } else {
    write-host "$storageContainer storage container already exists."
  }

  # Start the zip package upload to storage.
  Set-AzureStorageBlobContent -Container $storageContainer  -File $extensionPackageFile -Context $storageContext
}

Export-ModuleMember -Function Upload-ChefPkgToAzure


$env:PATH +=";$env:SystemDrive\ProgramData\chocolatey\bin"

[[Command]]

if ($LASTEXITCODE -ne 0) {
	exit 1
}

Allow for all acceptable exit codes

$env:PATH +=";$($env:SystemDrive)\ProgramData\chocolatey\bin"
# https://github.com/chocolatey/choco/issues/512
$validExitCodes = @(0, 1605, 1614, 1641, 3010)

[[Command]]

$exitCode = $LASTEXITCODE

Write-Host "Exit code was $exitCode"
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode


param(
	[string]$emulatorName = "AndroidBuildEmulator" # Name of emulator
)

Write-Verbose "Entering script KillAndroidEmulator.ps1"
Write-Verbose "emulatorName = $emulatorName"

$adbexe = $env:ANDROID_HOME + "\platform-tools\adb.exe"
$androidbat = $env:ANDROID_HOME + "\tools\android.bat"

# Delete emulator device.  Stop-Process is used because Wait-Job or Stop-Job hangs.
Stop-Process -processname emulator-x86
& $adbexe kill-server
& $androidbat delete avd -n $emulatorName

Write-Verbose "Leaving script KillAndroidEmulator.ps1"

Clean up temporary emu files

param(
	[string]$emulatorName = "AndroidBuildEmulator" # Name of emulator
)

Write-Verbose "Entering script KillAndroidEmulator.ps1"
Write-Verbose "emulatorName = $emulatorName"

$adbexe = $env:ANDROID_HOME + "\platform-tools\adb.exe"
$androidbat = $env:ANDROID_HOME + "\tools\android.bat"

# Delete emulator device.  Stop-Process is used because Wait-Job or Stop-Job hangs.
Stop-Process -processname emulator-x86
& $adbexe kill-server
& $androidbat delete avd -n $emulatorName

# Remove temporary emulator file
$user = [Environment]::UserName
$tempDirectory = "C:\Users\" + $user + "\AppData\Local\Temp\AndroidEmulator"
if(Test-Path $tempDirectory) {
	Remove-Item $tempDirectory -recurse
}

Write-Verbose "Leaving script KillAndroidEmulator.ps1"


$currentPath = Split-Path $MyInvocation.MyCommand.Path
$msbuildFile = Join-Path $currentPath src\VersionTasks.msbuild

& "$(get-content env:windir)\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" $msbuildFile /t:Build

Write-Host "Press any key to continue . . ."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")


<#
.summary
    Test suite for MSFT_xPackageResource.psm1
#>
[CmdletBinding()]
param()

Import-Module $PSScriptRoot\..\DSCResources\MSFT_xPackageResource\MSFT_xPackageResource.psm1

$ErrorActionPreference = 'stop'
Set-StrictMode -Version latest

function Suite.BeforeAll {
    # Remove any leftovers from previous test runs
    Suite.AfterAll

}

function Suite.AfterAll {
    Remove-Module MSFT_xPackageResource
}

function Suite.BeforeEach {
}

try
{
    InModuleScope MSFT_xPackageResource {
    Describe 'Get-RegistryValueIgnoreError' {

        It 'Should get values from HKLM' {
                $installValue = Get-RegistryValueIgnoreError 'LocalMachine' "SOFTWARE\Microsoft\Windows\CurrentVersion" "ProgramFilesDir" Registry64
                $installValue | should be $env:programfiles
        }
        It 'Should get values from HKCU' {
                $installValue = Get-RegistryValueIgnoreError 'CurrentUser' "Environment" "Temp" Registry64
                $installValue | should be $env:temp
        }

    }
    }
}
finally
{
    Suite.AfterAll
}


function Get-HashtableFromString
{
    param
    (
        [string]$lineInput
    )

    # check for empty first
    If ([String]::IsNullOrEmpty($lineInput.trim(';'))) {
        return @{}
    }

    Foreach ($line in ($lineInput -split '(?<=}\s*),')) {
        # Use the language parser to safely parse the hashtable string into a real hashtable.
        [System.Management.Automation.Language.Parser]::ParseInput($line, [Ref]$null, [Ref]$null).Find({
            $args[0] -is [System.Management.Automation.Language.HashtableAst]
        }, $false).SafeGetValue()
    }
}

Add support for PowerShell v4 and lower in hashtable parsing

function Get-HashtableFromString
{
    param
    (
        [string]$lineInput
    )

    # check for empty first
    If ([String]::IsNullOrEmpty($lineInput.trim(';'))) {
        return @{}
    }

    Foreach ($line in ($lineInput -split '(?<=}\s*),')) {
        $Hashtable = [System.Management.Automation.Language.Parser]::ParseInput($line, [Ref]$null, [Ref]$null).Find({
            $args[0] -is [System.Management.Automation.Language.HashtableAst]
        }, $false)

        if ($PSVersionTable.PSVersion.Major -ge 5) {
            # Use the language parser to safely parse the hashtable string into a real hashtable.
            $Hashtable.SafeGetValue()
        }
        else {
            Write-Warning -Message "PowerShell Version lower than 5 detected. Performing Unsafe hashtable conversion. Please update to version 5 or above when possible for safe conversion of hashtable."
            Invoke-Expression -Command $Hashtable.Extent
        }
    }
}


Add powershell module that was being ignored by git (oops)

function Get-Version
{
	param
	(
		[string]$assemblyInfoFilePath
	)
	Write-Host "path $assemblyInfoFilePath"
	$pattern = '(?<=^\[assembly\: AssemblyVersion\(\")(?<versionString>\d+\.\d+\.\d+\.\d+)(?=\"\))'
	$assmblyInfoContent = Get-Content $assemblyInfoFilePath
	return $assmblyInfoContent | Select-String -Pattern $pattern | Select -expand Matches |% {$_.Groups['versionString'].Value}
}

function Update-Version
{
	param
    (
		[string]$version,
		[string]$assemblyInfoFilePath
	)

	$newVersion = 'AssemblyVersion("' + $version + '")';
	$newFileVersion = 'AssemblyFileVersion("' + $version + '")';
	$tmpFile = $assemblyInfoFilePath + ".tmp"

	Get-Content $assemblyInfoFilePath |
		%{$_ -replace 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)', $newFileVersion }  | Out-File -Encoding UTF8 $tmpFile

	Move-Item $tmpFile $assemblyInfoFilePath -force
}


Write-Host "Installing chocolatey"
Set-ExecutionPolicy Unrestricted
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

((New-Object System.Net.WebClient).DownloadFile('https://github.com/ctfhacker/windows-setup/archive/master.zip', 'C:\Windows\Temp\master.zip'))

cd C:\Windows\Temp\
mkdir master
$shell = new-object -com shell.application
$zip = $shell.NameSpace("C:\Windows\Temp\master.zip")
foreach($item in $zip.items())
{
    $shell.Namespace(".\master").copyhere($item)
}

cd master\windows-setup-master

Get-ChildItem | ForEach-Object {
    Write-Host "Executing " + $_.FullName
    & $_.FullName
}

Write-Host "Rebooting.."
shutdown /r /t 0

Use native powershell for unzipping

Write-Host "Installing chocolatey"
Set-ExecutionPolicy Unrestricted
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

((New-Object System.Net.WebClient).DownloadFile('https://github.com/ctfhacker/windows-setup/archive/master.zip', 'C:\Windows\Temp\master.zip'))

cd C:\Windows\Temp\
mkdir master
$shell = new-object -com shell.application
$zip = $shell.NameSpace("C:\Windows\Temp\master.zip")
foreach($item in $zip.items())
{
    $shell.Namespace(".\master").copyhere($item)
}

cd .\master\windows-setup-master

Get-ChildItem | ForEach-Object {
    Write-Host "Executing " + $_.FullName
    & $_.FullName
}

# Write-Host "Rebooting.."
# shutdown /r /t 0


# List of beta cmdlets.
$cmdletsToBeExported = @("Get-GcsBucket")
$cmdletsToBeExported

Remove a cmdlet from beta cmdlet

# List of beta cmdlets.
$cmdletsToBeExported = @("")
$cmdletsToBeExported


############################
##
## Helper functions
##
############################
function Load-Module
{
  Param (
    $ModuleName,
    $ModuleLocation
  )
  if (Get-Module -Name $ModuleName -Verbose:$False -EA Stop)
  {
    Remove-Module -Name $ModuleName -Verbose:$False -EA Stop
  }
  $QualifiedModuleName = $ModuleLocation + "\" + $ModuleName
  $Ignore = Import-Module -Name $QualifiedModuleName -PassThru -Verbose:$False -EA Stop
}

##
# script initialization
##
Load-Module -ModuleName AzureUtilities -ModuleLocation .\Modules

Check the Azure Powershell version installed

############################
##
## Helper functions
##
############################
function Load-Module
{
  Param (
    $ModuleName,
    $ModuleLocation
  )
  if (Get-Module -Name $ModuleName -Verbose:$False -EA Stop)
  {
    Remove-Module -Name $ModuleName -Verbose:$False -EA Stop
  }
  $QualifiedModuleName = $ModuleLocation + "\" + $ModuleName
  $Ignore = Import-Module -Name $QualifiedModuleName -PassThru -Verbose:$False -EA Stop
}

function Check-Azure-Version
{
    Param ([version]$requiredVersion)

    if (-Not (Get-Module -ListAvailable -Name Azure)) {
        Throw "Azure Powershell SDK is not installed."
    }

    if (-Not (Get-Module Azure)) {
        Import-Module Azure
    }

    $version = (Get-Module Azure).Version
    Write-Host "Azure Powershell SDK Version $($version) is installed."

    if ($version -lt $requiredVersion) {
        Throw "This script requires at least version $($requiredVersion) of the Azure Powershell SDK."
    }
}

##
# script initialization
##
Check-Azure-Version "0.9.3"

Load-Module -ModuleName AzureUtilities -ModuleLocation .\Modules


$ErrorActionPreference = "Stop"

If ($Args.Count -ne 2) {
  echo "Usage:"
  echo $Args[0] + " <BOOTSTRAP TARBALL VERSION>"
  echo "Bootstrap tarball version will be compiled into Installer."
  echo ""
  exit 1
}

echo "Compiling InstallMeteor"
echo "Bootstrap tarball version " + $Args[1]

# Set the version
(Get-Content InstallMeteor.cs) | Foreach-Object {$_ -replace '\[__BOOTSTRAP_VERSION__\]', $Args[1]} | Out-File InstallMeteor.cs

Invoke-Expression $WINDIR + "Microsoft.NET\Framework\v3.5\csc.exe InstallMeteor.cs /debug /nologo"
echo "Done"

Fix the windows installer script

$ErrorActionPreference = "Stop"
$script_path = (split-path -parent $MyInvocation.MyCommand.Definition) + "\"

If ($Args.Count -ne 1) {
  echo "Usage:"
  echo "build-installer.ps1 <BOOTSTRAP TARBALL VERSION>"
  echo "Bootstrap tarball version will be compiled into Installer."
  echo ""
  exit 1
}

echo "Compiling InstallMeteor"
echo ("Bootstrap tarball version " + $Args[0])

# Set the version
$version = $Args[0].replace("`n","").replace("`r","")
(Get-Content ($script_path + "InstallMeteor.cs")) | Foreach-Object {$_ -replace '__BOOTSTRAP_VERSION__',$version} | Out-File ($script_path + "InstallMeteor_.cs")

Invoke-Expression ($env:WINDIR + "\Microsoft.NET\Framework\v3.5\csc.exe /out:" + $script_path + "InstallMeteor.exe " + $script_path + "InstallMeteor_.cs /debug /nologo")
echo "Done"


#region Initialize Cache
if (-not [Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["group"]) {
	[Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["group"] = @{ }
}
#endregion Initialize Cache

#region Tepp Data return
$ScriptBlock = {
    param (
        $commandName,

        $parameterName,

        $wordToComplete,

        $commandAst,

        $fakeBoundParameter
    )

    $start = Get-Date
    [Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Scripts["group"].LastExecution = $start

	$server = $fakeBoundParameter['SqlInstance']

	if (-not $server) {
		$server = $fakeBoundParameter['Source']
	}

	if (-not $server) {
		$server = $fakeBoundParameter['ComputerName']
	}

	if (-not $server) { return }

    try
    {
        [DbaInstanceParameter]$parServer = $server | Select-Object -First 1
    }
    catch
    {
        [Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Scripts["group"].LastDuration = (Get-Date) - $start
        return
    }

    if ([Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["group"][$parServer.FullSmoName.ToLower()])
    {
        foreach ($name in ([Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["group"][$parServer.FullSmoName.ToLower()] | Where-DbaObject -Like "$wordToComplete*"))
        {
            New-DbaTeppCompletionResult -CompletionText $name -ToolTip $name
        }
        [Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Scripts["group"].LastDuration = (Get-Date) - $start
        return
    }

    try
    {
        $serverObject = Connect-SqlInstance -SqlInstance $parServer -SqlCredential $fakeBoundParameter['SqlCredential'] -ErrorAction Stop
        foreach ($name in ([Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["group"][$parServer.FullSmoName.ToLower()] | Where-DbaObject -Like "$wordToComplete*"))
        {
            New-DbaTeppCompletionResult -CompletionText $name -ToolTip $name
        }
        [Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Scripts["group"].LastDuration = (Get-Date) - $start
        return
    }
    catch
    {
        [Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Scripts["group"].LastDuration = (Get-Date) - $start
        return
    }
}

Register-DbaTeppScriptblock -ScriptBlock $ScriptBlock -Name Group
#endregion Tepp Data return

#region Update Cache
$ScriptBlock = {

    $cms = New-Object Microsoft.SqlServer.Management.RegisteredServers.RegisteredServersStore($server.ConnectionContext.SqlConnectionObject)
	[Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["group"][$FullSmoName] = $cms.DatabaseEngineServerGroup.ServerGroups.Name
}
Register-DbaTeppInstanceCacheBuilder -ScriptBlock $ScriptBlock
#endregion Update Cache


$uninstString = (Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
    'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' |
    Get-ItemProperty |
    Where-Object {$_.DisplayName -match 'Mp3tag' } |
    Select-Object -Property DisplayName, UninstallString).uninstallString

if ($uninstString) {
    Uninstall-ChocolateyPackage '{{PackageName}}' 'exe' '/S' $uninstString
}


.fullsize-screen.start-view#start
  .row
    .container
      = image_tag 'keep-talking-logo.png', width: '400px'

Add temporary markup for sections

.fullsize-screen.start-view#start
  .row
    .container
      = image_tag 'keep-talking-logo.png', width: '400px', height: '103px'
      h2.hero.text-align-center Ready to defuse the bomb?
      = link_to 'Defuse the Bomb!', '#batteries-and-serial', class: 'btn btn--secondary inline-block'

.fullsize-screen#batteries-and-serial
  .row
    .container
      h2.hero.text-align-center This section should contain the questions about the batteries and serial number

.fullsize-screen#wires
  .row
    .container
      h2.hero.text-align-center The module has no wires!

      .mod-wire-container.inline-block.js-mod-wire-container
        - for i in (1..6)
          .mod-wire.inline-block.js-mod-wire
            .mod-wire__indicator.js-mod-wire-indicator
              .mod-wire__inner-2
            .mod-wire__inner
              .mod-wire__inner-2
                - for color in ['red', 'white', 'blue', 'yellow', 'black']
                  .mod-wire__color class='mod-wire__color--#{color} js-mod-wire-color-selector' js-color=color

.tips.text-align-center.js-tips


- content_for :head do
  // Force a full page reload, see https://github.com/turbolinks/turbolinks/issues/326.
     Otherwise, code might not be highlighted correctly (race condition)
  meta name='turbolinks-visit-control' content='reload'
  = javascript_pack_tag('highlight', 'data-turbolinks-track': true)
  = stylesheet_pack_tag('highlight', media: 'all', 'data-turbolinks-track': true)

h1 = @submission

= row(label: 'submission.exercise', value: link_to_if(policy(@submission.exercise).show?, @submission.exercise, @submission.exercise))
= row(label: 'submission.user', value: link_to_if(policy(@submission.user).show?, @submission.user, @submission.user))
= row(label: 'submission.study_group', value: link_to_if(policy(@submission.study_group).show?, @submission.study_group, @submission.study_group))
= row(label: 'submission.cause', value: t("submissions.causes.#{@submission.cause}"))
= row(label: 'submission.score', value: @submission.score)

h2.mt-4 = t('activerecord.attributes.submission.files')

ul.list-unstyled
  - @files.each do |file|
    li.card.mt-2
      .card-body = render('shared/file', file: file)

Check for study group before checking permission

- content_for :head do
  // Force a full page reload, see https://github.com/turbolinks/turbolinks/issues/326.
     Otherwise, code might not be highlighted correctly (race condition)
  meta name='turbolinks-visit-control' content='reload'
  = javascript_pack_tag('highlight', 'data-turbolinks-track': true)
  = stylesheet_pack_tag('highlight', media: 'all', 'data-turbolinks-track': true)

h1 = @submission

= row(label: 'submission.exercise', value: link_to_if(policy(@submission.exercise).show?, @submission.exercise, @submission.exercise))
= row(label: 'submission.user', value: link_to_if(policy(@submission.user).show?, @submission.user, @submission.user))
= row(label: 'submission.study_group', value: link_to_if(@submission.study_group.present? && policy(@submission.study_group).show?, @submission.study_group, @submission.study_group))
= row(label: 'submission.cause', value: t("submissions.causes.#{@submission.cause}"))
= row(label: 'submission.score', value: @submission.score)

h2.mt-4 = t('activerecord.attributes.submission.files')

ul.list-unstyled
  - @files.each do |file|
    li.card.mt-2
      .card-body = render('shared/file', file: file)


= div_for(post, class: ['post']) do
  div.user
    h5 = link_to_user(post.creator)

  div.contents
    h4.title
      a = format_inline_text(post.title)
      div.pull-right
        .timestamp
          => format_datetime(post.created_at)

    = format_block_text(post.text)

    - if defined?(show_buttons)
      div.info
        div.pull-right
          .btn-group
            - if can? :reply_topic, @topic
              = link_to reply_course_forum_topic_post_path(current_course, @forum, @topic, post),
                        title: t('.reply'), class: ['btn', 'btn-primary'] do
                = fa_icon 'mail-reply'.freeze
            - if can? :edit, post
              = edit_button(edit_course_forum_topic_post_path(current_course, @forum, @topic, post))
            - if can? :delete, post
              = delete_button(course_forum_topic_post_path(current_course, @forum, @topic, post))

Fix forum posts' HTML formatting.

= div_for(post, class: ['post']) do
  div.user
    h5 = link_to_user(post.creator)

  div.contents
    h4.title
      a = format_inline_text(post.title)
      div.pull-right
        .timestamp
          => format_datetime(post.created_at)

    = format_html(post.text)

    - if defined?(show_buttons)
      div.info
        div.pull-right
          .btn-group
            - if can? :reply_topic, @topic
              = link_to reply_course_forum_topic_post_path(current_course, @forum, @topic, post),
                        title: t('.reply'), class: ['btn', 'btn-primary'] do
                = fa_icon 'mail-reply'.freeze
            - if can? :edit, post
              = edit_button(edit_course_forum_topic_post_path(current_course, @forum, @topic, post))
            - if can? :delete, post
              = delete_button(course_forum_topic_post_path(current_course, @forum, @topic, post))


.comable-page
  .comable-main-fixed-top
    .comable-page-heading
      ul.pull-right.list-inline
        li.dropdown
          = link_to '#', class: 'btn btn-default', 'data-toggle' => 'dropdown' do
            i.fa.fa-bars
          ul.dropdown-menu.dropdown-menu-right
            li
              = link_to comable.page_path(@page) do
                span.fa.fa-external-link>
                = Comable.t('admin.preview')

        li
          = link_to_save

      h1.page-header
        ol.breadcrumb
          li>
            = link_to Comable.t('admin.nav.page'), comable.admin_pages_path
          li.active
            = @page.title

  .comable-page-body
    = render 'form'
    hr
    .panel.panel-danger
      .panel-heading type="button" data-toggle="collapse" data-target="#comable-danger"
        strong
          span.fa.fa-angle-down>
          = Comable.t('admin.actions.destroy')
      #comable-danger.collapse
        .panel-body
          p
            = Comable.t('admin.confirmation_to_remove_page')
          = link_to Comable.t('admin.actions.destroy'), comable.admin_page_path(@page), method: :delete, class: 'btn btn-danger'

Change the design of the preview button

.comable-page
  .comable-main-fixed-top
    .comable-page-heading
      ul.pull-right.list-inline
        li
          = link_to comable.page_path(@page), class: 'btn btn-default', target: '_blank' do
            i.fa.fa-external-link>
            = Comable.t('admin.preview')
        li
          = link_to_save

      h1.page-header
        ol.breadcrumb
          li>
            = link_to Comable.t('admin.nav.page'), comable.admin_pages_path
          li.active
            = @page.title

  .comable-page-body
    = render 'form'
    hr
    .panel.panel-danger
      .panel-heading type="button" data-toggle="collapse" data-target="#comable-danger"
        strong
          span.fa.fa-angle-down>
          = Comable.t('admin.actions.destroy')
      #comable-danger.collapse
        .panel-body
          p
            = Comable.t('admin.confirmation_to_remove_page')
          = link_to Comable.t('admin.actions.destroy'), comable.admin_page_path(@page), method: :delete, class: 'btn btn-danger'


doctype html
html
  head
    title WaniKani to Anki Exporter
    meta name="viewport" content="width=device-width, initial-scale=1"
    = stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Gudea:400,400italic,700|Scada:700'
    = stylesheet_link_tag 'bootstrap.min'
    = stylesheet_link_tag 'wkanki', cache: true
    = javascript_include_tag 'jquery','jquery-ujs', 'jquery.validate.min', 'bootstrap.min'
    = javascript_include_tag 'application', cache: true
    = yield_content :include

  body
    .container
      = yield

    .row
      .col-md-12.text-center
        p.created_by Created by #{link_to('@dennmart', 'http://twitter.com/dennmart', target: "_blank")}

    script
      | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create','UA-49980547-1','wanikanitoanki.com');ga('send','pageview');

Send 'Created At' link to my website

doctype html
html
  head
    title WaniKani to Anki Exporter
    meta name="viewport" content="width=device-width, initial-scale=1"
    = stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Gudea:400,400italic,700|Scada:700'
    = stylesheet_link_tag 'bootstrap.min'
    = stylesheet_link_tag 'wkanki', cache: true
    = javascript_include_tag 'jquery','jquery-ujs', 'jquery.validate.min', 'bootstrap.min'
    = javascript_include_tag 'application', cache: true
    = yield_content :include

  body
    .container
      = yield

    .row
      .col-md-12.text-center
        p.created_by Created by #{link_to('Dennis Martinez', 'http://dennmart.com', target: "_blank")}

    script
      | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create','UA-49980547-1','wanikanitoanki.com');ga('send','pageview');


= div_for(announcement, class: time_period_class(announcement) + unread_class(announcement))
  h2.announcement-title
    - if announcement.unread?(current_user)
      small => fa_icon 'envelope'.freeze

    = format_inline_text(announcement.title)

    - if announcement.sticky?
      small title=t('.sticky')
        =< fa_icon 'thumb-tack'.freeze
    - unless announcement.currently_active?
      small title=time_period_message(announcement)
        =< fa_icon 'calendar'.freeze

    div.pull-right
      div.btn-group
        = edit_button(edit_button_path) if can?(:edit, announcement)
        = delete_button(delete_button_path) if can?(:destroy, announcement)

  i.timestamp
    => format_datetime(announcement.start_at)
    ' by
    = link_to_user(announcement.creator)

  div.content
    = format_html(announcement.content)

Enlarge and reposition announcement status icons

= div_for(announcement, class: time_period_class(announcement) + unread_class(announcement))
  h2.announcement-title
    - if announcement.unread?(current_user)
      span => fa_icon 'envelope'.freeze
    - if announcement.sticky?
      span title=t('.sticky')
        => fa_icon 'thumb-tack'.freeze
    - unless announcement.currently_active?
      span title=time_period_message(announcement)
        => fa_icon 'calendar'.freeze

    = format_inline_text(announcement.title)

    div.pull-right
      div.btn-group
        = edit_button(edit_button_path) if can?(:edit, announcement)
        = delete_button(delete_button_path) if can?(:destroy, announcement)

  i.timestamp
    => format_datetime(announcement.start_at)
    ' by
    = link_to_user(announcement.creator)

  div.content
    = format_html(announcement.content)


= javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"

Switch jquery cdn source to code.jquery.com and add integrity check.

= javascript_include_tag "https://code.jquery.com/jquery-3.3.1.min.js",
  integrity: "sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=",
  crossorigin: "anonymous"


.product-listing
  .col-lg-3.col-sm-6.col-xs-12(ng-repeat='product in products' ng-class-odd="'odd'" ng-class-even="'even'" ng-class="{'sold-out': !product.isAvailable() }")
    .col-lg-12
      a(ng-href='{{product.permalink}}')
        img.img-responsive.full(ng-src="{{product.image.large}}")

    h2.title
      a(ng-href='{{product.permalink}}') {{product.name}}

    p.desc
      | {{product.description}}

    .with-variants(ng-show="product.hasVariants")
      ul.variants
        li(ng-repeat="variant in product.variants")
          a(ng-click="selectVariant(variant)"
            ng-class="{'is-selected': isSelected(variant)}"
            ng-bind="variant.options_text")

      p.sold-out(ng-if="!selectedVariants[product].isAvailable()") This item is sold out

      add-to-cart-button(ng-if="selectedVariants[product].isAvailable()"
                         product="product"
                         variant="selectedVariants[product.id]"
                         quantity=1)

    .without-variants(ng-hide="product.hasVariants")
      p.sold-out(ng-if="!product.isAvailable()") This item is sold out

      add-to-cart-button(ng-if="product.isAvailable()"
                         product="product"
                         variant="product.master"
                         quantity=1)

Update display of soldout msg in products/list

.product-listing
  .col-lg-3.col-sm-6.col-xs-12(ng-repeat='product in products' ng-class-odd="'odd'" ng-class-even="'even'" ng-class="{'sold-out': !product.isAvailable() }")
    .col-lg-12
      a(ng-href='{{product.permalink}}')
        img.img-responsive.full(ng-src="{{product.image.large}}")

    h2.title
      a(ng-href='{{product.permalink}}') {{product.name}}

    p.desc
      | {{product.description}}

    .with-variants(ng-show="product.hasVariants")
      ul.variants
        li(ng-repeat="variant in product.variants")
          a(ng-click="selectVariant(variant)"
            ng-class="{'is-selected': isSelected(variant)}"
            ng-bind="variant.options_text")

      p.sold-out(ng-if="selectedVariants[product] && !selectedVariants[product].isAvailable()") This item is sold out

      add-to-cart-button(ng-if="!selectedVariants[product] || selectedVariants[product].isAvailable()"
                         product="product"
                         variant="selectedVariants[product.id]"
                         quantity=1)

    .without-variants(ng-hide="product.hasVariants")
      p.sold-out(ng-if="!product.isAvailable()") This item is sold out

      add-to-cart-button(ng-if="product.isAvailable()"
                         product="product"
                         variant="product.master"
                         quantity=1)


table.auto-layout
  thead
    tr
      th
      th= medication_sort_link(treatable, query, :drug_name, "Medication")
      th Drug Type
      th Dose
      th Frequency
      th Route
      th Provider
      th= medication_sort_link(treatable, query, :start_date, "Prescribed on")
  tbody
    - medications.each do |medication|
      tr
        td
          = link_to "Edit", edit_patient_medication_path(patient, medication), remote: true
          = pipe_separator
          = link_to "Terminate", patient_medication_path(patient, medication), method: :delete,
              remote: true, data: { confirm: "Are you sure?" }
        td= medication.drug.name
        td= medication.drug.drug_types.map(&:name).join(", ")
        td= medication.dose
        td= medication.frequency
        td= medication.medication_route.name == 'Route: Other (Please specify in notes)' ? medication.medication_route.full_name : medication.medication_route.name
        td= I18n.t("enums.provider.#{medication.provider}")
        td= medication.start_date

.right
  = link_to "Add Medication", new_patient_medication_path(patient, treatable), remote: true, class: %i(button tiny)

Use prefered I18n scope syntax

table.auto-layout
  thead
    tr
      th
      th= medication_sort_link(treatable, query, :drug_name, "Medication")
      th Drug Type
      th Dose
      th Frequency
      th Route
      th Provider
      th= medication_sort_link(treatable, query, :start_date, "Prescribed on")
  tbody
    - medications.each do |medication|
      tr
        td
          = link_to "Edit", edit_patient_medication_path(patient, medication), remote: true
          = pipe_separator
          = link_to "Terminate", patient_medication_path(patient, medication), method: :delete,
              remote: true, data: { confirm: "Are you sure?" }
        td= medication.drug.name
        td= medication.drug.drug_types.map(&:name).join(", ")
        td= medication.dose
        td= medication.frequency
        td= medication.medication_route.name == 'Route: Other (Please specify in notes)' ? medication.medication_route.full_name : medication.medication_route.name
        td= I18n.t(medication.provider, scope: "enums.provider")
        td= medication.start_date

.right
  = link_to "Add Medication", new_patient_medication_path(patient, treatable), remote: true, class: %i(button tiny)


---
title: À propos
page_title: Message à l'attention du directeur du musée du Louvre
page_subtitle: Expositions en cours et à venir
---

h2 AÄ

HENRI LOYRETTE, Président-directeur du musée du Louvre
DANIEL PERCHERON, Président de la Région Nord-Pas de Calais

Xavier Dectot, Directeur
Luc Herchin
Orange Business Service - IT&L@bs

Bonjour messieurs,

J'aimerais bien vous dire que je trouve votre site génial et qu'il respecte les standards d'accessibilité

http://davidl.fr/webdesign.html

Update about page for deploy

---
title: À propos
page_title: Message à l'attention du directeur du musée du Louvre
page_subtitle: Expositions en cours et à venir
---

.row
  .medium-10.medium-centered.columns
    h2 À propos


- provide(:page_wrapper_class, "page-devise")

.article-related-positioning-container
  header.page-header.group
    div
      h1
        | Sign up

  .article-container.group
    article.group role="article"
      .inner
        = simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
          /= f.error_notification

          .form-inputs
            .question
              h2 Email*
              .question-body
                = f.input :email, required: true, autofocus: true, label: false

          .form-inputs
            .question
              h2 Password*
              .question-body
                = f.input :password, required: true, label: false, hint: ("#{@minimum_password_length} characters minimum" if @validatable), input_html: { class: 'password-strength-meter' }

          .form-inputs
            .question
              h2 Password confirmation*
              .question-body
                = f.input :password_confirmation, required: true, label: false

          .form-inputs
            .question
              .question-body
                = f.input :agreed_with_privacy_policy, as: :boolean, label: "I have read and accept the #{link_to 'terms and conditions of the privacy statement'}".html_safe

          .form-actions
            = f.button :submit, "Sign up", class: "button large"

        = render "users/shared/links"

Make the login link bigger on sign up page

- provide(:page_wrapper_class, "page-devise")

.article-related-positioning-container
  header.page-header.group
    div
      h1
        | Sign up

  .article-container.group
    article.group role="article"
      .inner
        = simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
          /= f.error_notification

          .form-inputs
            .question
              h2 Email*
              .question-body
                = f.input :email, required: true, autofocus: true, label: false

          .form-inputs
            .question
              h2 Password*
              .question-body
                = f.input :password, required: true, label: false, hint: ("#{@minimum_password_length} characters minimum" if @validatable), input_html: { class: 'password-strength-meter' }

          .form-inputs
            .question
              h2 Password confirmation*
              .question-body
                = f.input :password_confirmation, required: true, label: false

          .form-inputs
            .question
              .question-body
                = f.input :agreed_with_privacy_policy, as: :boolean, label: "I have read and accept the #{link_to 'terms and conditions of the privacy statement'}".html_safe

          .form-actions
            = f.button :submit, "Sign up", class: "button large"

        /= render "users/shared/links"
        p
          ' or
          = link_to "Log in", new_user_session_path


= simple_form_for [current_course, achievement] do |f|
  = f.error_notification
  = f.error :achievement

  div.alert.alert-info
    = simple_format(t('.notice'))

  table.table.table-hover
    thead
      th = t('.name')
      th = t('.enabled')
    tbody
      - collection = course.course_users.students
      = f.collection_check_boxes :course_user_ids, collection, :id, :name do |f|
        tr
          th = link_to_course_user(f.object)
          td = f.check_box

  = f.button :submit, t('.button')

Create a toplevel checkbox to toggle selection of users when awarding achievements

= simple_form_for [current_course, achievement] do |f|
  = f.error_notification
  = f.error :achievement

  div.alert.alert-info
    = simple_format(t('.notice'))

  table.table.table-hover
    thead
      th = t('.name')
      th
        input.toggle-all#toggle-all-achievements type='checkbox' style='display: none'
        '
        label for='toggle-all-achievements'
          = t('.enabled')
    tbody
      - collection = course.course_users.students
      = f.collection_check_boxes :course_user_ids, collection, :id, :name do |f|
        tr
          th = link_to_course_user(f.object)
          td = f.check_box 'data-for-select-all' => 'toggle-all-achievements'

  = f.button :submit, t('.button')


span.doc-item__directive-type
  = item.context.type

h3.doc-item__title
  code
    = item.context.name

- if item.return.present?
  div.doc-item__returns
    | Returns: #{ item.return.type }

- if item.since.present?
  - item.since.each do |release|
    span.doc-item__since
      | #{release.version}+

div.doc-item__source-link
  = link_to "View Source", github_file_url(item.file.path, version)

- if item.description.present?
  div.doc-item__description
    = markdown(item.description)

Move directive type underneath title

h3.doc-item__title
  code
    = item.context.name

span.doc-item__directive-type
  = item.context.type

- if item.return.present?
  div.doc-item__returns
    | Returns: #{ item.return.type }

- if item.since.present?
  - item.since.each do |release|
    span.doc-item__since
      | #{release.version}+

div.doc-item__source-link
  = link_to "View Source", github_file_url(item.file.path, version)

- if item.description.present?
  div.doc-item__description
    = markdown(item.description)


= page_header do
  div.btn-group
    - if can?(:create, Course::Assessment::Skill.new(course: current_course))
      = new_button([current_course, :assessments, :skill])
    - if can?(:create, Course::Assessment::SkillBranch.new(course: current_course))
      = new_button([current_course, :assessments, :skill_branch])

table.table.skills-list.table-hover
  thead
    tr
      th = Course::Assessment::Skill.human_attribute_name(:title)
      th = Course::Assessment::Skill.human_attribute_name(:description)
      th
  = render partial: 'skill_branch', collection: @skill_branches + [nil],
           locals: { skills: @skills.group_by(&:skill_branch) }

Use a different icon for the new skill branch button.

= page_header do
  div.btn-group
    - if can?(:create, Course::Assessment::Skill.new(course: current_course))
      = new_button([current_course, :assessments, :skill])
    - if can?(:create, Course::Assessment::SkillBranch.new(course: current_course))
      = new_button([current_course, :assessments, :skill_branch]) { fa_icon 'code-fork'.freeze }

table.table.skills-list.table-hover
  thead
    tr
      th = Course::Assessment::Skill.human_attribute_name(:title)
      th = Course::Assessment::Skill.human_attribute_name(:description)
      th
  = render partial: 'skill_branch', collection: @skill_branches + [nil],
           locals: { skills: @skills.group_by(&:skill_branch) }


= page_header do
  div.btn-group
    - if can?(:create, Course::LessonPlan::Milestone.new(course: current_course))
      = new_button([current_course, :lesson_plan_milestone])
    - if can?(:create, Course::LessonPlan::Event.new(course: current_course))
      = new_button([current_course, :lesson_plan_event])

- props = render 'course/lesson_plan/items/index.json.jbuilder'
= react_component("LessonPlanPlugin", props: props, prerender: false)

Change icons for new lesson plan milestone and event.

= page_header do
  div.btn-group
    - if can?(:create, Course::LessonPlan::Milestone.new(course: current_course))
      = new_button([current_course, :lesson_plan_milestone]) { fa_icon 'flag-checkered'.freeze }
    - if can?(:create, Course::LessonPlan::Event.new(course: current_course))
      = new_button([current_course, :lesson_plan_event]) { fa_icon 'calendar-plus-o'.freeze }

- props = render 'course/lesson_plan/items/index.json.jbuilder'
= react_component("LessonPlanPlugin", props: props, prerender: false)


= simple_form_for(resource, as: resource_name, url: session_path(resource_name), wrapper: :bootstrap) do |f|
  h2= t 'admin.auth.sessions.title'
  .form-inputs
    = f.input :email, required: false, autofocus: true
    = f.input :password, required: false
    = f.input :remember_me, as: :boolean, wrapper: :default if devise_mapping.rememberable?
  = f.button :submit, t('admin.auth.sessions.button'), class: 'btn-primary btn-large'
  br
  br
  = link_to t('admin.auth.passwords.new.title'), new_password_path(resource_name) if devise_mapping.recoverable?

Add i18n defaults to login form

= simple_form_for(resource, as: resource_name, url: session_path(resource_name), wrapper: :bootstrap) do |f|
  h2= t 'admin.auth.sessions.title', default: 'Sign in'
  .form-inputs
    = f.input :email, required: false, autofocus: true
    = f.input :password, required: false
    = f.input :remember_me, as: :boolean, wrapper: :default if devise_mapping.rememberable?
  = f.button :submit, t('admin.auth.sessions.button', default: 'Sign in'), class: 'btn-primary btn-large'
  br
  br
  = link_to t('admin.auth.passwords.new.title', default: 'Forgot your password?'), new_password_path(resource_name) if devise_mapping.recoverable?


footer.footer-simple
  .w-container
    .footer-signature-text.fontsize-smallest #{CatarseSettings[:company_name]} #{Time.current.strftime("%Y")}
    ul.w-list-unstyled.footer-simple-links.fontsize-smallest
      li.footer-simple-links-list
        a.zendesk_widget.link-footer href="#{CatarseSettings[:zendesk_url]}/account/dropboxes/#{CatarseSettings[:zendesk_dropbox_id]}"  #{t('layouts.footer.links.contact')}
      li.footer-simple-links-list
        a.link-footer href="mailto:comunicacao@catarse.me"  #{t('layouts.footer.links.press')}
      li.footer-simple-links-list
        a.w-hidden-small.link-footer href="#{explore_path}"  #{t('layouts.footer.links.discover')}
      li.footer-simple-links-list
        a.w-hidden-small.link-footer href="#{guides_url}"  #{t('layouts.footer.links.guides')}
      li.footer-simple-links-list
        a.link-footer href="#{CatarseSettings[:faq_url]}"  #{t('layouts.footer.links.faq')}
      li.footer-simple-links-list
        a.link-footer href="#{terms_of_use_path}"  #{t('layouts.footer.links.terms')}
      li.footer-simple-links-list
        a.link-footer href="#{privacy_policy_path}"  #{t('layouts.footer.links.privacy')}

Include link to press page on footer

footer.footer-simple
  .w-container
    .footer-signature-text.fontsize-smallest #{CatarseSettings[:company_name]} #{Time.current.strftime("%Y")}
    ul.w-list-unstyled.footer-simple-links.fontsize-smallest
      li.footer-simple-links-list
        a.zendesk_widget.link-footer href="#{CatarseSettings[:zendesk_url]}/account/dropboxes/#{CatarseSettings[:zendesk_dropbox_id]}"  #{t('layouts.footer.links.contact')}
      li.footer-simple-links-list
        a.link-footer href="#{press_url}"  #{t('layouts.footer.links.press')}
      li.footer-simple-links-list
        a.w-hidden-small.link-footer href="#{explore_path}"  #{t('layouts.footer.links.discover')}
      li.footer-simple-links-list
        a.w-hidden-small.link-footer href="#{guides_url}"  #{t('layouts.footer.links.guides')}
      li.footer-simple-links-list
        a.link-footer href="#{CatarseSettings[:faq_url]}"  #{t('layouts.footer.links.faq')}
      li.footer-simple-links-list
        a.link-footer href="#{terms_of_use_path}"  #{t('layouts.footer.links.terms')}
      li.footer-simple-links-list
        a.link-footer href="#{privacy_policy_path}"  #{t('layouts.footer.links.privacy')}


span.hidden aria-hidden="true" #{"["}
a href="#{summary_user_path(author)}"
  -if author.author_rep_pct
    -if author.author_rep_pct >= 90
      span.glyphicon.glyphicon-equalizer.author-rep.author-rep-gold.tooltips title="Author contribution score: #{author.author_rep_pct.floor}"
    -elsif author.author_rep_pct >= 75
      span.glyphicon.glyphicon-equalizer.author-rep.author-rep-silver.tooltips title="Author contribution score: #{author.author_rep_pct.floor}"
    -elsif author.author_rep_pct >= 50
      span.glyphicon.glyphicon-equalizer.author-rep.author-rep-bronze.tooltips title="Author contribution score: #{author.author_rep_pct.floor}"
    -else
      span.glyphicon.glyphicon-equalizer.author-rep.author-rep-white.tooltips title="Author contribution score: #{author.author_rep_pct.floor}"
  -else
    span.glyphicon.glyphicon-equalizer.author-rep.author-rep-white.tooltips title="Author contribution score: 0"
  span.sr-only Author with contribution score of #{author.author_rep_pct.floor}
span.hidden aria-hidden="true" #{"]"}

Correct display of author rep trophy when author rep is 0

span.hidden aria-hidden="true" #{"["}
a href="#{summary_user_path(author)}"
  -if author.author_rep_pct
    -if author.author_rep_pct >= 90
      span.glyphicon.glyphicon-equalizer.author-rep.author-rep-gold.tooltips title="Author contribution score: #{author.author_rep_pct.floor}"
    -elsif author.author_rep_pct >= 75
      span.glyphicon.glyphicon-equalizer.author-rep.author-rep-silver.tooltips title="Author contribution score: #{author.author_rep_pct.floor}"
    -elsif author.author_rep_pct >= 50
      span.glyphicon.glyphicon-equalizer.author-rep.author-rep-bronze.tooltips title="Author contribution score: #{author.author_rep_pct.floor}"
    -else
      span.glyphicon.glyphicon-equalizer.author-rep.author-rep-white.tooltips title="Author contribution score: #{author.author_rep_pct.floor}"
    span.sr-only Author with contribution score of #{author.author_rep_pct.floor}
  -else
    span.glyphicon.glyphicon-equalizer.author-rep.author-rep-white.tooltips title="Author contribution score: 0"
    span.sr-only Author with contribution score of 0
span.hidden aria-hidden="true" #{"]"}


| Hi, #{@user.display_name},
br/
br/

| #{@asker.display_name} has a question for you regarding your project on Neighbor.ly. Simply reply to this email to contact #{@asker.display_name} directly.
br/
br/
strong Question:
= simple_format(@question)
br/
br/
| Tip: To answer general questions, be sure to check out the #{link_to 'FAQ tool', project_by_slug_url(permalink: @project.permalink, anchor: 'project_faqs')}. Answering common questions here will help users understand your project better and will lessen the need to contact you directly.
br/
br/
| High Fives,
br/
| The #{::Configuration[:company_name]} Team

Add asker email on new user question email

| Hi, #{@user.display_name},
br/
br/

| #{@asker.display_name} has a question for you regarding your project on Neighbor.ly. Simply reply to this email to contact #{mail_to @asker.email, @asker.display_name} directly.
br/
br/
strong Question:
= simple_format(@question)
br/
br/
| Tip: To answer general questions, be sure to check out the #{link_to 'FAQ tool', project_by_slug_url(permalink: @project.permalink, anchor: 'project_faqs')}. Answering common questions here will help users understand your project better and will lessen the need to contact you directly.
br/
br/
| High Fives,
br/
| The #{::Configuration[:company_name]} Team


header.page-header.group
  div
    h1
      ' Your account details

    = render "steps_progress_bar"

    h2
      ' Step 3 of 3: Contact Settings

.article-container
  article.group role="article"
    .inner
      = simple_form_for current_user, url: update_contact_settings_account_path, builder: SimpleForm::AccountFormBuilder, html: { class: "qae-form", id: "account-form" } do |f|
        = render "form_contact_settings", f: f

        fieldset
          h2
            ' How did you hear about The Queen's Awards?
          = f.input :qae_info_source, as: :select, item_wrapper_class: 'selectable', label_html: { class: 'visuallyhidden' }

          span.clear
          #qae_info_source_other.visuallyhidden
            = f.input :qae_info_source_other, label: 'Please specify'

        = f.submit "Save your account settings", class: "button medium"
        footer
          nav.pagination role="navigation" aria-label="Pagination"
            ul.group
              li.previous
                = link_to account_2_path, rel: "prev", title: "Navigate to previous part" do
                  span class="pagination-label"
                    ' Previous
                  span class="pagination-part-title"
                    ' Company Details

Move account submit into pagination

header.page-header.group
  div
    h1
      ' Your account details

    = render "steps_progress_bar"

    h2
      ' Step 3 of 3: Contact Settings

.article-container
  article.group role="article"
    .inner
      = simple_form_for current_user, url: update_contact_settings_account_path, builder: SimpleForm::AccountFormBuilder, html: { class: "qae-form", id: "account-form" } do |f|
        = render "form_contact_settings", f: f

        fieldset
          h2
            ' How did you hear about The Queen's Awards?
          = f.input :qae_info_source, as: :select, item_wrapper_class: 'selectable', label_html: { class: 'visuallyhidden' }

          span.clear
          #qae_info_source_other.visuallyhidden
            = f.input :qae_info_source_other, label: 'Please specify'

        footer
          nav.pagination role="navigation" aria-label="Pagination"
            ul.group
              li.previous
                = link_to account_2_path, rel: "prev", title: "Navigate to previous part" do
                  span class="pagination-label"
                    ' Previous
                  span class="pagination-part-title"
                    ' Company Details
              li.submit
                = f.submit "Save your account settings", class: "button"


- if award_applications && award_applications.any?
  table.applications-table
    colgroup
      col width="300"
      col width="200"
      col width="200"
    tbody
      /tr
        td colspan="3"
          h3
            = award_applications.first.decorate.award_type
            '  Award
      - award_applications.each do |award|
        tr
          td
            h4
              = award.decorate.application_name
              br
              small
                = award.decorate.award_type
                '  Award
          td
            p
              - if award.submitted?
                ' Submitted
              - else
                = award.decorate.fill_progress_in_percents
                '  completed
          td.pull-right
            // TODO use better method to test for submitted awards
            - if award.urn?
              = link_to edit_form_path(award.id)
                ' Edit
                - if award.award_type == "promotion"
                  ' nomination
                - else
                  ' application
            - else
              = link_to edit_form_path(award.id)
                ' Continue
                - if award.award_type == "promotion"
                  ' nomination
                - else
                  ' application

Improve the submission status checking

- if award_applications && award_applications.any?
  table.applications-table
    colgroup
      col width="300"
      col width="200"
      col width="200"
    tbody
      /tr
        td colspan="3"
          h3
            = award_applications.first.decorate.award_type
            '  Award
      - award_applications.each do |award|
        tr
          td
            h4
              = award.decorate.application_name
              br
              small
                = award.decorate.award_type
                '  Award
          td
            p
              - if award.submitted?
                ' Submitted
              - else
                = award.decorate.fill_progress_in_percents
                '  completed
          td.pull-right
            - if award.submitted?
              = link_to edit_form_path(award.id)
                ' Edit
                - if award.award_type == "promotion"
                  ' nomination
                - else
                  ' application
            - else
              = link_to edit_form_path(award.id)
                ' Continue
                - if award.award_type == "promotion"
                  ' nomination
                - else
                  ' application


.modal#send-application
  .content
    h2
      = t '.title'
      a.close-modal(href='#')
    .item-block
      .applicant-details
        p.name = @user.full_name
        p.email = @user.email
        p.phone = @user.phone
    .hr

    = form_for @position_application, url: call_position_applications_path(format: :fragment), class: 'send-application' do |f|
      = f.hidden_field :user_id
      .item-row
        span.label = t '.apply_to'
        span.buttons
          - [:position_member, :position_deputy, :position_both].each do |position_value|
            label.btn
              = f.radio_button :position, position_value, checked: (position_value == :position_member)
              span = PositionApplication.human_attribute_name(position_value)
        = f.text_field :deputy_of, placeholder:  PositionApplication.human_attribute_name(:deputy_of), class: 'field half', style: 'display:none;'
      = f.text_area :personal_statement, placeholder: PositionApplication.human_attribute_name(:personal_statement), class: 'wide'
      .button-row
        a.cancel.close-modal.btn(href='#') = t 'modals.cancel'
        input.submit.js-submit.btn(type='submit' value="#{t 'modals.send'}")

Fix preselection to be highlighted

.modal#send-application
  .content
    h2
      = t '.title'
      a.close-modal(href='#')
    .item-block
      .applicant-details
        p.name = @user.full_name
        p.email = @user.email
        p.phone = @user.phone
    .hr

    = form_for @position_application, url: call_position_applications_path(format: :fragment), class: 'send-application' do |f|
      = f.hidden_field :user_id
      .item-row
        span.label = t '.apply_to'
        span.buttons
          - [:position_member, :position_deputy, :position_both].each do |position_value|
            - selected = position_value == :position_member
            label.btn(class="#{'checked' if selected}")
              = f.radio_button :position, position_value, checked: selected
              span = PositionApplication.human_attribute_name(position_value)
        = f.text_field :deputy_of, placeholder:  PositionApplication.human_attribute_name(:deputy_of), class: 'field half', style: 'display:none;'
      = f.text_area :personal_statement, placeholder: PositionApplication.human_attribute_name(:personal_statement), class: 'wide'
      .button-row
        a.cancel.close-modal.btn(href='#') = t 'modals.cancel'
        input.submit.js-submit.btn(type='submit' value="#{t 'modals.send'}")


doctype html

html lang="#{data.settings.site.i18n}"
    head
        meta charset="utf-8"
        meta name="viewport" content="width=device-width,initial-scale=1"

        title #{data.settings.site.title}
        meta name="description" content="#{current_page.data.description}"
        meta name="keywords" content="#{current_page.data.keywords}"

        link rel="icon" type="image/png" href="http://www.rapsodie.pro/favicon.png"
        link rel="icon" type="image/x-icon" href="http://www.rapsodie.pro/favicon.ico"
        link href='http://fonts.googleapis.com/css?family=Roboto+Slab:300,100,400' rel='stylesheet' type='text/css'
        = stylesheet_link_tag 'application'

    body class='#{page_classes}'
        h1.visuallyhidden = data.settings.site.title
        div#container
            = partial 'views/global/header'
            section.content#content
                == yield
            = partial 'views/global/player'
        = javascript_include_tag 'application'
        = yield_content :javascripts
        / = google_analytics_universal_tag

Change H1 path in layout

doctype html

html lang="#{data.settings.site.i18n}"
    head
        meta charset="utf-8"
        meta name="viewport" content="width=device-width,initial-scale=1"

        title #{data.settings.site.title}
        meta name="description" content="#{current_page.data.description}"
        meta name="keywords" content="#{current_page.data.keywords}"

        link rel="icon" type="image/png" href="http://www.rapsodie.pro/favicon.png"
        link rel="icon" type="image/x-icon" href="http://www.rapsodie.pro/favicon.ico"
        link href='http://fonts.googleapis.com/css?family=Roboto+Slab:300,100,400' rel='stylesheet' type='text/css'
        = stylesheet_link_tag 'application'

    body class='#{page_classes}'
        h1.visuallyhidden = "#{current_page.data.title}"
        div#container
            = partial 'views/global/header'
            section.content#content
                == yield
            = partial 'views/global/player'
        = javascript_include_tag 'application'
        = yield_content :javascripts
        / = google_analytics_universal_tag


= render layout: "renalware/patients/layout", locals: { title: "Peritonitis Episode", patient: @patient } do
  = render partial: "renalware/shared/errors", locals: { model: @peritonitis_episode }

  = simple_nested_form_for [@patient, @peritonitis_episode] do |f|
    = render partial: 'renalware/peritonitis_episodes/fields', locals: { f: f }

    = submit_tag "Save", class: "button"
    span= " or "
    = link_to "cancel", patient_pd_summary_path(@patient)

Remove specialized form builder, the form is no longer nested

= render layout: "renalware/patients/layout", locals: { title: "Peritonitis Episode", patient: @patient } do
  = render partial: "renalware/shared/errors", locals: { model: @peritonitis_episode }

  = simple_form_for [@patient, @peritonitis_episode] do |f|
    = render partial: 'renalware/peritonitis_episodes/fields', locals: { f: f }

    = submit_tag "Save", class: "button"
    span= " or "
    = link_to "cancel", patient_pd_summary_path(@patient)


.backer.large-6.small-6.columns
  .row
    .large-4.columns
      - if backer.anonymous
        = image_tag 'user.png', class: 'avatar'
      - else
        = link_to user_path(backer.user) do
          = backer.user.display_image_html width: 85, height: 85
    .large-8.columns
      .name
        - if backer.anonymous
          = " #{t('.anonymous_backer')}"
        - else
          = link_to backer.user.short_name, user_path(backer.user)
      .infos
        - if current_user and (current_user == @project.user or current_user.admin)
          .custom-tooltip
            = link_to '#' do
              i.icon-et-info-circled
            .tooltip-content.hide
              .reward
                .value = backer.display_value
                - if backer.reward
                  .user-reward
                    = backer.reward.display_minimum
                    |  -
                    = backer.reward.medium_description
                - else
                  = "  #{t('.no_reward')}"
                .user_email = mail_to backer.user.email

        - if backer.short_note.present?
          .custom-tooltip
            = link_to '#' do
              i.icon-et-comment
            .tooltip-content.hide
              = backer.short_note

Remove medium_description from backer view

.backer.large-6.small-6.columns
  .row
    .large-4.columns
      - if backer.anonymous
        = image_tag 'user.png', class: 'avatar'
      - else
        = link_to user_path(backer.user) do
          = backer.user.display_image_html width: 85, height: 85
    .large-8.columns
      .name
        - if backer.anonymous
          = " #{t('.anonymous_backer')}"
        - else
          = link_to backer.user.short_name, user_path(backer.user)
      .infos
        - if current_user and (current_user == @project.user or current_user.admin)
          .custom-tooltip
            = link_to '#' do
              i.icon-et-info-circled
            .tooltip-content.hide
              .reward
                .value = backer.display_value
                - if backer.reward
                  .user-reward
                    = backer.reward.display_minimum
                    |  -
                    = backer.reward.description
                - else
                  = "  #{t('.no_reward')}"
                .user_email = mail_to backer.user.email

        - if backer.short_note.present?
          .custom-tooltip
            = link_to '#' do
              i.icon-et-comment
            .tooltip-content.hide
              = backer.short_note


- content_for :page_title do
  = "#{@page_title} - Registers Design Authority"

- content_for :head do
  = raw stylesheet_link_tag("application", media: "all")
  = raw %Q|    <!--[if IE 6]> #{stylesheet_link_tag "govuk_elements_extensions_ie6", media: "all"} <![endif]-->|
  = raw %Q|    <!--[if IE 7]> #{stylesheet_link_tag "govuk_elements_extensions_ie7", media: "all"} <![endif]-->|
  = raw %Q|    <!--[if IE 8]> #{stylesheet_link_tag "govuk_elements_extensions_ie8", media: "all"} <![endif]-->|
  = raw %Q|    <!--[if gte IE 7]><!--> #{javascript_include_tag "application"} <!--<![endif]-->|
  = csrf_meta_tags

- content_for :cookie_message, ""

- content_for :header_class, 'with-proposition'
- content_for :proposition_header do
  .header-proposition
    .content
      nav#proposition-menu
        a href='/' id='proposition-name'
          | This is a prototype
        p#proposition-link
          a href='url-to-page-1'

- content_for :content do
  main id='content' role='main'
    = yield

= render template: "layouts/govuk_template"

Add custom license message for footer

- content_for :page_title do
  = "#{@page_title} - Registers Design Authority"

- content_for :head do
  = raw stylesheet_link_tag("application", media: "all")
  = raw %Q|    |
  = raw %Q|    |
  = raw %Q|    |
  = raw %Q|     #{javascript_include_tag "application"} |
  = csrf_meta_tags

- content_for :cookie_message, ""

- content_for :header_class, 'with-proposition'
- content_for :proposition_header do
  .header-proposition
    .content
      nav#proposition-menu
        a href='/' id='proposition-name'
          | This is a prototype
        p#proposition-link
          a href='url-to-page-1'

- content_for :content do
  main id='content' role='main'
    = yield

- content_for :licence_message do
  p All content is available under the Open Government Licence v3.0, except where otherwise stated.
= render template: "layouts/govuk_template"


a href="/oauth/connect" class="connect"
  | Connect to your Pocket account

Add an explanation to the front page

p
  | This will tag your articles with how long it should take to read
  |  them, such as "2min", "5min", "10min", etc.

a href="/oauth/connect" class="connect"
  | Connect to your Pocket account


- @title = @shop.name
#show
  .shop
    h2.name
      = @shop.name
    .address
      = "Address: #{@shop.address}"
    .weekday
      = "Weekday: #{@shop.weekday}"
    .saturday
      = "Saturday: #{@shop.saturday}"
    .sunday
      = "Sunday: #{@shop.sunday}"
    -if @shop.holidays
      .holidays
        = "Holidays: #{@shop.holidays}"
    -if @shop.url
      .url
        = "URL: "
        = link_to(@shop.url, @shop.url)
    .description
      = simple_format(@shop.description)
    .last_update
      = "Last Update: #{time_ago_in_words(@shop.updated_at)} ago"

p= link_to "View all shops", url_for(:shops, :index)

Add project name to title of a shop page

- @title = "#{@shop.name} - Be Open Now"
#show
  .shop
    h2.name
      = @shop.name
    .address
      = "Address: #{@shop.address}"
    .weekday
      = "Weekday: #{@shop.weekday}"
    .saturday
      = "Saturday: #{@shop.saturday}"
    .sunday
      = "Sunday: #{@shop.sunday}"
    -if @shop.holidays
      .holidays
        = "Holidays: #{@shop.holidays}"
    -if @shop.url
      .url
        = "URL: "
        = link_to(@shop.url, @shop.url)
    .description
      = simple_format(@shop.description)
    .last_update
      = "Last Update: #{time_ago_in_words(@shop.updated_at)} ago"

p= link_to "View all shops", url_for(:shops, :index)


= javascript_include_tag 'plugins/suppliers/javascripts/consumers'

= js_translations_include plugin: :suppliers

- search_url = url_for(:controller => :profile_members, :action => 'search_user', :profile => profile.identifier, :role => @role.id)
.consumers-page

  consumer-page

javascript:
  riot.mount($('consumer-page'), {
    consumers: #{SuppliersPlugin::ConsumersPageSerializer.new(profile, scope: self).to_hash.fetch(:consumers, []).to_json},
    tasks_count: #{@tasks_count}
  })

  jQuery('#search_input')
  .tokenInput("#{search_url}", {
    hintText: #{_('Type in a search term for users').to_json},
    noResultsText: #{_('No results').to_json},
    searchingText: #{ _('Searching...').to_json},
    searchDelay: 500,
    minChars: 3,
    backspaceDeleteItem: false,
    preventDuplicates: true,
    queryParam: #{('q_'+@role.key).to_json}
  });

  jQuery(document)
  .on("keydown","#token-input-search-enterprises", function(event){
    if(event.keyCode == "13") return false;
  });
  jQuery('.token-input-input-token input').blur();
  jQuery('.token-input-input-token input')[0].focus();

Fix issue created on mount ignoring some fields

= javascript_include_tag 'plugins/suppliers/javascripts/consumers'

= js_translations_include plugin: :suppliers

- search_url = url_for(:controller => :profile_members, :action => 'search_user', :profile => profile.identifier, :role => @role.id)
- object = SuppliersPlugin::ConsumersPageSerializer.new(profile, scope: self).to_hash.merge!({tasks_count: @tasks_count})
.consumers-page

  consumer-page

javascript:
  riot.mount($('consumer-page'), #{object.to_json})

  jQuery('#search_input')
  .tokenInput("#{search_url}", {
    hintText: #{_('Type in a search term for users').to_json},
    noResultsText: #{_('No results').to_json},
    searchingText: #{ _('Searching...').to_json},
    searchDelay: 500,
    minChars: 3,
    backspaceDeleteItem: false,
    preventDuplicates: true,
    queryParam: #{('q_'+@role.key).to_json}
  });

  jQuery(document)
  .on("keydown","#token-input-search-enterprises", function(event){
    if(event.keyCode == "13") return false;
  });
  jQuery('.token-input-input-token input').blur();
  jQuery('.token-input-input-token input')[0].focus();


- document = event.document

i=attr_name(document, :result1, suffix: ":")
|
= document.result1&.text || t("unspecified")
|
i= attr_name(document, :result2, suffix: ":")
|
= document.result2&.text || t("unspecified")

Use 1: and 2: for result titles in events table

- document = event.document

| 1:
|
= document.result1&.text || t("unspecified")
|
| 2:
|
= document.result2&.text || t("unspecified")


- f.inputs t('activerecord.models.newsletter_user_role.other') do
  - f.has_many :newsletter_user_roles, heading: false do |item|
    = item.translated_inputs 'Translated fields', switch_locale: true do |t|
      - t.input :title,
                label: I18n.t('activerecord.attributes.newsletter_user_role.title'),
                hint: I18n.t('form.hint.newsletter_user_role.title')

Remove Ability to create new NewsletterUserRole

- f.inputs t('activerecord.models.newsletter_user_role.other') do
  - f.has_many :newsletter_user_roles, heading: false, new_record: false do |item|
    = item.translated_inputs 'Translated fields', switch_locale: true do |t|
      - t.input :title,
                label: I18n.t('activerecord.attributes.newsletter_user_role.title'),
                hint: I18n.t('form.hint.newsletter_user_role.title')


label.form-label Audit Certificate
p = link_to "View Audit Certificate", "#", target: "_blank"
.form-value
  - unless resource.audit_certificate.try(:reviewed?)
    p.audit-cert-nil-val Not confirmed yet.
  - else
    - if resource.audit_certificate.try(:no_changes_necessary?)
      p No change necessary
    - elsif resource.audit_certificate.try(:confirmed_changes?)
      .audit
        label.control-label Changes made
        p= resource.audit_certificate.changes_description
.if-js-hide
  - unless resource.audit_certificate.try(:reviewed?)
    p.audit-cert-nil-val Not confirmed yet.
  - else
    - if resource.audit_certificate.try(:no_changes_necessary?)
      p No change necessary
    - elsif resource.audit_certificate.try(:confirmed_changes?)
      .audit
        label.control-label Changes made
        p= resource.audit_certificate.changes_description

Fix missing audit certificate link

label.form-label Audit Certificate
- if resource.audit_certificate.present?
  p = link_to "View Audit Certificate", resource.audit_certificate.attachment_url,
      target: "_blank", class: "js-audit-certificate-title"
.form-value
  - unless resource.audit_certificate.try(:reviewed?)
    p.audit-cert-nil-val Not confirmed yet.
  - else
    - if resource.audit_certificate.try(:no_changes_necessary?)
      p No change necessary
    - elsif resource.audit_certificate.try(:confirmed_changes?)
      .audit
        label.control-label Changes made
        p= resource.audit_certificate.changes_description
.if-js-hide
  - unless resource.audit_certificate.try(:reviewed?)
    p.audit-cert-nil-val Not confirmed yet.
  - else
    - if resource.audit_certificate.try(:no_changes_necessary?)
      p No change necessary
    - elsif resource.audit_certificate.try(:confirmed_changes?)
      .audit
        label.control-label Changes made
        p= resource.audit_certificate.changes_description


= javascript_include_tag '/lib/survey-reveal.js'
.row
  .large-8.columns.large-centered
    .status
      .progress.round
        span.meter[style="width: #{@project.display_progress}%"]
      .pledged = "#{@project.display_pledged} / #{@project.display_goal} (#{@project.progress}%)"
.reveal-modal#survey data-reveal
  h2 Would you mind participating in our survey?
  p As part of this research project, we are trying to establish why you decided to contribute to this campaign.
  p If you will, then please fill in this <a href="https://docs.google.com/forms/d/10KJuCXwiB0eIm2vogJ-E2sG52F_5q8s8C1ZOKjn9juw/viewform">Google form or contact Chiara directly if you have concerns
  a.close-reveal-modal ×

Fix slim text for contribution survey

= javascript_include_tag '/lib/survey-reveal.js'
.row
  .large-8.columns.large-centered
    .status
      .progress.round
        span.meter[style="width: #{@project.display_progress}%"]
      .pledged = "#{@project.display_pledged} / #{@project.display_goal} (#{@project.progress}%)"

#myModal.reveal-modal data-reveal=""
  h2 Would you mind participating in our survey?
  p.lead As part of this research project, we are trying to establish why you decided to contribute to this campaign.
  p If you will, then please fill in this <a href="https://docs.google.com/forms/d/10KJuCXwiB0eIm2vogJ-E2sG52F_5q8s8C1ZOKjn9juw/viewform">Google form or contact Chiara directly if you have concerns
  a.close-reveal-modal ×


|Welcome, #{@email},
br
br
|Almost ready to use #{Configuration[:company_name]}! Please finish creating your account by clicking the link below:
br
br
h1 #{link_to 'Confirm my email', confirmation_url(@resource, :confirmation_token => @token)}
br
br
|If you received this email in error, please disregard.
br
br
|High fives,
br
|The #{Configuration[:company_name]} Team

Change text of confirmation instructions mail

p Thanks for your interest in Neighborly! You're almost ready to start investing. Please finish creating your account by clicking the link below.
p
  strong = link_to 'Confirm my email', confirmation_url(@resource, confirmation_token: @token)
p
  | High fives,
  br
  | The #{Configuration[:company_name]} Team


.book-cover
  .book-image
    = image_tag @book.cover
  .book-stats
    .book-readings
      .small = t('helpers.label.book.readings', count: @book.readings)
    = render 'my_rating', book: @book

.book-info
  h1.book-title.milli = @book.title
  .small = t('books.owner', name: @book.owner)
  h2.nano = @book.subtitle
  p.small = @book.authors
  #avg-rating
    = render 'rating_show', book: @book, rating_value: @book.average_rating
  - if @book.published_on
    p.small = "#{t('helpers.label.book.published_on')} #{@book.published_on}"
  - if @book.pages
    p.small = "#{@book.pages} #{t('helpers.label.book.pages')}"
  - if @book.summary.present?
    h2.micro = t('helpers.label.book.summary')
    = @book.summary

Hide owner if there is none

.book-cover
  .book-image
    = image_tag @book.cover
  .book-stats
    .book-readings
      .small = t('helpers.label.book.readings', count: @book.readings)
    = render 'my_rating', book: @book

.book-info
  h1.book-title.milli = @book.title
  h2.nano = @book.subtitle
  - if @book.owner.present?
    .small = t('books.owner', name: @book.owner)
  p.small = @book.authors
  #avg-rating
    = render 'rating_show', book: @book, rating_value: @book.average_rating
  - if @book.published_on
    p.small = "#{t('helpers.label.book.published_on')} #{@book.published_on}"
  - if @book.pages
    p.small = "#{@book.pages} #{t('helpers.label.book.pages')}"
  - if @book.summary.present?
    h2.micro = t('helpers.label.book.summary')
    = @book.summary


.product-listing
  .product.col-lg-3.col-sm-6.col-xs-12(ng-repeat='product in products' ng-class-odd="'odd'" ng-class-even="'even'" ng-class="{'sold-out': !product.isAvailable()}")
    .col-lg-12
      h2.title
        a(ng-href='{{product.permalink}}' ng-bind="product.name")

      .with-variants(ng-show="product.hasVariants")
        variant-selection(product="product" variant="selectedVariants[product.id]" class="{'btn-group-xs': true}")

        p.sold-out(ng-if="selectedVariants[product.id] && !selectedVariants[product.id].isAvailable()") Sold out

        add-to-cart-button(ng-if="!selectedVariants[product.id] || selectedVariants[product.id].isAvailable()"
                           product="product"
                           variant="selectedVariants[product.id]"
                           quantity=1
                           class="{'btn-primary': true}")

      .without-variants(ng-hide="product.hasVariants")
        p.sold-out(ng-if="!product.isAvailable()") Sold out

        add-to-cart-button(ng-if="product.isAvailable()"
                           product="product"
                           variant="product.master"
                           quantity=1
                           class="{'btn-primary': true}")

      a(ng-href='{{product.permalink}}')
        img.img-responsive.full(ng-src="{{product.image.largeUrl}}")

Use the correct method for the large image

.product-listing
  .product.col-lg-3.col-sm-6.col-xs-12(ng-repeat='product in products' ng-class-odd="'odd'" ng-class-even="'even'" ng-class="{'sold-out': !product.isAvailable()}")
    .col-lg-12
      h2.title
        a(ng-href='{{product.permalink}}' ng-bind="product.name")

      .with-variants(ng-show="product.hasVariants")
        variant-selection(product="product" variant="selectedVariants[product.id]" class="{'btn-group-xs': true}")

        p.sold-out(ng-if="selectedVariants[product.id] && !selectedVariants[product.id].isAvailable()") Sold out

        add-to-cart-button(ng-if="!selectedVariants[product.id] || selectedVariants[product.id].isAvailable()"
                           product="product"
                           variant="selectedVariants[product.id]"
                           quantity=1
                           class="{'btn-primary': true}")

      .without-variants(ng-hide="product.hasVariants")
        p.sold-out(ng-if="!product.isAvailable()") Sold out

        add-to-cart-button(ng-if="product.isAvailable()"
                           product="product"
                           variant="product.master"
                           quantity=1
                           class="{'btn-primary': true}")

      a(ng-href='{{product.permalink}}')
        img.img-responsive.full(ng-src="{{product.image.large_url}}")


- content_for(:title) do
  h3= t("promo_mailer.promo_activated_2018q1_unverified.subject")

p.salutation= t("publisher_mailer.shared.salutation", name: @publisher.name)

p = t("promo_mailer.promo_activated_2018q1_unverified.body_one")

= t("promo_mailer.promo_activated_2018q1_unverified.body_two_html")

p = t("promo_mailer.promo_activated_2018q1_unverified.body_two")

div.center= link_to(t("promo_mailer.promo_activated_2018q1_unverified.cta"), new_auth_token_publishers_url, class: "btn-primary btn-login")

p= t("publisher_mailer.shared.signature")

hr

Remove extra/missing paragraph in activated unverfied email

- content_for(:title) do
  h3= t("promo_mailer.promo_activated_2018q1_unverified.subject")

p.salutation= t("publisher_mailer.shared.salutation", name: @publisher.name)

p = t("promo_mailer.promo_activated_2018q1_unverified.body_one")

= t("promo_mailer.promo_activated_2018q1_unverified.body_two_html")

div.center= link_to(t("promo_mailer.promo_activated_2018q1_unverified.cta"), new_auth_token_publishers_url, class: "btn-primary btn-login")

p= t("publisher_mailer.shared.signature")

hr


p
  strong Recent Pathology Results

ul
  - recent_pathology_results[1..-1].each do |observation|
    - description, result, date = observation
    li #{date}: #{description} #{result}

Format pathology results close to original implementation from PHP app

p
  strong Recent Pathology Results

p
  - recent_pathology_results[1..-1].each do |observation|
    - description, result, date = observation
    span #{date}: #{description} #{result};


h3.doc-item__title
  code
    = item.context.name

span.doc-item__directive-type
  = item.context.type.capitalize

- if item.return.present?
  div.doc-item__returns
    | Returns: #{ item.return.type }

- if item.since.present?
  - item.since.each do |release|
    span.doc-item__since
      | #{release.version}+

div.doc-item__source-link
  = link_to "View Source", github_file_url(item.file.path, version)

- if item.description.present?
  div.doc-item__description
    = markdown(item.description)

Clean up function returns markup

h3.doc-item__title
  code
    = item.context.name

span.doc-item__directive-type
  = item.context.type.capitalize

- if item.return.present?
  span.doc-item__returns
    | Returns:
    code< #{item.return.type}

- if item.since.present?
  - item.since.each do |release|
    span.doc-item__since
      | #{release.version}+

div.doc-item__source-link
  = link_to "View Source", github_file_url(item.file.path, version)

- if item.description.present?
  div.doc-item__description
    = markdown(item.description)


= simple_form_for @project, html: { class: 'project-form w-form' } do |form|
  .w-section.section
    .w-container
      .w-row
        .w-col.w-col-10.w-col-push-1
          .w-form
            = @project.display_errors(:budget)
            = form.input :budget, as: :text,
              wrapper: :two_columns,
              wrapper_class: 'w-row u-marginbottom-30 card card-terciary padding-redactor-description',
              input_html: { class: 'redactor positive', required: false },
              validation_text: false
  .w-section.save-draft-btn-section
    .w-container
      .w-row
        .w-col.w-col-4.w-col-push-4
          = hidden_field_tag 'anchor', 'budget'
          = form.button :submit, t('.submit'), class:'btn btn-medium', id: 'budget-save'

Include link to budget video in budget dashboard

= simple_form_for @project, html: { class: 'project-form w-form' } do |form|
  .w-section.section
    .w-container
      .w-row
        .w-col.w-col-10.w-col-push-1
          .u-marginbottom-60.u-text-center
            .w-inline-block.card.fontsize-small.u-radius
              span.fa.fa-fw.fa-lightbulb-o
              | Veja dicas de como
              a.alt-link href="http://fazum.catarse.me/agradecimento-video-tutorial-orcamento-basico?ref=ctrse_dashboard" target="_blank"  determinar a meta de seu projeto!

          .w-form
            = @project.display_errors(:budget)
            = form.input :budget, as: :text,
              wrapper: :two_columns,
              wrapper_class: 'w-row u-marginbottom-30 card card-terciary padding-redactor-description',
              input_html: { class: 'redactor positive', required: false },
              validation_text: false
  .w-section.save-draft-btn-section
    .w-container
      .w-row
        .w-col.w-col-4.w-col-push-4
          = hidden_field_tag 'anchor', 'budget'
          = form.button :submit, t('.submit'), class:'btn btn-medium', id: 'budget-save'


- content_for(:navbar_content) do
  = render :partial => 'progress', :locals => { progress: { info: 50, verify: 0, wallet: 0 }, publisher: current_publisher }

.row
  .col-center.col-xs-12.col-md-7
    h4.section-title
      h3= t("publishers.create_done_header")
      .help-block= t("publishers.create_done_body_html", email: @publisher_email)
      = image_tag("email_envelope.png", class: "img-center")
.row
  .col-center.col-xs-6.col-md-3
    = button_to t("publishers.create_done_resend_email"),
        { controller: "publishers", action: "resend_email_verify_email" },
        { method: "post", form_class: "btn btn-block btn-secondary" }

Move class from form to button

- content_for(:navbar_content) do
  = render :partial => 'progress', :locals => { progress: { info: 50, verify: 0, wallet: 0 }, publisher: current_publisher }

.row
  .col-center.col-xs-12.col-md-7
    h4.section-title
      h3= t("publishers.create_done_header")
      .help-block= t("publishers.create_done_body_html", email: @publisher_email)
      = image_tag("email_envelope.png", class: "img-center")
.row
  .col-center.col-xs-6.col-md-3
    = button_to t("publishers.create_done_resend_email"),
        { controller: "publishers", action: "resend_email_verify_email" },
        { method: "post", class: "btn btn-block btn-secondary" }


- contribution = @notification.contribution

|Olá, <strong>#{contribution.user.decorate.display_name}</strong>!
br
br
' Verificamos que você iniciou um apoio para o projeto #{link_to contribution.project.name, project_by_slug_url(permalink: contribution.project.permalink, ref: 'notificacao_pending')},
|porém não chegou a concluí-lo.
br
br
| O seu apoio é essencial e você pode juntar-se a outras #{contribution.project.total_contributions} pessoas para tornar esse projeto uma realidade.
br
br
| #{ link_to "Você tem até #{l(contribution.project.expires_at)} para realizar sua contribuição de onde parou.", edit_project_contribution_url(project_id: contribution.project.id, id: contribution.id, ref: 'notification_pending') }
br
br
| Caso o motivo para não ter concluído seu apoio foi algum problema técnico, recomendamos tentar novamente utilizando outro navegador.
br
br
| Se o problema persistir, entre em contato imediatamente respondendo a esta mensagem ou através do e-mail #{mail_to CatarseSettings[:email_contact]}
br
br
|Um abraço,
br
|#{CatarseSettings[:company_name]}

Update the `pending payment` email template

- contribution = @notification.contribution

|Olá, <strong>#{contribution.user.decorate.display_name}</strong>!
br
br
' Verificamos que você iniciou um apoio para o projeto #{link_to contribution.project.name, project_by_slug_url(permalink: contribution.project.permalink, ref: 'notificacao_pending')},
|porém não chegou a concluí-lo.
br
br
| O seu apoio é essencial e você pode juntar-se aos outros #{contribution.project.total_contributions} apoiadores para tornar esse projeto uma realidade.
br
br
| #{ link_to "Você tem até #{l(contribution.project.expires_at)} para realizar sua contribuição de onde parou.", edit_project_contribution_url(project_id: contribution.project.id, id: contribution.id, ref: 'notification_pending') }
br
br
| Caso o motivo para não ter concluído seu apoio foi algum problema técnico, recomendamos tentar novamente utilizando outro navegador.
br
br
| Se o problema persistir, entre em contato imediatamente respondendo a esta mensagem ou através do e-mail #{mail_to CatarseSettings[:email_contact]}
br
br
|Um abraço,
br
|#{CatarseSettings[:company_name]}