Skip to content

Commit

Permalink
Merge branch 'develop' into round-14
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
WaveHack committed Jul 31, 2019
2 parents 88436fc + e27e48d commit 60e3ad4
Show file tree
Hide file tree
Showing 17 changed files with 1,027 additions and 189 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- *Note: The Nox was a premiun race back in Dominion Classic. In OpenDominion it has been renamed to just 'Nox', and made available for everyone, without restrictions.
- Added missing Valhalla races, including the ones mentioned above
- Construction advisor now shows total amount of barren land
- Added info op archive, allowing you to view previously taken info ops
- Boats are now fully implemented, preventing a certain amount of boats from being sunk

### Changed
- Condensed the items in the left navigation menu (except on mobile)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class RemoveInfoOpsSourceRealmTargetDominionConstraint extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Schema::table('info_ops', static function (Blueprint $table) {
$table->boolean('latest')
->after('data')
->default(true);

$table->index(['source_realm_id']);
$table->index(['target_dominion_id']);
$table->dropUnique(['source_realm_id', 'target_dominion_id', 'type']);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::table('info_ops', static function (Blueprint $table) {
$table->dropColumn(['latest']);

$table->unique(['source_realm_id', 'target_dominion_id', 'type']);
$table->dropIndex(['source_realm_id']);
$table->dropIndex(['target_dominion_id']);
});
}
}
727 changes: 727 additions & 0 deletions app/resources/views/pages/dominion/op-center/archive.blade.php

Large diffs are not rendered by default.

75 changes: 40 additions & 35 deletions app/resources/views/pages/dominion/op-center/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,69 @@
<col>
<col>
<col width="100">
{{--
<col width="100">
<col width="100">
--}}
<col width="100">
<col width="200">
<col width="50">
<col width="100">
<col width="160">
<col width="130">
</colgroup>
<thead>
<tr>
<th>Dominion</th>
<th>Realm</th>
<th class="text-center">Race</th>
{{--
<th class="text-center">OP</th>
<th class="text-center">DP</th>
--}}
<th class="text-center">Land</th>
<th class="text-center">Networth</th>
<th class="text-center">Last Op</th>
<th class="text-center">Ops</th>
<th class="text-center">Recent Ops</th>
</tr>
</thead>
<tbody>
@foreach ($targetDominions as $dominion)
@php
$lastInfoOp = $infoOpService->getLastInfoOp($selectedDominion->realm, $dominion);
@endphp
@if ($lastInfoOp == null || $lastInfoOp->isInvalid())
@continue
@endif
@foreach ($latestInfoOps as $targetDominionOps)
@php $lastInfoOp = $targetDominionOps->first(); @endphp
<tr>
<td>
<a href="{{ route('dominion.op-center.show', $dominion) }}">{{ $dominion->name }}</a>
@if ($lastInfoOp->isStale())
<a href="{{ route('dominion.op-center.show', $lastInfoOp->targetDominion) }}">{{ $lastInfoOp->targetDominion->name }}</a>
@if ($lastInfoOp->isInvalid())
<span class="label label-danger">Invalid</span>
@elseif ($lastInfoOp->isStale())
<span class="label label-warning">Stale</span>
@endif
</td>
<td data-search="realm:{{ $dominion->realm->number }}">
<a href="{{ route('dominion.realm', $dominion->realm->number) }}">{{ $dominion->realm->name }} (#{{ $dominion->realm->number }})</a>
<td data-search="realm:{{ $lastInfoOp->targetDominion->realm->number }}">
<a href="{{ route('dominion.realm', $lastInfoOp->targetDominion->realm->number) }}">{{ $lastInfoOp->targetDominion->realm->name }} (#{{ $lastInfoOp->targetDominion->realm->number }})</a>
{{-- todo: highlight clicked dominion in realm page? --}}
</td>
<td class="text-center" data-search="" data-order="{{ $infoOpService->getOffensivePower($selectedDominion->realm, $dominion) }}">
{{ $infoOpService->getOffensivePowerString($selectedDominion->realm, $dominion) }}
<td class="text-center" data-search="" data-order="{{ $lastInfoOp->targetDominion->race->name }}">
{{ $lastInfoOp->targetDominion->race->name }}
</td>
{{--
<td class="text-center" data-search="" data-order="{{ $infoOpService->getOffensivePower($selectedDominion->realm, $lastInfoOp->targetDominion) }}">
{{ $infoOpService->getOffensivePowerString($selectedDominion->realm, $lastInfoOp->targetDominion) }}
</td>
<td class="text-center" data-search="" data-order="{{ $infoOpService->getDefensivePower($selectedDominion->realm, $dominion) }}">
{{ $infoOpService->getDefensivePowerString($selectedDominion->realm, $dominion) }}
<td class="text-center" data-search="" data-order="{{ $infoOpService->getDefensivePower($selectedDominion->realm, $lastInfoOp->targetDominion) }}">
{{ $infoOpService->getDefensivePowerString($selectedDominion->realm, $lastInfoOp->targetDominion) }}
</td>
<td class="text-center" data-search="" data-order="{{ $infoOpService->getLand($selectedDominion->realm, $dominion) }}">
{{ $infoOpService->getLandString($selectedDominion->realm, $dominion) }}
--}}
<td class="text-center" data-search="" data-order="{{ $infoOpService->getLand($selectedDominion->realm, $lastInfoOp->targetDominion) }}">
{{ $infoOpService->getLandString($selectedDominion->realm, $lastInfoOp->targetDominion) }}
<br>
<span class="small {{ $rangeCalculator->getDominionRangeSpanClass($selectedDominion, $dominion) }}">
{{ number_format($rangeCalculator->getDominionRange($selectedDominion, $dominion), 1) }}%
<span class="small {{ $rangeCalculator->getDominionRangeSpanClass($selectedDominion, $lastInfoOp->targetDominion) }}">
{{ number_format($rangeCalculator->getDominionRange($selectedDominion, $lastInfoOp->targetDominion), 1) }}%
</span>
</td>
<td class="text-center" data-search="" data-order="{{ $infoOpService->getNetworth($selectedDominion->realm, $dominion) }}">
{{ $infoOpService->getNetworthString($selectedDominion->realm, $dominion) }}
<td class="text-center" data-search="" data-order="{{ $infoOpService->getNetworth($selectedDominion->realm, $lastInfoOp->targetDominion) }}">
{{ $infoOpService->getNetworthString($selectedDominion->realm, $lastInfoOp->targetDominion) }}
</td>
<td class="text-center" data-search="" data-order="{{ $lastInfoOp->updated_at->getTimestamp() }}">
{{ $infoOpService->getLastInfoOpName($selectedDominion->realm, $dominion) }}
<td class="text-center" data-search="" data-order="{{ $lastInfoOp->created_at->getTimestamp() }}">
{{ $infoOpService->getInfoOpName($lastInfoOp) }}
by
@if ($lastInfoOp->sourceDominion->id === $selectedDominion->id)
<strong>
Expand All @@ -81,11 +89,11 @@
@endif
<br>
<span class="small">
{{ $lastInfoOp->updated_at }}
{{ $lastInfoOp->created_at }}
</span>
</td>
<td class="text-center" data-search="" data-order="{{ $infoOpService->getNumberOfActiveInfoOps($selectedDominion->realm, $dominion) }}">
{{ $infoOpService->getNumberOfActiveInfoOps($selectedDominion->realm, $dominion) }}/{{ $infoOpService->getMaxInfoOps() }}
<td class="text-center" data-search="" data-order="{{ $infoOpService->getNumberOfActiveInfoOps($selectedDominion->realm, $lastInfoOp->targetDominion) }}">
{{ $infoOpService->getNumberOfActiveInfoOps($selectedDominion->realm, $lastInfoOp->targetDominion) }}/{{ $infoOpService->getMaxInfoOps() }}
</td>
</tr>
@endforeach
Expand Down Expand Up @@ -117,17 +125,14 @@
@php
$lastInfoOp = $infoOpService->getLastClairvoyance($selectedDominion->realm, $realm);
@endphp
@if ($lastInfoOp == null || $lastInfoOp->isInvalid())
@continue
@endif
<tr>
<td data-order="{{ $realm->number }}">
<a href="{{ route('dominion.op-center.clairvoyance', $realm->id) }}">{{ $realm->name }} (#{{ $realm->number }})</a>
</td>
<td data-order="{{ $lastInfoOp->targetDominion->name }}">
<a href="{{ route('dominion.op-center.show', $lastInfoOp->targetDominion) }}">{{ $lastInfoOp->targetDominion->name }}</a>
</td>
<td class="text-center" data-search="" data-order="{{ $lastInfoOp->updated_at->getTimestamp() }}">
<td class="text-center" data-search="" data-order="{{ $lastInfoOp->created_at->getTimestamp() }}">
Clairvoyance by
@if ($lastInfoOp->sourceDominion->id === $selectedDominion->id)
<strong>
Expand All @@ -138,7 +143,7 @@
@endif
<br>
<span class="small">
{{ $lastInfoOp->updated_at->diffForHumans() }}
{{ $lastInfoOp->created_at->diffForHumans() }}
</span>
</td>
</tr>
Expand Down Expand Up @@ -178,7 +183,7 @@
<script type="text/javascript">
(function ($) {
$('#dominions-table').DataTable({
order: [[6, 'desc']],
order: [[5, 'desc']],
});
})(jQuery);
</script>
Expand Down
Loading

0 comments on commit 60e3ad4

Please sign in to comment.