@@ -50,8 +50,6 @@ func branchesPage(w http.ResponseWriter, r *http.Request) {
50
50
Branches []brEntry
51
51
DB com.SQLiteDBinfo
52
52
DefaultBranch string
53
- MyStar bool
54
- MyWatch bool
55
53
PageMeta PageMetaInfo
56
54
}
57
55
pageData .PageMeta .Title = "Branch list"
@@ -76,20 +74,6 @@ func branchesPage(w http.ResponseWriter, r *http.Request) {
76
74
return
77
75
}
78
76
79
- // Check if the database was starred by the logged in user
80
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
81
- if err != nil {
82
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
83
- return
84
- }
85
-
86
- // Check if the database is being watched by the logged in user
87
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
88
- if err != nil {
89
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
90
- return
91
- }
92
-
93
77
// Read the branch heads list from the database
94
78
branches , err := com .GetBranches (dbName .Owner , dbName .Folder , dbName .Database )
95
79
if err != nil {
@@ -149,8 +133,6 @@ func commitsPage(w http.ResponseWriter, r *http.Request) {
149
133
Branches []string
150
134
DB com.SQLiteDBinfo
151
135
History []HistEntry
152
- MyStar bool
153
- MyWatch bool
154
136
PageMeta PageMetaInfo
155
137
}
156
138
@@ -183,20 +165,6 @@ func commitsPage(w http.ResponseWriter, r *http.Request) {
183
165
return
184
166
}
185
167
186
- // Check if the database was starred by the logged in user
187
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
188
- if err != nil {
189
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
190
- return
191
- }
192
-
193
- // Check if the database is being watched by the logged in user
194
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
195
- if err != nil {
196
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
197
- return
198
- }
199
-
200
168
// Read the branch heads list from the database
201
169
branches , err := com .GetBranches (dbName .Owner , dbName .Folder , dbName .Database )
202
170
if err != nil {
@@ -346,8 +314,6 @@ func comparePage(w http.ResponseWriter, r *http.Request) {
346
314
DestFolder string
347
315
DestOwner string
348
316
Forks []com.ForkEntry
349
- MyStar bool
350
- MyWatch bool
351
317
PageMeta PageMetaInfo
352
318
SourceDBBranches []string
353
319
SourceDBDefaultBranch string
@@ -444,20 +410,6 @@ func comparePage(w http.ResponseWriter, r *http.Request) {
444
410
return
445
411
}
446
412
447
- // Check if the database was starred by the logged in user
448
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
449
- if err != nil {
450
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
451
- return
452
- }
453
-
454
- // Check if the database is being watched by the logged in user
455
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
456
- if err != nil {
457
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
458
- return
459
- }
460
-
461
413
// If the initially chosen source and destinations can be directly applied, fill out the initial commit list entries
462
414
// for display to the user
463
415
ancestorID , cList , errType , err := com .GetCommonAncestorCommits (dbName .Owner , dbName .Folder , dbName .Database ,
@@ -593,8 +545,6 @@ func contributorsPage(w http.ResponseWriter, r *http.Request) {
593
545
var pageData struct {
594
546
Contributors map [string ]AuthorEntry
595
547
DB com.SQLiteDBinfo
596
- MyStar bool
597
- MyWatch bool
598
548
PageMeta PageMetaInfo
599
549
}
600
550
pageData .PageMeta .Title = "Contributors"
@@ -619,20 +569,6 @@ func contributorsPage(w http.ResponseWriter, r *http.Request) {
619
569
return
620
570
}
621
571
622
- // Check if the database was starred by the logged in user
623
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
624
- if err != nil {
625
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
626
- return
627
- }
628
-
629
- // Check if the database is being watched by the logged in user
630
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
631
- if err != nil {
632
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
633
- return
634
- }
635
-
636
572
// Read the commit list from the database
637
573
commitList , err := com .GetCommitList (dbName .Owner , dbName .Folder , dbName .Database )
638
574
if err != nil {
@@ -755,8 +691,6 @@ func createBranchPage(w http.ResponseWriter, r *http.Request) {
755
691
func createDiscussionPage (w http.ResponseWriter , r * http.Request ) {
756
692
var pageData struct {
757
693
DB com.SQLiteDBinfo
758
- MyStar bool
759
- MyWatch bool
760
694
PageMeta PageMetaInfo
761
695
}
762
696
pageData .PageMeta .Title = "Create new discussion"
@@ -788,20 +722,6 @@ func createDiscussionPage(w http.ResponseWriter, r *http.Request) {
788
722
return
789
723
}
790
724
791
- // Check if the database was starred by the logged in user
792
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
793
- if err != nil {
794
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
795
- return
796
- }
797
-
798
- // Check if the database is being watched by the logged in user
799
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
800
- if err != nil {
801
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
802
- return
803
- }
804
-
805
725
// Render the page
806
726
t := tmpl .Lookup ("createDiscussionPage" )
807
727
err = t .Execute (w , pageData )
@@ -880,8 +800,6 @@ func databasePage(w http.ResponseWriter, r *http.Request, dbOwner string, dbFold
880
800
var pageData struct {
881
801
Data com.SQLiteRecordSet
882
802
DB com.SQLiteDBinfo
883
- MyStar bool
884
- MyWatch bool
885
803
PageMeta PageMetaInfo
886
804
Config com.TomlConfig // FIXME: This seems silly to include here, when we just need to provide the server/port info
887
805
}
@@ -1106,20 +1024,6 @@ func databasePage(w http.ResponseWriter, r *http.Request, dbOwner string, dbFold
1106
1024
return
1107
1025
}
1108
1026
1109
- // Check if the database was starred by the logged in user
1110
- myStar , err := com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbOwner , dbFolder , dbName )
1111
- if err != nil {
1112
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database star status" )
1113
- return
1114
- }
1115
-
1116
- // Check if the database is being watched by the logged in user
1117
- myWatch , err := com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbOwner , dbFolder , dbName )
1118
- if err != nil {
1119
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
1120
- return
1121
- }
1122
-
1123
1027
// If a specific table wasn't requested, use the user specified default (if present)
1124
1028
if dbTable == "" {
1125
1029
// Ensure the default table name validates. This catches a case where a database was uploaded with an invalid
@@ -1241,10 +1145,6 @@ func databasePage(w http.ResponseWriter, r *http.Request, dbOwner string, dbFold
1241
1145
pageData .DB .Info .Branch = branchName
1242
1146
pageData .DB .Info .Commits = branchHeads [branchName ].CommitCount
1243
1147
1244
- // Update database star and watch status for the logged in user
1245
- pageData .MyStar = myStar
1246
- pageData .MyWatch = myWatch
1247
-
1248
1148
// Render the full description as markdown
1249
1149
pageData .DB .Info .FullDesc = string (gfm .Markdown ([]byte (pageData .DB .Info .FullDesc )))
1250
1150
@@ -1277,8 +1177,6 @@ func diffPage(w http.ResponseWriter, r *http.Request) {
1277
1177
Diffs com.Diffs
1278
1178
ColumnNamesBefore map [string ][]string
1279
1179
ColumnNamesAfter map [string ][]string
1280
- MyStar bool
1281
- MyWatch bool
1282
1180
PageMeta PageMetaInfo
1283
1181
}
1284
1182
@@ -1316,20 +1214,6 @@ func diffPage(w http.ResponseWriter, r *http.Request) {
1316
1214
return
1317
1215
}
1318
1216
1319
- // Check if the database was starred by the logged in user
1320
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
1321
- if err != nil {
1322
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
1323
- return
1324
- }
1325
-
1326
- // Check if the database is being watched by the logged in user
1327
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
1328
- if err != nil {
1329
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
1330
- return
1331
- }
1332
-
1333
1217
// Retrieve the diffs for these commits
1334
1218
pageData .Diffs , err = com .Diff (dbName .Owner , "/" , dbName .Database , commitA , dbName .Owner , "/" , dbName .Database , commitB , pageData .PageMeta .LoggedInUser , com .NoMerge , true )
1335
1219
if err != nil {
@@ -1387,8 +1271,6 @@ func discussPage(w http.ResponseWriter, r *http.Request) {
1387
1271
DB com.SQLiteDBinfo
1388
1272
DiscussionList []com.DiscussionEntry
1389
1273
SelectedID int
1390
- MyStar bool
1391
- MyWatch bool
1392
1274
PageMeta PageMetaInfo
1393
1275
}
1394
1276
@@ -1425,20 +1307,6 @@ func discussPage(w http.ResponseWriter, r *http.Request) {
1425
1307
return
1426
1308
}
1427
1309
1428
- // Check if the database was starred by the logged in user
1429
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
1430
- if err != nil {
1431
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
1432
- return
1433
- }
1434
-
1435
- // Check if the database is being watched by the logged in user
1436
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
1437
- if err != nil {
1438
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
1439
- return
1440
- }
1441
-
1442
1310
// Retrieve the list of discussions for this database
1443
1311
pageData .DiscussionList , err = com .Discussions (dbName .Owner , dbName .Folder , dbName .Database , com .DISCUSSION , pageData .SelectedID )
1444
1312
if err != nil {
@@ -1619,8 +1487,6 @@ func mergePage(w http.ResponseWriter, r *http.Request) {
1619
1487
StatusMessageColour string
1620
1488
SourceBranchOK bool
1621
1489
SourceDBOK bool
1622
- MyStar bool
1623
- MyWatch bool
1624
1490
}
1625
1491
1626
1492
pageData .PageMeta .PageSection = "db_merge"
@@ -1657,20 +1523,6 @@ func mergePage(w http.ResponseWriter, r *http.Request) {
1657
1523
return
1658
1524
}
1659
1525
1660
- // Check if the database was starred by the logged in user
1661
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
1662
- if err != nil {
1663
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
1664
- return
1665
- }
1666
-
1667
- // Check if the database is being watched by the logged in user
1668
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
1669
- if err != nil {
1670
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
1671
- return
1672
- }
1673
-
1674
1526
// Retrieve the list of MRs for this database
1675
1527
pageData .MRList , err = com .Discussions (dbName .Owner , dbName .Folder , dbName .Database , com .MERGE_REQUEST , pageData .SelectedID )
1676
1528
if err != nil {
@@ -2075,8 +1927,6 @@ func releasesPage(w http.ResponseWriter, r *http.Request) {
2075
1927
}
2076
1928
var pageData struct {
2077
1929
DB com.SQLiteDBinfo
2078
- MyStar bool
2079
- MyWatch bool
2080
1930
PageMeta PageMetaInfo
2081
1931
ReleaseList map [string ]relEntry
2082
1932
}
@@ -2102,20 +1952,6 @@ func releasesPage(w http.ResponseWriter, r *http.Request) {
2102
1952
return
2103
1953
}
2104
1954
2105
- // Check if the database was starred by the logged in user
2106
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
2107
- if err != nil {
2108
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
2109
- return
2110
- }
2111
-
2112
- // Check if the database is being watched by the logged in user
2113
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
2114
- if err != nil {
2115
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
2116
- return
2117
- }
2118
-
2119
1955
// Retrieve the release list for the database
2120
1956
releases , err := com .GetReleases (dbName .Owner , dbName .Folder , dbName .Database )
2121
1957
if err != nil {
@@ -2232,8 +2068,6 @@ func settingsPage(w http.ResponseWriter, r *http.Request) {
2232
2068
FullDescRendered string
2233
2069
Licences map [string ]com.LicenceEntry
2234
2070
NumLicences int
2235
- MyStar bool
2236
- MyWatch bool
2237
2071
PageMeta PageMetaInfo
2238
2072
Shares map [string ]com.ShareDatabasePermissions
2239
2073
}
@@ -2265,20 +2099,6 @@ func settingsPage(w http.ResponseWriter, r *http.Request) {
2265
2099
return
2266
2100
}
2267
2101
2268
- // Check if the database was starred by the logged in user
2269
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
2270
- if err != nil {
2271
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
2272
- return
2273
- }
2274
-
2275
- // Check if the database is being watched by the logged in user
2276
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
2277
- if err != nil {
2278
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
2279
- return
2280
- }
2281
-
2282
2102
// Retrieve the database details
2283
2103
err = com .DBDetails (& pageData .DB , pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database , "" )
2284
2104
if err != nil {
@@ -2473,8 +2293,6 @@ func tagsPage(w http.ResponseWriter, r *http.Request) {
2473
2293
}
2474
2294
var pageData struct {
2475
2295
DB com.SQLiteDBinfo
2476
- MyStar bool
2477
- MyWatch bool
2478
2296
PageMeta PageMetaInfo
2479
2297
TagList map [string ]tgEntry
2480
2298
}
@@ -2500,20 +2318,6 @@ func tagsPage(w http.ResponseWriter, r *http.Request) {
2500
2318
return
2501
2319
}
2502
2320
2503
- // Check if the database was starred by the logged in user
2504
- pageData .MyStar , err = com .CheckDBStarred (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
2505
- if err != nil {
2506
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve latest social stats" )
2507
- return
2508
- }
2509
-
2510
- // Check if the database is being watched by the logged in user
2511
- pageData .MyWatch , err = com .CheckDBWatched (pageData .PageMeta .LoggedInUser , dbName .Owner , dbName .Folder , dbName .Database )
2512
- if err != nil {
2513
- errorPage (w , r , http .StatusInternalServerError , "Couldn't retrieve database watch status" )
2514
- return
2515
- }
2516
-
2517
2321
// Retrieve the tag list for the database
2518
2322
tags , err := com .GetTags (dbName .Owner , dbName .Folder , dbName .Database )
2519
2323
if err != nil {
0 commit comments