diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-10-22 15:42:07 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-10-22 22:36:55 +0200 |
commit | de02b8cb514a95c100d0ec11ab469acfc687ca00 (patch) | |
tree | 9c09a70f4ac2b582ae80dd6e065f700ef460ed11 /application/views/file/upload_form.php | |
parent | 36f0185d8c950933099268c69081cabc084545c9 (diff) |
switch design to bootstrap; minor fixes along the way
Initial-work-by: Oliver Mader <b52@reaktor42.de>
Additional-work-by: Markus Cisler <mrkscslr@gmail.com>
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/views/file/upload_form.php')
-rw-r--r-- | application/views/file/upload_form.php | 131 |
1 files changed, 68 insertions, 63 deletions
diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php index 20fb1a3d8..d92cbfb5c 100644 --- a/application/views/file/upload_form.php +++ b/application/views/file/upload_form.php @@ -1,67 +1,72 @@ -<? if ($username) { ?> -<div class="center"> - <?php echo form_open_multipart('file/do_upload'); ?> - <p> - File: <input type="file" id="file" name="file" size="30" /> - <input type="submit" value="Upload" id="upload_button" name="process" /> - </p> - </form> - <p><b>OR</b></p> - <?php echo form_open_multipart('file/do_paste'); ?> - <p> - <textarea id="textarea" name="content" cols="80" rows="20"></textarea><br /> - <input type="submit" value="Paste" name="process" /> - </p> - </form> - <script type="text/javascript"> - /* <![CDATA[ */ - var max_upload_size = "<?php echo $max_upload_size; ?>"; - /* ]]> */ - </script> - <script type="text/javascript" src="<?php echo link_with_mtime("/data/js/upload_form.js"); ?>"></script> -</div> -<? } else { ?> -You have to <?=anchor("user/login", "log in"); ?> to be able to upload/paste. -<div id="login-form"> - <?=form_open("user/login"); ?> - <input type="text" name="username" /> - <input type="password" name="password" /> - <input type="submit" value="Login" name="process" /> - </form> +<?php if (isset($username) && $username) { ?> +<div class="well"> + <div class="row-fluid"> + <div class="span6"> + <div style="border-right:1px solid #ddd;padding-right:25px;"> + <?php echo form_open_multipart('file/do_paste'); ?> + <h2>Text paste</h2> + <textarea name="content" style="width:98%; height:300px;"></textarea> + <button type="submit" class="btn btn-primary">Paste it!</button> + </form> + </div> + </div> + <div class="span6"> + <?php echo form_open_multipart('file/do_upload'); ?> + <h2>File upload</h2> + <input id="file" type="file" name="file"><br> + <button type="submit" id="upload_button" class="btn btn-primary">Upload it!</button> + </form> + <div class="alert alert-block alert-info"> + <h4 class="alert-heading">Notice!</h4> + <p> + Uploads/pastes are deleted after <?php echo $upload_max_age; ?> days + <?php if($small_upload_size > 0) { + echo "unless they are smaller than ".format_bytes($small_upload_size); + } ?>. Maximum upload size is <?php echo format_bytes($max_upload_size); ?> + </p> + </div> + </div> + </div> </div> -<? } ?> -<br /> -<p>Uploads/pastes are deleted after <?php echo $upload_max_age; ?> days<?php if($small_upload_size > 0): ?> - unless they are smaller than <?php echo format_bytes($small_upload_size); ?> - <?php endif; ?>. Maximum upload size is <?php echo format_bytes($max_upload_size); ?></p> -<h2>Features</h2> -<p>For shell uploading/pasting and download information for the client go to <a href="<?php echo site_url("file/client"); ?>"><?php echo site_url("file/client"); ?></a></p> -<p>You can use the <?php echo anchor("file/upload_history", "history"); ?> to find old uploads.</p> -<p>How to link your pastes:</p> -<ul> - <li><span class="example">/<ID>/</span> automatically highlight the paste</li> - <li><span class="example">/<ID></span> set the detected MIME type and let the browser do the rest</li> - <li><span class="example">/<ID>/plain</span> force the MIME type to be text/plain</li> - <li><span class="example">/<ID>/<file extension></span> override auto detection and use the supplied file extension or language name for highlighting</li> - <li><span class="example">/<ID>/qr</span> display a qr code containing a link to <span class="example">/<ID>/</span></li> - <li><span class="example">/<ID>/rmd</span> convert markdown to HTML</li> - <li><span class="example">/<ID>/ascii</span> convert text with ANSI (shell) escape codes to HTML</li> - <li><span class="example">/<ID>/info</span> display some information about the ID</li> -</ul> -<p>If your upload is not detected as text, only -<span class="example">/<ID>/qr</span>, -<span class="example">/<ID>/plain</span> and -<span class="example">/<ID>/info</span> -will work as above and all others will simply return the file with the detected MIME type.</p> -<h2>Information</h2> -<p>This website's primary goal is aiding developers, power users, students and alike in solving problems, debugging software, sharing their configuration, etc. It is not intended to distribute confidential or harmful information, scripts or software.</p> - -<p>If you believe you deserve an account, ask someone who is already using this service to <?=anchor("user/invite", "invite"); ?> you.</p> +<script type="text/javascript"> + /* <![CDATA[ */ + var max_upload_size = "<?php echo $max_upload_size; ?>"; + /* ]]> */ +</script> +<script type="text/javascript" src="<?php echo link_with_mtime("/data/js/upload_form.js"); ?>"></script> -<?php if($contact_me_url) {?><p>If you experience any problems feel free to <a href="<?php echo $contact_me_url; ?>">contact me</a>.</p> -<br /><?php }; ?> -<div class="small"> - <p>Icons by <a href="http://p.yusukekamiyamane.com/">Yusuke Kamiyamane</a></p> - <p>This service is provided without warranty of any kind and may not be used to distribute copyrighted content.</p> +<?php } else { ?> + <?php echo form_open('user/login'); ?> + <input type="text" name="username" placeholder="Username" /> + <input type="password" name="password" placeholder="Password" /> + <input type="submit" class="btn btn-primary" value="Login" name="process" style="margin-bottom: 9px" /> + </form> +<?php } ?> +<div class="row"> + <div class="span6"> + <div class="page-header"><h1>Features</h1></div> + <p>For shell uploading/pasting and download information for the client go to <a href="<?php echo site_url("file/client"); ?>"><?php echo site_url("file/client"); ?></a></p> + <p>You can use the <?php echo anchor("file/upload_history", "history"); ?> to find old uploads.</p> + <h3>How to link your pastes:</h3> + <dl class="dl-horizontal"> + <dt>/<ID>/</dt><dd>automatically highlight the paste</dd> + <dt>/<ID></dt><dd>set the detected MIME type and let the browser do the rest</dd> + <dt>/<ID>/plain</dt><dd>force the MIME type to be text/plain</dd> + <dt>/<ID>/<file extension></dt><dd>override auto detection and use the supplied file extension or language name for highlighting</dd> + <dt>/<ID>/qr</dt><dd>display a qr code containing a link to <span class="example">/<ID>/</span></dd> + <dt>/<ID>/rmd</dt><dd>convert markdown to HTML</dd> + <dt>/<ID>/ascii</dt><dd>convert text with ANSI (shell) escape codes to HTML</dd> + <dt>/<ID>/info</dt><dd>display some information about the ID</dd> + </dl> + <p>If your upload is not detected as text, only <b>/<ID>/qr</b>, <b>/<ID>/plain</b> and <b>/<ID>/info</b> will work as above and all others will simply return the file with the detected MIME type.</p> + </div> + <div class="span6"> + <div class="page-header"><h1>Information</h1></div> + <p>This website's primary goal is aiding developers, power users, students and alike in solving problems, debugging software, sharing their configuration, etc. It is not intended to distribute confidential or harmful information, scripts or software.</p> + <p>If you believe you deserve an account, ask someone who is already using this service to <a href="http://test.paste.xinu.at/index.php/user/invite">invite</a> you.</p> + <?php if(isset($contact_me_url) && $contact_me_url) { ?> + <p>If you experience any problems feel free to <a href="<?php echo $contact_me_url; ?>">contact me</a>.</p> + <?php } ?> + </div> </div> |