aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2015-01-02 12:10:50 +1100
committerRedMatrix <info@friendica.com>2015-01-02 12:10:50 +1100
commit817b54688e8cea4c7671a8326ce4cf815e1b62d6 (patch)
treeb1e398a186c77fa99b67dc6a99195713582fc4a4 /view
parentdb811ca975e6880ff6540a61c216e7e2432ea75e (diff)
parent85e76773a04995884e798a89cc285f48377bcb62 (diff)
downloadvolse-hubzilla-817b54688e8cea4c7671a8326ce4cf815e1b62d6.tar.gz
volse-hubzilla-817b54688e8cea4c7671a8326ce4cf815e1b62d6.tar.bz2
volse-hubzilla-817b54688e8cea4c7671a8326ce4cf815e1b62d6.zip
Merge pull request #805 from pafcu/moretpl
Move some HTML out to templates
Diffstat (limited to 'view')
-rw-r--r--view/js/mod_new_channel.js2
-rw-r--r--view/js/mod_settings.js4
-rw-r--r--view/tpl/field_select_grouped.tpl12
-rwxr-xr-xview/tpl/install_settings.tpl2
-rwxr-xr-xview/tpl/new_channel.tpl5
-rw-r--r--view/tpl/select_timezone.tpl11
-rwxr-xr-xview/tpl/settings.tpl7
7 files changed, 30 insertions, 13 deletions
diff --git a/view/js/mod_new_channel.js b/view/js/mod_new_channel.js
index 492267ff9..c4d5408f2 100644
--- a/view/js/mod_new_channel.js
+++ b/view/js/mod_new_channel.js
@@ -1,5 +1,5 @@
$(document).ready(function() {
-// $("#privacy-role-select").sSelect();
+// $("#id_permissions_role").sSelect();
$("#newchannel-name").blur(function() {
$("#name-spinner").spin('small');
var zreg_name = $("#newchannel-name").val();
diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js
index ff859936a..0db0dd165 100644
--- a/view/js/mod_settings.js
+++ b/view/js/mod_settings.js
@@ -9,8 +9,8 @@ $(document).ready(function() {
'transition' : 'elastic'
});
- $("#privacy-role-select").change(function() {
- var role = $("#privacy-role-select").val();
+ $("#id_permissions_role").change(function() {
+ var role = $("#id_permissions_role").val();
if(role == 'custom')
$('#advanced-perm').show();
else
diff --git a/view/tpl/field_select_grouped.tpl b/view/tpl/field_select_grouped.tpl
new file mode 100644
index 000000000..c7fb4f322
--- /dev/null
+++ b/view/tpl/field_select_grouped.tpl
@@ -0,0 +1,12 @@
+ <div class='field select'>
+ <label for='id_{{$field.0}}'>{{$field.1}}</label>
+ <select name='{{$field.0}}' id='id_{{$field.0}}'>
+ {{foreach $field.4 as $group=>$opts}}
+ <optgroup label='{{$group}}'>
+ {{foreach $opts as $opt=>$val}}
+ <option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>{{/foreach}}
+ {{/foreach}}
+ </optgroup>
+ </select>
+ <span class='field_help'>{{$field.3}}</span>
+ </div>
diff --git a/view/tpl/install_settings.tpl b/view/tpl/install_settings.tpl
index f4fd82fdb..62dcbb8b3 100755
--- a/view/tpl/install_settings.tpl
+++ b/view/tpl/install_settings.tpl
@@ -20,7 +20,7 @@
{{include file="field_input.tpl" field=$adminmail}}
{{include file="field_input.tpl" field=$siteurl}}
-{{$timezone}}
+{{include file="field_select_grouped.tpl" field=$timezone}}
<input id="install-submit" type="submit" name="submit" value="{{$submit}}" />
diff --git a/view/tpl/new_channel.tpl b/view/tpl/new_channel.tpl
index 241846eb4..ff2011181 100755
--- a/view/tpl/new_channel.tpl
+++ b/view/tpl/new_channel.tpl
@@ -5,10 +5,7 @@
<div id="newchannel-desc" class="descriptive-paragraph">{{$desc}}</div>
<div id="newchannel-role-help" class="descriptive-paragraph">{{$help_role}}</div>
-
- <label for="newchannel-role" id="label-newchannel-role" class="newchannel-label" >{{$label_role}}</label>
- {{$role_select}}
- <div class="newchannel-role-morehelp"><a href="help/roles" title="{{$what_is_role}}" target="_blank">{{$questionmark}}</a></div>
+ {{include file="field_select_grouped.tpl" field=$role}}
<div id="newchannel-role-end" class="newchannel-field-end"></div>
diff --git a/view/tpl/select_timezone.tpl b/view/tpl/select_timezone.tpl
new file mode 100644
index 000000000..2820a54f4
--- /dev/null
+++ b/view/tpl/select_timezone.tpl
@@ -0,0 +1,11 @@
+{{* TODO: Make id configurabel *}}
+<select id='timezone_select' name='timezone'>
+{{foreach $continents as $continent => $cities}}
+<optgroup label="{{$continent}}">
+{{foreach $cities as $city => $value}}
+<option value='{{$value}}' {{if $value == $selected}}selected='selected'{{/if}}>{{$city}}</option>
+{{/foreach}}
+</optgroup>
+{{/foreach}}
+</select>
+
diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl
index 9e53d4f98..894f0fe83 100755
--- a/view/tpl/settings.tpl
+++ b/view/tpl/settings.tpl
@@ -9,7 +9,7 @@
<h3 class="settings-heading">{{$h_basic}}</h3>
{{include file="field_input.tpl" field=$username}}
-{{include file="field_custom.tpl" field=$timezone}}
+{{include file="field_select_grouped.tpl" field=$timezone}}
{{include file="field_input.tpl" field=$defloc}}
{{include file="field_checkbox.tpl" field=$allowloc}}
@@ -22,10 +22,7 @@
<h3 class="settings-heading">{{$h_prv}}</h3>
-<div class="field custom">
-<label for="privacy-role-select">{{$role_lbl}}</label>
-{{$role_select}}
-</div>
+{{include file="field_select_grouped.tpl" field=$role}}
<div id="advanced-perm" style="display:{{if $permissions_set}}none{{else}}block{{/if}};">
{{include file="field_checkbox.tpl" field=$hide_presence}}