Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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
     )
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 7
0
def getFlashedMessages(*args,**kwargs):
    return getFlashedMessage(*args,**kwargs)