You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This form updates the profile photos on each page. It removes the previous file from the blob, uploads the new one, and creates a new record in the database.
@@ -138,35 +140,39 @@ The code page has three separate admin panels. One for the basic page informati
138
140
The third GUI is what controls the portfolio section of the page. It has CRUD actions to create, update, and delete projects, as well as add and remove images from projects.
139
141
I've included domain models for the add and remove projects methods. The general page admin is same as the index page. The add and remove image methods will be detailed below under the Art Page section.
The add project form takes in a new project title. Because the title will be used for class names to control the Bootstrap accordion dropdown they need to be unique. The `CheckProjectTitle` method validates the input. When the project is created the title is normalized and used to assign several class names for use with dropdowns. The project is saved to the database with the title and classnames. Then a list of technologies is attached to the project for display in portfolio view.
The delete project form sends the project Id to the model. First the join table records for the ProjectImages are removed. Then the respective Image records are removed and the file is deleted from blob storage. Lastly the ProjectTechnology records are removed and then the Project record.
The art page has an admin for the general page content just like the index and code page. The galleries have their own GUI that can add and remove galleries, similar to adding and removing projects from the code page, and add and remove images from galleries.
The add images form sends an array of IFormFiles to the AddImages handler. Each image resized for gallery view and a copy is made and resized for thumbnail view. Both file names have the white space stripped and the date and time attached to ensure a unique name in the blob. Once stored in the blob the filename and blob.uris are used to create and save an Image in the database. Then the image is added to the gallery with an `ImageGallery` join table and the page is refreshed.
The delete image form removes the image from the gallery by deleting the `GalleryImage` join table record. Then the image and thumbnail are removed from the blob by filename. And finally the image record is removed from the database.
0 commit comments