-
-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added migrations, services & repositories for generic content. See #1335
- Loading branch information
Showing
46 changed files
with
3,311 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) .NET Foundation and Contributors | ||
* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
* | ||
* https://github.com/piranhacms/piranha.core | ||
* | ||
*/ | ||
|
||
namespace Piranha.Extend | ||
{ | ||
/// <summary> | ||
/// Interface for marking a block or field as translatable. | ||
/// </summary> | ||
public interface ITranslatable { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) .NET Foundation and Contributors | ||
* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
* | ||
* https://github.com/piranhacms/piranha.core | ||
* | ||
*/ | ||
|
||
using Piranha.Extend.Fields; | ||
|
||
namespace Piranha.Models | ||
{ | ||
/// <summary> | ||
/// Base class for generic content. | ||
/// </summary> | ||
public abstract class GenericContent : ContentBase | ||
{ | ||
/// <summary> | ||
/// Gets/sets the optional primary image. | ||
/// </summary> | ||
public ImageField PrimaryImage { get; set; } = new ImageField(); | ||
|
||
/// <summary> | ||
/// Gets/sets the optional excerpt. | ||
/// </summary> | ||
public string Excerpt { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) .NET Foundation and Contributors | ||
* | ||
* This software may be modified and distributed under the terms | ||
* of the MIT license. See the LICENSE file for details. | ||
* | ||
* http://github.com/piranhacms/piranha | ||
* | ||
*/ | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using Piranha.Models; | ||
|
||
namespace Piranha.Repositories | ||
{ | ||
public interface IContentRepository | ||
{ | ||
/// <summary> | ||
/// Gets the content model with the specified id. | ||
/// </summary> | ||
/// <typeparam name="T">The model type</typeparam> | ||
/// <param name="id">The unique id</param> | ||
/// <param name="languageId">The selected language id</param> | ||
/// <returns>The content model</returns> | ||
Task<T> GetById<T>(Guid id, Guid languageId) where T : GenericContent; | ||
|
||
/// <summary> | ||
/// Saves the given content model | ||
/// </summary> | ||
/// <param name="model">The content model</param> | ||
/// <param name="languageId">The selected language id</param> | ||
Task Save<T>(T model, Guid languageId) where T : GenericContent; | ||
|
||
/// <summary> | ||
/// Deletes the content model with the specified id. | ||
/// </summary> | ||
/// <param name="id">The unique id</param> | ||
Task Delete(Guid id); | ||
} | ||
} |
Oops, something went wrong.