diff options
| author | 2011-03-09 23:29:24 +0100 | |
|---|---|---|
| committer | 2011-03-09 23:29:24 +0100 | |
| commit | aa78d90803a68e41ea663adb623c859cae3ad91e (patch) | |
| tree | c793e30df9fccdf350fcd299e70fb3c14fabc36a /module/web/templates/default | |
| parent | captcha manager fix, toggle reconnect (diff) | |
| download | pyload-aa78d90803a68e41ea663adb623c859cae3ad91e.tar.xz | |
new config page, mootools 1.3, removed old templates
Diffstat (limited to 'module/web/templates/default')
| -rw-r--r-- | module/web/templates/default/base.html | 107 | ||||
| -rw-r--r-- | module/web/templates/default/captcha.html | 17 | ||||
| -rw-r--r-- | module/web/templates/default/collector.html | 40 | ||||
| -rw-r--r-- | module/web/templates/default/downloads.html | 23 | ||||
| -rw-r--r-- | module/web/templates/default/edit_package.html | 39 | ||||
| -rw-r--r-- | module/web/templates/default/home.html | 14 | ||||
| -rw-r--r-- | module/web/templates/default/login.html | 17 | ||||
| -rw-r--r-- | module/web/templates/default/logout.html | 3 | ||||
| -rw-r--r-- | module/web/templates/default/logs.html | 23 | ||||
| -rw-r--r-- | module/web/templates/default/package_ui.js | 19 | ||||
| -rw-r--r-- | module/web/templates/default/pathchooser.html | 48 | ||||
| -rw-r--r-- | module/web/templates/default/queue.html | 40 | ||||
| -rw-r--r-- | module/web/templates/default/settings.html | 429 | ||||
| -rw-r--r-- | module/web/templates/default/settings_item.html | 45 | ||||
| -rw-r--r-- | module/web/templates/default/setup.html | 13 | ||||
| -rw-r--r-- | module/web/templates/default/window.html | 31 | 
16 files changed, 495 insertions, 413 deletions
| diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index d90ef6f07..77774daf7 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -1,4 +1,3 @@ -{% load i18n %}
  <?xml version="1.0" ?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 @@ -6,20 +5,28 @@  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 -<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"/>
 +<link rel="stylesheet" type="text/css" href="/media/default/css/default.css"/>
 -<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/window.css"/>
 +<link rel="stylesheet" type="text/css" href="/media/default/css/window.css"/>
 -<script type="text/javascript" src="{{ MEDIA_URL }}js/funktions.js"></script>
 -<script type="text/javascript" src="{{ MEDIA_URL }}js/mootools-1.2.5-core.js"></script>
 -<script type="text/javascript" src="{{ MEDIA_URL }}js/mootools-1.2.4.4-more.js"></script>
 +<script type="text/javascript" src="/media/default/js/funktions.js"></script>
 +<script type="text/javascript" src="/media/default/js/mootools-core-1.3.1.js"></script>
 +<script type="text/javascript" src="/media/default/js/mootools-more-1.3.1.1.js"></script>
 -<title>{% block title %}pyLoad {% trans "Webinterface" %}{% endblock %}</title>
 +<script type="text/javascript" src="/media/default/js/purr.js"></script>
 +
 +<title>{% block title %}pyLoad {{_("Webinterface")}}{% endblock %}</title>
  <script type="text/javascript">
 -var add_bg, add_box, cap_box, cap_info;
 +
 +var add_bg, add_box, cap_box, cap_info, notify;
  document.addEvent("domready", function(){
 +    notify = new Purr({
 +        'mode': 	'top',
 +        'position': 'center'
 +    });
 +
  	add_bg = new Fx.Tween($('add_bg'));
  	add_box = new Fx.Tween($('add_box'));
      cap_box = new Fx.Tween($('cap_box'));
 @@ -31,9 +38,9 @@ document.addEvent("domready", function(){  	$('add_form').onsubmit=function() {
              $('add_form').target = 'upload_target';
 -            if ($('add_name').value == "" && $('add_file').value != " "){
 -                alert("{% trans "Please Enter a packagename."  %}");
 -                return false
 +            if ($('add_name').value == "" && $('add_file').value == ""){
 +                alert("{{_("Please Enter a packagename.")}}");
 +                return false;
              }else{
  		out();
              }
 @@ -92,26 +99,31 @@ function LoadJsonToContent(data)      $("aktiv_from").set('text', data.queue);
      if (data.captcha){
 -        $("cap_info").setStyle('display', 'inline');
 +        if($("cap_info").getStyle("display") != "inline"){
 +            $("cap_info").setStyle('display', 'inline');
 +            notify.alert('{{_("New Captcha Request")}}', {
 +                            'className': 'notify'
 +                        });
 +        }
      }else{
          $("cap_info").setStyle('display', 'none');
      }
      if (data.download) {
 -        $("time").set('text', " {% trans "on" %}");
 +        $("time").set('text', " {{_("on")}}");
          $("time").setStyle('background-color', "#8ffc25");
      }else{
 -        $("time").set('text', " {% trans "off" %}");
 +        $("time").set('text', " {{_("off")}}");
          $("time").setStyle('background-color', "#fc6e26");
      }
      if (data.reconnect){
 -        $("reconnect").set('text', " {% trans "on" %}");
 +        $("reconnect").set('text', " {{_("on")}}");
          $("reconnect").setStyle('background-color', "#8ffc25");
      }
      else{
 -        $("reconnect").set('text', " {% trans "off" %}");
 +        $("reconnect").set('text', " {{_("off")}}");
          $("reconnect").setStyle('background-color', "#fc6e26");
      }
  }
 @@ -159,12 +171,12 @@ function load_cap(method, post){              if (data.captcha){
                  $('cap_img').set('src', data.src);
                  $('cap_span').setStyle('display', 'block');
 -                $$('#cap_form p')[0].set('text', '{% trans "Please read the text on the captcha." %}');
 +                $$('#cap_form p')[0].set('text', '{{_("Please read the text on the captcha.")}}');
                  $('cap_id').set('value', data.id);
              } else{
                  $('cap_img').set('src', '');
                  $('cap_span').setStyle('display', 'none');
 -                $$('#cap_form p')[0].set('text', '{% trans "No Captchas to read." %}');
 +                $$('#cap_form p')[0].set('text', '{{_("No Captchas to read.")}}');
              }
          },
          secure: false,
 @@ -202,52 +214,55 @@ function AddBox()  <div id="head-panel">
 +
      <div id="head-search-and-login">
 +    {% block headpanel %}
          {% if user.is_authenticated %}
  <span id="cap_info" style="display: {% if captcha %}inline{%else%}none{% endif %}">
 -<img src="{{ MEDIA_URL }}img/images.png" alt="Captcha:" style="vertical-align:middle; margin:2px" />
 -<span style="font-weight: bold; cursor: pointer; margin-right: 2px;">{% trans "Captcha waiting" %}</span>
 +<img src="/media/default/img/images.png" alt="Captcha:" style="vertical-align:middle; margin:2px" />
 +<span style="font-weight: bold; cursor: pointer; margin-right: 2px;">{{_("Captcha waiting")}}</span>
  </span>
 -<img src="{{ MEDIA_URL }}img/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user.username}}</span>
 +<img src="/media/default/img/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user.name}}</span>
  	<ul id="user-actions">
 -		<li><a href="/logout"  class="action logout" rel="nofollow">{% trans "Logout" %}</a></li>
 +		<li><a href="/logout"  class="action logout" rel="nofollow">{{_("Logout")}}</a></li>
  		{% if user.is_staff %}
 -		<li><a href="/admin" class="action profile" rel="nofollow">{% trans "Administrate" %}</a></li>
 +		<li><a href="/admin" class="action profile" rel="nofollow">{{_("Administrate")}}</a></li>
  		{% endif %}
  	</ul>
  {% else %}
 -    <span style="padding-right: 2px;">{% trans "Please Login!" %}</span>
 +    <span style="padding-right: 2px;">{{_("Please Login!")}}</span>
  {% endif %}
 +    {% endblock %}
  	</div>
 -	<a href="/"><img id="head-logo" src="{{ MEDIA_URL }}img/pyload-logo-edited3.5-new-font-small.png" alt="pyLoad" /></a>
 +	<a href="/"><img id="head-logo" src="/media/default/img/pyload-logo-edited3.5-new-font-small.png" alt="pyLoad" /></a>
  	<div id="head-menu">
  		<ul>
  		{% block menu %}
  		<li class="selected">
 -		    <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a>
 +		    <a href="/" title=""><img src="/media/default/img/head-menu-home.png" alt="" /> {{_("Home")}}</a>
  		</li>
  		<li>
 -		    <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-queue.png" alt="" /> {% trans "Queue" %}</a>
 +		    <a href="/queue/" title=""><img src="/media/default/img/head-menu-queue.png" alt="" /> {{_("Queue")}}</a>
  		</li>
  		<li>
 -		    <a href="/collector/" title=""><img src="{{ MEDIA_URL }}img/head-menu-collector.png" alt="" /> {% trans "Collector" %}</a>
 +		    <a href="/collector/" title=""><img src="/media/default/img/head-menu-collector.png" alt="" /> {{_("Collector")}}</a>
  		</li>
  		<li>
 -		    <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> {% trans "Downloads" %}</a>
 +		    <a href="/downloads/" title=""><img src="/media/default/img/head-menu-development.png" alt="" /> {{_("Downloads")}}</a>
  		</li>
  		<li class="right">
 -		    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />{% trans "Logs" %}</a>
 +		    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-index.png" alt="" />{{_("Logs")}}</a>
  		</li>
  		<li class="right">
 -		    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-config.png" alt="" />{% trans "Config" %}</a>
 +		    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-config.png" alt="" />{{_("Config")}}</a>
  		</li>
  		{% endblock %}
 @@ -257,22 +272,22 @@ function AddBox()  	<div style="clear:both;"></div>
  </div>
 -{% if perms.pyload.can_change_status %}
 +{% if perms.status %}
  <ul id="page-actions2">
 -	<li id="action_play"><a href="#"  class="action play" accesskey="o" rel="nofollow">{% trans "Play" %}</a></li>
 -    <li id="action_cancel"><a href="#"  class="action cancel" accesskey="o" rel="nofollow">{% trans "Cancel" %}</a></li>
 -    <li id="action_stop"><a href="#"  class="action stop" accesskey="o" rel="nofollow">{% trans "Stop" %}</a></li>
 -    <li id="action_add"><a href="javascript:AddBox();"  class="action add" accesskey="o" rel="nofollow" >{% trans "Add" %}</a></li>
 +	<li id="action_play"><a href="#"  class="action play" accesskey="o" rel="nofollow">{{_("Start")}}</a></li>
 +    <li id="action_stop"><a href="#"  class="action stop" accesskey="o" rel="nofollow">{{_("Stop")}}</a></li>
 +    <li id="action_cancel"><a href="#"  class="action cancel" accesskey="o" rel="nofollow">{{_("Cancel")}}</a></li>
 +    <li id="action_add"><a href="javascript:AddBox();"  class="action add" accesskey="o" rel="nofollow" >{{_("Add")}}</a></li>
  </ul>
  {% endif %}
 -{% if perms.pyload.can_see_dl %}
 +{% if perms.see_downloads %}
  <ul id="page-actions">
 -    <li><span class="time">{% trans "Download:" %}</span><a id="time" style=" background-color: {% if status.download %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.download %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a></li>
 -    <li><span class="reconnect">{% trans "Reconnect:" %}</span><a id="reconnect" style=" background-color: {% if status.reconnect %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.reconnect %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a></li>
 -    <li><a class="action backlink">{% trans "Speed:" %} <b id="speed">{{ status.speed }}</b> kb/s</a></li>
 -    <li><a class="action cog">{% trans "Active:" %} <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li>
 -    <li><a href=""  class="action revisions" accesskey="o" rel="nofollow">{% trans "Reload page" %}</a></li>
 +    <li><span class="time">{{_("Download:")}}</span><a id="time" style=" background-color: {% if status.download %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.download %}{{_("on")}}{% else %}{{_("off")}}{% endif %}</a></li>
 +    <li><span class="reconnect">{{_("Reconnect:")}}</span><a id="reconnect" style=" background-color: {% if status.reconnect %}#8ffc25{% else %} #fc6e26{% endif %}; padding-left: 0cm; padding-right: 0.1cm; "> {% if status.reconnect %}{{_("on")}}{% else %}{{_("off")}}{% endif %}</a></li>
 +    <li><a class="action backlink">{{_("Speed:")}} <b id="speed">{{ status.speed }}</b> kb/s</a></li>
 +    <li><a class="action cog">{{_("Active:")}} <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li>
 +    <li><a href=""  class="action revisions" accesskey="o" rel="nofollow">{{_("Reload page")}}</a></li>
  </ul>
  {% endif %}
 @@ -284,7 +299,7 @@ function AddBox()  <div id="content" lang="en" dir="ltr">
 -<h1>{% block subtitle %}pyLoad - {% trans "Webinterface" %}{% endblock %}</h1>
 +<h1>{% block subtitle %}pyLoad - {{_("Webinterface")}}{% endblock %}</h1>
  {% block statusbar %}
  {% endblock %}
 @@ -294,6 +309,7 @@ function AddBox()  <div class="level1" style="clear:both">
  </div>
 +<noscript><h1>Enable JavaScript to use the webinterface.</h1></noscript>
  {% for message in messages %}
  	<b><p>{{message}}</p></b>
 @@ -305,9 +321,8 @@ function AddBox()  	<hr style="clear: both;" />
  <div id="foot">© 2008-2011 pyLoad Team
 -<a href="#top" class="action top" accesskey="x"><span>{% trans "Back to top" %}</span></a><br />
 -	<!--<div class="breadcrumbs"></div>-->
 -
 +<a href="#top" class="action top" accesskey="x"><span>{{_("Back to top")}}</span></a><br />
 +<!--<div class="breadcrumbs"></div>-->
  </div>
  </div>
 diff --git a/module/web/templates/default/captcha.html b/module/web/templates/default/captcha.html index fe7b04fc9..b3be3deca 100644 --- a/module/web/templates/default/captcha.html +++ b/module/web/templates/default/captcha.html @@ -1,32 +1,31 @@ -{% load i18n %}
  <iframe id="upload_target" name="upload_target" src="" style="display: none; width:0;height:0"></iframe>
  <!--<div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;">-->
    <!--<div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div>-->
  <div id="cap_box" class="myform">
      <form id="cap_form" action="/json/set_captcha" method="POST" enctype="multipart/form-data" onsubmit="return false;">
 -<h1>{% trans "Captcha reading" %}</h1>
 -<p>{% trans "Please read the text on the captcha." %}</p>
 +<h1>{{_("Captcha reading")}}</h1>
 +<p>{{_("Please read the text on the captcha.")}}</p>
  <span id="cap_span">
 -<label>{% trans "Captcha" %}
 -<span class="small">{% trans "The captcha." %}</span>
 +<label>{{_("Captcha")}}
 +<span class="small">{{_("The captcha.")}}</span>
  </label>
  <span class="cont">
      <img id="cap_img" style="padding: 2px;" src="">
  </span>
 -<label>{% trans "Text" %}
 -<span class="small">{% trans "Input the text on the captcha." %}</span>
 +<label>{{_("Text")}}
 +<span class="small">{{_("Input the text on the captcha.")}}</span>
  </label>
  <input id="cap_text" name="cap_text" type="text" size="20" />
  <input type="hidden" value="" name="cap_id" id="cap_id"/>
  </span>
 -<button id="cap_submit" type="submit">{% trans "Submit" %}</button>
 -<button id="cap_reset" style="margin-left:0px;" type="reset">{% trans "Close" %}</button>
 +<button id="cap_submit" type="submit">{{_("Submit")}}</button>
 +<button id="cap_reset" style="margin-left:0px;" type="reset">{{_("Close")}}</button>
  <div class="spacer"></div>
 diff --git a/module/web/templates/default/collector.html b/module/web/templates/default/collector.html index 8dddd488e..3e6b47234 100644 --- a/module/web/templates/default/collector.html +++ b/module/web/templates/default/collector.html @@ -1,6 +1,4 @@  {% extends 'default/base.html' %}
 -{% load i18n %}
 -
  {% block head %}
  <script type="text/javascript" src="/package_ui.js"></script>
 @@ -13,42 +11,42 @@ document.addEvent("domready", function(){  </script>
  {% endblock %}
 -{% block title %}{% trans "Collector" %} - {{block.super}} {% endblock %}
 -{% block subtitle %}{% trans "Collector" %}{% endblock %}
 +{% block title %}{{_("Collector")}} - {{super()}} {% endblock %}
 +{% block subtitle %}{{_("Collector")}}{% endblock %}
  {% block menu %}
  <li>
 -    <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a>
 +    <a href="/" title=""><img src="/media/default/img/head-menu-home.png" alt="" /> {{_("Home")}}</a>
  </li>
  <li>
 -    <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-queue.png" alt="" /> {% trans "Queue" %}</a>
 +    <a href="/queue/" title=""><img src="/media/default/img/head-menu-queue.png" alt="" /> {{_("Queue")}}</a>
  </li>
  <li class="selected">
 -    <a href="/collector/" title=""><img src="{{ MEDIA_URL }}img/head-menu-collector.png" alt="" /> {% trans "Collector" %}</a>
 +    <a href="/collector/" title=""><img src="/media/default/img/head-menu-collector.png" alt="" /> {{_("Collector")}}</a>
  </li>
  <li>
 -    <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> {% trans "Downloads" %}</a>
 +    <a href="/downloads/" title=""><img src="/media/default/img/head-menu-development.png" alt="" /> {{_("Downloads")}}</a>
  </li>
  <li class="right">
 -    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />{% trans "Logs" %}</a>
 +    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-index.png" alt="" />{{_("Logs")}}</a>
  </li>
  <li class="right">
 -    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-config.png" alt="" />{% trans "Config" %}</a>
 +    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-config.png" alt="" />{{_("Config")}}</a>
  </li>{% endblock %}
  {% block pageactions %}
  <ul id="page-actions-more">
 -    <li id="del_finished"><a style="padding: 0; font-weight: bold;" href="#">{% trans "Delete Finished" %}</a></li>
 -    <li id="restart_failed"><a style="padding: 0; font-weight: bold;" href="#">{% trans "Restart Failed" %}</a></li>
 +    <li id="del_finished"><a style="padding: 0; font-weight: bold;" href="#">{{_("Delete Finished")}}</a></li>
 +    <li id="restart_failed"><a style="padding: 0; font-weight: bold;" href="#">{{_("Restart Failed")}}</a></li>
  </ul>
  {% endblock %}
  {% block content %}
 -<div id="load-success" style="opacity: 0; float: right; color: white; background-color: #90ee90; padding: 4px; -moz-border-radius: 5px; border-radius: 5px; font-weight: bold; margin-left: -100%; margin-top: -10px;">{% trans "success" %}</div>
 -<div id="load-failure" style="opacity: 0; float: right; color: white; background-color: #f08080; padding: 4px; -moz-border-radius: 5px; border-radius: 5px; font-weight: bold; margin-left: -100%; margin-top: -10px;">{% trans "failure" %}</div>
 +<div id="load-success" style="opacity: 0; float: right; color: white; background-color: #90ee90; padding: 4px; -moz-border-radius: 5px; border-radius: 5px; font-weight: bold; margin-left: -100%; margin-top: -10px;">{{_("success")}}</div>
 +<div id="load-failure" style="opacity: 0; float: right; color: white; background-color: #f08080; padding: 4px; -moz-border-radius: 5px; border-radius: 5px; font-weight: bold; margin-left: -100%; margin-top: -10px;">{{_("failure")}}</div>
  <div id="load-indicator" style="opacity: 0; float: right; margin-top: -10px;">
 -    <img src="{{ MEDIA_URL }}img/ajax-loader.gif" alt="" style="padding-right: 5px"/>
 -    {% trans "loading" %}
 +    <img src="/media/default/img/ajax-loader.gif" alt="" style="padding-right: 5px"/>
 +    {{_("loading")}}
  </div>
  <ul id="package-list" style="list-style: none; padding-left: 0; margin-top: -10px;">
 @@ -62,17 +60,17 @@ document.addEvent("domready", function(){          <span class="name">{{package.name}}</span>
            
          <span class="buttons" style="opacity:0">
 -        <img title="{% trans "Delete Package" %}" style="cursor: pointer" width="12px" height="12px" src="{{ MEDIA_URL }}img/delete.png" />
 +        <img title="{{_("Delete Package")}}" style="cursor: pointer" width="12px" height="12px" src="/media/default/img/delete.png" />
            
 -        <img title="{% trans "Restart Package" %}" style="margin-left: -10px; cursor: pointer" height="12px" src="{{ MEDIA_URL }}img/arrow_refresh.png" />
 +        <img title="{{_("Restart Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/arrow_refresh.png" />
            
 -        <img title="{% trans "Edit Package" %}" style="margin-left: -10px; cursor: pointer" height="12px" src="{{ MEDIA_URL }}img/pencil.png" />
 +        <img title="{{_("Edit Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/pencil.png" />
            
 -        <img title="{% trans "Move Package to Queue" %}" style="margin-left: -10px; cursor: pointer" height="12px" src="{{ MEDIA_URL }}img/package_go.png" />
 +        <img title="{{_("Move Package to Queue")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/package_go.png" />
          </span>
      </div>
      <div id="children_{{id}}" style="display: none;" class="children">
 -    <span class="child_secrow">{% trans "Folder:" %} <span class="folder">{{package.folder}}</span> | {% trans "Password:"%} <span class="password">{{package.password}}</span> | {% trans "Priority:"%} <span class="prio">{{package.priority}}</span></span>
 +    <span class="child_secrow">{{_("Folder:")}} <span class="folder">{{package.folder}}</span> | {{_("Password:")}} <span class="password">{{package.password}}</span> | {{_("Priority:")}} <span class="prio">{{package.priority}}</span></span>
      <ul id="sort_children_{{id}}" style="list-style: none; padding-left: 0">
      </ul>
      </div>
 diff --git a/module/web/templates/default/downloads.html b/module/web/templates/default/downloads.html index eeb73e151..813dc8d06 100644 --- a/module/web/templates/default/downloads.html +++ b/module/web/templates/default/downloads.html @@ -1,51 +1,48 @@  {% extends 'default/base.html' %} -{% load i18n %} -{% block title %}Downloads - {{block.super}} {% endblock %} +{% block title %}Downloads - {{super()}} {% endblock %}  {% block menu %}  <li> -    <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a> +    <a href="/" title=""><img src="/media/default/img/head-menu-home.png" alt="" /> {{_("Home")}}</a>  </li>  <li> -    <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-queue.png" alt="" /> {% trans "Queue" %}</a> +    <a href="/queue/" title=""><img src="/media/default/img/head-menu-queue.png" alt="" /> {{_("Queue")}}</a>  </li>  <li> -    <a href="/collector/" title=""><img src="{{ MEDIA_URL }}img/head-menu-collector.png" alt="" /> {% trans "Collector" %}</a> +    <a href="/collector/" title=""><img src="/media/default/img/head-menu-collector.png" alt="" /> {{_("Collector")}}</a>  </li>  <li class="selected"> -    <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> {% trans "Downloads" %}</a> +    <a href="/downloads/" title=""><img src="/media/default/img/head-menu-development.png" alt="" /> {{_("Downloads")}}</a>  </li>  <li class="right"> -    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />{% trans "Logs" %}</a> +    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-index.png" alt="" />{{_("Logs")}}</a>  </li>  <li class="right"> -    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-config.png" alt="" />{% trans "Config" %}</a> +    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-config.png" alt="" />{{_("Config")}}</a>  </li>  {% endblock %}  {% block subtitle %} -{% trans "Downloads" %} +{{_("Downloads")}}  {% endblock %}  {% block content %} -{% trans "Do not transfer downloaded files more than 10Mb in size via webinterface to external location, because it can result in high system load." %} -  <ul>      {% for folder in files.folder %}      <li>          {{ folder.name }}          <ul>          {% for file in folder.files %} -        <li><a href='{% url download 'get/' %}{{ folder.path|urlencode }}/{{ file|urlencode }}'>{{file}}</a></li> +        <li><a href='get/{{ folder.path|escape }}/{{ file|escape }}'>{{file}}</a></li>          {% endfor %}          </ul>      </li>      {% endfor %}      {% for file in files.files %} -    <li> <a href={% url download 'get/' %}{{ file|urlencode }}>{{ file }}</a></li> +    <li> <a href='get/{{ file|escape }}'>{{ file }}</a></li>      {% endfor %}  </ul> diff --git a/module/web/templates/default/edit_package.html b/module/web/templates/default/edit_package.html index caa8a02cd..0c9dcff42 100644 --- a/module/web/templates/default/edit_package.html +++ b/module/web/templates/default/edit_package.html @@ -1,39 +1,38 @@ -{% load i18n %}
  <div id="pack_box" class="myform" style="z-index: 2">
  <form id="pack_form" action="/json/edit_package" method="POST" enctype="multipart/form-data">
 -<h1>{% trans "Edit Package" %}</h1>
 -<p>{% trans "Edit the package detais below." %}</p>
 +<h1>{{_("Edit Package")}}</h1>
 +<p>{{_("Edit the package detais below.")}}</p>
  <input name="pack_id" id="pack_id" type="hidden" value=""/> 
 -<label for="pack_name">{% trans "Name" %}
 -<span class="small">{% trans "The name of the package." %}</span>
 +<label for="pack_name">{{_("Name")}}
 +<span class="small">{{_("The name of the package.")}}</span>
  </label>
  <input id="pack_name" name="pack_name" type="text" size="20" />
 -<label for="pack_folder">{% trans "Folder" %}
 -<span class="small">{% trans "Name of subfolder for these downloads." %}</span>
 +<label for="pack_folder">{{_("Folder")}}
 +<span class="small">{{_("Name of subfolder for these downloads.")}}</span>
  </label>
  <input id="pack_folder" name="pack_folder" type="text" size="20" />
 -<label for="pack_prio">{% trans "Priority" %}
 -<span class="small">{% trans "Priority of the package." %}</span>
 +<label for="pack_prio">{{_("Priority")}}
 +<span class="small">{{_("Priority of the package.")}}</span>
  </label>
      <select name="pack_prio" id="pack_prio">
 -        <option value="3">{% trans "highest" %}</option>
 -        <option value="2">{% trans "higher" %}</option>
 -        <option value="1">{% trans "high" %}</option>
 -        <option value="0" selected="selected">{% trans "normal" %}</option>
 -        <option value="-1">{% trans "low" %}</option>
 -        <option value="-2">{% trans "lower" %}</option>
 -        <option value="-3">{% trans "lowest" %}</option>
 +        <option value="3">{{_("highest")}}</option>
 +        <option value="2">{{_("higher")}}</option>
 +        <option value="1">{{_("high")}}</option>
 +        <option value="0" selected="selected">{{_("normal")}}</option>
 +        <option value="-1">{{_("low")}}</option>
 +        <option value="-2">{{_("lower")}}</option>
 +        <option value="-3">{{_("lowest")}}</option>
      </select>
 -<label for="pack_pws">{% trans "Password" %}
 -<span class="small">{% trans "List of passwords used for unrar." %}</span>
 +<label for="pack_pws">{{_("Password")}}
 +<span class="small">{{_("List of passwords used for unrar.")}}</span>
  </label>
  <textarea rows="3" name="pack_pws" id="pack_pws"></textarea>
 -<button type="submit">{% trans "Submit" %}</button>
 -<button id="pack_reset" style="margin-left: 0" type="reset">{% trans "Reset" %}</button>
 +<button type="submit">{{_("Submit")}}</button>
 +<button id="pack_reset" style="margin-left: 0" type="reset">{{_("Reset")}}</button>
  <div class="spacer"></div>
  </form>
 diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 97d245a38..b2cef2cb7 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -1,6 +1,4 @@  {% extends 'default/base.html' %}
 -{% load i18n %}
 -
  {% block head %}
  <script type="text/javascript">
 @@ -204,18 +202,18 @@ var LinkEntry = new Class({  {% endblock %}
  {% block subtitle %}
 -{% trans "Active Downloads" %}
 +{{_("Active Downloads")}}
  {% endblock %}
  {% block content %}
  <table width="100%" class="queue">
      <thead>
    <tr class="header">
 -    <th>{% trans "Name" %}</th>
 -    <th>{% trans "Status" %}</th>
 -    <th>{% trans "Information" %}</th>
 -    <th>{% trans "Size" %}</th>
 -    <th>{% trans "Progress" %}</th>
 +    <th>{{_("Name")}}</th>
 +    <th>{{_("Status")}}</th>
 +    <th>{{_("Information")}}</th>
 +    <th>{{_("Size")}}</th>
 +    <th>{{_("Progress")}}</th>
    </tr>
      </thead>
    <tbody id="LinksAktiv">
 diff --git a/module/web/templates/default/login.html b/module/web/templates/default/login.html index 7ae78183b..0e9e4d568 100644 --- a/module/web/templates/default/login.html +++ b/module/web/templates/default/login.html @@ -1,26 +1,23 @@  {% extends 'default/base.html' %} -{% load i18n %} -{% load token %} -{% block title %}{% trans "Login" %} - {{block.super}} {% endblock %} +{% block title %}{{_("Login")}} - {{super()}} {% endblock %}  {% block content %}  <div class="centeralign">  <form action="" method="post" accept-charset="utf-8" id="login"> -    {% csrf_token %}      <div class="no">          <input type="hidden" name="do" value="login" />          <fieldset>          <legend>Login</legend>          <label> -            <span>{% trans "Username" %}</span> -            {{ form.username }} +            <span>{{_("Username")}}</span> +            <input type="text" size="20" name="username"/>          </label>          <br />          <label> -            <span>{% trans "Password" %}</span> -            {{ form.password }} +            <span>{{_("Password")}}</span> +            <input type="password" size="20" name="password">          </label>          <br />          <input type="submit" value="Login" class="button" /> @@ -28,8 +25,8 @@      </div>  </form> -{% if form.errors %} -<p>{% trans "Your username and password didn't match. Please try again." %}</p> +{% if errors %} +<p>{{_("Your username and password didn't match. Please try again.")}}</p>  {% endif %}  </div> diff --git a/module/web/templates/default/logout.html b/module/web/templates/default/logout.html index edc30392e..d3f07472b 100644 --- a/module/web/templates/default/logout.html +++ b/module/web/templates/default/logout.html @@ -1,10 +1,9 @@  {% extends 'default/base.html' %} -{% load i18n %}  {% block head %}  <meta http-equiv="refresh" content="3; url=/">  {% endblock %}  {% block content %} -<p><b>{% trans "You were successfully logged out." %}</b></p> +<p><b>{{_("You were successfully logged out.")}}</b></p>  {% endblock %}
\ No newline at end of file diff --git a/module/web/templates/default/logs.html b/module/web/templates/default/logs.html index 5da99912f..7a95b4364 100644 --- a/module/web/templates/default/logs.html +++ b/module/web/templates/default/logs.html @@ -1,36 +1,35 @@  {% extends 'default/base.html' %} -{% load i18n %} -{% block title %}{% trans "Logs" %} - {{block.super}} {% endblock %} -{% block subtitle %}{% trans "Logs" %}{% endblock %} +{% block title %}{{_("Logs")}} - {{super()}} {% endblock %} +{% block subtitle %}{{_("Logs")}}{% endblock %}  {% block head %} -<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/log.css"/> +<link rel="stylesheet" type="text/css" href="/media/default/css/log.css"/>  {% endblock %}  {% block menu %}  <li> -    <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a> +    <a href="/" title=""><img src="/media/default/img/head-menu-home.png" alt="" /> {{_("Home")}}</a>  </li>  <li> -    <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-queue.png" alt="" /> {% trans "Queue" %}</a> +    <a href="/queue/" title=""><img src="/media/default/img/head-menu-queue.png" alt="" /> {{_("Queue")}}</a>  </li>  <li> -    <a href="/collector/" title=""><img src="{{ MEDIA_URL }}img/head-menu-collector.png" alt="" /> {% trans "Collector" %}</a> +    <a href="/collector/" title=""><img src="/media/default/img/head-menu-collector.png" alt="" /> {{_("Collector")}}</a>  </li>  <li> -    <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> {% trans "Downloads" %}</a> +    <a href="/downloads/" title=""><img src="/media/default/img/head-menu-development.png" alt="" /> {{_("Downloads")}}</a>  </li>  <li class="right selected"> -    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />{% trans "Logs" %}</a> +    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-index.png" alt="" />{{_("Logs")}}</a>  </li>  <li class="right"> -    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-config.png" alt="" />{% trans "Config" %}</a> +    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-config.png" alt="" />{{_("Config")}}</a>  </li>  {% endblock %}  {% block content %}  <div style="clear: both;"></div> -<div class="logpaginator"><a href="{% url logs 1%}"><< {% trans "Start" %}</a>  <a href="{% url logs iprev %}">< {% trans "prev" %}</a>  <a href="{% url logs inext %}">{% trans "next" %} ></a> <a href="{% url logs %}">{% trans "End" %} >></a></div> +<div class="logpaginator"><a href="{{ "/logs/1" }}"><< {{_("Start")}}</a>  <a href="{{ "/logs/" + iprev|string }}">< {{_("prev")}}</a>  <a href="{{ "/logs/" + inext|string }}">{{_("next")}} ></a> <a href="/logs/">{{_("End")}} >></a></div>  <div class="logperpage">      <form id="logform1" action="" method="POST">          <label for="reversed">Reversed:</label> @@ -38,7 +37,7 @@          <label for="perpage">Lines per page:</label>          <select name="perpage" onchange="this.form.submit();">              {% for value in  perpage_p %} -                <option value="{{value.0}}"{% ifequal value.0 perpage %} selected="selected" {% endifequal %}>{{value.1}}</option> +                <option value="{{value.0}}"{% if value.0 == perpage %} selected="selected" {% endif %}>{{value.1}}</option>              {% endfor %}          </select>      </form> diff --git a/module/web/templates/default/package_ui.js b/module/web/templates/default/package_ui.js index eec645184..b5577f58a 100644 --- a/module/web/templates/default/package_ui.js +++ b/module/web/templates/default/package_ui.js @@ -1,4 +1,3 @@ -//{% load i18n %}  var load, success, fail, pack_box;  document.addEvent("domready", function() { @@ -27,20 +26,15 @@ function indicateFinish() {  function indicateSuccess() {      indicateFinish(); -    success.start("opacity", 1).chain(function() { -        (function() { -            success.start("opacity", 0); -        }).delay(250); +    notify.alert('{{_("Success")}}.', { +             'className': 'success'      }); -  }  function indicateFail() {      indicateFinish(); -    fail.start("opacity", 1).chain(function() { -        (function() { -            fail.start("opacity", 0); -        }).delay(250); +    notify.alert('{{_("Failed")}}.', { +             'className': 'error'      });  } @@ -70,7 +64,6 @@ var PackageUI = new Class({              revert: true,              opacity: 0.4,              handle: ".package_drag", -            //onStart: this.startSort,              onComplete: this.saveSort.bind(this)          }); @@ -227,8 +220,8 @@ var Package = new Class({              html += "<span class='child_status'>{statusmsg}</span>{error} ".substitute({"statusmsg": link.statusmsg, "error":link.error});              html += "<span class='child_status'>{format_size}</span>".substitute({"format_size": link.format_size});              html += "<span class='child_status'>{plugin}</span>  ".substitute({"plugin": link.plugin}); -            html += "<img title='{% trans "Delete Link" %}' style='cursor: pointer;' width='10px' height='10px' src='{{ MEDIA_URL }}img/delete.png' />  "; -            html += "<img title='{% trans "Restart Link" %}' style='cursor: pointer;margin-left: -4px' width='10px' height='10px' src='{{ MEDIA_URL }}img/arrow_refresh.png' /></div>"; +            html += "<img title='{{_("Delete Link")}}' style='cursor: pointer;' width='10px' height='10px' src='/media/default/img/delete.png' />  "; +            html += "<img title='{{_("Restart Link")}}' style='cursor: pointer;margin-left: -4px' width='10px' height='10px' src='/media/default/img/arrow_refresh.png' /></div>";              var div = new Element("div", {                  "id": "file_" + link.id, diff --git a/module/web/templates/default/pathchooser.html b/module/web/templates/default/pathchooser.html index 6a72214e8..d00637055 100644 --- a/module/web/templates/default/pathchooser.html +++ b/module/web/templates/default/pathchooser.html @@ -1,6 +1,3 @@ -{% load truncate %} -{% load quotepath %} -{% load i18n %}  <html>  <head>  	<script class="javascript"> @@ -28,51 +25,50 @@          }  	</script> -	<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/pathchooser.css"/> +	<link rel="stylesheet" type="text/css" href="/media/default/css/pathchooser.css"/>  </head> -<body{% ifequal type 'file' %}{% if not oldfile %} onload="setInvalid();"{% endif %}{% endifequal %}> +<body{% if type == 'file' %}{% if not oldfile %} onload="setInvalid();"{% endif %}{% endif %}>  <center>      <div id="paths">  	<form method="get" action="?" onSubmit="chosen();" onReset="exit();"> -	    <input type="text" name="p" value="{{ oldfile|default:cwd }}" size="60" onfocus="setValid();">  +	    <input type="text" name="p" value="{{ oldfile|default(cwd) }}" size="60" onfocus="setValid();">  	    <input type="submit" value="Ok" name="send">  	</form> -    {% ifequal type 'folder' %} -	<span class="path_abs_rel">{% trans "Path" %}: <a href="{% url path cwd|path_make_absolute|quotepath %}"{% if absolute %} style="text-decoration: underline;"{% endif %}>{% trans "absolute" %}</a> | <a href="{% url path cwd|path_make_relative|quotepath %}"{% if not absolute %} style="text-decoration: underline;"{% endif %}>{% trans "relative" %}</a></span> +    {% if type == 'folder' %} +	<span class="path_abs_rel">{{_("Path")}}: <a href="{{ "/pathchooser" + cwd|path_make_absolute|quotepath }}"{% if absolute %} style="text-decoration: underline;"{% endif %}>{{_("absolute")}}</a> | <a href="{{ "/pathchooser/" + cwd|path_make_relative|quotepath }}"{% if not absolute %} style="text-decoration: underline;"{% endif %}>{{_("relative")}}</a></span>      {% else %} -	<span class="path_abs_rel">{% trans "Path" %}: <a href="{% url file cwd|path_make_absolute|quotepath %}"{% if absolute %} style="text-decoration: underline;"{% endif %}>{% trans "absolute" %}</a> | <a href="{% url file cwd|path_make_relative|quotepath %}"{% if not absolute %} style="text-decoration: underline;"{% endif %}>{% trans "relative" %}</a></span> -    {% endifequal %} +	<span class="path_abs_rel">{{_("Path")}}: <a href="{{ "/filechooser/" + cwd|path_make_absolute|quotepath }}"{% if absolute %} style="text-decoration: underline;"{% endif %}>{{_("absolute")}}</a> | <a href="{{ "/filechooser/" + cwd|path_make_relative|quotepath }}"{% if not absolute %} style="text-decoration: underline;"{% endif %}>{{_("relative")}}</a></span> +    {% endif %}      </div>      <table border="0" cellspacing="0" cellpadding="3">          <tr> -            <th>{% trans "name" %}</th> -            <th>{% trans "size" %}</th> -            <th>{% trans "type" %}</th> -            <th>{% trans "last modified" %}</th> +            <th>{{_("name")}}</th> +            <th>{{_("size")}}</th> +            <th>{{_("type")}}</th> +            <th>{{_("last modified")}}</th>          </tr>  	{% if parentdir %}          <tr>              <td colspan="4"> -                <a href="{% ifequal type 'folder' %}{% url path parentdir|quotepath %}{% else %}{% url file parentdir|quotepath %}{% endifequal %}"><span class="parentdir">{% trans "parent directory" %}</span></a> +                <a href="{% if type == 'folder' %}{{ "/pathchooser/" + parentdir|quotepath }}{% else %}{{ "/filechooser/" + parentdir|quotepath }}{% endif %}"><span class="parentdir">{{_("parent directory")}}</span></a>              </td>          </tr>  	{% endif %}  {% for file in files %}          <tr> -            {% ifequal type 'folder' %} -                <td class="name">{% ifequal file.type 'dir' %}<a href="{% url path file.fullpath|quotepath %}" title="{{ file.fullpath }}"><span class="path_directory">{{ file.name|truncate:25 }}</span></a>{% else %}<span class="path_file" title="{{ file.fullpath }}">{{ file.name|truncate:25 }}{% endifequal %}</span></td> +            {% if type == 'folder' %} +                <td class="name">{% if file.type == 'dir' %}<a href="{{ "/pathchooser/" + file.fullpath|quotepath }}" title="{{ file.fullpath }}"><span class="path_directory">{{ file.name|truncate(25) }}</span></a>{% else %}<span class="path_file" title="{{ file.fullpath }}">{{ file.name|truncate(25) }}{% endif %}</span></td>              {% else %} -                <td class="name">{% ifequal file.type 'dir' %}<a href="{% url file file.fullpath|quotepath %}" title="{{ file.fullpath }}"><span class="file_directory">{{ file.name|truncate:25 }}</span></a>{% else %}<a href="#" onclick="setFile('{{ file.fullpath }}');" title="{{ file.fullpath }}"><span class="file_file">{{ file.name|truncate:25 }}{% endifequal %}</span></a></td> -            {% endifequal %} -            <td class="size">{{ file.size|floatformat:-2 }} {{ file.unit }}</td> -            <td class="type">{% ifequal file.type 'dir' %}directory{% else %}{{ file.ext|default:"file" }}{% endifequal %}</td> -            <td class="mtime">{{ file.modified|date:"d.m.Y - H:i:s" }}</td> +                <td class="name">{% if file.type == 'dir' %}<a href="{{ "/filechooser/" + file.fullpath|quotepath }}" title="{{ file.fullpath }}"><span class="file_directory">{{ file.name|truncate(25) }}</span></a>{% else %}<a href="#" onclick="setFile('{{ file.fullpath }}');" title="{{ file.fullpath }}"><span class="file_file">{{ file.name|truncate(25) }}{% endif %}</span></a></td> +            {% endif %} +            <td class="size">{{ file.size|float|filesizeformat }}</td> +            <td class="type">{% if file.type == 'dir' %}directory{% else %}{{ file.ext|default("file") }}{% endif %}</td> +            <td class="mtime">{{ file.modified|date("d.m.Y - H:i:s") }}</td>          <tr> -{% empty %} -        <tr> -            <td colspan="4">{% trans "no content" %}</td> -        </tr> +<!--        <tr> +            <td colspan="4">{{_("no content")}}</td> +        </tr> -->  {% endfor %}      </table>      </center> diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index ec11bc365..e72871873 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -1,6 +1,4 @@  {% extends 'default/base.html' %}
 -{% load i18n %}
 -
  {% block head %}
  <script type="text/javascript" src="/package_ui.js"></script>
 @@ -13,43 +11,43 @@ document.addEvent("domready", function(){  </script>
  {% endblock %}
 -{% block title %}{% trans "Queue" %} - {{block.super}} {% endblock %}
 -{% block subtitle %}{% trans "Queue" %}{% endblock %}
 +{% block title %}{{_("Queue")}} - {{super()}} {% endblock %}
 +{% block subtitle %}{{_("Queue")}}{% endblock %}
  {% block menu %}
  <li>
 -    <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a>
 +    <a href="/" title=""><img src="/media/default/img/head-menu-home.png" alt="" /> {{_("Home")}}</a>
  </li>
  <li class="selected">
 -    <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-queue.png" alt="" /> {% trans "Queue" %}</a>
 +    <a href="/queue/" title=""><img src="/media/default/img/head-menu-queue.png" alt="" /> {{_("Queue")}}</a>
  </li>
  <li>
 -    <a href="/collector/" title=""><img src="{{ MEDIA_URL }}img/head-menu-collector.png" alt="" /> {% trans "Collector" %}</a>
 +    <a href="/collector/" title=""><img src="/media/default/img/head-menu-collector.png" alt="" /> {{_("Collector")}}</a>
  </li>
  <li>
 -    <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> {% trans "Downloads" %}</a>
 +    <a href="/downloads/" title=""><img src="/media/default/img/head-menu-development.png" alt="" /> {{_("Downloads")}}</a>
  </li>
  <li class="right">
 -    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />{% trans "Logs" %}</a>
 +    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-index.png" alt="" />{{_("Logs")}}</a>
  </li>
  <li class="right">
 -    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-config.png" alt="" />{% trans "Config" %}</a>
 +    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-config.png" alt="" />{{_("Config")}}</a>
  </li>
  {% endblock %}
  {% block pageactions %}
  <ul id="page-actions-more">
 -    <li id="del_finished"><a style="padding: 0; font-weight: bold;" href="#">{% trans "Delete Finished" %}</a></li>
 -    <li id="restart_failed"><a style="padding: 0; font-weight: bold;" href="#">{% trans "Restart Failed" %}</a></li>
 +    <li id="del_finished"><a style="padding: 0; font-weight: bold;" href="#">{{_("Delete Finished")}}</a></li>
 +    <li id="restart_failed"><a style="padding: 0; font-weight: bold;" href="#">{{_("Restart Failed")}}</a></li>
  </ul>
  {% endblock %}
  {% block content %}
 -<div id="load-success" style="opacity: 0; float: right; color: white; background-color: #90ee90; padding: 4px; -moz-border-radius: 5px; border-radius: 5px; font-weight: bold; margin-left: -100%; margin-top: -10px;">{% trans "success" %}</div>
 -<div id="load-failure" style="opacity: 0; float: right; color: white; background-color: #f08080; padding: 4px; -moz-border-radius: 5px; border-radius: 5px; font-weight: bold; margin-left: -100%; margin-top: -10px;">{% trans "failure" %}</div>
 +<div id="load-success" style="opacity: 0; float: right; color: white; background-color: #90ee90; padding: 4px; -moz-border-radius: 5px; border-radius: 5px; font-weight: bold; margin-left: -100%; margin-top: -10px;">{{_("success")}}</div>
 +<div id="load-failure" style="opacity: 0; float: right; color: white; background-color: #f08080; padding: 4px; -moz-border-radius: 5px; border-radius: 5px; font-weight: bold; margin-left: -100%; margin-top: -10px;">{{_("failure")}}</div>
  <div id="load-indicator" style="opacity: 0; float: right; margin-top: -10px;">
 -    <img src="{{ MEDIA_URL }}img/ajax-loader.gif" alt="" style="padding-right: 5px"/>
 -    {% trans "loading" %}
 +    <img src="/media/default/img/ajax-loader.gif" alt="" style="padding-right: 5px"/>
 +    {{_("loading")}}
  </div>
  <ul id="package-list" style="list-style: none; padding-left: 0; margin-top: -10px;">
 @@ -63,17 +61,17 @@ document.addEvent("domready", function(){          <span class="name">{{package.name}}</span>
            
          <span class="buttons" style="opacity:0">
 -        <img title="{% trans "Delete Package" %}" style="cursor: pointer" width="12px" height="12px" src="{{ MEDIA_URL }}img/delete.png" />
 +        <img title="{{_("Delete Package")}}" style="cursor: pointer" width="12px" height="12px" src="/media/default/img/delete.png" />
            
 -        <img title="{% trans "Restart Package" %}" style="margin-left: -10px; cursor: pointer" height="12px" src="{{ MEDIA_URL }}img/arrow_refresh.png" />
 +        <img title="{{_("Restart Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/arrow_refresh.png" />
            
 -        <img title="{% trans "Edit Package" %}" style="margin-left: -10px; cursor: pointer" height="12px" src="{{ MEDIA_URL }}img/pencil.png" />
 +        <img title="{{_("Edit Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/pencil.png" />
            
 -        <img title="{% trans "Move Package to Collector" %}" style="margin-left: -10px; cursor: pointer" height="12px" src="{{ MEDIA_URL }}img/package_go.png" />
 +        <img title="{{_("Move Package to Collector")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/package_go.png" />
          </span>
      </div>
      <div id="children_{{id}}" style="display: none;" class="children">
 -    <span class="child_secrow">{% trans "Folder:" %} <span class="folder">{{package.folder}}</span> | {% trans "Password:"%} <span class="password">{{package.password}}</span> | {% trans "Priority:"%} <span class="prio">{{package.priority}}</span></span>
 +    <span class="child_secrow">{{_("Folder:")}} <span class="folder">{{package.folder}}</span> | {{_("Password:")}} <span class="password">{{package.password}}</span> | {{_("Priority:")}} <span class="prio">{{package.priority}}</span></span>
      <ul id="sort_children_{{id}}" style="list-style: none; padding-left: 0">
      </ul>
      </div>
 diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html index 0ef9ce9f4..69ab39292 100644 --- a/module/web/templates/default/settings.html +++ b/module/web/templates/default/settings.html @@ -1,217 +1,254 @@  {% extends 'default/base.html' %} -{% load i18n %} -{% load contains %} -{% load quotepath %} -{% block title %}{% trans "Config" %} - {{block.super}} {% endblock %} -{% block subtitle %}{% trans "Config" %}{% endblock %} +{% block title %}{{ _("Config") }} - {{ super() }} {% endblock %} +{% block subtitle %}{{ _("Config") }}{% endblock %}  {% block head %} -<script type="text/javascript"> -    window.addEvent('domready', function() -    { -        $$('#toptabs a').addEvent('click', function(e) -        { -            $$('#toptabs a').removeProperty('class'); -            e.target.set('class', 'selected'); - -            $$('#tabs span').removeProperty('class'); -            $('g_'+e.target.get('href').substring(1)).set('class', 'selected'); - -            var firstsel = $$('#tabs span.selected a')[0]; -            firstsel.fireEvent('click', {target: firstsel}); -            return false; +    <script type="text/javascript" src="/media/default/js/tinytab.js"></script> +    <script type="text/javascript" src="/media/default/js/MooDropMenu.js"></script> +    <script type="text/javascript" src="/media/default/js/settings_ui.js"></script> + +    <script type="text/javascript"> +        window.addEvent('domready', function() { + +            account_dialog = new Fx.Tween($("account_box")); + +            new TinyTab($$('#toptabs li a'), $$('#tabs-body > span')); + +            $$('ul.nav').each(function(nav) { +                var dropMenu = new MooDropMenu(nav, { +                            onOpen: function(el) { +                                el.fade('in') +                            }, +                            onClose: function(el) { +                                el.fade('out'); +                            }, +                            onInitialize: function(el) { +                                el.fade('hide').set('tween', {duration:500}); +                            } +                        }); +            }); + +            new SettingsUI();          }); -	$$('#tabs a').addEvent('click', function(e) -        { -            $$('#tabs a').removeProperty('class'); -            e.target.set('class', 'selected'); -            $$('div.tabContent').set('class', 'tabContent hide'); -            $(e.target.get('href').substring(1)).set('class', 'tabContent'); -            return false; -        }); - -        $$('#toptabs a')[0].set('class', 'selected'); -        $$('#tabs span')[0].set('class', 'selected'); - -        var firstsel = $$('#tabs span.selected a')[0]; -        firstsel.fireEvent('click', {target: firstsel}); -    }); - -     -</script> +    </script>  {% endblock %}  {% block menu %} -<li> -    <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a> -</li> -<li> -    <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-queue.png" alt="" /> {% trans "Queue" %}</a> -</li> -<li> -    <a href="/collector/" title=""><img src="{{ MEDIA_URL }}img/head-menu-collector.png" alt="" /> {% trans "Collector" %}</a> -</li> -<li> -    <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> {% trans "Downloads" %}</a> -</li> -<li class="right"> -    <a href="/logs/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />{% trans "Logs" %}</a> -</li> -<li class="right selected"> -    <a href="/settings/"  class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-config.png" alt="" />{% trans "Config" %}</a> -</li> +    <li> +        <a href="/" title=""><img src="/media/default/img/head-menu-home.png" alt=""/> {{ _("Home") }}</a> +    </li> +    <li> +        <a href="/queue/" title=""><img src="/media/default/img/head-menu-queue.png" alt=""/> {{ _("Queue") }}</a> +    </li> +    <li> +        <a href="/collector/" title=""><img src="/media/default/img/head-menu-collector.png" +                                            alt=""/> {{ _("Collector") }}</a> +    </li> +    <li> +        <a href="/downloads/" title=""><img src="/media/default/img/head-menu-development.png" +                                            alt=""/> {{ _("Downloads") }}</a> +    </li> +    <li class="right"> +        <a href="/logs/" class="action index" accesskey="x" rel="nofollow"><img +                src="/media/default/img/head-menu-index.png" alt=""/>{{ _("Logs") }}</a> +    </li> +    <li class="right selected"> +        <a href="/settings/" class="action index" accesskey="x" rel="nofollow"><img +                src="/media/default/img/head-menu-config.png" alt=""/>{{ _("Config") }}</a> +    </li>  {% endblock %}  {% block content %} -     -<ul id="toptabs" class="tabs"> -    {% for configname, config in conf.iteritems  %} -        <li><a href="#{{configname}}">{{configname}}</a></li> -    {% endfor %} -</ul> - -<div id="tabsback"> -    <ul id="tabs" class="tabs"> -        {% for configname, config in conf.iteritems  %} -            <span id="g_{{configname}}"> -				{% ifnotequal configname "Accounts" %} -					{% for skey, section in config.iteritems  %} -					    <li><a href="#{{configname}}{{skey}}">{{section.desc}}</a></li> -					{% endfor %} -				{% else %} -					{% for skey, section in config.iteritems  %} -					    <li><a href="#{{configname}}{{skey}}">{{skey}}</a></li> -					{% endfor %} -				{% endifnotequal %} -            </span> -        {% endfor %} + +    <ul id="toptabs" class="tabs"> +            <li><a class="selected" href="#">{{ _("General") }}</a></li> +            <li><a href="#">{{ _("Plugins") }}</a></li> +            <li><a href="#">{{ _("Accounts") }}</a></li>      </ul> -</div> -<form id="horizontalForm" action="" method="POST" autocomplete="off"> -{% for configname, config in conf.iteritems  %} -	{% ifnotequal configname "Accounts" %} -    {% for skey, section in config.iteritems  %} -        <div class="tabContent" id="{{configname}}{{skey}}"> -            <table class="settable"> -                {% for okey, option in section.items %} -                    {% ifnotequal okey "desc" %} -                        <tr> -                            <td><label for="{{configname}}|{{skey}}|{{okey}}" style="color:#424242;">{{option.desc}}:</label></td> -                            <td> -                                {% ifequal option.type "bool" %} -                                    <select id="{{skey}}|{{okey}}" name="{{configname}}|{{skey}}|{{okey}}"> -                                        <option {% if option.value %} selected="selected" {% endif %}value="True">{% trans "on" %}</option> -                                        <option {% if not option.value %} selected="selected" {% endif %}value="False">{% trans "off" %}</option> -                                    </select> -                                {% else %} -                                    {% if option.type|contains:";" %} -                                        <select id="{{skey}}|{{okey}}" name="{{configname}}|{{skey}}|{{okey}}"> -                                            {% for entry in option.list %} -                                                <option {% ifequal option.value entry %} selected="selected" {% endifequal %}>{{entry}}</option> -                                            {% endfor %} -                                        </select> -                                    {% else %} -                                        {% ifequal option.type "folder" %} -                                            <input name="{{configname}}|{{skey}}|{{okey}}" type="text" id="{{skey}}|{{okey}}" value="{{option.value}}"/> -		                                    <input name="browsebutton" type="button" onclick="ifield = document.getElementById('{{skey}}|{{okey}}'); pathchooser = window.open('{% if option.value %}{% url path option.value|quotepath %}{% else %}{% url pathroot %}{% endif %}', 'pathchooser', 'scrollbars=yes,toolbar=no,menubar=no,statusbar=no,width=650,height=300'); pathchooser.ifield = ifield; window.ifield = ifield;" value="{% trans "Browse" %}"/> -                                        {% else %} -                                            {% ifequal option.type "file" %} -                                            <input name="{{configname}}|{{skey}}|{{okey}}" type="text" id="{{skey}}|{{okey}}" value="{{option.value}}"/> -		                                    <input name="browsebutton" type="button" onclick="ifield = document.getElementById('{{skey}}|{{okey}}'); filechooser = window.open('{% if option.value %}{% url file option.value|quotepath %}{% else %}{% url fileroot %}{% endif %}', 'filechooser', 'scrollbars=yes,toolbar=no,menubar=no,statusbar=no,width=650,height=300'); filechooser.ifield = ifield; window.ifield = ifield;" value="{% trans "Browse" %}"/> -                                            {% else %} -                                                <input id="{{skey}}|{{okey}}" name="{{configname}}|{{skey}}|{{okey}}" type="text" value="{{option.value}}"/> -                                            {% endifequal %} -                                        {% endifequal %} -                                    {% endif %} -                                {% endifequal %} -                            </td> -                        </tr> -                    {% endifnotequal %} -                {% endfor %} -            </table> -        </div> -    {% endfor %} -	{% else %} -	<!-- Accounts -->	 -	{% for plugin, accounts in config.iteritems  %} -        <div class="tabContent" id="{{configname}}{{plugin}}"> -            <table class="settable"> -                {% for account in accounts %}          + +    <div id="tabsback" style="height: 20px; padding-left: 150px; color: white; font-weight: bold;"> + +    </div> + +        <span id="tabs-body"> +            <!-- General --> +            <span id="general" class="active tabContent"> +                <ul class="nav tabs"> +                    <li class> +                        <a>Menu</a> +                        <ul id="general-menu"> +                            {% for entry,name in conf.general %} +                                <nobr> +                                    <li id="general|{{ entry }}">{{ name }}</li> +                                </nobr> +                                <br> +                            {% endfor %} +                        </ul> +                    </li> +                </ul> + +                <form id="general_form" action="" method="POST" autocomplete="off"> +                    <span id="general_form_content"> +                    <br> +                    <h3>   {{ _("Choose a section from the menu") }}</h3> +                    <br> +                    </span> + +                  <input id="general|submit" class="styled_button" type="submit" value="{{_("Submit")}}"/> +                </form> +            </span> + +            <!-- Plugins --> +            <span id="plugins" class="tabContent"> +                <ul class="nav tabs"> +                    <li class> +                        <a>Menu</a> +                        <ul id="plugin-menu"> +                            {% for entry,name in conf.plugin %} +                                <nobr> +                                    <li id="plugin|{{ entry }}">{{ name }}</li> +                                </nobr> +                                <br> +                            {% endfor %} +                        </ul> +                    </li> +                </ul> + + +                 <form id="plugin_form" action="" method="POST" autocomplete="off"> + +                     <span id="plugin_form_content"> +                    <br> +                    <h3>   {{ _("Choose a section from the menu") }}</h3> +                    <br> +                         </span> +                     <input id="plugin|submit" class="styled_button" type="submit" value="{{_("Submit")}}"/> +                </form> + +            </span> + +            <!-- Accounts --> +            <span id="accounts" class="tabContent"> +            <form id="account_form" action="/json/update_accounts" method="POST"> + +                        <table class="settable wide"> + +                        <thead>                          <tr> -                            <td><label for="{{configname}}|{{plugin}}|password;{{account.login}}" style="color:#424242;">{{account.login}}:</label></td> -                            <td> -							<input id="{{plugin}}|password;{{account.login}}" name="{{configname}}|{{plugin}}|password;{{account.login}}" type="password" value="{{account.password}}" size="14"/> -                            </td> -                            <td> -                            {% trans "Status:" %} -                            {% if account.valid %} -                                <span style="font-weight: bold; color: #006400;"> -                                {% trans "valid"  %} -                            {% else %} -                                <span style="font-weight: bold; color: #8b0000;"> -                                {% trans "not valid"  %} -                            {% endif %} -                            </span> -                            </td> -                            <td> -                            {% trans "Valid until:" %} -                            <span style="font-weight: bold;"> -                            {{ account.validuntil }} -                            </span> -                            </td> -                            <td> -                            {% trans "Traffic left:" %} -                            <span style="font-weight: bold;"> -                            {{ account.trafficleft }} -                            </span> -                            </td> -                            <td> -                            {% trans "Time:" %} -                            <input id="{{configname}}|{{plugin}}|time;{{account.login}}" name="{{configname}}|{{plugin}}|time;{{account.login}}" type="text" size="7" value="{{account.time}}"/> -                            </td> -                            <td> -                                {% trans "Delete? " %} -                                <input id="{{configname}}|{{plugin}}|delete;{{account.login}}" name="{{configname}}|{{plugin}}|delete;{{account.login}}" type="checkbox" value="True"/> -                            </td> +                            <th>{{ _("Plugin") }}</th> +                            <th>{{ _("Name") }}</th> +                            <th>{{ _("Password") }}</th> +                            <th>{{ _("Status") }}</th> +                            <th>{{ _("Premium") }}</th> +                            <th>{{ _("Valid until") }}</th> +                            <th>{{ _("Traffic left") }}</th> +                            <th>{{ _("Time") }}</th> +                            <th>{{ _("Delete?") }}</th>                          </tr> -												 -                {% endfor %} -				<tr><td> </td></tr> -				 -				<tr> -					<td><label for="{{configname}}|{{plugin}}|{{account.login}}" style="color:#424242;">{% trans "New account:" %}</label></td> -                             -					<td> -						<input id="{{plugin}}|newacc" name="{{configname}}|{{plugin}}|newacc" type="text" size="14"/> -					</td> -				</tr> -				<tr> -					<td><label for="{{configname}}|{{plugin}}|{{account.name}}" style="color:#424242;">{% trans "New password:" %}</label></td> -                             -					<td> -						<input id="{{configname}}|{{plugin}}" name="{{configname}}|{{plugin}}|newpw" type="password" size="14"/> -					</td> -				</tr>	 -				 -            </table> -        </div> -    {% endfor %} -	 -	{% endifnotequal %} -{% endfor %} -{% if conf %} -<input class="submit" type="submit" value="{% trans "Submit" %}" /> -</form> +                        </thead> + +                         {% for plugin, accounts in conf.accs.iteritems() %} + + +                            {% for account in accounts %} +                                       <tr> +                                            <td> +                                                <span style="padding:5px">{{ plugin }}</span> +                                            </td> +                                        +                                           <td><label for="{{plugin}}|password;{{account.login}}" +                                                      style="color:#424242;">{{ account.login }}</label></td> +                                           <td> +                                               <input id="{{plugin}}|password;{{account.login}}" +                                                      name="{{plugin}}|password;{{account.login}}" +                                                      type="password" value="{{account.password}}" size="14"/> +                                           </td> +                                           <td> +                                               {% if account.valid %} +                                                   <span style="font-weight: bold; color: #006400;"> +                                                   {{ _("valid") }} +                                               {% else %} +                                                   <span style="font-weight: bold; color: #8b0000;"> +                                                   {{ _("not valid") }} +                                               {% endif %} +                                               </span> +                                           </td> +                                          <td> +                                               {% if account.premium %} +                                                   <span style="font-weight: bold; color: #006400;"> +                                                   {{ _("yes") }} +                                               {% else %} +                                                   <span style="font-weight: bold; color: #8b0000;"> +                                                   {{ _("no") }} +                                               {% endif %} +                                               </span> +                                           </td> +                                           <td> +                                   <span style="font-weight: bold;"> +                                   {{ account.validuntil }} +                                   </span> +                                           </td> +                                           <td> +                                   <span style="font-weight: bold;"> +                                   {{ account.trafficleft }} +                                   </span> +                                           </td> +                                           <td> +                                               <input id="{{plugin}}|time;{{account.login}}" +                                                      name="{{plugin}}|time;{{account.login}}" type="text" +                                                      size="7" value="{{account.time}}"/> +                                           </td> +                                           <td> +                                               <input id="{{plugin}}|delete;{{account.login}}" +                                                      name="{{plugin}}|delete;{{account.login}}" type="checkbox" +                                                      value="True"/> +                                           </td> +                                       </tr> +                                    {% endfor %} +                                {% endfor %} +                            </table> + + +            <button id="account_submit" type="submit" class="styled_button">{{_("Submit")}}</button> +            <button id="account_add" style="margin-left: 0" type="submit" class="styled_button">{{_("Add")}}</button> +            </form> +            </span> +        </span> + + +<div id="account_box" class="myform window_box" style="z-index: 2"> +<form id="add_account_form" action="/json/add_account" method="POST" enctype="multipart/form-data"> +<h1>{{_("Add Account")}}</h1> +<p>{{_("Enter your account data to use premium features.")}}</p> +<label for="account_login">{{_("Login")}} +<span class="small">{{_("Your username.")}}</span> +</label> +<input id="account_login" name="account_login" type="text" size="20" /> + +<label for="account_password">{{_("Password")}} +<span class="small">The password for this account.</span> +</label> +<input id="account_password" name="account_password" type="text" size="20" /> + +<label for="account_type">{{_("Type")}} +<span class="small">{{_("Choose the hoster for your account.")}}</span> +</label> +    <select name=account_type id="account_type"> +        {% for type in conf.accs.iterkeys()|sort %} +            <option value="{{ type }}">{{ type }}</option> +        {% endfor %} +    </select> -<br> -{% for message in errors %} -<b>{{message}}</b><br> -{% endfor %} -{% endif %} +<button id="account_add_button" type="submit">{{_("Add")}}</button> +<button id="account_reset" style="margin-left: 0" type="reset">{{_("Reset")}}</button> +<div class="spacer"></div> +</form> + +</div>  {% endblock %} diff --git a/module/web/templates/default/settings_item.html b/module/web/templates/default/settings_item.html new file mode 100644 index 000000000..593050bd2 --- /dev/null +++ b/module/web/templates/default/settings_item.html @@ -0,0 +1,45 @@ +<table class="settable"> +    {% for okey, option in section.iteritems() %} +        {% if okey != "desc" %} +            <tr> +                <td><label for="{{skey}}|{{okey}}" +                           style="color:#424242;">{{ option.desc }}:</label></td> +                <td> +                    {% if option.type == "bool" %} +                        <select id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}"> +                            <option {% if option.value %} selected="selected" +                                                          {% endif %}value="True">{{ _("on") }}</option> +                            <option {% if not option.value %} selected="selected" +                                                              {% endif %}value="False">{{ _("off") }}</option> +                        </select> +                        {% elif ";" in option.type %} +                        <select id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}"> +                            {% for entry in option.list %} +                                <option {% if option.value == entry %} +                                        selected="selected" {% endif %}>{{ entry }}</option> +                            {% endfor %} +                        </select> +                        {% elif option.type == "folder" %} +                        <input name="{{skey}}|{{okey}}" type="text" +                               id="{{skey}}|{{okey}}" value="{{option.value}}"/> +                        <input name="browsebutton" type="button" +                               onclick="ifield = document.getElementById('{{skey}}|{{okey}}'); pathchooser = window.open('{% if option.value %}{{ "/pathchooser/" + option.value|quotepath }}{% else %}{{ pathroot }}{% endif %}', 'pathchooser', 'scrollbars=yes,toolbar=no,menubar=no,statusbar=no,width=650,height=300'); pathchooser.ifield = ifield; window.ifield = ifield;" +                               value="{{_("Browse")}}"/> +                        {% elif option.type == "file" %} +                        <input name="{{skey}}|{{okey}}" type="text" +                               id="{{skey}}|{{okey}}" value="{{option.value}}"/> +                        <input name="browsebutton" type="button" +                               onclick="ifield = document.getElementById('{{skey}}|{{okey}}'); filechooser = window.open('{% if option.value %}{{ "/filechooser/" + option.value|quotepath }}{% else %}{{ fileroot }}{% endif %}', 'filechooser', 'scrollbars=yes,toolbar=no,menubar=no,statusbar=no,width=650,height=300'); filechooser.ifield = ifield; window.ifield = ifield;" +                               value="{{_("Browse")}}"/> +                        {% elif option.type == "password" %} +                        <input id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}" +                               type="password" value="{{option.value}}"/> +                    {% else %} +                        <input id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}" +                               type="text" value="{{option.value}}"/> +                    {% endif %} +                </td> +            </tr> +        {% endif %} +    {% endfor %} +</table>
\ No newline at end of file diff --git a/module/web/templates/default/setup.html b/module/web/templates/default/setup.html new file mode 100644 index 000000000..39ef6f1e8 --- /dev/null +++ b/module/web/templates/default/setup.html @@ -0,0 +1,13 @@ +{% extends 'default/base.html' %} + +{% block title %}{{ _("Setup") }} - {{ super() }} {% endblock %} +{% block subtitle %}{{ _("Setup") }}{% endblock %} +{% block headpanel %}Welcome to pyLoad{% endblock %} +{% block menu %} +    <li style="height: 25px"> <!-- Needed to get enough margin --> +    </li> +{% endblock %} + +{% block content %} +    Comming Soon. +{% endblock %}
\ No newline at end of file diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index 3613c6df7..734745887 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -1,4 +1,3 @@ -{% load i18n %}
  <iframe id="upload_target" name="upload_target" src="" style="display: none; width:0;height:0"></iframe>
  <div id="add_bg" style="filter:alpha(opacity:80);KHTMLOpacity:0.80;MozOpacity:0.80;opacity:0.80; background:#000; width:100%; height: 100%; position:fixed; top:0; left:0; display:none;"> </div>
  <!--<div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;">-->
 @@ -6,39 +5,39 @@    <!--<div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div>-->
  <div id="add_box" class="myform">
  <form id="add_form" action="/json/add_package" method="POST" enctype="multipart/form-data">
 -<h1>{% trans "Add Package" %}</h1>
 -<p>{% trans "Paste your links or upload a container." %}</p>
 -<label for="add_name">{% trans "Name" %}
 -<span class="small">{% trans "The name of the new package." %}</span>
 +<h1>{{_("Add Package")}}</h1>
 +<p>{{_("Paste your links or upload a container.")}}</p>
 +<label for="add_name">{{_("Name")}}
 +<span class="small">{{_("The name of the new package.")}}</span>
  </label>
  <input id="add_name" name="add_name" type="text" size="20" />
 -<label for="add_links">{% trans "Links" %}
 -<span class="small">{% trans "Paste your links here" %}</span>
 +<label for="add_links">{{_("Links")}}
 +<span class="small">{{_("Paste your links here")}}</span>
  </label>
  <textarea rows="5" name="add_links" id="add_links"></textarea>
 -<label for="add_password">{% trans "Password" %}
 -    <span class="small">{% trans "Password for RAR-Archive" %}</span>
 +<label for="add_password">{{_("Password")}}
 +    <span class="small">{{_("Password for RAR-Archive")}}</span>
  </label>
  <input id="add_password" name="add_password" type="text" size="20">
 -<label>{% trans "File" %}
 -<span class="small">{% trans "Upload a container." %}</span>
 +<label>{{_("File")}}
 +<span class="small">{{_("Upload a container.")}}</span>
  </label>
  <input type="file" name="add_file" id="add_file"/>
 -<label for="add_dest">{% trans "Destination" %}
 +<label for="add_dest">{{_("Destination")}}
  </label>
  <span class="cont">
 -    {% trans "Queue" %}
 +    {{_("Queue")}}
      <input type="radio" name="add_dest" id="add_dest" value="1" checked="checked"/>
 -    {% trans "Collector" %}
 +    {{_("Collector")}}
      <input type="radio" name="add_dest" id="add_dest2" value="0"/>
  </span>
 -<button type="submit">{% trans "Add Package" %}</button>
 -<button id="add_reset" style="margin-left:0;" type="reset">{% trans "Reset" %}</button>
 +<button type="submit">{{_("Add Package")}}</button>
 +<button id="add_reset" style="margin-left:0;" type="reset">{{_("Reset")}}</button>
  <div class="spacer"></div>
  </form>
 | 
