Add link from root upload page to upload pool detail page.
This commit is contained in:
parent
a776c83557
commit
c8f5408f27
8 changed files with 20 additions and 85 deletions
|
|
@ -74,8 +74,7 @@ func Router() chi.Router {
|
|||
r.Method("GET", "/trap/{globalid}", authenticatedHandler(getTrap))
|
||||
r.Method("GET", "/text/{destination}", authenticatedHandler(getTextMessages))
|
||||
r.Method("GET", "/upload", authenticatedHandler(getUploadList))
|
||||
r.Method("GET", "/upload/pool", authenticatedHandler(getUploadPoolList))
|
||||
r.Method("GET", "/upload/pool/create", authenticatedHandler(getUploadPoolCreate))
|
||||
r.Method("GET", "/upload/pool", authenticatedHandler(getUploadPoolCreate))
|
||||
r.Method("POST", "/upload/pool/create", authenticatedHandlerPostMultipart(postUploadPoolCreate))
|
||||
r.Method("GET", "/upload/{id}", authenticatedHandler(getUploadByID))
|
||||
r.Method("POST", "/upload/{id}/discard", authenticatedHandlerPost(postUploadDiscard))
|
||||
|
|
|
|||
|
|
@ -47,20 +47,9 @@ type contentUploadPoolList struct {
|
|||
}
|
||||
type contentUploadPoolCreate struct{}
|
||||
|
||||
func getUploadPoolList(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentUploadPoolList], *errorWithStatus) {
|
||||
uploads, err := platform.PoolUploadList(ctx, u.OrganizationID)
|
||||
if err != nil {
|
||||
return nil, newError("Failed to get uploads: %w", err)
|
||||
}
|
||||
data := contentUploadPoolList{
|
||||
Uploads: uploads,
|
||||
}
|
||||
return newResponse("sync/pool-list.html", data), nil
|
||||
}
|
||||
|
||||
func getUploadPoolCreate(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentUploadPoolCreate], *errorWithStatus) {
|
||||
data := contentUploadPoolCreate{}
|
||||
return newResponse("sync/pool-csv-upload.html", data), nil
|
||||
return newResponse("sync/upload-csv-pool.html", data), nil
|
||||
}
|
||||
func getUploadByID(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentUploadDetail], *errorWithStatus) {
|
||||
file_id_str := chi.URLParam(r, "id")
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import (
|
|||
|
||||
type ContentURL struct {
|
||||
OAuthRefreshArcGIS string
|
||||
PoolCSVUpload string
|
||||
Root string
|
||||
Route string
|
||||
SamplePoolCSV string
|
||||
|
|
@ -18,12 +17,12 @@ type ContentURL struct {
|
|||
SettingUser string
|
||||
SettingUserAdd string
|
||||
Tegola string
|
||||
UploadCSVPool string
|
||||
}
|
||||
|
||||
func newContentURL() ContentURL {
|
||||
return ContentURL{
|
||||
OAuthRefreshArcGIS: config.MakeURLNidus("/arcgis/oauth/begin"),
|
||||
PoolCSVUpload: config.MakeURLNidus("/pool/upload"),
|
||||
Root: config.MakeURLNidus("/"),
|
||||
Route: config.MakeURLNidus("/route"),
|
||||
SamplePoolCSV: config.MakeURLNidus("/static/file/sample-pool.csv"),
|
||||
|
|
@ -35,5 +34,6 @@ func newContentURL() ContentURL {
|
|||
SettingUser: config.MakeURLNidus("/setting/user"),
|
||||
SettingUserAdd: config.MakeURLNidus("/setting/user/add"),
|
||||
Tegola: config.MakeURLTegola("/"),
|
||||
UploadCSVPool: config.MakeURLNidus("/upload/pool"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue