Compare commits
2 Commits
68f837b104
...
d98dfa9f7e
Author | SHA1 | Date | |
---|---|---|---|
d98dfa9f7e | |||
ad6e10250b |
41
.gitea/workflows/gitea-push-docker.yml
Normal file
41
.gitea/workflows/gitea-push-docker.yml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: Create and publish a Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ['main']
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.zetcraft.ru
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: catthehacker/ubuntu:act-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
|
id: meta
|
||||||
|
uses: https://github.com/docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ gitea.repository }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||||
|
with:
|
||||||
|
context: PaydayFrontend
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
15
PaydayFrontend/Controllers/AdminController.cs
Normal file
15
PaydayFrontend/Controllers/AdminController.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using PaydayFrontend.Models;
|
||||||
|
|
||||||
|
namespace PaydayFrontend.Controllers;
|
||||||
|
|
||||||
|
public class AdminController : Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
|
public IActionResult Error()
|
||||||
|
{
|
||||||
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||||
|
}
|
||||||
|
}
|
@ -28,12 +28,19 @@ public class HomeController : Controller
|
|||||||
return View(universities.ToList());
|
return View(universities.ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public IActionResult SecondPage([FromQuery] long universityId)
|
[Route("Directions")]
|
||||||
|
public IActionResult Directions(long universityId)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine(universityId);
|
||||||
|
if (universityId == 0)
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IActionResult ThirdPage()
|
public IActionResult Credits()
|
||||||
{
|
{
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 443
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["PaydayFrontend/PaydayFrontend.csproj", "PaydayFrontend/"]
|
COPY ["PaydayFrontend.csproj", "PaydayFrontend/"]
|
||||||
RUN dotnet restore "PaydayFrontend/PaydayFrontend.csproj"
|
RUN dotnet restore "PaydayFrontend.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/PaydayFrontend"
|
WORKDIR "/src"
|
||||||
RUN dotnet build "PaydayFrontend.csproj" -c Release -o /app/build
|
RUN dotnet build "PaydayFrontend.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
|
11
PaydayFrontend/Models/DirectionViewModel.cs
Normal file
11
PaydayFrontend/Models/DirectionViewModel.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace PaydayFrontend.Models;
|
||||||
|
|
||||||
|
public class Direction
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public long UniversityId { get; set; }
|
||||||
|
public string Code { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Url { get; set; }
|
||||||
|
public int PlaceCost { get; set; }
|
||||||
|
}
|
@ -6,6 +6,7 @@ namespace PaydayFrontend.Services;
|
|||||||
public interface IUniversityService
|
public interface IUniversityService
|
||||||
{
|
{
|
||||||
public Task<List<University>> GetAllUniversity();
|
public Task<List<University>> GetAllUniversity();
|
||||||
|
public Task<List<University>> GetDirectionsByUniversityId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UniversityService : IUniversityService
|
public class UniversityService : IUniversityService
|
||||||
@ -28,4 +29,15 @@ public class UniversityService : IUniversityService
|
|||||||
});
|
});
|
||||||
return university;
|
return university;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<University>> GetDirectionsByUniversityId()
|
||||||
|
{
|
||||||
|
var response = await _httpClient.GetAsync("v1/public/university");
|
||||||
|
var result = await response.Content.ReadAsStringAsync();
|
||||||
|
var university = JsonSerializer.Deserialize<List<University>>(result, new JsonSerializerOptions
|
||||||
|
{
|
||||||
|
PropertyNameCaseInsensitive = true
|
||||||
|
});
|
||||||
|
return university;
|
||||||
|
}
|
||||||
}
|
}
|
@ -22,10 +22,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="navigation_choise">
|
||||||
<div class="navigation_slid">
|
<div class="navigation_slid">
|
||||||
<span class="navigation_slid_disable"></span>
|
<span class="navigation_slid_disable"></span>
|
||||||
<span class="navigation_slid_active"></span>
|
<span class="navigation_slid_active"></span>
|
||||||
<span class="navigation_slid_disable"></span>
|
<span class="navigation_slid_disable"></span>
|
||||||
<span class="navigation_slid_disable"></span>
|
<span class="navigation_slid_disable"></span>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
@ -14,27 +14,26 @@
|
|||||||
@{
|
@{
|
||||||
foreach (var university in Model)
|
foreach (var university in Model)
|
||||||
{
|
{
|
||||||
<div universityId="@university.Id" class="col-2 universe_card universe_card_text">
|
<a href="Directions?UniversityId=@university.Id" class="col-2 universe_card universe_card_text">
|
||||||
<img src="@university.ImageUrl" alt="universe" class="universe_icon">
|
<img src="@university.ImageUrl" alt="universe" class="universe_icon">
|
||||||
@university.Name
|
@university.Name
|
||||||
@if (university.MinPlaceCost != 0)
|
@if (university.MinPlaceCost != 0)
|
||||||
{
|
{
|
||||||
<span>от @university.MinPlaceCost тыс. руб</span>
|
<span>от @university.MinPlaceCost тыс. руб</span>
|
||||||
}
|
}
|
||||||
</div>
|
</a>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<a asp-controller="Home" asp-action="SecondPage">
|
<div class="navigation_choise">
|
||||||
<input type="button" class="btn btn-primary"/>
|
<div class="navigation_slid">
|
||||||
</a>
|
<span class="navigation_slid_active"></span>
|
||||||
<div class="universe_slid">
|
<span class="navigation_slid_disable"></span>
|
||||||
<span class="universe_slid_active"></span>
|
<span class="navigation_slid_disable"></span>
|
||||||
<span class="universe_slid_disable"></span>
|
<span class="navigation_slid_disable"></span>
|
||||||
<span class="universe_slid_disable"></span>
|
</div>
|
||||||
<span class="universe_slid_disable"></span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user