Commit 1beee8ec by Anton Sudak

Update styles for all file helpers

parent 74f3aa76
......@@ -5,7 +5,6 @@
label: String,
placeholder: String,
helperText: String = null,
width: Integer = 300,
additionalOptions: Html = Html.apply("")
)(implicit handler: views.html.helper.FieldConstructor)
......@@ -16,7 +15,7 @@
<input type="hidden" name="@{formKey + ".id"}" value="@{mstring}" />
}
<div >
<div>
@helper.input(
theForm(formKey),
'id -> (formKey),
......@@ -25,14 +24,20 @@
'_label -> label,
'placeholder -> ""
) { (id, name, value, args) =>
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) style="width: @{width}px;display:inline;" />
<a class="btn btn-primary moxman-btn-browse" data-input_id="@id" href="#"> Browse </a>
<div class="input-group">
<input id="@id" name="@name" value="@value" @toHtmlArgs(args) />
<span class="input-group-btn">
<a class="btn btn-primary moxman-btn-browse" data-input_id="@id" href="#">
Browse
</a>
</span>
</div>
@if(helperText != null) {
<span class="help-block">@helperText</span>
}
@if(!value.isEmpty && (value.get.toLowerCase.endsWith(".png") || value.get.toLowerCase.endsWith(".gif") || value.get.toLowerCase.endsWith(".jpg") || value.get.toLowerCase.endsWith(".jpeg"))) {
<span class="help-block">
<img src="@value" alt="Vorschau" title="Vorschau" style="max-width: 640px" />
<img src="@value" style="max-width: 640px" />
</span>
}
}
......
......@@ -6,7 +6,6 @@
label: String,
placeholder: String,
helperText: String = null,
width: Integer = 300,
additionalOptions: Html = Html.apply(""),
languages: Seq[String] = null
)(implicit handler: views.html.helper.FieldConstructor)
......@@ -14,28 +13,32 @@
@import ch.insign.cms.models.CMS
@if(mstring != null && mstring.getId != null) {
<input type="hidden" name="@{formKey + ".id"}" value="@{mstring.getId}" />
<input type="hidden" name="@{formKey + ".id"}" value="@{mstring.getId}" >
}
@defining(Option(languages).filter(_.nonEmpty).getOrElse(CMS.getConfig.frontendLanguages.toSeq)) { langs =>
@for(lang <- langs) {
<div mstring-lang="@lang">
@helper.input(
theForm(formKey + "." + lang),
'id -> (formKey + "_" + lang),
'name -> (formKey + "." + lang),
'class -> "form-control",
'_label -> label,
'placeholder -> ""
) { (id, name, value, args) =>
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) style="width: @{width}px;display:inline;" />
<button type="button" class="btn btn-primary image-upload" data-field="#@id">
Browse
</button>
@if(helperText != null){
<span class="help-block">@helperText</span>
@helper.input(
theForm(formKey + "." + lang),
'id -> (formKey + "_" + lang),
'name -> (formKey + "." + lang),
'class -> "form-control",
'_label -> label,
'placeholder -> ""
) { (id, name, value, args) =>
<div class="input-group">
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) >
<span class="input-group-btn">
<button type="button" class="btn btn-primary image-upload" data-field="#@id">
@Messages("btn.browse")
</button>
</span>
</div>
@if(helperText != null){
<span class="help-block">@helperText</span>
}
}
}
</div>
}
}
}
\ No newline at end of file
......@@ -6,7 +6,6 @@
label: String,
placeholder: String,
helperText: String = null,
width: Integer = 300,
additionalOptions: Html = Html.apply(""),
languages: Seq[String] = null
)(implicit handler: views.html.helper.FieldConstructor)
......@@ -18,26 +17,33 @@
}
@defining(Option(languages).filter(_.nonEmpty).getOrElse(CMS.getConfig.frontendLanguages.toSeq)) { langs =>
@for(lang <- langs) {
<div mstring-lang="@lang">
@helper.input(
theForm(formKey + "." + lang),
'id -> (formKey + "_" + lang),
'name -> (formKey + "." + lang),
'class -> "form-control",
'_label -> label,
'placeholder -> ""
) { (id, name, value, args) =>
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) style="width: @{width}px;display:inline;" />
<a class="btn btn-primary moxman-btn-browse" data-input_id="@id" href="#"> Browse </a>
@if(helperText != null) {
<span class="help-block">@helperText</span>
@for(lang <- langs) {
<div mstring-lang="@lang">
@helper.input(
theForm(formKey + "." + lang),
'id -> (formKey + "_" + lang),
'name -> (formKey + "." + lang),
'class -> "form-control",
'_label -> label,
'placeholder -> ""
) { (id, name, value, args) =>
<div class="input-group">
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) />
<span class="input-group-btn">
<a class="btn btn-primary moxman-btn-browse" data-input_id="@id" href="#">
@Messages("btn.browse")
</a>
</span>
</div>
@if(helperText != null) {
<span class="help-block">@helperText</span>
}
@if(!value.isEmpty && (value.get.toLowerCase.endsWith(".png") || value.get.toLowerCase.endsWith(".gif") || value.get.toLowerCase.endsWith(".jpg") || value.get.toLowerCase.endsWith(".jpeg"))) {
<span class="help-block">
<img src="@value" alt="Vorschau" title="Vorschau" style="max-width: 640px" />
</span>
}
}
@if(!value.isEmpty && (value.get.toLowerCase.endsWith(".png") || value.get.toLowerCase.endsWith(".gif") || value.get.toLowerCase.endsWith(".jpg") || value.get.toLowerCase.endsWith(".jpeg"))) {
<span class="help-block">
<img src="@value" alt="Vorschau" title="Vorschau" style="max-width: 640px" />
</span>
}
}
</div>
}}
</div>
}
}
......@@ -8,14 +8,14 @@
label: String,
placeholder: String,
helperText: String = null,
width: Integer = 300,
additionalOptions: Html = Html.apply(""))(implicit handler: views.html.helper.FieldConstructor)
additionalOptions: Html = Html.apply("")
)(implicit handler: views.html.helper.FieldConstructor)
@* [Optionally]MString input for the file manager named "Responsive" *@
@* ---must be used in couple with fancybox webjar--- *@
@if(mstring != null && mstring.getId != null) {
<input type="hidden" name="@{formKey + ".id"}" value="@{mstring.getId}" />
<input type="hidden" name="@{formKey + ".id"}" value="@{mstring.getId}" >
}
@* TODO change getAllLanguages() to CMS.getConfig.getFrontEndLanguages() after merging with PLAY-81 *@
......@@ -29,16 +29,18 @@
'_label -> label,
'placeholder -> ""
) { (id, name, value, args) =>
<div class="input-group">
<input id="@id" name="@name" value="@value" @toHtmlArgs(args) />
<span class="input-group-btn">
<a class="btn btn-primary iframe-btn"
type="button"
data-width="900"
data-height="500"
href="@{CMS.getConfig.getResponsiveFileManagerUrlPrefix}dialog.php?type=2&field_id=@id&relative_url=1&crossdomain=1"> Browse </a>
</span>
</div>
<div class="input-group">
<input id="@id" name="@name" value="@value" @toHtmlArgs(args) />
<span class="input-group-btn">
<a class="btn btn-primary iframe-btn"
type="button"
data-width="900"
data-height="500"
href="@{CMS.getConfig.getResponsiveFileManagerUrlPrefix}dialog.php?type=2&field_id=@id&relative_url=1&crossdomain=1">
@Messages("btn.browse")
</a>
</span>
</div>
@if(helperText != null) {
<span class="help-block">@helperText</span>
......
......@@ -2,6 +2,7 @@ btn.cancel=Cancel
btn.save=Save
btn.edit=Edit
btn.delete=Delete
btn.browse=Browse
modal.close.btn=Close
modal.cancel.btn=Cancel
modal.delete.btn=Delete
......
@(theForm: Form[_], formKey: String, label: String, helperText: String = null, width: Integer=300, additionalOptions: Html = Html.apply(""))
@(theForm: Form[_], formKey: String, label: String, helperText: String = null, additionalOptions: Html = Html.apply(""))
@import metronic._
......@@ -10,14 +10,20 @@
'_label -> label,
'placeholder -> ""
) { (id, name, value, args) =>
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) style="width: @{width}px;display:inline;" />
<a class="btn btn-primary moxman-btn-browse" data-input_id="@id" href="#"> Browse </a>
<div class="input-group">
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) />
<span class="input-group-btn">
<a class="btn btn-primary moxman-btn-browse" data-input_id="@id" href="#">
@Messages("btn.browse")
</a>
</span>
</div>
@if(helperText != null){
<span class="help-block">@helperText</span>
}
@if(!value.isEmpty && (value.get.toLowerCase.endsWith(".png") || value.get.toLowerCase.endsWith(".gif") || value.get.toLowerCase.endsWith(".jpg") || value.get.toLowerCase.endsWith(".jpeg")) && !value.get.startsWith("/onki_covers/")) {
@if(!value.isEmpty && (value.get.toLowerCase.endsWith(".png") || value.get.toLowerCase.endsWith(".gif") || value.get.toLowerCase.endsWith(".jpg") || value.get.toLowerCase.endsWith(".jpeg"))) {
<span class="help-block">
<img style="max-width: 550px;" src="@value" alt="Vorschau" title="Vorschau" />
<img style="max-width: 550px;" src="@value">
</span>
}
}
@(theForm: Form[_], formKey: String, label: String, helperText: String = null, width: Integer=300, additionalOptions: Html = Html.apply(""))
@(theForm: Form[_], formKey: String, label: String, helperText: String = null, additionalOptions: Html = Html.apply(""))
@import metronic._
......@@ -10,10 +10,14 @@
'_label -> label,
'placeholder -> ""
) { (id, name, value, args) =>
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) style="width: @{width}px;display:inline;" />
<button type="button" class="btn btn-primary image-upload" data-field="#@id">
Browse
</button>
<div class="input-group">
<input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(args) >
<span class="input-group-btn">
<button type="button" class="btn btn-primary image-upload" data-field="#@id">
@Messages("btn.browse")
</button>
</span>
</div>
@if(helperText != null) {
<span class="help-block">@helperText</span>
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment