Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit 09757e8

Browse files
authored
Merge pull request #99 from paiindustries/develop
Finish 1.1.0
2 parents 48dc977 + a955ee7 commit 09757e8

22 files changed

Lines changed: 990 additions & 448 deletions

File tree

.github/workflows/prod.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ jobs:
4242
docker pull ${{ secrets.DOCKER_HUB_IP }}:${{ secrets.DOCKER_HUB_PORT}}/wheels-dev-prod
4343
docker stack deploy --with-registry-auth -c docker-compose.yml wheels-dev-prod
4444
45-
- name: Post Slack Message
46-
id: Post-Slack-Message
47-
uses: act10ns/slack@v2
48-
with:
49-
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
50-
status: ${{ job.status }}
51-
steps: ${{ toJson(steps) }}
52-
channel: '#wheels-dev'
53-
if: always()
45+
# - name: Post Slack Message
46+
# id: Post-Slack-Message
47+
# uses: act10ns/slack@v2
48+
# with:
49+
# webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
50+
# status: ${{ job.status }}
51+
# steps: ${{ toJson(steps) }}
52+
# channel: '#wheels-dev'
53+
# if: always()

app/config/routes.cfm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@
103103
.namespace("admin")
104104
// Admin Controls
105105
.get(name = "dashboard", pattern="/", to="AdminController##dashboard")
106+
107+
// FeatureController routes
108+
.get(name = "feature", pattern = "feature", to = "FeatureController##index")
109+
.get(name = "addFeature", pattern = "feature/add", to = "FeatureController##addFeature")
110+
.get(name = "editFeature", pattern = "feature/edit/[id]", to = "FeatureController##addFeature")
111+
.post(name = "storeFeature", pattern = "feature/store", to = "FeatureController##store")
112+
.get(name = "deleteFeature", pattern = "feature/delete/[id]", to = "FeatureController##delete")
106113
.get(name = "blog", pattern = "blog", to = "AdminController##blog")
107114
.get(name = "blogEdit", pattern = "blog/edit/[id]", to = "AdminController##editBlog")
108115
.put(name = "blog-update", pattern = "blog/blogUpdate/[id]", to = "AdminController##update")

app/controllers/admin/AdminController.cfc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,11 @@ component extends="app.Controllers.Controller" {
441441
var emailparams = {
442442
"name" = user.fullname,
443443
"buttonTitle" = "View Your Post",
444-
"content" = "Thank you for writing a blog post. Your post '#blog.title#' has been published on the Wheels website.",
444+
"content" = "Thank you for contributing to the Wheels.dev community. Your blog post '#blog.title#' has been published and is now live on our platform.",
445445
"URl" = siteurl,
446-
"Footer" = "If you did not write blog post, you can safely ignore this email."
446+
"Footer" = "If you haven't published a blog post, please disregard this email.",
447+
"footerGreetings" = "Thank you for being part of the Wheels.dev community.",
448+
"isSubscriber" = user.newsletter
447449
};
448450
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
449451
cfheader(name="Content-Type" value="text/html; charset=UTF-8");
@@ -797,9 +799,11 @@ component extends="app.Controllers.Controller" {
797799
var emailparams = {
798800
"name" = user.fullname,
799801
"buttonTitle" = "View Your Comment",
800-
"content" = "Thanks for commenting on our blog post. Your comment is now live on the Wheels site.",
802+
"content" = "Thank you for engaging with our community. Your comment has been published and is now visible on the Wheels.dev platform.",
801803
"URl" = siteurl,
802-
"Footer" = "If you did not write comment, you can safely ignore this email."
804+
"Footer" = "If you haven't submitted a comment, please disregard this email.",
805+
"footerGreetings" = "Thank you for being part of the Wheels.dev community.",
806+
"isSubscriber" = user.newsletter
803807
};
804808
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
805809
cfmail(
@@ -871,9 +875,11 @@ component extends="app.Controllers.Controller" {
871875
var emailparams = {
872876
"name" = user.fullname,
873877
"buttonTitle" = "View Your Post",
874-
"content" = "Thank you for writing a blog post. Your post '#blog.title#' has been rejected.",
878+
"content" = "Thank you for your contribution to the Wheels.dev community. After careful review, we regret to inform you that your blog post '#blog.title#' has not been approved for publication at this time.",
875879
"URl" = "",
876-
"Footer" = "If you did not write blog post, you can safely ignore this email."
880+
"Footer" = "If you haven't submitted a blog post, please disregard this email.",
881+
"footerGreetings" = "Thank you for being part of the Wheels.dev community.",
882+
"isSubscriber" = user.newsletter
877883
};
878884
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
879885
cfheader(name="Content-Type" value="text/html; charset=UTF-8");
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
component extends="app.Controllers.Controller" {
2+
3+
function config() {
4+
verifies(except="index,addFeature,store", params="key", paramsTypes="integer", handler="index");
5+
usesLayout(template="/admin/AdminController/layout");
6+
filters(through="checkAdminAccess");
7+
}
8+
9+
// List all features
10+
function index() {
11+
features = model("Feature").getAllFeatures();
12+
}
13+
14+
// Add or edit feature
15+
function addFeature() {
16+
param name="id" default=0;
17+
feature;
18+
if (id > 0) {
19+
feature = findById(params.id);
20+
} else {
21+
feature = model("Feature");
22+
}
23+
return feature;
24+
}
25+
26+
// Save feature (create or update)
27+
function store() {
28+
try {
29+
var message = saveFeature(params);
30+
flashInsert(success=message);
31+
redirectTo(route="adminFeature");
32+
} catch (any e) {
33+
flashInsert(error="Failed to save feature: " & e.message);
34+
redirectTo(route="adminFeature");
35+
}
36+
}
37+
38+
// Delete feature (soft delete)
39+
function delete() {
40+
try {
41+
var message = softDelete(params.id);
42+
flashInsert(success=message.message);
43+
renderText('');
44+
} catch (any e) {
45+
flashInsert(error="Failed to delete feature: " & e.message);
46+
cfheader(statusCode=500);
47+
}
48+
}
49+
50+
// Find feature by ID
51+
private function findById(id) {
52+
return model("Feature").findByKey(arguments.id);
53+
}
54+
55+
// Save or update feature
56+
private function saveFeature(featureData) {
57+
var message = "";
58+
if (featureData.id > 0) {
59+
var feature = model("Feature").findByKey(featureData.id);
60+
if (!isNull(feature)) {
61+
feature.title = featureData.title;
62+
feature.image = featureData.image;
63+
feature.description = featureData.description;
64+
feature.updatedAt = now();
65+
feature.save();
66+
message = "Feature updated successfully.";
67+
} else {
68+
message = "Feature not found for editing.";
69+
}
70+
} else {
71+
var newFeature = model("Feature").new();
72+
newFeature.title = featureData.title;
73+
newFeature.image = featureData.image;
74+
newFeature.description = featureData.description;
75+
newFeature.createdAt = now();
76+
newFeature.updatedAt = now();
77+
newFeature.save();
78+
message = "Feature created successfully.";
79+
}
80+
return message;
81+
}
82+
83+
// Soft delete feature
84+
private function softDelete(id) {
85+
var feature = model("Feature").findByKey(arguments.id);
86+
if (!isNull(feature)) {
87+
feature.deletedAt = now();
88+
feature.save();
89+
return { success = true, message = "Feature deleted successfully." };
90+
}
91+
return { success = false, message = "Feature not found." };
92+
}
93+
}

app/controllers/admin/testimonialController.cfc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ component extends="app.Controllers.Controller" {
222222
"buttonTitle" = "View Your Testimonial",
223223
"content" = "Thank you for writing a testimonial. Your testimonial has been approved and published on the Wheels website.",
224224
"URl" = siteurl,
225-
"Footer" = "If you did not write testinomial, you can safely ignore this email."
225+
"Footer" = "If you did not write testinomial, you can safely ignore this email.",
226+
"footerGreetings" = "Thank you for being a part of Wheels community.",
227+
"isSubscriber" = user.newsletter
226228
};
227229
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
228230
cfheader(name="Content-Type" value="text/html; charset=UTF-8");

0 commit comments

Comments
 (0)