
site-admin: show warning affix when admin user was logged in
@ce6b94f1354dd86f020cd2574416e05219502220
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
... | ... | @@ -6154,3 +6154,14 @@ |
6154 | 6154 |
text-align:center; |
6155 | 6155 |
} |
6156 | 6156 |
} |
6157 |
+ |
|
6158 |
+.admin-logged-in-affix { |
|
6159 |
+ z-index:999; |
|
6160 |
+ padding: 10px 10px; |
|
6161 |
+ width:100%; |
|
6162 |
+ color:white; |
|
6163 |
+ font-size:20px; |
|
6164 |
+ background-color: #ad0000; |
|
6165 |
+ text-align: center; |
|
6166 |
+ font-weight: bold; |
|
6167 |
+} |
--- app/controllers/UserApp.java
+++ app/controllers/UserApp.java
... | ... | @@ -926,4 +926,12 @@ |
926 | 926 |
return forbidden(json); |
927 | 927 |
} |
928 | 928 |
} |
929 |
+ |
|
930 |
+ public static boolean isSiteAdminLoggedInSession(){ |
|
931 |
+ if(SiteAdmin.SITEADMIN_DEFAULT_LOGINID.equals(session().get(SESSION_LOGINID))){ |
|
932 |
+ return true; |
|
933 |
+ } else { |
|
934 |
+ return false; |
|
935 |
+ } |
|
936 |
+ } |
|
929 | 937 |
} |
--- app/views/layout.scala.html
+++ app/views/layout.scala.html
... | ... | @@ -46,6 +46,9 @@ |
46 | 46 |
</head> |
47 | 47 |
|
48 | 48 |
<body class="@theme"> |
49 |
+ @if(UserApp.isSiteAdminLoggedInSession){ |
|
50 |
+ <div class="admin-logged-in-affix" data-spy="affix" data-offset-top="30">@Messages("user.siteAdminLoggedInAffix") <span class="small-font">@Messages("user.siteAdminLoggedInAffix.maxim")</span></div> |
|
51 |
+ } |
|
49 | 52 |
@partial_update_notification() |
50 | 53 |
@content |
51 | 54 |
@common.scripts() |
--- conf/messages
+++ conf/messages
... | ... | @@ -894,6 +894,8 @@ |
894 | 894 |
user.newPassword = New password |
895 | 895 |
user.notExists.name = User not exists |
896 | 896 |
user.password = Password |
897 |
+user.siteAdminLoggedInAffix = You are Admin now! |
|
898 |
+user.siteAdminLoggedInAffix.maxim = With great power comes great responsibility |
|
897 | 899 |
user.role.anonymous = Anonymous |
898 | 900 |
user.role.guest = Guest |
899 | 901 |
user.role.manager = Manager |
--- conf/messages.ko-KR
+++ conf/messages.ko-KR
... | ... | @@ -894,6 +894,8 @@ |
894 | 894 |
user.newPassword = 신규 비밀번호 |
895 | 895 |
user.notExists.name = 존재하지 않는 사용자입니다. |
896 | 896 |
user.password = 비밀번호 |
897 |
+user.siteAdminLoggedInAffix = 관리자로 로그인 하였습니다! |
|
898 |
+user.siteAdminLoggedInAffix.maxim = - 큰 힘에는 큰 책임이 따릅니다 |
|
897 | 899 |
user.role.anonymous = 익명 사용자 |
898 | 900 |
user.role.guest = 지나가던 사람 |
899 | 901 |
user.role.manager = 관리자 |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?