-
-
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.
- Loading branch information
Showing
72 changed files
with
1,720 additions
and
19,629 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* 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 System; | ||
using System.Collections.Generic; | ||
|
||
namespace Piranha.Manager.Models | ||
{ | ||
public class ContentEditModel | ||
{ | ||
/// <summary> | ||
/// Gets/sets the unique id. | ||
/// </summary> | ||
public Guid Id { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the optional language id. | ||
/// </summary> | ||
public Guid? LanguageId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the content type id. | ||
/// </summary> | ||
public string TypeId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the mandatory title. | ||
/// </summary> | ||
public string Title { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets if blocks should be used. | ||
/// </summary> | ||
public bool UseBlocks { get; set; } = true; | ||
|
||
/// <summary> | ||
/// Gets/sets if the content type should be | ||
/// categorized. | ||
/// </summary> | ||
public bool UseCategory { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets if excerpt should be used for the | ||
/// content type. The default value is true. | ||
/// </summary> | ||
public bool UseExcerpt { get; set; } = true; | ||
|
||
/// <summary> | ||
/// Gets/sets if primary image should be used for the | ||
/// content type. The default value is true. | ||
/// </summary> | ||
public bool UsePrimaryImage { get; set; } = true; | ||
|
||
/// <summary> | ||
/// Gets/sets if tags should be used for the content type. | ||
/// </summary> | ||
public bool UseTags { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets if the content should be translatable. | ||
/// </summary> | ||
public bool UseTranslations { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the available blocks. | ||
/// </summary> | ||
public IList<Content.BlockModel> Blocks { get; set; } = new List<Content.BlockModel>(); | ||
|
||
/// <summary> | ||
/// Gets/sets the available regions. | ||
/// </summary> | ||
public IList<Content.RegionModel> Regions { get; set; } = new List<Content.RegionModel>(); | ||
|
||
/// <summary> | ||
/// Gets/sets the available custom editors. | ||
/// </summary> | ||
public IList<Content.EditorModel> Editors { get; set; } = new List<Content.EditorModel>(); | ||
} | ||
} |
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,40 @@ | ||
/* | ||
* 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 System; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Piranha.Models | ||
{ | ||
public class Language | ||
{ | ||
/// <summary> | ||
/// Gets/sets the unique id. | ||
/// </summary> | ||
public Guid Id { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the display title. | ||
/// </summary> | ||
[Required] | ||
[StringLength(64)] | ||
public string Title { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the optional culture. | ||
/// </summary> | ||
public string Culture { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets if this is the default language. | ||
/// </summary> | ||
public bool IsDefault { 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
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,52 @@ | ||
/* | ||
* 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 System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Piranha.Models; | ||
|
||
namespace Piranha.Repositories | ||
{ | ||
public interface ILanguageRepository | ||
{ | ||
/// <summary> | ||
/// Gets all available models. | ||
/// </summary> | ||
/// <returns>The available models</returns> | ||
Task<IEnumerable<Language>> GetAll(); | ||
|
||
/// <summary> | ||
/// Gets the model with the specified id. | ||
/// </summary> | ||
/// <param name="id">The unique id</param> | ||
/// <returns>The model, or null if it doesn't exist</returns> | ||
Task<Language> GetById(Guid id); | ||
|
||
/// <summary> | ||
/// Gets the default side. | ||
/// </summary> | ||
/// <returns>The modell</returns> | ||
Task<Language> GetDefault(); | ||
|
||
/// <summary> | ||
/// Adds or updates the given model in the database | ||
/// depending on its state. | ||
/// </summary> | ||
/// <param name="model">The model</param> | ||
Task Save(Language model); | ||
|
||
/// <summary> | ||
/// Deletes the model with the specified id. | ||
/// </summary> | ||
/// <param name="id">The unique id</param> | ||
Task Delete(Guid id); | ||
} | ||
} |
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,58 @@ | ||
/* | ||
* 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.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Piranha.Models; | ||
|
||
namespace Piranha.Services | ||
{ | ||
public interface ILanguageService | ||
{ | ||
/// <summary> | ||
/// Gets all available models. | ||
/// </summary> | ||
/// <returns>The available models</returns> | ||
Task<IEnumerable<Language>> GetAllAsync(); | ||
|
||
/// <summary> | ||
/// Gets the model with the specified id. | ||
/// </summary> | ||
/// <param name="id">The unique id</param> | ||
/// <returns>The model, or null if it doesn't exist</returns> | ||
Task<Language> GetByIdAsync(Guid id); | ||
|
||
/// <summary> | ||
/// Gets the default side. | ||
/// </summary> | ||
/// <returns>The modell</returns> | ||
Task<Language> GetDefaultAsync(); | ||
|
||
/// <summary> | ||
/// Adds or updates the given model in the database | ||
/// depending on its state. | ||
/// </summary> | ||
/// <param name="model">The model</param> | ||
Task SaveAsync(Language model); | ||
|
||
/// <summary> | ||
/// Deletes the model with the specified id. | ||
/// </summary> | ||
/// <param name="id">The unique id</param> | ||
Task DeleteAsync(Guid id); | ||
|
||
/// <summary> | ||
/// Deletes the given model. | ||
/// </summary> | ||
/// <param name="model">The model</param> | ||
Task DeleteAsync(Language model); | ||
} | ||
} |
Oops, something went wrong.