frontend: display issues related to the team
This commit is contained in:
parent
7bec409ab8
commit
a3ffdeae17
12 changed files with 238 additions and 12 deletions
|
|
@ -96,6 +96,27 @@ func consumer() {
|
|||
}
|
||||
}
|
||||
|
||||
// Generate issues.json for a given team
|
||||
func genTeamIssuesFile(team fic.Team) error {
|
||||
dirPath := path.Join(TeamsDir, fmt.Sprintf("%d", team.Id))
|
||||
|
||||
if s, err := os.Stat(dirPath); os.IsNotExist(err) {
|
||||
os.MkdirAll(dirPath, 0777)
|
||||
} else if !s.IsDir() {
|
||||
return errors.New(fmt.Sprintf("%s is not a directory", dirPath))
|
||||
}
|
||||
|
||||
if my, err := team.MyIssueFile(); err != nil {
|
||||
return err
|
||||
} else if j, err := json.Marshal(my); err != nil {
|
||||
return err
|
||||
} else if err = ioutil.WriteFile(path.Join(dirPath, "issues.json"), j, 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Generate my.json and wait.json for a given team
|
||||
func genTeamMyFile(team *fic.Team) error {
|
||||
dirPath := path.Join(TeamsDir, fmt.Sprintf("%d", team.Id))
|
||||
|
|
|
|||
Reference in a new issue