M admin/input.go => admin/input.go +1 -1
@@ 85,7 85,7 @@ func (d *DomainForm) Validate(c echo.Context) error {
}
type OrgTypeForm struct {
- OrgType int `form:"org_type" validate:"oneof=0 1 2 3"`
+ OrgType int `form:"org_type" validate:"oneof=0 1 2 3 4"`
}
func (ot *OrgTypeForm) Validate(c echo.Context) error {
M core/routes.go => core/routes.go +1 -0
@@ 623,6 623,7 @@ func (s *Service) OrgList(c echo.Context) error {
pd.Data["business"] = lt.Translate("Business")
pd.Data["free"] = lt.Translate("Free")
pd.Data["open_source"] = lt.Translate("Open Source")
+ pd.Data["sponsored"] = lt.Translate("Sponsored")
pd.Data["paid"] = lt.Translate("Paid")
pd.Data["enabled"] = lt.Translate("Enabled")
pd.Data["disabled"] = lt.Translate("Disabled")
M models/organization.go => models/organization.go +6 -0
@@ 241,6 241,8 @@ func (o *Organization) IsRestricted(restrictedStatus []int) bool {
return false
}
+// XXX We should remove these and make the fetching of status with translations
+// via a helper function that takes a context
func (o *Organization) IsFreeAccount() bool {
return o.Settings.Billing.Status == BillingStatusFree
}
@@ 257,6 259,10 @@ func (o *Organization) IsOpenSourceAccount() bool {
return o.Settings.Billing.Status == BillingStatusOpenSource
}
+func (o *Organization) IsSponsoredAccount() bool {
+ return o.Settings.Billing.Status == BillingStatusSponsored
+}
+
// This function ennable or disable based on the boolean flag a batch of organization
func ToggleOrganizaiongBatch(ctx context.Context, opts *database.FilterOptions, flag bool) error {
err := database.WithTx(ctx, nil, func(tx *sql.Tx) error {
M templates/admin_update_org_type.html => templates/admin_update_org_type.html +1 -1
@@ 22,7 22,7 @@
<option value="{{$key}}"{{if eq $key $.form.OrgType}}selected{{end}}>{{$val}}</option>
{{end}}
</select>
- {{ with .errors.Type }}
+ {{ with .errors.OrgType }}
<p class="error">{{ . }}</p>
{{ end }}
</div>
M templates/link_short_create.html => templates/link_short_create.html +1 -1
@@ 63,7 63,7 @@
</form>
<footer class="is-right">
<button type="submit" form="link-form" class="button dark">{{.pd.Data.save}}</button>
- <a href="{{reverse "short:link_short_list"}}" class="button error">{{.pd.Data.cancel}}</a>
+ <a href="{{reverse "short:link_short_list" .org.Slug}}" class="button error">{{.pd.Data.cancel}}</a>
</footer>
</section>
{{template "base_footer" .}}
M templates/org_list.html => templates/org_list.html +2 -0
@@ 30,6 30,8 @@
{{$.pd.Data.business}} ({{$.pd.Data.paid}})
{{ else if .IsOpenSourceAccount }}
{{$.pd.Data.open_source}}
+ {{ else if .IsSponsoredAccount }}
+ {{$.pd.Data.sponsored}}
{{end}}
</td>
<td>