General cleanup and fixed PR comments

This commit is contained in:
Roch D'Amour 2020-10-25 22:00:24 -04:00
parent fdf2289f8e
commit 395d039d41
5 changed files with 15 additions and 12 deletions

View File

@ -116,7 +116,7 @@ func (h *SettingsHandler) DeleteCustomRule(w http.ResponseWriter, r *http.Reques
user := r.Context().Value(models.UserKey).(*models.User)
ruleId, err := strconv.Atoi(r.PostFormValue("ruleid"))
if err != nil {
respondAlert(w, "internal server error", "", "settings.tpl.html", http.StatusInternalServerError)
respondAlert(w, "internal server error", "", conf.SettingsTemplate, http.StatusInternalServerError)
return
}
@ -149,7 +149,7 @@ func (h *SettingsHandler) PostCreateCustomRule(w http.ResponseWriter, r *http.Re
};
if _, err := h.customRuleSrvc.Create(rule); err != nil {
respondAlert(w, "internal server error", "", "settings.tpl.html", http.StatusInternalServerError)
respondAlert(w, "internal server error", "", conf.SettingsTemplate, http.StatusInternalServerError)
return
}

View File

@ -2,24 +2,25 @@ package services
import (
"github.com/jinzhu/gorm"
"github.com/muety/wakapi/config"
"github.com/muety/wakapi/models"
)
type CustomRuleService struct {
Config *models.Config
Config *config.Config
Db *gorm.DB
}
func NewCustomRuleService(db *gorm.DB) *CustomRuleService {
return &CustomRuleService{
Config: models.GetConfig(),
Config: config.Get(),
Db: db,
}
}
func (srv *CustomRuleService) GetCustomRuleById(CustomRuleId uint) (*models.CustomRule, error) {
func (srv *CustomRuleService) GetCustomRuleById(customRuleId uint) (*models.CustomRule, error) {
r := &models.CustomRule{}
if err := srv.Db.Where(&models.CustomRule{ID: CustomRuleId}).First(r).Error; err != nil {
if err := srv.Db.Where(&models.CustomRule{ID: customRuleId}).First(r).Error; err != nil {
return r, err
}
return r, nil

View File

@ -304,3 +304,4 @@ window.addEventListener('load', function () {
togglePlaceholders(getPresentDataMask())
draw()
})

View File

@ -32,7 +32,8 @@
<label class="inline-block text-sm mb-1 text-gray-500" for="password_new">New Password</label>
<input class="shadow appearance-none bg-gray-800 focus:bg-gray-700 text-gray-300 border-green-700 focus:border-gray-500 border rounded w-full py-1 px-3"
type="password" id="password_new"
name="password_new" placeholder="Choose a password" minlength="6" required> </div>
name="password_new" placeholder="Choose a password" minlength="6" required>
</div>
<div class="mb-8">
<label class="inline-block text-sm mb-1 text-gray-500" for="password_repeat">And again ...</label>
<input class="shadow appearance-none bg-gray-800 focus:bg-gray-700 text-gray-300 border-green-700 focus:border-gray-500 border rounded w-full py-1 px-3"
@ -154,8 +155,7 @@
</div>
</div>
<
zzp>You can also add <span class="text-xs bg-gray-900 rounded py-1 px-2 font-mono">/project:your-cool-project</span> to the URL to filter by project.</p>
<p>You can also add <span class="text-xs bg-gray-900 rounded py-1 px-2 font-mono">/project:your-cool-project</span> to the URL to filter by project.</p>
{{ else }}
<p>You have the ability to create badges from your coding statistics using <a href="https://shields.io" target="_blank" class="border-b border-green-800" rel="noopener noreferrer">Shields.io</a>. To do so, you need to grant public, unauthorized access to the respective endpoint.</p>
<div class="flex justify-around mt-4">
@ -189,3 +189,4 @@
</body>
</html>

View File

@ -1,9 +1,9 @@
#!/bin/bash
if [ "$WAKAPI_DB_TYPE" != "sqlite3" ]; then
echo "Waiting 3 Seconds for DB to start"
sleep 3;
echo "Waiting 10 Seconds for DB to start"
sleep 10;
fi
echo "Starting Application"
./wakapi
./wakapi