A digital gallery built around the Denis Baly Slide Collection.
The rails app is contained in the interface/ folder, in which the app/ folder contains all the code that may need occaisonal maintance.
To import the app onto a new server, follow the setup instructions in this configuration file
For a detailed explanation of the code and directions for further development, check out the interface README.
The repository has three folders.
- The interface folder contains the source code for the Rails app
- The methodTesting folder contains a copy of the interface models, and can be used for testing and update simulation
- The samplePages folder contains HTML prototypes of various views
Some of the most important workflows used in developing and updating the rails app
Rules to follow when updating and developing.
-
- All changes should be made on a separate server, configured using the steps in configuration.md.
- All changes should be made in a new github branch, not main.
- Thoroughly test all large modifications, and always complete features before merging with the main branch.
- Merges can be made with pull requests on the github webpage for the project. If there is more than one person working on the project, pull requests (to main) must be approved by one other member of the Baly Project Organization. An organization administrator has the ability to override this safeguard, but this should only ever be used in one-developer situations.
- When changes are ready to be put in production and have been incorporated into the main branch, strictly adhere to the following steps:
-
Type
git pullto pull the changes. -
Execute any commands performed during new development
-
Execute these standard rails commands to ensure full sync with updated version
bundle install rails assets:clobber rails assets:precompile rake record:update
-
Execute the following commands together to end the running server and restart it with the new changes. This will put the server down for a moment, and if you are running on a multi-processor system then you should explore options for zero-downtime deploys such as this tutorial from Digital Ocean.
pkill -9 ruby nohup rails s -e production -b 0.0.0.0 & -
Check that the server is running at baly.kenyon.edu, and test the new feature immediately. If anything does not work as expected, revert your changes by typing
git logand picking the last commit before the merge, then typinggit checkout COMMIT HASHwhere COMMIT HASH is the first 7 characters in the string of numbers and letters at the top of that commit's log entry. This will revert to the version before the merge, and repeating step iv (previous) should start the server back the way it was. When the changes have been fixed, follow this entire list from the top.
-
Before a change is added by a commit, make sure to update the documentation and testing as much as possible to reflect the changes. This helps prevent obsolete information from entering the main branch and ensures that commits can be reverted cleanly.
- Slideshow feature available in slide views, to automatically rotate through the current set of images. Because the next and previous buttons handle all the functionality, this can be initiated with a 30 second delay (but not ended) by the javascript snippet:
The remaining work will involve creating a new button that triggers this functionality, as well as finding a way to end. Ending the recursive cycle could be done by checking for a variable in the sessionStorage object, which persists between pages. Review the addArrows function in
const minutes = 0.5; function iterate(seconds){ const interval = seconds*1000; return setTimeout(() => { document.querySelector('.fs-control.next')?.click(); iterate(seconds); }, interval)}; iterate(minutes * 60);
interface/app/javascript/controllers/back_forth_controller.jsfor examples of setting and retrieving variables from sessionStorage.