diff --git a/contrib/Makefile b/contrib/Makefile index 4c7e0e6d6..8f9beb420 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -7,14 +7,8 @@ APP_INSTALL_PREFIX=preprod- include .$(APP_INSTALL_ENV).env -reinstall: copy-binaries - @for project in $(APP_PROJECT_NAMES); do \ - echo "🚀 Starting $(APP_INSTALL_PREFIX)yavsc$${project}" \ - sudo systemctl start $(APP_INSTALL_PREFIX)yavsc$${project} ; done - @echo "💯 backend started" - -reinstall-prod: - make APP_INSTALL_ENV= APP_INSTALL_PREFIX= APP_INSTALL_ENV=production +generated/: + @mkdir -p $@ generated/$(APP_INSTALL_PREFIX)yavscOrg.service: generated/$(APP_INSTALL_PREFIX)yavscBlogs.service: @@ -68,6 +62,7 @@ copy-binaries: build_publish_Org build_publish_Blogs build_publish_Api stop-serv @sudo chown -R $(USER_AND_GROUP) $(DESTDIR)$(APPDIR) @sync + $(DESTDIR)/etc/systemd/system/$(APP_INSTALL_PREFIX)yavsc%.service: generated/$(APP_INSTALL_PREFIX)yavsc%.service sudo cp $^ $@ sudo chown root:root $@ @@ -86,11 +81,21 @@ install: copy-binaries copy-services sudo systemctl start yavsc$${project} ; \ done +reinstall: copy-binaries + @for project in $(APP_PROJECT_NAMES); do \ + sudo systemctl start yavsc$${project} ; done + +reinstall-prod: + make APP_INSTALL_ENV= APP_INSTALL_PREFIX= + +reinstall-pre: copy-binaries + @for project in $(APP_PROJECT_NAMES); do \ + sudo systemctl start yavscPre$${project} ; done stop-services: @for project in $(APP_PROJECT_NAMES); \ do \ - sudo systemctl stop $(APP_INSTALL_PREFIX)yavsc$${project} ; \ + sudo systemctl stop yavsc$${project} ; \ done $(SLNDIR)/src/Yavsc.Org/bin/$(CONFIGURATION)/$(DOTNET_FRAMEWORK)/publish: build_publish @@ -113,5 +118,3 @@ showBlogsLogs: clean: @rm -rf generated -generated/: - @mkdir -p $@ diff --git a/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs b/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs index 32b7a14b2..6f85a953f 100644 --- a/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs +++ b/src/Yavsc.Org/ViewComponents/CommentViewComponent.cs @@ -18,10 +18,7 @@ namespace Yavsc.ViewComponents } public async Task InvokeAsync(long id) { - var comment = await context.Comment - .Include(c => c.Children) - .Include(c => c.Author) - .FirstOrDefaultAsync(c => c.Id==id); + var comment = await context.Comment.Include(c=>c.Children).FirstOrDefaultAsync(c => c.Id==id); if (comment == null) throw new InvalidOperationException(); ViewBag.apictlr = "/api/v1/blogcomments"; diff --git a/src/Yavsc.Org/Views/Blogspot/Details.cshtml b/src/Yavsc.Org/Views/Blogspot/Details.cshtml index 0b07b0d94..a78964c5e 100644 --- a/src/Yavsc.Org/Views/Blogspot/Details.cshtml +++ b/src/Yavsc.Org/Views/Blogspot/Details.cshtml @@ -1,235 +1,102 @@ @model BlogPost @{ - ViewBag.Title = Model.Title; + ViewBag.Title=Model.Title; } -@section header { +@section scripts { + + + } -@section scripts { - -} - -
-
- @if (!string.IsNullOrEmpty(Model.Photo)) - { - @Model.Title - } -
-

@Model.Title

- -
-
- @Model.Article +
+
+
+ +

@Model.Title

+ + @Html.DisplayFor(m=>m.Author) + @Html.DisplayFor(m=>m.Article) +
- @if (Model.Comments != null) - { - foreach (var comment in Model.Comments.Where(c => c.ParentId == null)) - { + @if (Model.Comments!=null) { + foreach (var comment in Model.Comments.Where(c=>c.ParentId==null)) { @await Component.InvokeAsync("Comment", new { id = comment.Id }) } }
- - @if (User.GetUserId() != null) - { -
-
- - - - - -
+@if (User.GetUserId()!=null) { +
+
+ + + + +
+ +
} - else - { -

Vous devez être identifié pour commenter.

+ else { +

Vous devez être identifié pour commenter.

} Back to List -
\ No newline at end of file + diff --git a/src/Yavsc.Org/Views/Blogspot/Index.cshtml b/src/Yavsc.Org/Views/Blogspot/Index.cshtml index 9f29a9417..1179dba53 100644 --- a/src/Yavsc.Org/Views/Blogspot/Index.cshtml +++ b/src/Yavsc.Org/Views/Blogspot/Index.cshtml @@ -1,155 +1,85 @@ + @model IEnumerable @{ ViewBag.Title = "Blogs, l'index"; - - // Pagination reflects the Index(string id, int skip, int take) - // call profile. The service applies Skip/Take server-side, so - // the view only needs the current page params to build Prev/Next - // links — it does not receive a total count. - int currentSkip = Context.Request.Query.TryGetValue("skip", out var skipVal) && int.TryParse(skipVal, out var s) ? s : 0; - int currentTake = Context.Request.Query.TryGetValue("take", out var takeVal) && int.TryParse(takeVal, out var t) ? t : 25; - - var posts = Model.ToList(); - bool hasPrev = currentSkip > 0; - bool hasNext = posts.Count >= currentTake; - - int prevSkip = Math.Max(0, currentSkip - currentTake); - int nextSkip = currentSkip + currentTake; - - int maxSummaryLen = 256; } @section header { + +} +@section scripts { + }

@ViewBag.Title

@ViewBag.StatusMessage

-@if (!posts.Any()) -{ -

Néant

-} -else -{ -
- @foreach (var post in posts) - { - var canEdit = (await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded; -
- @if (!string.IsNullOrEmpty(post.Photo)) - { - - @post.Title - - } -
-

- @post.Title -

-
- - @post.Article - -
- -
- Details - @if (canEdit) - { - Delete - } -
-
-
- } -
+
+@{ + int maxTextLen = 75; + foreach (var post in Model) { +
- -} \ No newline at end of file + + +
+

@post.Title

+
+
+ + @post.Article + @Html.DisplayFor(m => post.Author) + + posté le @post.DateCreated.ToString("dddd d MMM yyyy à H:mm") + @if ((post.DateModified - post.DateCreated).Minutes > 0){ + @:- Modifié le @post.DateModified.ToString("dddd d MMM yyyy à H:mm") + } + +
+
+ @if ((await AuthorizationService.AuthorizeAsync(User, post, new ReadPermission())).Succeeded) + { + Details + } + else + { + Details + } + @if ((await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded) + { + Delete + + } +
+
+ } +} +
+ +@if(Model.Count()==0){

Néant

} diff --git a/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml b/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml index e83ea14c6..4d9344eba 100644 --- a/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml +++ b/src/Yavsc.Org/Views/Shared/Components/Comment/Default.cshtml @@ -1,30 +1,16 @@ @model Comment -
-
+
@Model.Article -
- - — @(Model.Author?.UserName ?? "Anonyme"), - posté le @Model.DateCreated.ToString("dddd d MMM yyyy à H:mm") - - @if (User.GetUserId() != null) - { - - } + + @if (Model.Children!=null) {
- @if (Model.Children != null) - { - foreach (var comment in Model.Children) + @foreach (var comment in Model.Children) { - @await this.Component.InvokeAsync("Comment", new { id = comment.Id }) + @await this.Component.InvokeAsync("Comment", new { id = comment.Id}); } - }
-
\ No newline at end of file +} +
+