<commit_before><%= f.error_messages -%>
<p>
    <%= f.label :title -%>
    <br/>
    <%= f.text_field :title,:size=>75 -%>
</p>
<p>
    <%= f.label :body -%>
    <br/>
    <%= f.text_area :body, :rows=>20,:cols=>75 -%>
</p>
<p>
    <%= f.label :show_in_feed -%>
    <%= f.check_box :show_in_feed -%>
</p>
<p>
    <%= f.label :is_headline,"Headline announcement" -%>
    <%= f.check_box :is_headline,{:onchange=>"toggle_expires_at();"} -%>
    <div id="announcement_expires" style="display: none;">
        <%= f.label :expires,"Expires at" -%>
        <br/>
        <%= datetime_select "site_announcement","expires_at" -%>
        <br/>
    </div>
</p>
<p>
    <%= f.label :email_notification -%>
	<% if edit -%>
		<%= f.check_box :email_notification, :disabled=>true -%>
	<% else -%>
    	<%= f.check_box :email_notification -%>
	<% end -%>
</p>
<script type="text/javascript">
    function toggle_expires_at(){
        if ($("site_announcement_is_headline").checked) {
            Effect.Appear("announcement_expires");
        }
        else {
            Effect.Fade("announcement_expires")
        }
    }
    
    toggle_expires_at();
</script><commit_msg>show current server time in form when setting announcement expiry date<commit_after><%= f.error_messages -%>
<p>
    <%= f.label :title -%>
    <br/>
    <%= f.text_field :title,:size=>75 -%>
</p>
<p>
    <%= f.label :body -%>
    <br/>
    <%= f.text_area :body, :rows=>20,:cols=>75 -%>
</p>
<p>
    <%= f.label :show_in_feed -%>
    <%= f.check_box :show_in_feed -%>
</p>
<p>
    <%= f.label :is_headline,"Headline announcement" -%>
    <%= f.check_box :is_headline,{:onchange=>"toggle_expires_at();"} -%>
    <div id="announcement_expires" style="display: none;">
        <%= f.label :expires,"Expires at" -%>
        <br/>
        <%= datetime_select "site_announcement","expires_at" -%>
        <br/>		
		<span class="headline_announcement_date">( Current server time is <%= Time.now.utc -%> )</span>
    </div>
</p>
<p>
    <%= f.label :email_notification -%>
	<% if edit -%>
		<%= f.check_box :email_notification, :disabled=>true -%>
	<% else -%>
    	<%= f.check_box :email_notification -%>
	<% end -%>
</p>
<script type="text/javascript">
    function toggle_expires_at(){
        if ($("site_announcement_is_headline").checked) {
            Effect.Appear("announcement_expires");
        }
        else {
            Effect.Fade("announcement_expires")
        }
    }
    
    toggle_expires_at();
</script>
{'fraction_non_alphanumeric': 0.21201128577186618, 'fraction_numerical': 0.0048367593712212815, 'mean_word_length': 2.7663125948406675, 'pattern_counts': {'":': 0, '<': 76, '<?xml version=': 0, '>': 86, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6963800', 'n_tokens_mistral': 1019, 'n_tokens_neox': 967, 'n_words': 149}