Fossil SCM
Remove the unused description field from the forum-statuses setting.
Commit
c56de3f19a5abd3e8e687cb3796b3e4a874d275b179cbbcdc9d36b2af7b30f2b
Parent
3b2d0c9f59eb7bd…
2 files changed
+7
-11
+4
-5
+7
-11
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -68,11 +68,10 @@ | ||
| 68 | 68 | ** A single entry from the forum-statuses setting. |
| 69 | 69 | */ |
| 70 | 70 | struct ForumStatus { |
| 71 | 71 | char *zLabel; /* Label for the UI */ |
| 72 | 72 | char *zValue; /* status=X tag value */ |
| 73 | - char *zDescr; /* Brief description */ | |
| 74 | 73 | }; |
| 75 | 74 | |
| 76 | 75 | /* |
| 77 | 76 | ** A list of ForumStatus objects. |
| 78 | 77 | */ |
| @@ -113,37 +112,35 @@ | ||
| 113 | 112 | ** list. A length-1 list is, for purposes of the UI, identical to |
| 114 | 113 | ** an empty one - status selection/filtering makes no sense if |
| 115 | 114 | ** there's only one choice. */ |
| 116 | 115 | db_multi_exec( |
| 117 | 116 | "CREATE TEMP TABLE IF NOT EXISTS forumstatus(" |
| 118 | - " ord INTEGER PRIMARY KEY," | |
| 119 | - " label, value, descr" | |
| 117 | + " ord INTEGER PRIMARY KEY, label, value" | |
| 120 | 118 | ");" |
| 121 | 119 | "DELETE FROM forumstatus;" |
| 122 | - "INSERT INTO forumstatus(label,value,descr)" | |
| 120 | + "INSERT INTO forumstatus(label,value)" | |
| 123 | 121 | " WITH setting(v) AS (" |
| 124 | 122 | " SELECT value v FROM config WHERE name='forum-statuses'" |
| 125 | 123 | " )," |
| 126 | 124 | " room(r) AS (" |
| 127 | 125 | " SELECT e.value FROM setting s, jsonb_each(s.v) e" |
| 128 | 126 | " WHERE json_valid(s.v, 0x02)" |
| 129 | 127 | " )" |
| 130 | - " SELECT r->>'label', r->>'value', r->>'description'" | |
| 128 | + " SELECT r->>'label', r->>'value'" | |
| 131 | 129 | " FROM room;" |
| 132 | 130 | ); |
| 133 | 131 | fses.n = (unsigned)db_int(0, "SELECT count(*) FROM forumstatus"); |
| 134 | 132 | if( fses.n ){ |
| 135 | 133 | int i = 0; |
| 136 | 134 | Stmt q; |
| 137 | - db_prepare(&q,"SELECT label, value, descr FROM forumstatus" | |
| 138 | - " ORDER BY ord"); | |
| 135 | + db_prepare(&q,"SELECT label, value FROM forumstatus" | |
| 136 | + " ORDER BY ord"); | |
| 139 | 137 | fses.aStatus = fossil_malloc(sizeof(fses.aStatus[0]) * fses.n); |
| 140 | 138 | while( SQLITE_ROW==db_step(&q) ){ |
| 141 | 139 | ForumStatus * fs = &fses.aStatus[i++]; |
| 142 | 140 | fs->zLabel = fossil_strdup(db_column_text(&q, 0)); |
| 143 | 141 | fs->zValue = fossil_strdup(db_column_text(&q, 1)); |
| 144 | - fs->zDescr = fossil_strdup(db_column_text(&q, 2)); | |
| 145 | 142 | } |
| 146 | 143 | db_finalize(&q); |
| 147 | 144 | } |
| 148 | 145 | } |
| 149 | 146 | return &fses; |
| @@ -180,12 +177,11 @@ | ||
| 180 | 177 | unsigned i; |
| 181 | 178 | db_find_and_open_repository(0,0); |
| 182 | 179 | fses = forum_statuses(); |
| 183 | 180 | for(i = 0; i < fses->n; ++i ){ |
| 184 | 181 | const ForumStatus * fs = &fses->aStatus[i]; |
| 185 | - fossil_print("Status: %!j %!j %!j\n", | |
| 186 | - fs->zValue, fs->zLabel, fs->zDescr); | |
| 182 | + fossil_print("Status: %!j %!j\n", fs->zValue, fs->zLabel); | |
| 187 | 183 | assert( fs==forum_status_by_value(fs->zValue, 0) ); |
| 188 | 184 | } |
| 189 | 185 | fossil_print("Total statuses: %u\n", i); |
| 190 | 186 | } |
| 191 | 187 | |
| @@ -2232,11 +2228,11 @@ | ||
| 2232 | 2228 | ** unlimited but a limit may be imposed by the web server or a proxy. |
| 2233 | 2229 | ** |
| 2234 | 2230 | ** SETTING: forum-statuses width=40 block-text |
| 2235 | 2231 | ** This JSON5-formatted value defines an array of objects describing |
| 2236 | 2232 | ** the available statuses of forum posts. Each entry of the array must |
| 2237 | -** be an object in the form {label:"X",value:"Y",description:"Z"}. | |
| 2233 | +** be an object in the form {label:"X",value:"Y"}. | |
| 2238 | 2234 | ** The label is used in the UI and value becomes the value of the |
| 2239 | 2235 | ** "status" tag on forum posts. Any forum post which has a status |
| 2240 | 2236 | ** value which does not appear in this list is treated as if it had |
| 2241 | 2237 | ** the first value from this list. If this setting is empty, is |
| 2242 | 2238 | ** ill-formed JSON, or has only a single entry then the forum will |
| 2243 | 2239 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -68,11 +68,10 @@ | |
| 68 | ** A single entry from the forum-statuses setting. |
| 69 | */ |
| 70 | struct ForumStatus { |
| 71 | char *zLabel; /* Label for the UI */ |
| 72 | char *zValue; /* status=X tag value */ |
| 73 | char *zDescr; /* Brief description */ |
| 74 | }; |
| 75 | |
| 76 | /* |
| 77 | ** A list of ForumStatus objects. |
| 78 | */ |
| @@ -113,37 +112,35 @@ | |
| 113 | ** list. A length-1 list is, for purposes of the UI, identical to |
| 114 | ** an empty one - status selection/filtering makes no sense if |
| 115 | ** there's only one choice. */ |
| 116 | db_multi_exec( |
| 117 | "CREATE TEMP TABLE IF NOT EXISTS forumstatus(" |
| 118 | " ord INTEGER PRIMARY KEY," |
| 119 | " label, value, descr" |
| 120 | ");" |
| 121 | "DELETE FROM forumstatus;" |
| 122 | "INSERT INTO forumstatus(label,value,descr)" |
| 123 | " WITH setting(v) AS (" |
| 124 | " SELECT value v FROM config WHERE name='forum-statuses'" |
| 125 | " )," |
| 126 | " room(r) AS (" |
| 127 | " SELECT e.value FROM setting s, jsonb_each(s.v) e" |
| 128 | " WHERE json_valid(s.v, 0x02)" |
| 129 | " )" |
| 130 | " SELECT r->>'label', r->>'value', r->>'description'" |
| 131 | " FROM room;" |
| 132 | ); |
| 133 | fses.n = (unsigned)db_int(0, "SELECT count(*) FROM forumstatus"); |
| 134 | if( fses.n ){ |
| 135 | int i = 0; |
| 136 | Stmt q; |
| 137 | db_prepare(&q,"SELECT label, value, descr FROM forumstatus" |
| 138 | " ORDER BY ord"); |
| 139 | fses.aStatus = fossil_malloc(sizeof(fses.aStatus[0]) * fses.n); |
| 140 | while( SQLITE_ROW==db_step(&q) ){ |
| 141 | ForumStatus * fs = &fses.aStatus[i++]; |
| 142 | fs->zLabel = fossil_strdup(db_column_text(&q, 0)); |
| 143 | fs->zValue = fossil_strdup(db_column_text(&q, 1)); |
| 144 | fs->zDescr = fossil_strdup(db_column_text(&q, 2)); |
| 145 | } |
| 146 | db_finalize(&q); |
| 147 | } |
| 148 | } |
| 149 | return &fses; |
| @@ -180,12 +177,11 @@ | |
| 180 | unsigned i; |
| 181 | db_find_and_open_repository(0,0); |
| 182 | fses = forum_statuses(); |
| 183 | for(i = 0; i < fses->n; ++i ){ |
| 184 | const ForumStatus * fs = &fses->aStatus[i]; |
| 185 | fossil_print("Status: %!j %!j %!j\n", |
| 186 | fs->zValue, fs->zLabel, fs->zDescr); |
| 187 | assert( fs==forum_status_by_value(fs->zValue, 0) ); |
| 188 | } |
| 189 | fossil_print("Total statuses: %u\n", i); |
| 190 | } |
| 191 | |
| @@ -2232,11 +2228,11 @@ | |
| 2232 | ** unlimited but a limit may be imposed by the web server or a proxy. |
| 2233 | ** |
| 2234 | ** SETTING: forum-statuses width=40 block-text |
| 2235 | ** This JSON5-formatted value defines an array of objects describing |
| 2236 | ** the available statuses of forum posts. Each entry of the array must |
| 2237 | ** be an object in the form {label:"X",value:"Y",description:"Z"}. |
| 2238 | ** The label is used in the UI and value becomes the value of the |
| 2239 | ** "status" tag on forum posts. Any forum post which has a status |
| 2240 | ** value which does not appear in this list is treated as if it had |
| 2241 | ** the first value from this list. If this setting is empty, is |
| 2242 | ** ill-formed JSON, or has only a single entry then the forum will |
| 2243 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -68,11 +68,10 @@ | |
| 68 | ** A single entry from the forum-statuses setting. |
| 69 | */ |
| 70 | struct ForumStatus { |
| 71 | char *zLabel; /* Label for the UI */ |
| 72 | char *zValue; /* status=X tag value */ |
| 73 | }; |
| 74 | |
| 75 | /* |
| 76 | ** A list of ForumStatus objects. |
| 77 | */ |
| @@ -113,37 +112,35 @@ | |
| 112 | ** list. A length-1 list is, for purposes of the UI, identical to |
| 113 | ** an empty one - status selection/filtering makes no sense if |
| 114 | ** there's only one choice. */ |
| 115 | db_multi_exec( |
| 116 | "CREATE TEMP TABLE IF NOT EXISTS forumstatus(" |
| 117 | " ord INTEGER PRIMARY KEY, label, value" |
| 118 | ");" |
| 119 | "DELETE FROM forumstatus;" |
| 120 | "INSERT INTO forumstatus(label,value)" |
| 121 | " WITH setting(v) AS (" |
| 122 | " SELECT value v FROM config WHERE name='forum-statuses'" |
| 123 | " )," |
| 124 | " room(r) AS (" |
| 125 | " SELECT e.value FROM setting s, jsonb_each(s.v) e" |
| 126 | " WHERE json_valid(s.v, 0x02)" |
| 127 | " )" |
| 128 | " SELECT r->>'label', r->>'value'" |
| 129 | " FROM room;" |
| 130 | ); |
| 131 | fses.n = (unsigned)db_int(0, "SELECT count(*) FROM forumstatus"); |
| 132 | if( fses.n ){ |
| 133 | int i = 0; |
| 134 | Stmt q; |
| 135 | db_prepare(&q,"SELECT label, value FROM forumstatus" |
| 136 | " ORDER BY ord"); |
| 137 | fses.aStatus = fossil_malloc(sizeof(fses.aStatus[0]) * fses.n); |
| 138 | while( SQLITE_ROW==db_step(&q) ){ |
| 139 | ForumStatus * fs = &fses.aStatus[i++]; |
| 140 | fs->zLabel = fossil_strdup(db_column_text(&q, 0)); |
| 141 | fs->zValue = fossil_strdup(db_column_text(&q, 1)); |
| 142 | } |
| 143 | db_finalize(&q); |
| 144 | } |
| 145 | } |
| 146 | return &fses; |
| @@ -180,12 +177,11 @@ | |
| 177 | unsigned i; |
| 178 | db_find_and_open_repository(0,0); |
| 179 | fses = forum_statuses(); |
| 180 | for(i = 0; i < fses->n; ++i ){ |
| 181 | const ForumStatus * fs = &fses->aStatus[i]; |
| 182 | fossil_print("Status: %!j %!j\n", fs->zValue, fs->zLabel); |
| 183 | assert( fs==forum_status_by_value(fs->zValue, 0) ); |
| 184 | } |
| 185 | fossil_print("Total statuses: %u\n", i); |
| 186 | } |
| 187 | |
| @@ -2232,11 +2228,11 @@ | |
| 2228 | ** unlimited but a limit may be imposed by the web server or a proxy. |
| 2229 | ** |
| 2230 | ** SETTING: forum-statuses width=40 block-text |
| 2231 | ** This JSON5-formatted value defines an array of objects describing |
| 2232 | ** the available statuses of forum posts. Each entry of the array must |
| 2233 | ** be an object in the form {label:"X",value:"Y"}. |
| 2234 | ** The label is used in the UI and value becomes the value of the |
| 2235 | ** "status" tag on forum posts. Any forum post which has a status |
| 2236 | ** value which does not appear in this list is treated as if it had |
| 2237 | ** the first value from this list. If this setting is empty, is |
| 2238 | ** ill-formed JSON, or has only a single entry then the forum will |
| 2239 |
+4
-5
| --- www/forum.wiki | ||
| +++ www/forum.wiki | ||
| @@ -419,12 +419,12 @@ | ||
| 419 | 419 | <tt>forum-statuses</tt> is a JSON5-format array of objects in the |
| 420 | 420 | following format: |
| 421 | 421 | |
| 422 | 422 | <verbatim> |
| 423 | 423 | [ |
| 424 | - {label:"Open", value:"open", description:"Unresolved posts"}, | |
| 425 | - {label:"Resolved", value:"resolved", description:"Resolved posts"} | |
| 424 | + {label:"Open", value:"open"}, | |
| 425 | + {label:"Resolved", value:"resolved"} | |
| 426 | 426 | ... |
| 427 | 427 | ]</verbatim> |
| 428 | 428 | |
| 429 | 429 | The list defines the legal statuses for forum posts and syncs with |
| 430 | 430 | other project-level settings. All "label" and "value" members must be |
| @@ -447,10 +447,12 @@ | ||
| 447 | 447 | * The forum list shows the "label" value of the current status and |
| 448 | 448 | a selection list of available filters. It elides the status column |
| 449 | 449 | when filtering on a specific status. |
| 450 | 450 | * The root of each thread, when selected, gets a new UI control for |
| 451 | 451 | displaying or editing the status, depending on permissions. |
| 452 | + * A drop-down selection list is added to the <tt>/forum</tt> page | |
| 453 | + for filtering based on the status. | |
| 452 | 454 | |
| 453 | 455 | A list with only a single entry is treated as empty, the justification |
| 454 | 456 | being that if there is only one option then the UI does not need to be |
| 455 | 457 | cluttered with it. |
| 456 | 458 | |
| @@ -468,12 +470,9 @@ | ||
| 468 | 470 | value of the first entry in the list. |
| 469 | 471 | * The tag is applied only to the first version of any given post. The |
| 470 | 472 | UI ensures that the tag is applied to the proper post, even when |
| 471 | 473 | rendering a newer version. |
| 472 | 474 | |
| 473 | -The UI will eventually offer the ability to filter the post list by | |
| 474 | -status. | |
| 475 | - | |
| 476 | 475 | Caveat: a "closed" status is not recommended because it's easy to confuse with |
| 477 | 476 | the <a href='#close-post'>"closed" tag feature</a>, which behaves considerably |
| 478 | 477 | differently and predates that "status" tag support by about three years. The |
| 479 | 478 | "closed" semantics cannot be trivially consolidated with those of "status". |
| 480 | 479 |
| --- www/forum.wiki | |
| +++ www/forum.wiki | |
| @@ -419,12 +419,12 @@ | |
| 419 | <tt>forum-statuses</tt> is a JSON5-format array of objects in the |
| 420 | following format: |
| 421 | |
| 422 | <verbatim> |
| 423 | [ |
| 424 | {label:"Open", value:"open", description:"Unresolved posts"}, |
| 425 | {label:"Resolved", value:"resolved", description:"Resolved posts"} |
| 426 | ... |
| 427 | ]</verbatim> |
| 428 | |
| 429 | The list defines the legal statuses for forum posts and syncs with |
| 430 | other project-level settings. All "label" and "value" members must be |
| @@ -447,10 +447,12 @@ | |
| 447 | * The forum list shows the "label" value of the current status and |
| 448 | a selection list of available filters. It elides the status column |
| 449 | when filtering on a specific status. |
| 450 | * The root of each thread, when selected, gets a new UI control for |
| 451 | displaying or editing the status, depending on permissions. |
| 452 | |
| 453 | A list with only a single entry is treated as empty, the justification |
| 454 | being that if there is only one option then the UI does not need to be |
| 455 | cluttered with it. |
| 456 | |
| @@ -468,12 +470,9 @@ | |
| 468 | value of the first entry in the list. |
| 469 | * The tag is applied only to the first version of any given post. The |
| 470 | UI ensures that the tag is applied to the proper post, even when |
| 471 | rendering a newer version. |
| 472 | |
| 473 | The UI will eventually offer the ability to filter the post list by |
| 474 | status. |
| 475 | |
| 476 | Caveat: a "closed" status is not recommended because it's easy to confuse with |
| 477 | the <a href='#close-post'>"closed" tag feature</a>, which behaves considerably |
| 478 | differently and predates that "status" tag support by about three years. The |
| 479 | "closed" semantics cannot be trivially consolidated with those of "status". |
| 480 |
| --- www/forum.wiki | |
| +++ www/forum.wiki | |
| @@ -419,12 +419,12 @@ | |
| 419 | <tt>forum-statuses</tt> is a JSON5-format array of objects in the |
| 420 | following format: |
| 421 | |
| 422 | <verbatim> |
| 423 | [ |
| 424 | {label:"Open", value:"open"}, |
| 425 | {label:"Resolved", value:"resolved"} |
| 426 | ... |
| 427 | ]</verbatim> |
| 428 | |
| 429 | The list defines the legal statuses for forum posts and syncs with |
| 430 | other project-level settings. All "label" and "value" members must be |
| @@ -447,10 +447,12 @@ | |
| 447 | * The forum list shows the "label" value of the current status and |
| 448 | a selection list of available filters. It elides the status column |
| 449 | when filtering on a specific status. |
| 450 | * The root of each thread, when selected, gets a new UI control for |
| 451 | displaying or editing the status, depending on permissions. |
| 452 | * A drop-down selection list is added to the <tt>/forum</tt> page |
| 453 | for filtering based on the status. |
| 454 | |
| 455 | A list with only a single entry is treated as empty, the justification |
| 456 | being that if there is only one option then the UI does not need to be |
| 457 | cluttered with it. |
| 458 | |
| @@ -468,12 +470,9 @@ | |
| 470 | value of the first entry in the list. |
| 471 | * The tag is applied only to the first version of any given post. The |
| 472 | UI ensures that the tag is applied to the proper post, even when |
| 473 | rendering a newer version. |
| 474 | |
| 475 | Caveat: a "closed" status is not recommended because it's easy to confuse with |
| 476 | the <a href='#close-post'>"closed" tag feature</a>, which behaves considerably |
| 477 | differently and predates that "status" tag support by about three years. The |
| 478 | "closed" semantics cannot be trivially consolidated with those of "status". |
| 479 |