예제 #1
0
 def show(self, *args, **kwargs):
     u"""メモの詳細を表示します。"""
     id = kwargs["id"]
     model = ArticleModel.get_by_id(id)
     article = ArticleModel.getArticle(model)
     alert = dict(getFlashedMessage(withCategory=True))
     return self.renderTemplate("index/show.html", article=article, alert=alert)
예제 #2
0
 def show(self, *args, **kwargs):
     u"""メモの詳細を表示します。"""
     id = kwargs['id']
     model = ArticleModel.get_by_id(id)
     article = ArticleModel.getArticle(model)
     alert = dict(getFlashedMessage(withCategory=True))
     return self.renderTemplate('index/show.html',
                                article=article,
                                alert=alert)
예제 #3
0
 def edit(self, *args, **kwargs):
     u"""メモを編集します。"""
     alert = dict(getFlashedMessage(withCategory=True))
     id = kwargs["id"]
     model = ArticleModel.get_by_id(id)
     form = self.renderTemplate("index/form.html", action="/" + str(id), method="PUT")
     defaults = {"title": model.title, "text": model.text, "tags": ",".join([tag.tagname for tag in model.tags])}
     form = htmlfill.render(form, defaults)
     return self.renderTemplate("index/edit.html", form=form, alert=alert)
예제 #4
0
 def index(self, *args, **kwargs):
     u"""メモを一覧で表示します。"""
     page = kwargs["page"] if "page" in kwargs else 1
     count = SystemInfoModel.getArticleCount()
     articles = ArticleModel.getArticleForPage(page, PER_PAGE)
     pagination = Pagination(page, PER_PAGE, count)
     alert = dict(getFlashedMessage(withCategory=True))
     return self.renderTemplate(
         "index/index.html", articles=articles, pagination=pagination, pagePath="/page/", alert=alert
     )
예제 #5
0
 def index(self, *args, **kwargs):
     u"""メモを一覧で表示します。"""
     page = kwargs['page'] if 'page' in kwargs else 1
     count = SystemInfoModel.getArticleCount()
     articles = ArticleModel.getArticleForPage(page, PER_PAGE)
     pagination = Pagination(page, PER_PAGE, count)
     alert = dict(getFlashedMessage(withCategory=True))
     return self.renderTemplate('index/index.html',
                                articles=articles,
                                pagination=pagination,
                                pagePath='/page/',
                                alert=alert)
예제 #6
0
 def edit(self, *args, **kwargs):
     u"""メモを編集します。"""
     alert = dict(getFlashedMessage(withCategory=True))
     id = kwargs['id']
     model = ArticleModel.get_by_id(id)
     form = self.renderTemplate('index/form.html',
                                action='/' + str(id),
                                method='PUT')
     defaults = {
         'title': model.title,
         'text': model.text,
         'tags': ','.join([tag.tagname for tag in model.tags])
     }
     form = htmlfill.render(form, defaults)
     return self.renderTemplate('index/edit.html', form=form, alert=alert)
예제 #7
0
def getFlashedMessages(*args,**kwargs):
    return getFlashedMessage(*args,**kwargs)