Fossil SCM

Minor doc and style tweaks.

stephan 2026-06-03 18:05 UTC attach-v2
Commit 766755a3f910b39e8b1ac597ce0a4feb269dd44d170f2f67036ebf39c5c45ac1
--- skins/darkmode/css.txt
+++ skins/darkmode/css.txt
@@ -132,11 +132,11 @@
132132
outline: 0
133133
}
134134
button:disabled,
135135
input[type=submit]:disabled {
136136
color: #363636;
137
- background-color: #707070;
137
+ background-color: #a0a0a0;
138138
}
139139
.button:focus,
140140
button:focus,
141141
input[type=button]:focus,
142142
input[type=reset]:focus,
143143
--- skins/darkmode/css.txt
+++ skins/darkmode/css.txt
@@ -132,11 +132,11 @@
132 outline: 0
133 }
134 button:disabled,
135 input[type=submit]:disabled {
136 color: #363636;
137 background-color: #707070;
138 }
139 .button:focus,
140 button:focus,
141 input[type=button]:focus,
142 input[type=reset]:focus,
143
--- skins/darkmode/css.txt
+++ skins/darkmode/css.txt
@@ -132,11 +132,11 @@
132 outline: 0
133 }
134 button:disabled,
135 input[type=submit]:disabled {
136 color: #363636;
137 background-color: #a0a0a0;
138 }
139 .button:focus,
140 button:focus,
141 input[type=button]:focus,
142 input[type=reset]:focus,
143
+8 -5
--- src/attach.c
+++ src/attach.c
@@ -57,23 +57,24 @@
5757
db_reset(&q);
5858
return rc;
5959
}
6060
6161
/*
62
-** For a given aritfact ID and type, returns true if the current user
63
-** could hypothetically attach something to it, else returns 0.
62
+** For a given aritfact ID and type (from the CFTYPE_xyz enum),
63
+** returns true if the current user could hypothetically attach
64
+** something to it, else returns 0.
6465
**
65
-** The rid is currently only relevant when iArtifactType is
66
+** The rid is currently only relevant when eArtifactType is
6667
** CFTYPE_FORUM. For forum posts, it checks precisely the rid given,
6768
** not the head RID, to keep non-admins from attaching files to
6869
** threads which have since been taken over by another user (this
6970
** happens when an admin edits another user's post).
7071
*/
71
-int attach_user_may(int rid, int iArtifactType){
72
+int attach_user_may(int rid, int eArtifactType){
7273
if( g.perm.Admin ) return 1;
7374
if( !login_is_individual() ) return 0;
74
- switch(iArtifactType){
75
+ switch(eArtifactType){
7576
case CFTYPE_FORUM:
7677
return forumpost_is_owner(rid, 0);
7778
case CFTYPE_WIKI:
7879
return g.perm.ApndWiki && g.perm.Attach;
7980
case CFTYPE_TICKET:
@@ -88,10 +89,12 @@
8889
/*
8990
** Emits a single-button FORM which invokes
9091
** /attachadd?target=$zTarget.
9192
*/
9293
void attach_render_attachadd_button(const char *zTarget){
94
+ /* This could be changed from POST to GET, and arguably should so
95
+ ** that the target=X part becomes part of the resulting URL. */
9396
@ <form method="post" action="%R/attachadd">\
9497
@ <input type="hidden" name="target" value="%T(zTarget)">\
9598
@ <input type="submit" value="Attach...">
9699
@ </form>\
97100
}
98101
--- src/attach.c
+++ src/attach.c
@@ -57,23 +57,24 @@
57 db_reset(&q);
58 return rc;
59 }
60
61 /*
62 ** For a given aritfact ID and type, returns true if the current user
63 ** could hypothetically attach something to it, else returns 0.
 
64 **
65 ** The rid is currently only relevant when iArtifactType is
66 ** CFTYPE_FORUM. For forum posts, it checks precisely the rid given,
67 ** not the head RID, to keep non-admins from attaching files to
68 ** threads which have since been taken over by another user (this
69 ** happens when an admin edits another user's post).
70 */
71 int attach_user_may(int rid, int iArtifactType){
72 if( g.perm.Admin ) return 1;
73 if( !login_is_individual() ) return 0;
74 switch(iArtifactType){
75 case CFTYPE_FORUM:
76 return forumpost_is_owner(rid, 0);
77 case CFTYPE_WIKI:
78 return g.perm.ApndWiki && g.perm.Attach;
79 case CFTYPE_TICKET:
@@ -88,10 +89,12 @@
88 /*
89 ** Emits a single-button FORM which invokes
90 ** /attachadd?target=$zTarget.
91 */
92 void attach_render_attachadd_button(const char *zTarget){
 
 
93 @ <form method="post" action="%R/attachadd">\
94 @ <input type="hidden" name="target" value="%T(zTarget)">\
95 @ <input type="submit" value="Attach...">
96 @ </form>\
97 }
98
--- src/attach.c
+++ src/attach.c
@@ -57,23 +57,24 @@
57 db_reset(&q);
58 return rc;
59 }
60
61 /*
62 ** For a given aritfact ID and type (from the CFTYPE_xyz enum),
63 ** returns true if the current user could hypothetically attach
64 ** something to it, else returns 0.
65 **
66 ** The rid is currently only relevant when eArtifactType is
67 ** CFTYPE_FORUM. For forum posts, it checks precisely the rid given,
68 ** not the head RID, to keep non-admins from attaching files to
69 ** threads which have since been taken over by another user (this
70 ** happens when an admin edits another user's post).
71 */
72 int attach_user_may(int rid, int eArtifactType){
73 if( g.perm.Admin ) return 1;
74 if( !login_is_individual() ) return 0;
75 switch(eArtifactType){
76 case CFTYPE_FORUM:
77 return forumpost_is_owner(rid, 0);
78 case CFTYPE_WIKI:
79 return g.perm.ApndWiki && g.perm.Attach;
80 case CFTYPE_TICKET:
@@ -88,10 +89,12 @@
89 /*
90 ** Emits a single-button FORM which invokes
91 ** /attachadd?target=$zTarget.
92 */
93 void attach_render_attachadd_button(const char *zTarget){
94 /* This could be changed from POST to GET, and arguably should so
95 ** that the target=X part becomes part of the resulting URL. */
96 @ <form method="post" action="%R/attachadd">\
97 @ <input type="hidden" name="target" value="%T(zTarget)">\
98 @ <input type="submit" value="Attach...">
99 @ </form>\
100 }
101

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button