diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-08-29 17:45:48 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2014-08-29 17:45:48 +0200 |
commit | 6065c00e637872804d057bfe6fc6b719f4652019 (patch) | |
tree | b4523c79395ab0cae3c8bd3386283476332cdd61 /application/views | |
parent | cc72236f71c60396b69631656f8e0ad00a6301c8 (diff) | |
parent | f8674b37bd7db4e47103391b28dfa5b34d58f29f (diff) |
Merge branch 'multipaste' into working
Diffstat (limited to 'application/views')
-rw-r--r-- | application/views/file/file_info.php | 2 | ||||
-rw-r--r-- | application/views/file/fragments/alert-wide.php | 3 | ||||
-rw-r--r-- | application/views/file/fragments/thumbnail.php | 9 | ||||
-rw-r--r-- | application/views/file/fragments/uploads_table.php | 26 | ||||
-rw-r--r-- | application/views/file/html_footer.php | 4 | ||||
-rw-r--r-- | application/views/file/html_header.php | 89 | ||||
-rw-r--r-- | application/views/file/html_paste_footer.php | 2 | ||||
-rw-r--r-- | application/views/file/html_paste_header.php | 79 | ||||
-rw-r--r-- | application/views/file/multipaste_info.php | 26 | ||||
-rw-r--r-- | application/views/file/upload_form.php | 6 | ||||
-rw-r--r-- | application/views/file/upload_history.php | 9 | ||||
-rw-r--r-- | application/views/file/upload_history_thumbnails.php | 9 | ||||
-rw-r--r-- | application/views/file_plaintext/upload_history.php | 4 | ||||
-rw-r--r-- | application/views/footer.php | 4 |
14 files changed, 166 insertions, 106 deletions
diff --git a/application/views/file/file_info.php b/application/views/file/file_info.php index 6c2772a21..0620ac9bd 100644 --- a/application/views/file/file_info.php +++ b/application/views/file/file_info.php @@ -1,4 +1,4 @@ -<div class="center"> +<div class="center simple-container"> <?php if($filedata): ?> <div class="table-responive"> <table class="table" style="margin: auto"> diff --git a/application/views/file/fragments/alert-wide.php b/application/views/file/fragments/alert-wide.php new file mode 100644 index 000000000..ae303e119 --- /dev/null +++ b/application/views/file/fragments/alert-wide.php @@ -0,0 +1,3 @@ +<div class="alert alert-danger alert-wide"> + <?php echo $error_message; ?> +</div> diff --git a/application/views/file/fragments/thumbnail.php b/application/views/file/fragments/thumbnail.php new file mode 100644 index 000000000..6bd82fcb9 --- /dev/null +++ b/application/views/file/fragments/thumbnail.php @@ -0,0 +1,9 @@ +<!-- Comment markers background: http://stackoverflow.com/a/14776780/953022 --> +<div class="container container-wide"> +<div class="upload_thumbnails"><!-- + <?php foreach($items as $key => $item): ?> + --><a href="<?php echo site_url("/".$item["id"])."/"; ?>" title="<?php echo htmlentities($item["filename"]); ?>" data-content="<?php echo htmlentities($item["tooltip"]); ?>" data-id="<?php echo $item["id"]; ?>"><img class="thumb" src="<?php echo site_url("file/thumbnail/".$item["id"]); ?>"></a><!-- + <?php endforeach; ?> + --> +</div> +</div> diff --git a/application/views/file/fragments/uploads_table.php b/application/views/file/fragments/uploads_table.php new file mode 100644 index 000000000..142d19e91 --- /dev/null +++ b/application/views/file/fragments/uploads_table.php @@ -0,0 +1,26 @@ +<?php register_js_include("/data/js/jquery.tablesorter.min.js"); ?> +<div class="table-responsive container-wide"> + <p>Non-previewable file(s):</p> + <table class="table table-striped tablesorter"> + <thead> + <tr> + <th>ID</th> + <th>Filename</th> + <th>Mimetype</th> + <th>Date</th> + <th>Size</th> + </tr> + </thead> + <tbody> + <?php foreach($items as $item): ?> + <tr> + <td><a href="<?php echo site_url("/".$item["id"]) ?>/"><?php echo $item["id"] ?></a></td> + <td class="wrap"><?php echo htmlspecialchars($item["filename"]); ?></td> + <td><?php echo $item["mimetype"] ?></td> + <td class="nowrap" data-sort-value="<?=$item["date"]; ?>"><?php echo date("r", $item["date"]); ?></td> + <td><?php echo format_bytes($item["filesize"]) ?></td> + </tr> + <?php endforeach; ?> + </tbody> + </table> +</div> diff --git a/application/views/file/html_footer.php b/application/views/file/html_footer.php index bbec7ebd1..bd07b63f9 100644 --- a/application/views/file/html_footer.php +++ b/application/views/file/html_footer.php @@ -1,6 +1,4 @@ - </div> - </div> - +<div class="container"> <?php $force_full_html = true; include(FCPATH."application/views/footer.php"); diff --git a/application/views/file/html_header.php b/application/views/file/html_header.php index 2c556720c..fdce101a2 100644 --- a/application/views/file/html_header.php +++ b/application/views/file/html_header.php @@ -2,95 +2,14 @@ $force_full_html = true; include(FCPATH."application/views/header.php"); ?> -</div> +</div><!-- .container --> <script type="text/javascript"> /* <![CDATA[ */ window.lexers = <?php echo json_encode($lexers); ?>; - window.paste_base = '<?php echo site_url($id) ?>'; /* ]]> */ </script> -<?php if (isset($error_message)) { ?> -<div class="alert alert-danger" style="text-align: center; border-radius: 0;"> - <?php echo $error_message; ?> -</div> -<?php } ?> - -<div class="container paste-container"> - <div style="border:1px solid #ccc;"> - <div class="navbar navbar-default navbar-static-top navbar-paste"> - <ul class="nav navbar-nav navbar-left dont-float"> - <li><a href="#file-info" class="navbar-brand" data-toggle="modal"><?php echo $title ?></a></li> - <li class="divider"></li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="language-toggle"> - Language: <?php echo htmlspecialchars($current_highlight); ?> - <b class="caret"></b> - </a> - <div class="dropdown-menu" style="padding: 15px;"> - <form> - <input type="text" id="language" placeholder="Language" class="form-control"> - </form> - </div> - </li> - <li class="divider"></li> - <li> - <a href="#file-info" role="button" data-toggle="modal">Info</a> - </li> - <li class="divider"></li> - <li><a href="<?php echo site_url('file/index?repaste='.$id); ?>" role="button">Repaste</a></li> - </ul> - <div class="btn-group navbar-right" style="margin: 8px;"> - <a id="linewrap" class="btn btn-default" rel="tooltip" title="Toggle wrapping of long lines">Linewrap</a> - <a href="<?php echo site_url($id."/plain") ?>" class="btn btn-default" rel="tooltip" title="View as plain text">Plain</a> - <a href="<?php echo site_url($id) ?>" class="btn btn-default" rel="tooltip" title="View as raw file (org. mime type)">Raw</a> - <?php if ($current_highlight === 'rmd') { ?> - <a href="<?php echo site_url($id)."/" ?>" class="btn btn-default" rel="tooltip" title="Render as Code">Code</a> - <?php } else { ?> - <a href="<?php echo site_url($id."/rmd") ?>" class="btn btn-default" rel="tooltip" title="Render as Markdown">Markdown</a> - <?php } ?> - </div> - </div> <!-- .navbar --> - <div id="file-info" class="modal fade" role="dialog" aria-labelledby="file-info" aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal">×</button> - <h3 class="modal-title">Paste Information</h3> - </div> - <div class="modal-body"> - <table class="table"> - <tr> - <td style="border:0;">Filename:</td> - <td style="border:0;"><?php echo htmlspecialchars($filedata["filename"]) ?></td> - </tr> - <tr> - <td>Size:</td> - <td><?php echo format_bytes($filedata["filesize"]) ?></td> - </tr> - <tr> - <td>Mimetype:</td> - <td><?php echo $filedata["mimetype"] ?></td> - </tr> - <tr> - <td>Uploaded:</td> - <td><?php echo date("r", $filedata["date"]) ?></td> - </tr> - <tr> - <td>Removal:</td> - <td><?php echo $timeout ?></td> - </tr> - </table> - </div> - <div class="modal-footer"> - <?php echo form_open("file/do_delete/", array("style" => "display: inline")); ?> - <input type="hidden" name="ids[<?php echo $id; ?>]" value="<?php echo $id; ?>"> - <button class="btn btn-danger pull-left" aria-hidden="true">Delete</button> - </form> - <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button> - </div> - </div> - </div> - </div> <!-- .modal --> - <div> +<?php if (isset($error_message)) { + include 'framgents/alert-wide.php'; +} ?> diff --git a/application/views/file/html_paste_footer.php b/application/views/file/html_paste_footer.php new file mode 100644 index 000000000..22bc4dabb --- /dev/null +++ b/application/views/file/html_paste_footer.php @@ -0,0 +1,2 @@ +</div><!-- .container .paste-container --> + diff --git a/application/views/file/html_paste_header.php b/application/views/file/html_paste_header.php new file mode 100644 index 000000000..f4d3021ec --- /dev/null +++ b/application/views/file/html_paste_header.php @@ -0,0 +1,79 @@ +<div class="container paste-container container-wide"> + <div style="border:1px solid #ccc;"> + <div class="navbar navbar-default navbar-static-top navbar-paste"> + <ul class="nav navbar-nav navbar-left dont-float"> + <li><a href="<?=site_url($id)."/"; ?>" class="navbar-brand" data-toggle="modal"><?php echo $title ?></a></li> + <li class="divider"></li> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="language-toggle-<?=$id; ?>"> + Language: <?php echo htmlspecialchars($current_highlight); ?> + <b class="caret"></b> + </a> + <div class="dropdown-menu" style="padding: 15px;"> + <form> + <input data-base-url="<?=site_url($id); ?>" type="text" id="language-<?=$id; ?>" placeholder="Language" class="form-control"> + </form> + </div> + </li> + <li class="divider"></li> + <li> + <a href="#file-info-<?=$id; ?>" role="button" data-toggle="modal">Info</a> + </li> + <?php if (isset($user_logged_in) && $user_logged_in) { ?> + <li class="divider"></li> + <li><a href="<?php echo site_url('file/index?repaste='.$id); ?>" role="button">Repaste</a></li> + <?php } ?> + </ul> + <div class="btn-group navbar-right" style="margin: 8px;"> + <a id="linewrap-<?=$id; ?>" class="btn btn-default" rel="tooltip" title="Toggle wrapping of long lines">Linewrap</a> + <a href="<?php echo site_url($id."/plain") ?>" class="btn btn-default" rel="tooltip" title="View as plain text">Plain</a> + <a href="<?php echo site_url($id) ?>" class="btn btn-default" rel="tooltip" title="View as raw file (org. mime type)">Raw</a> + <?php if ($current_highlight === 'rmd') { ?> + <a href="<?php echo site_url($id)."/" ?>" class="btn btn-default" rel="tooltip" title="Render as Code">Code</a> + <?php } else { ?> + <a href="<?php echo site_url($id."/rmd") ?>" class="btn btn-default" rel="tooltip" title="Render as Markdown">Markdown</a> + <?php } ?> + </div> + </div> <!-- .navbar --> + <div id="file-info-<?=$id; ?>" class="modal fade" role="dialog" aria-labelledby="file-info-<?=$id; ?>" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal">×</button> + <h3 class="modal-title">Paste Information</h3> + </div> + <div class="modal-body"> + <table class="table"> + <tr> + <td style="border:0;">Filename:</td> + <td style="border:0;"><?php echo htmlspecialchars($filedata["filename"]) ?></td> + </tr> + <tr> + <td>Size:</td> + <td><?php echo format_bytes($filedata["filesize"]) ?></td> + </tr> + <tr> + <td>Mimetype:</td> + <td><?php echo $filedata["mimetype"] ?></td> + </tr> + <tr> + <td>Uploaded:</td> + <td><?php echo date("r", $filedata["date"]) ?></td> + </tr> + <tr> + <td>Removal:</td> + <td><?php echo $timeout ?></td> + </tr> + </table> + </div> + <div class="modal-footer"> + <?php echo form_open("file/do_delete/", array("style" => "display: inline")); ?> + <input type="hidden" name="ids[<?php echo $id; ?>]" value="<?php echo $id; ?>"> + <button class="btn btn-danger pull-left" aria-hidden="true">Delete</button> + </form> + <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button> + </div> + </div> + </div> + </div> <!-- .modal --> + </div> diff --git a/application/views/file/multipaste_info.php b/application/views/file/multipaste_info.php new file mode 100644 index 000000000..5baf732a2 --- /dev/null +++ b/application/views/file/multipaste_info.php @@ -0,0 +1,26 @@ +<div class="center simple-container"> + <div class="table-responive"> + <table class="table" style="margin: auto"> + <tr> + <td class="title">ID</td> + <td class="text"><a href="<?=site_url($id); ?>/"><?=$id; ?></a></td> + </tr> + <tr> + <td class="title">Number of files</td> + <td class="text"><?=$file_count; ?></td> + </tr> + <tr> + <td class="title">Date of upload</td> + <td class="text"><?=date("r", $upload_date); ?></td> + </tr> + <tr> + <td class="title">Date of removal</td> + <td class="text"><?=$timeout_string; ?></td> + </tr> + <tr> + <td class="title">Total size (including duplicates)</td> + <td class="text"><?=format_bytes($size); ?></td> + </tr> + </table> + </div> +</div> diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php index c5b28536c..44828c53a 100644 --- a/application/views/file/upload_form.php +++ b/application/views/file/upload_form.php @@ -26,7 +26,10 @@ <h3 class="panel-title">File upload</h3> </div> <div class="panel-body"> - <input class="file-upload" type="file" name="file[]" multiple="multiple"><br> + <div> + <input class="file-upload" type="file" name="file[]" multiple="multiple"><br> + </div> + <label><input type="checkbox" name="multipaste" value="1"> Create multipaste</label><br> <button type="submit" id="upload_button" class="btn btn-primary">Upload it!</button> </div> </div> @@ -57,6 +60,7 @@ <script type="text/javascript"> /* <![CDATA[ */ var max_upload_size = "<?php echo $max_upload_size; ?>"; + var max_files_per_upload = "<?php echo ini_get("max_file_uploads"); ?>"; /* ]]> */ </script> diff --git a/application/views/file/upload_history.php b/application/views/file/upload_history.php index 634ad5935..10afc53e9 100644 --- a/application/views/file/upload_history.php +++ b/application/views/file/upload_history.php @@ -1,11 +1,12 @@ <?php register_js_include("/data/js/jquery.tablesorter.min.js"); ?> +<?php register_js_include("/data/js/jquery.metadata.js"); ?> <?php include 'nav_history.php'; ?> <?php echo form_open("file/do_delete") ?> <div class="table-responsive"> - <table id="upload_history" class="table table-striped tablesorter"> + <table id="upload_history" class="table table-striped tablesorter {sortlist: [[4,1]]}"> <thead> <tr> - <th><input type="checkbox" name="all-ids" id="history-all"></th> + <th class="{sorter: false}"><input type="checkbox" name="all-ids" id="history-all"></th> <th>ID</th> <th>Filename</th> <th>Mimetype @@ -14,13 +15,13 @@ </tr> </thead> <tbody> - <?php foreach($query as $key => $item): ?> + <?php foreach($items as $key => $item): ?> <tr> <td><input type="checkbox" name="ids[<?php echo $item["id"] ?>]" value="<?php echo $item["id"] ?>" class="delete-history"></td> <td><a href="<?php echo site_url("/".$item["id"]) ?>/"><?php echo $item["id"] ?></a></td> <td class="wrap"><?php echo htmlspecialchars($item["filename"]); ?></td> <td><?php echo $item["mimetype"] ?></td> - <td class="nowrap"><?php echo date("r", $item["date"]); ?><span class="hidden">t=<?php echo $item["date"]; ?></span></td> + <td class="nowrap" data-sort-value="<?=$item["date"]; ?>"><?php echo date("r", $item["date"]); ?></td> <td><?php echo $item["filesize"] ?></td> </tr> <?php endforeach; ?> diff --git a/application/views/file/upload_history_thumbnails.php b/application/views/file/upload_history_thumbnails.php index bcafc44ca..a061d9676 100644 --- a/application/views/file/upload_history_thumbnails.php +++ b/application/views/file/upload_history_thumbnails.php @@ -6,14 +6,7 @@ </div> <?php include 'nav_history.php'; ?> - -<!-- Comment markers background: http://stackoverflow.com/a/14776780/953022 --> -<div class="upload_history_thumbnails"><!-- - <?php foreach($query as $key => $item): ?> - --><a href="<?php echo site_url("/".$item["id"]); ?>" title="<?php echo htmlentities($item["filename"]); ?>" data-content="<?php echo htmlentities($item["tooltip"]); ?>" data-id="<?php echo $item["id"]; ?>"><img class="thumb" src="<?php echo site_url("file/thumbnail/".$item["id"]); ?>"></a><!-- - <?php endforeach; ?> - --> -</div> +<?php include 'fragments/thumbnail.php'; ?> <div class="row-fluid"> <div class="span12 alert alert-block alert-info"> diff --git a/application/views/file_plaintext/upload_history.php b/application/views/file_plaintext/upload_history.php index f9a14af0b..53801494f 100644 --- a/application/views/file_plaintext/upload_history.php +++ b/application/views/file_plaintext/upload_history.php @@ -9,13 +9,13 @@ echo .mb_str_pad($fields["hash"], $lengths["hash"])." | " .mb_str_pad($fields["filesize"], $lengths["filesize"])."\n"; -foreach($query as $key => $item) { +foreach($items as $key => $item) { echo mb_str_pad($item["id"], $lengths["id"])." | " .mb_str_pad($item["filename"], $lengths["filename"])." | " .mb_str_pad($item["mimetype"], $lengths["mimetype"])." | " .date($dateformat, $item["date"])." | " - .$item["hash"]." | " + .mb_str_pad($item["hash"], $lengths["hash"])." | " .$item["filesize"]."\n"; } ?> diff --git a/application/views/footer.php b/application/views/footer.php index e748cd4e3..ae8d2e575 100644 --- a/application/views/footer.php +++ b/application/views/footer.php @@ -3,9 +3,9 @@ if (is_cli_client() && !isset($force_full_html)) { return; } ?> - </div> + </div><!-- .container --> <div id="push"></div> -</div> +</div> <!-- #wrap --> <footer class="footer" id="footer"> <div class="container muted credits"> <p>Site code licensed under <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank">AGPL v3</a>.</p> |