Committer: ailyin
LJSUP-6880 (Checkbox "Publish my tweets to my journal" should be disabled if the account is identity.)U trunk/cgi-bin/LJ/Setting/TwitterConnect.pm U trunk/templates/Settings/TwitterConnect.tmpl
Modified: trunk/cgi-bin/LJ/Setting/TwitterConnect.pm =================================================================== --- trunk/cgi-bin/LJ/Setting/TwitterConnect.pm 2010-09-22 10:09:57 UTC (rev 9535) +++ trunk/cgi-bin/LJ/Setting/TwitterConnect.pm 2010-09-22 10:14:34 UTC (rev 9536) @@ -64,7 +64,9 @@ 'repost_entries' => $repost_entries, 'repost_comments' => $repost_comments, 'digest' => LJ::TwitterDigest->turned_on_for_user($u), - 'is_identity' => $u->is_identity, + 'is_identity' => $u->is_identity + && $u->identity->short_code eq 'twitter', + 'has_journal' => !$u->is_identity, ); return $template->output; Modified: trunk/templates/Settings/TwitterConnect.tmpl =================================================================== --- trunk/templates/Settings/TwitterConnect.tmpl 2010-09-22 10:09:57 UTC (rev 9535) +++ trunk/templates/Settings/TwitterConnect.tmpl 2010-09-22 10:14:34 UTC (rev 9536) @@ -5,10 +5,12 @@ (<a href="<TMPL_VAR disconnect_link>"><TMPL_VAR expr="ml('setting.twitterconnect.link.remove')"></a>) </p> <ul class="b-manage-connectopt"> - <li> - <input type="checkbox" name="<TMPL_VAR form_field_prefix>digest" value="1" id="<TMPL_VAR form_field_prefix>digest"<TMPL_IF digest> checked="checked"</TMPL_IF> /> - <label for="<TMPL_VAR form_field_prefix>digest"><TMPL_VAR expr="ml('setting.twitterconnect.option.digest2')"></label> - </li> + <TMPL_IF has_journal> + <li> + <input type="checkbox" name="<TMPL_VAR form_field_prefix>digest" value="1" id="<TMPL_VAR form_field_prefix>digest"<TMPL_IF digest> checked="checked"</TMPL_IF> /> + <label for="<TMPL_VAR form_field_prefix>digest"><TMPL_VAR expr="ml('setting.twitterconnect.option.digest2')"></label> + </li> + </TMPL_IF> <TMPL_IF is_identity> <li class="disabled"> <input type="checkbox" name="<TMPL_VAR form_field_prefix>repost_entries" value="1" id="<TMPL_VAR form_field_prefix>repost_entries" disabled="disabled" /> @@ -29,7 +31,9 @@ <TMPL_ELSE> <p class="b-manage-connectbtn"><button type="submit" name="<TMPL_VAR form_field_prefix>connect" value="<TMPL_VAR expr="ml('setting.twitterconnect.button.twitter_connect')">" class="b-connectbtn b-connectbtn-twitter" title="<TMPL_VAR expr="ml('setting.twitterconnect.button.twitter_connect')">"><span><i></i><TMPL_VAR expr="ml('setting.twitterconnect.button.twitter_connect')"></span></button></p> <ul class="b-manage-connectopt"> - <li class="disabled"><input type="checkbox" name="<TMPL_VAR form_field_prefix>digest" value="1" id="<TMPL_VAR form_field_prefix>digest" disabled="disabled"<TMPL_IF digest> checked="checked"</TMPL_IF>> <label for="<TMPL_VAR form_field_prefix>digest"><TMPL_VAR expr="ml('setting.twitterconnect.option.digest2')"></label></li> + <TMPL_IF has_journal> + <li class="disabled"><input type="checkbox" name="<TMPL_VAR form_field_prefix>digest" value="1" id="<TMPL_VAR form_field_prefix>digest" disabled="disabled"<TMPL_IF digest> checked="checked"</TMPL_IF>> <label for="<TMPL_VAR form_field_prefix>digest"><TMPL_VAR expr="ml('setting.twitterconnect.option.digest2')"></label></li> + </TMPL_IF> <li class="disabled"><input type="checkbox" name="<TMPL_VAR form_field_prefix>repost_entries" value="1" id="<TMPL_VAR form_field_prefix>repost_entries" disabled="disabled"<TMPL_IF repost_entries> checked="checked"</TMPL_IF>> <label for="<TMPL_VAR form_field_prefix>repost_entries"><TMPL_VAR expr="ml('setting.twitterconnect.option.entries_twitter')"></label></li> <li class="disabled"><input type="checkbox" name="<TMPL_VAR form_field_prefix>repost_comments" value="1" id="<TMPL_VAR form_field_prefix>repost_comments" disabled="disabled"<TMPL_IF repost_comments> checked="checked"</TMPL_IF>> <label for="<TMPL_VAR form_field_prefix>repost_comments"><TMPL_VAR expr="ml('setting.twitterconnect.option.comments_twitter')"></label></li> </ul>