Commits

Antonios E Garnelis  committed a4207a6

improve add translation UI

  • Participants
  • Parent commits e6e62bf

Comments (0)

Files changed (3)

File transifex/templates/resources/resource_detail.html

 
         {% if request.user.is_authenticated %}
         $("#new_translation1").click( function (){
-            $("#new_translation_box1").toggle();
+            $("#new_translation_box1").slideToggle();
         });
 
         $("#start_new_translation").click( function() {
   </dl>
 </div>
 
-
+{% get_permission "project_perm.submit_translations" for request.user and resource.project,1 as "can_submit_translation" %}
+{% get_permission "project_perm.maintain" for request.user and resource.project as "is_maintainer" %}
 <div class="separate-header  clearfix">
 	<h3  class="sh-label">{% blocktrans with resource.available_languages|length as num_of_langs %}Available languages ({{ num_of_langs }}){% endblocktrans %}</h3>
+	{% if can_submit_translation and resource.accept_translations or is_maintainer %}  
+  <div class="separate-buttons"><a id="new_translation1" class="i16 nude-button add tipsy_enable" title="{% blocktrans %}If you cannot see your language, click the button below to translate( You must belong to a language team of this project, to be able to translate! ){% endblocktrans %}" href="#">{% trans "Add new translation" %}</a></div>
+	{% endif %}
 </div>
 
+
 <div class="list clear">
+
+
+{% if can_submit_translation and resource.accept_translations or is_maintainer %}
+
+<div id="new_translation_box1" class="no-display">
+
+{% comment %}
+    I kept this in order to remember to fix the languages in the templatetags.
+    The change should respect the below permissions!!!
+
+    <select name="translation_languages" class="language">
+        <option value="">{% trans "Select Language" %}</option>
+        {% if is_maintainer or request.user.is_superuser %}
+          {% for language in languages %}
+              <option value="{{ language.code }}">{{ language.name }}</option>
+          {% endfor %}
+        {% else %}
+          {% for team in user_teams %}
+              <option value="{{ team.language.code }}">{{ team.language.name }}</option>
+          {% endfor %}
+        {% endif %}
+    </select>
+{% endcomment %}
+
+{% upload_resource_translation_button request resource '' 'button-global' 'True' %}
+</div>
+
+{% endif %}
+
+
 <table class="stat_table_font stats_table highlighted tablesorter_resource" style="clear:both;margin-top:0.5em;width:99%;margin-left:auto;margin-right:auto;">
   <thead>
   <tr>
 
 {% endcache %}
 
-
-{% get_permission "project_perm.submit_translations" for request.user and resource.project,1 as "can_submit_translation" %}
-{% get_permission "project_perm.maintain" for request.user and resource.project as "is_maintainer" %}
-{% if can_submit_translation and resource.accept_translations or is_maintainer %}
-
-<p class="i16 tip" style="font-size:85%">
-{% blocktrans %}If you cannot see your language, click the button below to translate.<span class="note">( You must belong to a language team of this project, to be able to translate! )</span>{% endblocktrans %}
-</p>
-
-<div id="new_translation_box1">
-
-{% comment %}
-    I kept this in order to remember to fix the languages in the templatetags.
-    The change should respect the below permissions!!!
-
-    <select name="translation_languages" class="language">
-        <option value="">{% trans "Select Language" %}</option>
-        {% if is_maintainer or request.user.is_superuser %}
-          {% for language in languages %}
-              <option value="{{ language.code }}">{{ language.name }}</option>
-          {% endfor %}
-        {% else %}
-          {% for team in user_teams %}
-              <option value="{{ team.language.code }}">{{ team.language.name }}</option>
-          {% endfor %}
-        {% endif %}
-    </select>
-{% endcomment %}
-
-{% upload_resource_translation_button request resource '' 'button-global' 'True' %}
-</div>
-<p style="text-align:center;padding-top:1em">
-  <a id="new_translation1" class="buttonized i16 add">{% trans "Add Translation" %}</a>
-</p>
-{% endif %}
-
 </div>
 
 </div>

File transifex/templates/resources/upload_create_resource_form.html

 <div id="create_new_resource_form" class="generic_form" {% if not display_form %}style="display:none;"{% endif %}>
 
 
-		<span src="{{ STATIC_URL }}images/icons/help.png" class="txf-helptext tipsy_enable right" title="  {% blocktrans %}
-	  Create a resource by selecting a source language and uploading a source translation file from your workstation, such as an English POT file.
-	  Transifex will analyze the file, extract the strings from inside it, and create your resource based on these.
-	  {% endblocktrans %}">?</span>
+	<span src="{{ STATIC_URL }}images/icons/help.png" class="txf-helptext tipsy_enable right" title="  {% blocktrans %}
+  Create a resource by selecting a source language and uploading a source translation file from your workstation, such as an English POT file.
+  Transifex will analyze the file, extract the strings from inside it, and create your resource based on these.
+  {% endblocktrans %}">?</span>
 
 
  <form  id="create-resource-submit" action='' method='post' enctype="multipart/form-data" class="tx-form dual houdini">

File transifex/templates/resources/upload_resource_translation_button.html

 {% load compress %}
 
 {% if create %}
-<div id="upload_resource_translation_button" class="generic_form">
+<div id="upload_resource_translation_button" class="clearfix tx-form">
   <form action='' method='POST' enctype="multipart/form-data">
     {% csrf_token %}
-    <p>
+    <div class="left">
       {{ resource_translation_form.target_language.label }}:
       <span class="fieldp" id="target_language_span">
         {{ resource_translation_form.target_language }}
       </span>
-    </p>
-    <p>
+    </div>
+    <div class="left" style="width:300px;margin:0.4em 2em 0.4em 4em;">
       <span id="upload_button_create" class="i16 send_file buttonized">
         {% trans "Upload file" %}
       </span>
-      {% trans "or" %}
-      <a id="start_new_translation" class="i16 buttonized action">
+      <span>{% trans "&nbsp;or&nbsp;" %}</span>
+      <span id="start_new_translation" class="i16 buttonized action">
         {% trans "Translate Online" %}
-      </a>
-    </p>
+      </span>
+    </div>
   </form>
 </div>