Skip to content

Commit

Permalink
#1679 Revamp thread and forum design further
Browse files Browse the repository at this point in the history
  • Loading branch information
Studio384 committed Jul 18, 2018
1 parent 1be3183 commit 23befa5
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 82 deletions.
15 changes: 6 additions & 9 deletions include/draw_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1178,19 +1178,16 @@ function draw_search_forum_list() {
}
}

function draw_mark_read($class, $page) {
global $luna_user, $id;
function get_read_url($page) {
global $id;

if (!empty($class))
$classes = ' class="'.$class.'"';
if ($luna_user['is_guest'])
return false;

if ($page == 'index')
$url = 'misc.php?action=markread&csrf_token='.luna_csrf_token();
return 'misc.php?action=markread&csrf_token='.luna_csrf_token();
elseif ($page == 'forumview')
$url = 'misc.php?action=markforumread&fid='.$id.'&csrf_token='.luna_csrf_token();

if (!$luna_user['is_guest'])
echo '<a'.$classes.' href="'.$url.'">'.__('Mark as read', 'luna').'</a>';
return 'misc.php?action=markforumread&amp;fid='.$id.'&amp;csrf_token='.luna_csrf_token();
}

function draw_wall_error($description, $action = NULL) {
Expand Down
2 changes: 1 addition & 1 deletion themes/Typography/css/_btn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
border-radius: 0;

&.btn-light {
background: none;
background: #fff;
color: #333;

&.btn-light-active {
Expand Down
3 changes: 2 additions & 1 deletion themes/Typography/css/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
footer {
color: #fff;
background-color: #333;
border-bottom: #222 12px solid;
padding: 1.5rem 2rem;
border-bottom: 15px solid #292929;

a {
color: inherit !important;
Expand Down
7 changes: 4 additions & 3 deletions themes/Typography/css/_jumbotron.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
margin-left: -.75rem;
margin-right: -.75rem;
background: $accent;
padding: 1.5rem .75rem;
padding: 1.2rem .75rem;

h2 {
color: #fff;
Expand All @@ -23,7 +23,7 @@
}

&.profile {
padding: 1.5rem .75rem;
padding: 1.2rem .75rem;
margin-left: -.75rem;
margin-right: -.75rem;

Expand Down Expand Up @@ -98,8 +98,9 @@

&.titletron {
color: #fff;
margin-left: -.75rem;
margin-right: -.75rem;
padding: 1.2rem .75rem;
margin-bottom: 0;

h2 {
margin-bottom: 0;
Expand Down
14 changes: 8 additions & 6 deletions themes/Typography/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion themes/Typography/css/style.css.map

Large diffs are not rendered by default.

24 changes: 9 additions & 15 deletions themes/Typography/views/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
$btn_style = ' style="color:'.$cur_commenting['color'].';"';

?>
<div class="jumbotron titletron"<?php echo $jumbo_style ?>>
<div class="container">
<div class="main container">
<div class="jumbotron titletron"<?php echo $jumbo_style ?>>
<h2 class="forum-title">
<?php if ($fid) { ?>
<small>
Expand All @@ -34,10 +34,6 @@
<?php } ?>
</h2>
</div>
</div>
<div class="main container">
<div class="row">
<div class="col-12">
<?php
if (isset($errors))
draw_error_panel($errors);
Expand All @@ -50,18 +46,16 @@
$email_form_name = ($luna_config['o_force_guest_email'] == '1') ? 'req_email' : 'email';

?>
<label class="d-none required"><?php _e('Name', 'luna') ?></label>
<input class="info-textfield form-control" type="text" placeholder="<?php _e('Name', 'luna') ?>" name="req_username" value="<?php if (isset($_POST['req_username'])) echo luna_htmlspecialchars($username); ?>" maxlength="25" tabindex="<?php echo $cur_index++ ?>" required autofocus />
<label class="conl<?php echo ($luna_config['o_force_guest_email'] == '1') ? ' required' : '' ?> d-none"><?php _e('Email', 'luna') ?></label>
<input class="info-textfield form-control" type="text" placeholder="<?php _e('Email', 'luna') ?>" name="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo luna_htmlspecialchars($email); ?>" maxlength="80" tabindex="<?php echo $cur_index++ ?>" />
<label class="d-none required"><?php _e('Name', 'luna') ?></label>
<input class="info-textfield form-control" type="text" placeholder="<?php _e('Name', 'luna') ?>" name="req_username" value="<?php if (isset($_POST['req_username'])) echo luna_htmlspecialchars($username); ?>" maxlength="25" tabindex="<?php echo $cur_index++ ?>" required autofocus />
<label class="conl<?php echo ($luna_config['o_force_guest_email'] == '1') ? ' required' : '' ?> d-none"><?php _e('Email', 'luna') ?></label>
<input class="info-textfield form-control" type="text" placeholder="<?php _e('Email', 'luna') ?>" name="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo luna_htmlspecialchars($email); ?>" maxlength="80" tabindex="<?php echo $cur_index++ ?>" />
<?php
}

if ($fid): ?>
<label class="required d-none"><?php _e('Subject', 'luna') ?></label><input class="info-textfield form-control" placeholder="<?php _e('Subject', 'luna') ?>" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo luna_htmlspecialchars($subject); ?>" maxlength="70" tabindex="<?php echo $cur_index++ ?>"<?php if (!$luna_user['is_guest']) { echo ' autofocus'; } ?> />
<label class="required d-none"><?php _e('Subject', 'luna') ?></label><input class="info-textfield form-control" placeholder="<?php _e('Subject', 'luna') ?>" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo luna_htmlspecialchars($subject); ?>" maxlength="70" tabindex="<?php echo $cur_index++ ?>"<?php if (!$luna_user['is_guest']) { echo ' autofocus'; } ?> />
<?php endif; ?>
<?php draw_editor('20'); ?>
</form>
</div>
</div>
<?php draw_editor('20'); ?>
</form>
</div>
40 changes: 11 additions & 29 deletions themes/Typography/views/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,26 @@
<div class="description"><?php echo $cur_forum['forum_desc'] ?></div>
</div>
<div class="row forumview">
<div class="col-md-3">
<div class="list-group list-group-nav">
<a class="list-group-item" href="index.php"><span class="fas fa-fw fa-chevron-left"></span> <?php _e('Back to index', 'luna') ?></a>
</div>
<?php if (!$luna_user['is_guest'] && $luna_config['o_forum_subscriptions'] == '1') { ?>
<hr />
<div class="list-group list-group-nav">
<div class="col-12">
<div class="btn-toolbar btn-toolbar-options">
<a class="btn btn-light" href="index.php"><i class="fas fa-fw fa-chevron-left"></i> <?php _e('Back', 'luna') ?></a>
<?php if ($cur_forum['is_subscribed']) { ?>
<a class="list-group-item list-group-item-success" href="misc.php?action=unsubscribe&amp;fid=<?php echo $id ?><?php echo $token_url ?>"><span class="fas fa-fw fa-star-o"></span> <?php _e('Unsubscribe', 'luna') ?></a>
<a class="btn btn-light btn-light-active" href="misc.php?action=unsubscribe&amp;fid=<?php echo $id ?><?php echo $token_url ?>"><i class="fas fa-fw fa-star"></i></a>
<?php } else { ?>
<a class="list-group-item" href="misc.php?action=subscribe&amp;fid=<?php echo $id ?><?php echo $token_url ?>"><span class="fas fa-fw fa-star"></span> <?php _e('Subscribe', 'luna') ?></a>
<a class="btn btn-light" href="misc.php?action=subscribe&amp;fid=<?php echo $id ?><?php echo $token_url ?>"><i class="far fa-fw fa-star"></i></a>
<?php } ?>
<?php if (get_read_url('forumview')) { ?>
<a class="btn btn-light" href="<?php echo get_read_url('forumview') ?>"><i class="fas fa-fw fa-glasses"></i></a>
<?php } ?>
<?php if ($id != '0' && $is_admmod) { ?>
<a class="btn btn-light" href="backstage/moderate.php?fid=<?php echo $forum_id ?>&p=<?php echo $p ?>"><i class="fas fa-fw fa-eye"></i></a>
<?php } ?>
</div>
<?php } ?>
<hr />
<?php if ((is_subforum($id) && $id != '0')): ?>
<h5 class="list-group-head"><?php _e('Subforums', 'luna') ?></h5>
<div class="list-group list-group-nav">
<?php draw_subforum_list('forum.php') ?>
</div>
<hr />
<?php endif; ?>
<div class="forum-list d-none d-md-block">
<div class="list-group list-group-nav">
<?php draw_forum_list('forum.php', 1, 'category.php', '') ?>
</div>
<hr />
</div>
<div class="list-group list-group-none">
<?php draw_mark_read('list-group-item', 'forumview') ?>
<?php if ($id != '0' && $is_admmod) { ?>
<a class="list-group-item" href="backstage/moderate.php?fid=<?php echo $forum_id ?>&p=<?php echo $p ?>"><span class="fas fa-fw fa-eye"></span> <?php _e('Moderate forum', 'luna') ?></a>
<?php } ?>
</div>
<div class="d-block d-md-none"><hr /></div>
</div>
<div class="col-md-9">
<?php typography_paginate($paging_links) ?>
<div class="list-group list-group-thread">
<?php draw_threads_list(); ?>
</div>
Expand Down
35 changes: 19 additions & 16 deletions themes/Typography/views/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="vendor/css/bootstrap.min.css">
<?php if ($luna_config['o_fontawesomepro'] == 0) { ?>
<?php if ($luna_config['o_use_cdn']) { ?>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.1/css/all.css" integrity="sha384-O8whS3fhG2OnA5Kas0Y9l3cfpmYjapjI0E4theH4iuMD+pLhbf6JI0jIMfYcK3yZ" crossorigin="anonymous">
<?php } else { ?>
<link rel="stylesheet" href="../vendor/css/fontawesome-all.min.css">
<?php } ?>
Expand All @@ -28,25 +28,28 @@
echo '</style>';
}
?>
<link rel="icon" href="img/favicon.png" />
</head>
<body>
<?php if ($luna_user['is_guest']): require load_page('login.php'); endif; ?>
<div class="container">
<div id="header">
<nav class="navbar navbar-expand-md navbar-light bg-white">
<a class="navbar-brand" href="index.php"><?php echo $menu_title ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon<?php echo (($num_new_pm != 0 || $num_notifications != 0)? ' flash' : '') ?>"></span>
</button>
<a class="navbar-brand" href="index.php">
<img class="img-fluid img-brand" src="img/favicon.png" alt="Logo"> <?php echo $menu_title ?>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon<?php echo (($num_new_pm != 0 || $num_notifications != 0)? ' flash' : '') ?>"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<?php echo implode('', $links); ?>
</ul>
<ul class="navbar-nav my-2 my-md-0">
<?php echo $usermenu; ?>
</ul>
</div>
</nav>
</div>
</div>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<?php echo implode('', $links); ?>
</ul>
<ul class="navbar-nav my-2 my-md-0">
<?php echo $usermenu; ?>
</ul>
</div>
</nav>
</div>
</div>
4 changes: 3 additions & 1 deletion themes/Typography/views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@
<?php echo implode('', $page_threadsearches) ?>
</div>
<?php } ?>
<?php if (get_read_url('forumview')) { ?>
<hr />
<div class="list-group list-group-none">
<?php draw_mark_read('list-group-item', 'index'); ?>
<a class="list-group-item" href="<?php echo get_read_url('index') ?>"><i class="fas fa-fw fa-glasses"></i> <?php _e('Mark as read', 'luna') ?></a>
</div>
<?php } ?>
</div>
<div class="col-md-9 col-12">
<?php
Expand Down

0 comments on commit 23befa5

Please sign in to comment.