Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
teebbstudios
teebblog
提交
5b9e4cca
T
teebblog
项目概览
teebbstudios
/
teebblog
通知
0
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
teebblog
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5b9e4cca
编写于
7月 21, 2021
作者:
T
teebbstudios
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
84. twig function is_granted(ROLE_USER)
上级
51b88120
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
32 deletion
+49
-32
templates/base.html.twig
templates/base.html.twig
+2
-32
templates/footer.html.twig
templates/footer.html.twig
+6
-0
templates/nav.html.twig
templates/nav.html.twig
+36
-0
templates/post/show.html.twig
templates/post/show.html.twig
+5
-0
未找到文件。
templates/base.html.twig
浏览文件 @
5b9e4cca
...
...
@@ -20,32 +20,7 @@
<!-- Navigation -->
{%
block
nav
%}
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark fixed-top"
>
<div
class=
"container"
>
<a
class=
"navbar-brand"
href=
"#"
>
Start Bootstrap
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarResponsive"
aria-controls=
"navbarResponsive"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarResponsive"
>
<ul
class=
"navbar-nav ml-auto"
>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
href=
"#"
>
Home
<span
class=
"sr-only"
>
(current)
</span>
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
About
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
Services
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
Contact
</a>
</li>
</ul>
</div>
</div>
</nav>
{%
include
'nav.html.twig'
%}
{%
endblock
%}
<!-- Page Content -->
...
...
@@ -132,12 +107,7 @@
<!-- Footer -->
{%
block
footer
%}
<footer
class=
"py-5 bg-dark"
>
<div
class=
"container"
>
<p
class=
"m-0 text-center text-white"
>
Copyright
©
Your Website 2020
</p>
</div>
<!-- /.container -->
</footer>
{%
include
'footer.html.twig'
%}
{%
endblock
%}
{%
block
javascripts
%}
...
...
templates/footer.html.twig
0 → 100644
浏览文件 @
5b9e4cca
<footer
class=
"py-5 bg-dark"
>
<div
class=
"container"
>
<p
class=
"m-0 text-center text-white"
>
Copyright
©
Your Website 2020
</p>
</div>
<!-- /.container -->
</footer>
\ No newline at end of file
templates/nav.html.twig
0 → 100644
浏览文件 @
5b9e4cca
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark fixed-top"
>
<div
class=
"container"
>
<a
class=
"navbar-brand"
href=
"
{{
path
(
'post_index'
)
}}
"
>
Teebblog
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarResponsive"
aria-controls=
"navbarResponsive"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarResponsive"
>
<ul
class=
"navbar-nav ml-auto"
>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
href=
"
{{
path
(
'post_index'
)
}}
"
>
Home
<span
class=
"sr-only"
>
(current)
</span>
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
About
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
Services
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
Contact
</a>
</li>
{%
if
app.user
%}
<div
class=
"dropdown"
>
<button
class=
"btn btn-secondary dropdown-toggle"
type=
"button"
id=
"dropdownMenuButton"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
{{
app.user.userIdentifier
}}
</button>
<div
class=
"dropdown-menu"
aria-labelledby=
"dropdownMenuButton"
>
<a
class=
"dropdown-item"
href=
"
{{
path
(
'app_logout'
)
}}
"
>
退出
</a>
</div>
</div>
{%
endif
%}
</ul>
</div>
</div>
</nav>
\ No newline at end of file
templates/post/show.html.twig
浏览文件 @
5b9e4cca
...
...
@@ -39,6 +39,8 @@
<hr>
<!-- Comments Form -->
{# {% if app.user %}#}
{%
if
is_granted
(
'ROLE_USER'
)
%}
<div
class=
"card my-4"
>
<h5
class=
"card-header"
>
Leave a Comment:
</h5>
<div
class=
"card-body"
>
...
...
@@ -55,6 +57,9 @@
{{
form_end
(
comment_form
)
}}
</div>
</div>
{%
else
%}
您需要
<a
href=
"
{{
path
(
'app_login'
)
}}
"
>
登录
</a>
后,才可以提交评论。
{%
endif
%}
<!-- Single Comment -->
{%
for
comment
in
pagination
%}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录