Remove inline CSS for log pages.

Darken links on hover in Nox.
Add another group.CanSee test.
This commit is contained in:
Azareal 2019-06-28 09:35:34 +10:00
parent 55382dfdb1
commit 8cf9badd46
9 changed files with 60 additions and 30 deletions

View File

@ -784,6 +784,7 @@ func TestForumPermsStore(t *testing.T) {
} }
// TODO: Test the group permissions // TODO: Test the group permissions
// TODO: Test group.CanSee for forum presets + group perms
func TestGroupStore(t *testing.T) { func TestGroupStore(t *testing.T) {
miscinit(t) miscinit(t)
if !c.PluginsInited { if !c.PluginsInited {
@ -823,7 +824,7 @@ func TestGroupStore(t *testing.T) {
expect(t, group.IsAdmin, "This should be an admin group") expect(t, group.IsAdmin, "This should be an admin group")
expect(t, group.IsMod, "This should be a mod group") expect(t, group.IsMod, "This should be a mod group")
expect(t, !group.IsBanned, "This shouldn't be a ban group") expect(t, !group.IsBanned, "This shouldn't be a ban group")
// TODO: Add a proper CanSee test expect(t, len(group.CanSee) == 0, "group.CanSee should be empty")
isAdmin = false isAdmin = false
isMod = true isMod = true

View File

@ -1,17 +1,18 @@
<div class="colstack_item colstack_head rowhead"> <div class="colstack_item colstack_head rowhead">
<div class="rowitem"><h1>{{lang "account_logins_head"}}</h1></div> <div class="rowitem"><h1>{{lang "account_logins_head"}}</h1></div>
</div> </div>
<div class="colstack_item rowlist"> <div class="colstack_item rowlist loglist">
<!-- TODO: Do we need this inline CSS? --> <!-- TODO: Do we need this inline CSS? -->
{{range .ItemList}} {{range .ItemList}}
<div class="rowitem{{if not .Success}} bg_red{{end}}"> <div class="rowitem{{if not .Success}} bg_red{{end}}">
<span style="float: left;"> <span class="to_left">
<span>{{if .Success}}{{lang "account_logins_success"}}{{else}}{{lang "account_logins_failure"}}"{{end}}</span><br /> <span>{{if .Success}}{{lang "account_logins_success"}}{{else}}{{lang "account_logins_failure"}}"{{end}}</span><br />
<small style="margin-left: 2px;font-size: 12px;" title="{{.IPAddress}}">{{.IPAddress}}</small> <small title="{{.IPAddress}}">{{.IPAddress}}</small>
</span> </span>
<span class="to_right"> <span class="to_right">
<span style="font-size: 14px;" title="{{.DoneAt}}">{{.DoneAt}}</span> <span title="{{.DoneAt}}">{{.DoneAt}}</span>
</span> </span>
<div style="clear:both;"></div>
</div> </div>
{{end}} {{end}}
</div> </div>

View File

@ -1,15 +1,15 @@
<div class="colstack_item colstack_head"> <div class="colstack_item colstack_head">
<div class="rowitem"><h1>{{lang "panel_logs_administration_head"}}</h1></div> <div class="rowitem"><h1>{{lang "panel_logs_administration_head"}}</h1></div>
</div> </div>
<div id="panel_modlogs" class="colstack_item rowlist"> <div id="panel_modlogs" class="colstack_item rowlist loglist">
{{range .Logs}} {{range .Logs}}
<div class="rowitem panel_compactrow"> <div class="rowitem panel_compactrow">
<span style="float: left;"> <span class="to_left">
<span>{{.Action}}</span> <span>{{.Action}}</span>
{{if $.CurrentUser.Perms.ViewIPs}}<br /><small style="margin-left: 2px;font-size: 12px;" title="{{.IPAddress}}">{{.IPAddress}}</small>{{end}} {{if $.CurrentUser.Perms.ViewIPs}}<br /><small title="{{.IPAddress}}">{{.IPAddress}}</small>{{end}}
</span> </span>
<span class="to_right"> <span class="to_right">
<span style="font-size: 14px;" title="{{.DoneAt}}">{{.DoneAt}}</span> <span title="{{.DoneAt}}">{{.DoneAt}}</span>
</span> </span>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>

View File

@ -1,15 +1,15 @@
<div class="colstack_item colstack_head"> <div class="colstack_item colstack_head">
<div class="rowitem"><h1>{{lang "panel_logs_moderation_head"}}</h1></div> <div class="rowitem"><h1>{{lang "panel_logs_moderation_head"}}</h1></div>
</div> </div>
<div id="panel_modlogs" class="colstack_item rowlist"> <div id="panel_modlogs" class="colstack_item rowlist loglist">
{{range .Logs}} {{range .Logs}}
<div class="rowitem panel_compactrow"> <div class="rowitem panel_compactrow">
<span style="float: left;"> <span class="to_left">
<span>{{.Action}}</span> <span>{{.Action}}</span>
{{if $.CurrentUser.Perms.ViewIPs}}<br /><small style="margin-left: 2px;font-size: 12px;" title="{{.IPAddress}}">{{.IPAddress}}</small>{{end}} {{if $.CurrentUser.Perms.ViewIPs}}<br /><small title="{{.IPAddress}}">{{.IPAddress}}</small>{{end}}
</span> </span>
<span class="to_right"> <span class="to_right">
<span style="font-size: 14px;" title="{{.DoneAt}}">{{.DoneAt}}</span> <span title="{{.DoneAt}}">{{.DoneAt}}</span>
</span> </span>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>

View File

@ -1,15 +1,15 @@
<div class="colstack_item colstack_head"> <div class="colstack_item colstack_head">
<div class="rowitem"><h1>{{lang "panel_logs_registration_head"}}</h1></div> <div class="rowitem"><h1>{{lang "panel_logs_registration_head"}}</h1></div>
</div> </div>
<div id="panel_modlogs" class="colstack_item rowlist"> <div id="panel_modlogs" class="colstack_item rowlist loglist">
{{range .Logs}} {{range .Logs}}
<div class="rowitem panel_compactrow{{if not .Success}} bg_red{{end}}"> <div class="rowitem panel_compactrow{{if not .Success}} bg_red{{end}}">
<span{{if not .Success}} class="panel_registration_attempt"{{end}} style="float: left;"> <span class="to_left{{if not .Success}} panel_registration_attempt{{end}}">
<span>{{if not .Success}}{{lang "panel_logs_registration_attempt"}}: {{end}}{{.Username}} ({{lang "panel_logs_registration_email"}}: {{.Email}}){{if .ParsedReason}} ({{lang "panel_logs_registration_reason"}}: {{.ParsedReason}}){{end}}</span> <span>{{if not .Success}}{{lang "panel_logs_registration_attempt"}}: {{end}}{{.Username}} ({{lang "panel_logs_registration_email"}}: {{.Email}}){{if .ParsedReason}} ({{lang "panel_logs_registration_reason"}}: {{.ParsedReason}}){{end}}</span>
{{if $.CurrentUser.Perms.ViewIPs}}<br /><small style="margin-left: 2px;font-size: 12px;" title="{{.IPAddress}}">{{.IPAddress}}</small>{{end}} {{if $.CurrentUser.Perms.ViewIPs}}<br /><small title="{{.IPAddress}}">{{.IPAddress}}</small>{{end}}
</span> </span>
<span class="to_right"> <span class="to_right">
<span style="font-size: 14px;" title="{{.DoneAt}}">{{.DoneAt}}</span> <span title="{{.DoneAt}}">{{.DoneAt}}</span>
</span> </span>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>

View File

@ -786,6 +786,14 @@ textarea {
padding: 16px; padding: 16px;
} }
.loglist .to_left small {
margin-left: 2px;
font-size: 12px;
}
.loglist .to_right span {
font-size: 14px;
}
.topic_list .rowtopic { .topic_list .rowtopic {
font-size: 16px; font-size: 16px;
margin-right: 1px; margin-right: 1px;

View File

@ -15,6 +15,9 @@ a {
color: #eeeeee; color: #eeeeee;
text-decoration: none; text-decoration: none;
} }
a:hover {
color: #cccccc;
}
nav.nav { nav.nav {
background: {{$darkest_bg}}; background: {{$darkest_bg}};
@ -1110,6 +1113,10 @@ input[type=checkbox]:checked + label .sel {
margin-left: 0px; margin-left: 0px;
margin-top: 0px; margin-top: 0px;
} }
.loglist .to_left small {
margin-left: 2px;
font-size: 12px;
}
.ip_search_block { .ip_search_block {
margin-bottom: 12px; margin-bottom: 12px;

View File

@ -223,6 +223,9 @@ h1, h2, h3, h4, h5 {
} }
/* Align to right in a flex head */ /* Align to right in a flex head */
.to_left {
float: left;
}
.to_right { .to_right {
float: right; float: right;
margin-left: auto; margin-left: auto;
@ -231,8 +234,7 @@ h1, h2, h3, h4, h5 {
/* Topic View */ /* Topic View */
/* TODO: How should we handle the sticky headers? */ /* TODO: How should we handle the sticky headers? */
.topic_sticky_head { .topic_sticky_head {}
}
/* TODO: Add the avatars to the forum list */ /* TODO: Add the avatars to the forum list */
.forum_list .forum_nodesc { .forum_list .forum_nodesc {
@ -515,6 +517,13 @@ textarea.large {
.rowlist .formrow, .rowlist .formrow:first-child { .rowlist .formrow, .rowlist .formrow:first-child {
margin-top: 0px; margin-top: 0px;
} }
.loglist .to_left small {
margin-left: 2px;
font-size: 12px;
}
.loglist .to_right span {
font-size: 14px;
}
input { input {
background-color: var(--input-background-color); background-color: var(--input-background-color);
@ -1166,10 +1175,7 @@ blockquote:first-child {
.topic_list .topic_left { .topic_list .topic_left {
width: 100%; width: 100%;
} }
.topic_list .topic_right { .topic_list .topic_right, #poweredBy span {
display: none;
}
#poweredBy span {
display: none; display: none;
} }
} }

View File

@ -343,6 +343,9 @@ h1, h2, h3, h4, h5 {
display: none; display: none;
} }
.to_left {
float: left;
}
.to_right { .to_right {
margin-left: auto; margin-left: auto;
float: right; float: right;
@ -355,6 +358,13 @@ h1, h2, h3, h4, h5 {
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
} }
.loglist .to_left small {
margin-left: 2px;
font-size: 12px;
}
.loglist .to_right span {
font-size: 14px;
}
.bgsub { .bgsub {
display: none; display: none;
} }
@ -570,10 +580,7 @@ input, select {
.quick_create_form .quick_button_row .formitem { .quick_create_form .quick_button_row .formitem {
display: flex; display: flex;
} }
.quick_create_form .formbutton:first-child { .quick_create_form .formbutton:first-child,
margin-left: 0px;
margin-right: 5px;
}
.quick_create_form .formbutton:not(:first-child) { .quick_create_form .formbutton:not(:first-child) {
margin-left: 0px; margin-left: 0px;
margin-right: 5px; margin-right: 5px;