Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved "Add another languages?" to librarian mode.

  • Loading branch information...
commit 9b8719a7655b135f39491333959d4742fe1a8847 1 parent ec56022
@anandology anandology authored
View
16 openlibrary/plugins/upstream/templates/books/edit/edition.html
@@ -15,7 +15,7 @@
<input name="languages--$i" class="language language-autocomplete" type="text" id="language-$i" value="$language.name" style="width:300px!important;"/>
<input name="edition--languages--$i--key" type="hidden" id="language-$i-key" value="$language.key" />
<a href="javascript:;" class="remove red plain hidden" title="$_('Remove this language')">[x]</a>
- <br/><a href="javascript:;" class="add small hidden">Add another language?</a>
+ <br/><a href="javascript:;" class="add small librarian hidden">Add another language?</a>
</div>
<script type="text/javascript">
@@ -28,8 +28,14 @@
else {
\$("#languages a.remove").hide();
}
- \$("#languages a.add:not(:last)").hide();
- \$("#languages a.add:last").show();
+
+ $# The add link should be made visible only if both librarian-on and it is the last element.
+ \$("#languages a.add:not(:last)").attr("style", "display: none");
+ \$("#languages a.add:last").attr("style", "");
+
+ if (\$("#translated-from").hasClass("librarian-on")) {
+ \$("#languages a.add:last").addClass("librarian-on");
+ }
}
update_visible();
@@ -313,7 +319,7 @@
$:render_language(0, storage(name="", key=""))
</div>
- <div class="formElement librarian hidden">
+ <div class="formElement librarian hidden" id="translated-from">
<div class="label">
<label for="is-translation">$_("Is it a translation of another book?")</label>
<span class="tip"></span>
@@ -682,7 +688,7 @@
\$("a#libraryMode").click(function(event) {
event.preventDefault();
- \$(".librarian").toggle();
+ \$(".librarian").toggleClass("librarian-on");
\$(this).parent().find('#modeToggle').toggleText("Turn on","Exit");
});
});
View
5 static/css/master.css
@@ -314,6 +314,11 @@ div.formDivider {float:left;width:25px;min-height:100px;}
.librarian {padding:0 10px 10px 10px; border-left: 10px solid #748d36; margin-bottom:20px;}
.librarian input[type=text],.librarian textarea {width:798px!important;}
.librarianFlip {position:relative;float:right;z-index:1000;padding:3px 5px; border-left: 10px solid #748d36;}
+
+.librarian-on {
+ display: block;
+}
+
.formBackLeft {float:left;width:670px;}
.formBackRight {float:left;width:120px;padding:10px 10px 15px 30px;text-align:center;}
#message {font-family: "Lucida Grande", "Trebuchet MS", Geneva, Helvetica, sans-serif;font-size:14px;background-color:##fffdcd;padding:15px;}
Please sign in to comment.
Something went wrong with that request. Please try again.