From 45b21c1d20d58e6ff885d704c37f36e78871ef36 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Tue, 14 Aug 2012 19:42:07 -0600 Subject: [PATCH 1/4] basic updates for Dispy and Diabook to try to make them at least not broken with threading updates --- view/theme/diabook/admin_site.tpl | 1 + view/theme/diabook/wall_thread.tpl | 125 ++++++++++++++++++ view/theme/diabook/wallwall_thread.tpl | 125 ++++++++++++++++++ view/theme/dispy/head.tpl | 11 ++ view/theme/dispy/wall_thread.tpl | 115 ++++++++++++++++ view/theme/dispy/wallwall_thread.tpl | 121 +++++++++++++++++ .../frost-mobile/threaded_conversation.tpl | 13 ++ view/theme/frost-mobile/wall_thread.tpl | 2 +- view/theme/frost-mobile/wallwall_thread.tpl | 2 +- view/theme/frost/wall_thread.tpl | 5 +- view/theme/frost/wallwall_thread.tpl | 2 +- 11 files changed, 517 insertions(+), 5 deletions(-) create mode 100644 view/theme/diabook/wall_thread.tpl create mode 100644 view/theme/diabook/wallwall_thread.tpl create mode 100644 view/theme/dispy/wall_thread.tpl create mode 100644 view/theme/dispy/wallwall_thread.tpl create mode 100644 view/theme/frost-mobile/threaded_conversation.tpl diff --git a/view/theme/diabook/admin_site.tpl b/view/theme/diabook/admin_site.tpl index 346934b70..33f68dd6a 100644 --- a/view/theme/diabook/admin_site.tpl +++ b/view/theme/diabook/admin_site.tpl @@ -39,6 +39,7 @@ {{ inc field_checkbox.tpl with $field=$ostatus_disabled }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$diaspora_enabled }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$thread_allow }}{{ endinc }} {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }}
diff --git a/view/theme/diabook/wall_thread.tpl b/view/theme/diabook/wall_thread.tpl new file mode 100644 index 000000000..c53f8b017 --- /dev/null +++ b/view/theme/diabook/wall_thread.tpl @@ -0,0 +1,125 @@ +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} diff --git a/view/theme/diabook/wallwall_thread.tpl b/view/theme/diabook/wallwall_thread.tpl new file mode 100644 index 000000000..c53f8b017 --- /dev/null +++ b/view/theme/diabook/wallwall_thread.tpl @@ -0,0 +1,125 @@ +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} diff --git a/view/theme/dispy/head.tpl b/view/theme/dispy/head.tpl index 5f6b26a78..3d1701b29 100644 --- a/view/theme/dispy/head.tpl +++ b/view/theme/dispy/head.tpl @@ -94,4 +94,15 @@ $('#hide-comments-' + id).html('$showfewer'); } } + + function showHideCommentBox(id) { + if( $('#comment-edit-form-' + id).is(':visible')) { + $('#comment-edit-form-' + id).hide(); + } + else { + $('#comment-edit-form-' + id).show(); + } + } + + diff --git a/view/theme/dispy/wall_thread.tpl b/view/theme/dispy/wall_thread.tpl new file mode 100644 index 000000000..5f434d4cb --- /dev/null +++ b/view/theme/dispy/wall_thread.tpl @@ -0,0 +1,115 @@ +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} diff --git a/view/theme/dispy/wallwall_thread.tpl b/view/theme/dispy/wallwall_thread.tpl new file mode 100644 index 000000000..cab97cafa --- /dev/null +++ b/view/theme/dispy/wallwall_thread.tpl @@ -0,0 +1,121 @@ +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} diff --git a/view/theme/frost-mobile/threaded_conversation.tpl b/view/theme/frost-mobile/threaded_conversation.tpl new file mode 100644 index 000000000..6e017ac29 --- /dev/null +++ b/view/theme/frost-mobile/threaded_conversation.tpl @@ -0,0 +1,13 @@ +{{ for $threads as $item }} +{{ inc $item.template }}{{ endinc }} +{{ endfor }} + +
+ + diff --git a/view/theme/frost-mobile/wall_thread.tpl b/view/theme/frost-mobile/wall_thread.tpl index 165a188f1..d6fb677c5 100644 --- a/view/theme/frost-mobile/wall_thread.tpl +++ b/view/theme/frost-mobile/wall_thread.tpl @@ -4,7 +4,6 @@ {{endif}}
@@ -103,4 +102,5 @@ {{ endif }}
+{{if $item.comment_lastcollapsed}}{{endif}} diff --git a/view/theme/frost-mobile/wallwall_thread.tpl b/view/theme/frost-mobile/wallwall_thread.tpl index 816c33d2d..3af6aaa11 100644 --- a/view/theme/frost-mobile/wallwall_thread.tpl +++ b/view/theme/frost-mobile/wallwall_thread.tpl @@ -4,7 +4,6 @@ {{endif}}
@@ -106,4 +105,5 @@ {{ endif }}
+{{if $item.comment_lastcollapsed}}{{endif}} diff --git a/view/theme/frost/wall_thread.tpl b/view/theme/frost/wall_thread.tpl index 95c7cf763..9e81c7a6a 100644 --- a/view/theme/frost/wall_thread.tpl +++ b/view/theme/frost/wall_thread.tpl @@ -4,7 +4,6 @@ {{endif}}
@@ -46,6 +45,7 @@
+
{{ if $item.vote }}
@@ -100,4 +101,4 @@ {{ endif }} - +{{if $item.comment_lastcollapsed}}{{endif}} diff --git a/view/theme/frost/wallwall_thread.tpl b/view/theme/frost/wallwall_thread.tpl index 1117b6903..346e384e5 100644 --- a/view/theme/frost/wallwall_thread.tpl +++ b/view/theme/frost/wallwall_thread.tpl @@ -4,7 +4,6 @@ {{endif}}
@@ -105,4 +104,5 @@ {{ endif }}
+{{if $item.comment_lastcollapsed}}{{endif}} From 77626cca744285804300930c92b7717962c05dfe Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Tue, 14 Aug 2012 19:54:22 -0600 Subject: [PATCH 2/4] missed something again --- view/theme/frost/conversation.tpl | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 view/theme/frost/conversation.tpl diff --git a/view/theme/frost/conversation.tpl b/view/theme/frost/conversation.tpl deleted file mode 100644 index fccd9a8bb..000000000 --- a/view/theme/frost/conversation.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{{ for $threads as $thread }} -
- {{ for $thread.items as $item }} - {{if $item.comment_firstcollapsed}} -
- $thread.num_comments $thread.hide_text -
- {{endif}} - - {{ inc $item.template }}{{ endinc }} - - - {{ endfor }} -
-{{ endfor }} - -
- -{{ if $dropping }} - -
-{{ endif }} From 52908d5e80219db89e2e33f61462e397b644b703 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 15 Aug 2012 10:15:21 +0200 Subject: [PATCH 3/4] lets mark mobile themes similar to experimental ones --- view/theme/frost-mobile/mobile | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 view/theme/frost-mobile/mobile diff --git a/view/theme/frost-mobile/mobile b/view/theme/frost-mobile/mobile new file mode 100644 index 000000000..e69de29bb From a09c20079926d0824359d58e8d3aa9f168ad8ab5 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 15 Aug 2012 10:16:42 +0200 Subject: [PATCH 4/4] add selector for mobile theme to admin panel --- mod/admin.php | 14 +++++++++++++- view/admin_site.tpl | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mod/admin.php b/mod/admin.php index 1752b3fe8..c4a984dcd 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -237,6 +237,7 @@ function admin_page_site_post(&$a){ $banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false); $language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : ''); $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : ''); + $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : ''); $maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0); @@ -325,6 +326,11 @@ function admin_page_site_post(&$a){ } set_config('system','language', $language); set_config('system','theme', $theme); + if ( $theme_mobile === '---' ) { + del_config('system','mobile-theme'); + } else { + set_config('system','mobile-theme', $theme_mobile); + } set_config('system','maximagesize', $maximagesize); set_config('config','register_policy', $register_policy); @@ -386,12 +392,17 @@ function admin_page_site(&$a) { /* Installed themes */ $theme_choices = array(); + $theme_choices_mobile = array(); + $theme_choices_mobile["---"] = t("Don't apply a special theme for mobile devices."); $files = glob('view/theme/*'); if($files) { foreach($files as $file) { $f = basename($file); $theme_name = ((file_exists($file . '/experimental')) ? sprintf("%s - \x28Experimental\x29", $f) : $f); - $theme_choices[$f] = $theme_name; + $theme_choices[$f] = $theme_name; + if (file_exists($file . '/mobile')) { + $theme_choices_mobile[$f] = $theme_name; + } } } @@ -433,6 +444,7 @@ function admin_page_site(&$a) { '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - change theme settings"), $theme_choices), + '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile), '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), diff --git a/view/admin_site.tpl b/view/admin_site.tpl index e918ff787..eb19afeed 100644 --- a/view/admin_site.tpl +++ b/view/admin_site.tpl @@ -6,6 +6,7 @@ autoDimensions: false, onStart: function(){ var theme = $("#id_theme :selected").val(); + var theme_mobile = $("#id_theme_mobile :selected").val(); $("#cnftheme").attr('href',"$baseurl/admin/themes/"+theme); }, onComplete: function(){ @@ -44,6 +45,7 @@ {{ inc field_textarea.tpl with $field=$banner }}{{ endinc }} {{ inc field_select.tpl with $field=$language }}{{ endinc }} {{ inc field_select.tpl with $field=$theme }}{{ endinc }} + {{ inc field_select.tpl with $field=$theme_mobile }}{{ endinc }} {{ inc field_select.tpl with $field=$ssl_policy }}{{ endinc }}