Hi!

Finally got the NOAA-Year to work!

Look at the attached txt-file to see what I changed in my index.html.tmpl.
The dates are those I have in my database so you might have to put in 
whatever dates you have in your database. 
Maybe the dates updates themself directly, I don't know, but this is how I 
did now.

Try this if you have NOAA-year issue in your sofaskin setup.

/Micael



Den lördag 16 mars 2019 kl. 12:36:22 UTC+1 skrev Micael Fredriksson:
>
> This is how it looks in skin.conf
>
>
> [CheetahGenerator]
>     # This section is used by the generator CheetahGenerator, and specifies
>     # which files are to be generated from which template.
>
>     # Possible encodings are 'html_entities', 'utf8', or 'strict_ascii'
>     encoding = html_entities
>
>     [[SummaryByMonth]]
>         # Reports that summarize "by month"
>         [[[NOAA_month]]]
>             encoding = utf8
>             template = NOAA/NOAA-YYYY-MM.txt.tmpl
>
>     [[SummaryByYear]]
>         # Reports that summarize "by year"
>         [[[NOAA_year]]]
>             encoding = utf8
>             template = NOAA/NOAA-YYYY.txt.tmpl
>         
>     [[ToDate]]
>         # Reports that show statistics "to date", such as day-to-date,
>         # week-to-date, month-to-date, etc.
>
>         [[[day]]]
>             template = index.html.tmpl
>         
>         [[[week]]]
>             template = week.html.tmpl
>         
>         [[[month]]]
>             template = month.html.tmpl
>         
>         [[[year]]]
>             template = year.html.tmpl
>         
> [[[RSS]]]
>           # template = RSS/weewx_rss.xml.tmpl
>            encoding = utf8
>           # template = dashboard.html.tmpl
>
>
>
>
> Den lördag 16 mars 2019 kl. 12:17:49 UTC+1 skrev Thomas Keffer:
>>
>> Look  through the sofa skin configuration file (its skin.conf) and make 
>> sure the sections are in the following order:
>>
>> [CheetahGenerator]
>>    [[SummaryByMonth]]
>>      ...
>>    [[SummaryByDate]]
>>      ...
>>    [[ByDate]]
>>      ...
>>
>> The algorithm that populates the drop down list depends on [[ByDate]] 
>> appearing last.
>>
>> -tk
>>
>> On Sat, Mar 16, 2019 at 3:20 AM Micael Fredriksson <[email protected]> 
>> wrote:
>>
>>> Hi Thomas,
>>>
>>> tried the file you attached but it makes no difference with the year 
>>> drop-down.
>>>
>>> I wrote that I've seen this on other sofa skin templates, but it may 
>>> occur on other skins as well but I've been looking at sofa skins most. 
>>> In my seasons skin the year drop-down works as intended.
>>>
>>>  
>>>
>>> Micael
>>>
>>>
>>> On Sat, Mar 16, 2019 at 1:20 AM Thomas Keffer <[email protected]> wrote:
>>>
>>>> As an experiment, could you please replace your copy of 
>>>> weewx/cheetahgenerator.py with the attached. Let me know if it makes a 
>>>> difference.
>>>>
>>>> -tk
>>>>
>>>> On Fri, Mar 15, 2019 at 5:11 PM Micael Fredriksson <[email protected]> 
>>>> wrote:
>>>>
>>>>> Hi Thomas!
>>>>>
>>>>> Yes, still an issue for me, and as I said I've really tried to change 
>>>>> things to figure out why only the month drop-down list work and not the 
>>>>> year drop-down. I get both 2018 and 2019 in the list but the don't lead 
>>>>> anywhere when I click on them. But, as I mentioned, if I first click on 
>>>>> the 
>>>>> month and choose some month in the drop-down list and then change the 
>>>>> address in the address bar in the browser ( /weewx/NOAA/NOAA-2018-07.txt 
>>>>> to /weewx/NOAA/NOAA-2018.txt) I see the text for 2018. I've looked at 
>>>>> other 
>>>>> sites that uses sofaskin and some of the sites also has issue. 
>>>>>
>>>>> Any clue why this is happening?
>>>>>
>>>>> Micael
>>>>>
>>>>> Den lördag 16 mars 2019 kl. 00:17:39 UTC+1 skrev Thomas Keffer:
>>>>>>
>>>>>> Micael,
>>>>>>
>>>>>> Are you still having problems getting your drop down lists to 
>>>>>> populate? I have noticed this problem on a few installations, including 
>>>>>> one 
>>>>>> of my own.
>>>>>>
>>>>>> -tk
>>>>>>
>>>>>> On Fri, Mar 15, 2019 at 1:59 PM Micael Fredriksson <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hello!
>>>>>>>
>>>>>>> I would really appreciate some help figuring out two issues I have 
>>>>>>> with my Weewx setup. I've really tried to figure out whats wrong but I 
>>>>>>> no 
>>>>>>> longer have any idea what to change.
>>>>>>>
>>>>>>> On my homepage I can not get the Yearly summary to show the 
>>>>>>> "NOAA-year.txt", but the "NOAA-month.txt" works as expected. If I open 
>>>>>>> some 
>>>>>>> NOAA-month.txt via link and then change the address in the address bar 
>>>>>>> to 
>>>>>>> the NOOA-year.txt it shows up, but not if I click on the link on the 
>>>>>>> homepage. This means that the file exist but somethings wrong when I 
>>>>>>> choose 
>>>>>>> a year in the drop-down on the homepage.
>>>>>>>
>>>>>>> The second issue is that in the syslog I get a error with some 
>>>>>>> Unknown color specifier, from I guess 
>>>>>>> weewx.imagegenerator.ImageGenerator. 
>>>>>>> I've looked through the all skin.conf and weewx.conf to see I could 
>>>>>>> find 
>>>>>>> som wrong typed colors in "image_background_color" , but I don't find 
>>>>>>> anything thats written in wrong color format.
>>>>>>>
>>>>>>> Is it possible to read out something more from my syslog to find out 
>>>>>>> where to look for this wrong color specifier?
>>>>>>>
>>>>>>> Attach Skin.conf from the skin I use, mylog from debug=1, and 
>>>>>>> index.html.
>>>>>>> Let me know if I should attach some other files.
>>>>>>>
>>>>>>> weewx 3.9.1
>>>>>>> installed from deb
>>>>>>> weatherstation WH1080
>>>>>>>
>>>>>>>
>>>>>>> Hope someone could help me with this or point me in some direction 
>>>>>>> where to look! 
>>>>>>> And sorry for my bad english!
>>>>>>>
>>>>>>> /Micael
>>>>>>>
>>>>>>> -- 
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "weewx-user" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>> send an email to [email protected].
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "weewx-user" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> -- 
>>>> You received this message because you are subscribed to a topic in the 
>>>> Google Groups "weewx-user" group.
>>>> To unsubscribe from this topic, visit 
>>>> https://groups.google.com/d/topic/weewx-user/1aXsosXgENo/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
Changes I made in Index.html.tmpl:

Added this under the line: <script type="text/javascript">


                function openNoaaFile(date)
            {
                var url = "NOAA/NOAA-";
                url = url + date;
                url = url + ".txt";
                if(date !== "Monthly summary" && date !== "Yearly summary") {
                    window.location=url;
                }
            }
        </script>



Then I removed this: 


<li><select class="noaaselect" onchange="openNoaaFile(value)">
                                <option value="0">Monthly Summary</option>
                                #for $monthYear in $SummaryByMonth
                                <option value="$monthYear">$monthYear</option>
                                #end for
                           </select></li>
                        <li><select class="noaaselect" 
onchange="openNoaaFile(value)">
                                <option value="0">Yearly Summary</option>
                                #for $yr in $SummaryByYear
                                <option value="$yr">$yr</option>
                                #end for
                            </select></li>


And put in this:


<li><select name="noaaselect" onchange="openNoaaFile(value)">
                                <option>Monthly summary</option>
                                    <option value="2018-07">2018-07</option>
                                    <option value="2018-08">2018-08</option>
                                    <option value="2018-09">2018-09</option>
                                    <option value="2018-10">2018-10</option>
                                    <option value="2018-11">2018-11</option>
                                    <option value="2018-12">2018-12</option>
                                    <option value="2019-01">2019-01</option>
                                    <option value="2019-02">2019-02</option>
                                    <option value="2019-03">2019-03</option>
                            </select></li>
                        <li><select name="noaaselect" 
onchange="openNoaaFile(value)">
                                <option>Yearly summary</option>
                                    <option value="2018">2018</option>
                                    <option value="2019">2019</option>
                            </select></li>


Reply via email to