mirror of https://github.com/interlegis/sapl.git
24 changed files with 295 additions and 1116 deletions
@ -0,0 +1 @@ |
|||||
|
3.12 |
||||
@ -0,0 +1,18 @@ |
|||||
|
# Generated by Django 2.2.28 on 2026-09-16 20:09 |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('audiencia', '0020_auto_20251201_1450'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='audienciapublica', |
||||
|
name='ano', |
||||
|
field=models.PositiveSmallIntegerField(choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,33 @@ |
|||||
|
# Generated by Django 2.2.28 on 2026-09-16 20:09 |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('materia', '0087_update_viewdb_materiaemtramitacao'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='materialegislativa', |
||||
|
name='ano', |
||||
|
field=models.PositiveSmallIntegerField(choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='materialegislativa', |
||||
|
name='ano_origem_externa', |
||||
|
field=models.PositiveSmallIntegerField(blank=True, choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='numeracao', |
||||
|
name='ano_materia', |
||||
|
field=models.PositiveSmallIntegerField(choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='proposicao', |
||||
|
name='ano', |
||||
|
field=models.PositiveSmallIntegerField(blank=True, choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,29 @@ |
|||||
|
# Generated by Django 2.2.28 on 2026-09-16 20:09 |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import sapl.norma.models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('norma', '0045_auto_20240711_1405'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='anexonormajuridica', |
||||
|
name='ano', |
||||
|
field=models.PositiveSmallIntegerField(choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='normaestatisticas', |
||||
|
name='ano', |
||||
|
field=models.PositiveSmallIntegerField(choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=sapl.norma.models.get_ano_atual, verbose_name='Ano'), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='normajuridica', |
||||
|
name='ano', |
||||
|
field=models.PositiveSmallIntegerField(choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,23 @@ |
|||||
|
# Generated by Django 2.2.28 on 2026-09-16 20:09 |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('protocoloadm', '0045_auto_20240711_1405'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='documentoadministrativo', |
||||
|
name='ano', |
||||
|
field=models.PositiveSmallIntegerField(choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='protocolo', |
||||
|
name='ano', |
||||
|
field=models.PositiveSmallIntegerField(choices=[(2027, 2027), (2026, 2026), (2025, 2025), (2024, 2024), (2023, 2023), (2022, 2022), (2021, 2021), (2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), |
||||
|
), |
||||
|
] |
||||
@ -1,609 +0,0 @@ |
|||||
{% load i18n %} |
|
||||
{% load common_tags %} |
|
||||
|
|
||||
{% load render_bundle from webpack_loader %} |
|
||||
{% load webpack_static from webpack_loader %} |
|
||||
|
|
||||
<!DOCTYPE HTML> |
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9" lang="pt-br"> <![endif]--> |
|
||||
<!--[if gt IE 8]><!--> |
|
||||
<html lang="pt-br"> |
|
||||
<!--<![endif]--> |
|
||||
<head> |
|
||||
<meta charset="UTF-8"> |
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
||||
<!-- TODO: does it need this head_title here? --> |
|
||||
<title>{% block head_title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %}</title> |
|
||||
|
|
||||
{% block webpack_loader_css %} |
|
||||
{% render_chunk_vendors 'css' %} |
|
||||
{% render_bundle 'global' 'css' %} |
|
||||
{% render_bundle 'painel' 'css' %} |
|
||||
{% endblock webpack_loader_css %} |
|
||||
|
|
||||
|
|
||||
<style type="text/css"> |
|
||||
html, body { |
|
||||
max-width: 100%; |
|
||||
overflow-x: hidden; |
|
||||
} |
|
||||
@media screen { |
|
||||
ul, li { |
|
||||
list-style-type: none; |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body class="painel-principal"> |
|
||||
<div id="ws-status-banner" style="display:none; position:fixed; top:0; left:0; right:0; z-index:2000; padding:10px 16px; text-align:center; font-weight:bold; color:#fff;"></div> |
|
||||
<audio type="hidden" id="audio" src="{% webpack_static 'audio/ring.mp3' %}"></audio> |
|
||||
|
|
||||
<div class="d-flex justify-content-center"> |
|
||||
<h1 id="sessao_plenaria" class="title text-title"></h1> |
|
||||
</div> |
|
||||
<div class="row "> |
|
||||
<div class="col text-center"> |
|
||||
<span id="sessao_plenaria_data" class="text-value"></span> |
|
||||
</div> |
|
||||
<div class="col text-center"> |
|
||||
<span id="sessao_plenaria_hora_inicio" class="text-value"></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<div class="row justify-content-center"> |
|
||||
<div class="col-1"> |
|
||||
<img src="" id="logo-painel" class="logo-painel" alt=""/> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<div class="row justify-content-center"> |
|
||||
<h2 class="text-danger"><span id="message"></span></h2> |
|
||||
</div> |
|
||||
|
|
||||
<div class="row"> |
|
||||
<div class="col text-center"><span class="text-value data-hora" id="date"></span></div> |
|
||||
<div class="col text-center"><span class="text-value data-hora" id="relogio"></span></div> |
|
||||
</div> |
|
||||
|
|
||||
|
|
||||
<div class=""> |
|
||||
<div class="d-flex justify-content-start"> |
|
||||
<div class="col-md-4"> |
|
||||
<div class="text-center painel"> |
|
||||
<h2 class="text-subtitle">Parlamentares</h2> |
|
||||
<span id="parlamentares" class="text-value text-center"></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="d-flex col-md-8 painels"> |
|
||||
<div class="col-md-6 text-center painel" id="aparecer_oradores"> |
|
||||
<h2 class="text-subtitle">Oradores</h2> |
|
||||
<span id="orador"></span> |
|
||||
</div> |
|
||||
|
|
||||
<div class="col-md-6 text-left painel"> |
|
||||
<div class="d-flex align-items-left justify-content-left mb-2"> |
|
||||
<h2 class="text-subtitle mb-0">Cronômetros</h2> |
|
||||
<button class="btn btn-sm btn-secondary ms-2" onclick="changeFontSize('box_cronometros', -1)"> |
|
||||
A- |
|
||||
</button> |
|
||||
<button class="btn btn-sm btn-secondary ms-2" onclick="changeFontSize('box_cronometros', 1)"> |
|
||||
A+ |
|
||||
</button> |
|
||||
</div> |
|
||||
<div class="text-value" id="box_cronometros"> |
|
||||
Discurso: <span id="cronometro_discurso"></span><br> |
|
||||
Aparte: <span id="cronometro_aparte"></span><br> |
|
||||
Questão de Ordem: <span id="cronometro_ordem"></span><br> |
|
||||
Considerações Finais: <span id="cronometro_consideracoes"></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<div class="col-md-6 text-left painel" id="resultado_votacao_div"> |
|
||||
<div class="d-flex align-items-left justify-content-left mb-2"> |
|
||||
<h2 class="text-subtitle mb-0">Resultado</h2> |
|
||||
<button class="btn btn-sm btn-secondary ms-2" onclick="changeFontSize('box_votacao', -1)"> |
|
||||
A- |
|
||||
</button> |
|
||||
<button class="btn btn-sm btn-secondary ms-2" onclick="changeFontSize('box_votacao', 1)"> |
|
||||
A+ |
|
||||
</button> |
|
||||
</div> |
|
||||
<div id="box_votacao"> |
|
||||
<span id="votacao" class="text-value"></span> |
|
||||
<span id="resultado_votacao" lass="text-title"></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<div class="col-md-6 text-center painel" id="obs_materia_div"> |
|
||||
<h2 class="text-subtitle" id="mat_em_votacao">Matéria em Votação</h2> |
|
||||
<span id="materia_legislativa_texto" class="text-value"></span> |
|
||||
<br> |
|
||||
<span id="materia_legislativa_ementa" class="text-value"></span> |
|
||||
<br> |
|
||||
<span id="observacao_materia" class="text-value"></span> |
|
||||
</div> |
|
||||
|
|
||||
<div class="col-md-6 text-center painel" id="tema_solene_div" style="display: none"> |
|
||||
<h2 class="text-subtitle">Tema da Sessão Solene</h2> |
|
||||
<span id="sessao_solene_tema" class="text-value"></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</body> |
|
||||
|
|
||||
{% block webpack_loader_js %} |
|
||||
{% render_chunk_vendors 'js' %} |
|
||||
{% render_bundle 'global' 'js' %} |
|
||||
{% render_bundle 'painel' 'js' %} |
|
||||
{% endblock webpack_loader_js %} |
|
||||
|
|
||||
{% block webpack_loader_chunks_js %} |
|
||||
{% endblock webpack_loader_chunks_js %} |
|
||||
|
|
||||
<script type="text/javascript"> |
|
||||
|
|
||||
$(document).ready(function() { |
|
||||
|
|
||||
// As constantes decisões sobre a existência ou não do horário de verão, |
|
||||
// assim como que data de início e termino do mesmo, fizeram com que fosse necessário |
|
||||
// substituir a chamada a Date() por um esquema mais elaborado, onde se |
|
||||
// recupera o offset do UTC (-3 GMT, no caso de Brasília) e seta-se |
|
||||
// manualmente. Esta informação vem do servidor, desta forma não ficamos |
|
||||
// na dependência da atualização de browser, pois tanto o Date() em JS |
|
||||
// quanto as libs python (django.utils.timezone, datetime, pytz, etc) |
|
||||
// lêem do tzdata, que precisa ser atualizado toda vez que o governo |
|
||||
// brasileiro modifica alguma coisa relacionada ao horário de verão. |
|
||||
// Recuperando essa informação do servidor só teremos que atualizar as |
|
||||
// libs tzdata (Linux) e pytz (Python) uma vez. Além disso, o uso da |
|
||||
// biblioteca moment.js é recomendada, pois ela trata data e hora |
|
||||
// melhor que o Date() do JS. |
|
||||
|
|
||||
//TODO: replace by a fancy jQuery clock |
|
||||
function checkTime(i) { |
|
||||
if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 |
|
||||
return i; |
|
||||
} |
|
||||
|
|
||||
const utcOffset = {{ utc_offset }}; |
|
||||
const serverEpochMs = {{ server_epoch_ms }}; |
|
||||
const pageLoadedAtMs = performance.now(); |
|
||||
|
|
||||
function startTime() { |
|
||||
const elapsedMs = performance.now() - pageLoadedAtMs; |
|
||||
|
|
||||
const now = moment |
|
||||
.utc(serverEpochMs + elapsedMs) |
|
||||
.utcOffset(utcOffset); |
|
||||
|
|
||||
$("#date").text(now.format("DD/MM/YY")); |
|
||||
$("#relogio").text(now.format("HH:mm:ss")); |
|
||||
|
|
||||
setTimeout(startTime, 500); |
|
||||
} |
|
||||
startTime(); |
|
||||
|
|
||||
var audioAlertFinish = document.getElementById("audio"); |
|
||||
|
|
||||
$('#cronometro_discurso').runner({ |
|
||||
autostart: false, |
|
||||
countdown: true, |
|
||||
startAt: {{ 'discurso'|cronometro_to_seconds }} * 1000, |
|
||||
stopAt: 0, |
|
||||
milliseconds: false, |
|
||||
format: function(value) { |
|
||||
let h = Math.floor((value/1000) / 3600); |
|
||||
h = checkTime(h); |
|
||||
let m = Math.floor((value/1000) % 3600 / 60); |
|
||||
m = checkTime(m); |
|
||||
let s = Math.floor((value/1000) % 3600 % 60); |
|
||||
s = checkTime(s); |
|
||||
return h.toString() + ":" + m.toString() + ":" + s.toString(); |
|
||||
} |
|
||||
}).on('runnerFinish', function(eventObject, info){ |
|
||||
audioAlertFinish.play(); |
|
||||
}); |
|
||||
|
|
||||
$('#cronometro_aparte').runner({ |
|
||||
autostart: false, |
|
||||
countdown: true, |
|
||||
startAt: {{ 'aparte'|cronometro_to_seconds }} * 1000, |
|
||||
stopAt: 0, |
|
||||
milliseconds: false, |
|
||||
format: function(value) { |
|
||||
let h = Math.floor((value/1000) / 3600); |
|
||||
h = checkTime(h); |
|
||||
let m = Math.floor((value/1000) % 3600 / 60); |
|
||||
m = checkTime(m); |
|
||||
let s = Math.floor((value/1000) % 3600 % 60); |
|
||||
s = checkTime(s); |
|
||||
return h.toString() + ":" + m.toString() + ":" + s.toString(); |
|
||||
} |
|
||||
}).on('runnerFinish', function(eventObject, info){ |
|
||||
audioAlertFinish.play(); |
|
||||
}); |
|
||||
|
|
||||
$('#cronometro_ordem').runner({ |
|
||||
autostart: false, |
|
||||
countdown: true, |
|
||||
startAt: {{ 'ordem'|cronometro_to_seconds }} * 1000, |
|
||||
stopAt: 0, |
|
||||
milliseconds: false, |
|
||||
format: function(value) { |
|
||||
let h = Math.floor((value/1000) / 3600); |
|
||||
h = checkTime(h); |
|
||||
let m = Math.floor((value/1000) % 3600 / 60); |
|
||||
m = checkTime(m); |
|
||||
let s = Math.floor((value/1000) % 3600 % 60); |
|
||||
s = checkTime(s); |
|
||||
return h.toString() + ":" + m.toString() + ":" + s.toString(); |
|
||||
} |
|
||||
}).on('runnerFinish', function(eventObject, info){ |
|
||||
audioAlertFinish.play(); |
|
||||
}); |
|
||||
|
|
||||
$('#cronometro_consideracoes').runner({ |
|
||||
autostart: false, |
|
||||
countdown: true, |
|
||||
startAt: {{ 'consideracoes'|cronometro_to_seconds }} * 1000, |
|
||||
stopAt: 0, |
|
||||
milliseconds: false, |
|
||||
format: function(value) { |
|
||||
let h = Math.floor((value/1000) / 3600); |
|
||||
h = checkTime(h); |
|
||||
let m = Math.floor((value/1000) % 3600 / 60); |
|
||||
m = checkTime(m); |
|
||||
let s = Math.floor((value/1000) % 3600 % 60); |
|
||||
s = checkTime(s); |
|
||||
return h.toString() + ":" + m.toString() + ":" + s.toString(); |
|
||||
} |
|
||||
}).on('runnerFinish', function(eventObject, info){ |
|
||||
audioAlertFinish.play(); |
|
||||
}); |
|
||||
|
|
||||
var discurso_previous; |
|
||||
var ordem_previous; |
|
||||
var aparte_previous; |
|
||||
var consideracoes_previous; |
|
||||
|
|
||||
// Renderiza o payload completo que o WebSocket manda em cada broadcast |
|
||||
// (build_dados_painel() — antes também servido por um endpoint HTTP de |
|
||||
// polling, removido junto com o fallback). |
|
||||
function renderDadosPainel(data) { |
|
||||
if (!data) { |
|
||||
return; |
|
||||
} |
|
||||
$("#sessao_plenaria").text(data["sessao_plenaria"]) |
|
||||
$("#sessao_plenaria_data").text("Data Início: " + data["sessao_plenaria_data"]) |
|
||||
$("#sessao_plenaria_hora_inicio").text("Hora Início: " + data["sessao_plenaria_hora_inicio"]) |
|
||||
$("#sessao_solene_tema").text(data["tema_solene"]) |
|
||||
if (data["status_painel"] == false) { |
|
||||
$("#message").text("PAINEL ENCONTRA-SE FECHADO"); |
|
||||
} |
|
||||
else { |
|
||||
$("#message").text(""); |
|
||||
} |
|
||||
|
|
||||
if (data["sessao_solene"]){ |
|
||||
$("#resultado_votacao_div").hide(); |
|
||||
$("#obs_materia_div").hide(); |
|
||||
$('#tema_solene_div').show(); |
|
||||
} |
|
||||
|
|
||||
if (data["brasao"] != null) |
|
||||
$("#logo-painel").attr("src", data["brasao"]); |
|
||||
|
|
||||
var presentes = $("#parlamentares"); |
|
||||
var votacao = $("#votacao"); |
|
||||
var oradores = $("#orador") |
|
||||
$("#votacao").text(''); |
|
||||
presentes.children().remove(); |
|
||||
votacao.children().remove(); |
|
||||
oradores.children().remove(); |
|
||||
|
|
||||
var oradores_list = data["oradores"]; |
|
||||
var presentes_list = data["presentes"]; |
|
||||
|
|
||||
if (data["status_painel"] == true) { |
|
||||
mostrar_voto = data["mostrar_voto"]; |
|
||||
presentes.append('<table id="parlamentares_list">'); |
|
||||
$.each(presentes_list, function (index, parlamentar) { |
|
||||
|
|
||||
|
|
||||
if (parlamentar.voto == 'Voto Informado' && mostrar_voto == false){ |
|
||||
$('#parlamentares_list').append('<tr><td style="padding-right:20px; color:yellow" >' + |
|
||||
parlamentar.nome + |
|
||||
'</td> <td style="padding-right:20px; color:yellow">' + |
|
||||
parlamentar.partido + '</td> <td style="padding-right:20px; color:yellow">' |
|
||||
+ '</td></tr>') |
|
||||
} |
|
||||
else{ |
|
||||
$('#parlamentares_list').append(show_voto(parlamentar)) |
|
||||
} |
|
||||
|
|
||||
}); |
|
||||
presentes.append('</table>') |
|
||||
|
|
||||
if (data["oradores"].length > 0){ |
|
||||
$('#aparecer_oradores').show(); |
|
||||
oradores.append('<table id="oradores_list">'); |
|
||||
$.each(oradores_list, function (index, orador) { |
|
||||
$('#oradores_list').append('<tr><td style="padding-right:20px; color:white" >' + |
|
||||
orador.numero + 'º  ' + |
|
||||
orador.nome +'</td></tr>') |
|
||||
}); |
|
||||
oradores.append('</table>'); |
|
||||
} |
|
||||
else { |
|
||||
$('#aparecer_oradores').hide(); |
|
||||
} |
|
||||
} |
|
||||
else{ |
|
||||
presentes.append('<span style="color:white" id="parlamentares_list">'); |
|
||||
$('#parlamentares_list').append( |
|
||||
'<center>A listagem de parlamentares só aparecerá quando o painel estiver aberto.</center>') |
|
||||
presentes.append('</span>'); |
|
||||
|
|
||||
oradores.append('<span style="color:white" id="oradores_list">'); |
|
||||
$('#oradores_list').append( |
|
||||
'<center>A listagem de oradores só aparecerá quando o painel estiver aberto.</center>') |
|
||||
oradores.append('</span>'); |
|
||||
|
|
||||
votacao.append('<span id="votacao">'); |
|
||||
$("#votacao").append('<center>A votação só aparecerá quando o painel estiver aberto</center>'); |
|
||||
votacao.append('</span>'); |
|
||||
} |
|
||||
|
|
||||
if(data["status_painel"]){ |
|
||||
if (data['materia_legislativa_texto']){ |
|
||||
var votacao = $("#votacao"); |
|
||||
|
|
||||
votacao.append("<li>Sim: " + data["numero_votos_sim"] + "</li>"); |
|
||||
votacao.append("<li>Não: " + data["numero_votos_nao"] + "</li>"); |
|
||||
votacao.append("<li>Abstenções: " + data["numero_abstencoes"] + "</li>"); |
|
||||
votacao.append("<li>Presentes: " + data["num_presentes"] + "</li>"); |
|
||||
votacao.append("<li>Total votos: " + data["total_votos"] + "</li>"); |
|
||||
} |
|
||||
else{ |
|
||||
$("#votacao").append('<center>Não há votação, pois não há nenhuma matéria aberta ou já votada.</center>'); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
var discurso_current = data["cronometro_discurso"]; |
|
||||
if (!discurso_previous){ |
|
||||
discurso_previous = '' |
|
||||
} |
|
||||
|
|
||||
if (discurso_current != discurso_previous) { |
|
||||
$('#cronometro_discurso').runner(discurso_current); |
|
||||
discurso_previous = discurso_current; |
|
||||
} |
|
||||
|
|
||||
var aparte_current = data["cronometro_aparte"]; |
|
||||
if (!aparte_previous){ |
|
||||
aparte_previous = '' |
|
||||
} |
|
||||
|
|
||||
if (aparte_current != aparte_previous) { |
|
||||
$('#cronometro_aparte').runner(aparte_current); |
|
||||
aparte_previous = aparte_current; |
|
||||
} |
|
||||
|
|
||||
var ordem_current = data["cronometro_ordem"]; |
|
||||
if (!ordem_previous){ |
|
||||
ordem_previous = '' |
|
||||
} |
|
||||
|
|
||||
if (ordem_current != ordem_previous) { |
|
||||
$('#cronometro_ordem').runner(ordem_current); |
|
||||
ordem_previous = ordem_current; |
|
||||
} |
|
||||
|
|
||||
var consideracoes_current = data["cronometro_consideracoes"]; |
|
||||
if (!consideracoes_previous){ |
|
||||
consideracoes_previous = '' |
|
||||
} |
|
||||
|
|
||||
if (consideracoes_current != consideracoes_previous) { |
|
||||
$('#cronometro_consideracoes').runner(consideracoes_current); |
|
||||
consideracoes_previous = consideracoes_current; |
|
||||
} |
|
||||
|
|
||||
if($('#cronometro_discurso').runner('info').formattedTime == "00:00:30") { |
|
||||
audioAlertFinish.play(); |
|
||||
} |
|
||||
|
|
||||
if($('#cronometro_aparte').runner('info').formattedTime == "00:00:30") { |
|
||||
audioAlertFinish.play(); |
|
||||
} |
|
||||
|
|
||||
if($('#cronometro_ordem').runner('info').formattedTime == "00:00:30") { |
|
||||
audioAlertFinish.play(); |
|
||||
} |
|
||||
|
|
||||
if($('#cronometro_consideracoes').runner('info').formattedTime == "00:00:30") { |
|
||||
audioAlertFinish.play(); |
|
||||
} |
|
||||
|
|
||||
if(data['sessao_finalizada']){ |
|
||||
$("#obs_materia_div").hide(); |
|
||||
$("#resultado_votacao_div").hide(); |
|
||||
} |
|
||||
else if (data['materia_legislativa_texto']){ |
|
||||
if (data["status_painel"] == true){ |
|
||||
$("#materia_legislativa_texto").text(data["materia_legislativa_texto"]); |
|
||||
$("#materia_legislativa_ementa").text(data["materia_legislativa_ementa"]); |
|
||||
} |
|
||||
else{ |
|
||||
$("#materia_legislativa_texto").text('A Matéria em votação só aparecerá quando o painel estiver aberto'); |
|
||||
} |
|
||||
} |
|
||||
else{ |
|
||||
$("#materia_legislativa_texto").text('Não há nenhuma matéria votada ou para votação.'); |
|
||||
} |
|
||||
|
|
||||
if (data['observacao_materia'] && data["status_painel"] == true){ |
|
||||
var texto = data['observacao_materia']; |
|
||||
if(texto.length > 151) { |
|
||||
$("#observacao_materia").text(texto.substr(0, 145).concat('(...)')); |
|
||||
} |
|
||||
else{ |
|
||||
$("#observacao_materia").text(texto); |
|
||||
} |
|
||||
} |
|
||||
else{ |
|
||||
$("#observacao_materia").text(''); |
|
||||
} |
|
||||
if (data['tipo_resultado'] && data['status_painel'] == true){ |
|
||||
if(data['tipo_votacao'] != 'Leitura' && !data['sessao_finalizada'] && !data["sessao_solene"]){ |
|
||||
$("#resultado_votacao").css("color", "#45919D"); |
|
||||
$("#mat_em_votacao").text("Matéria em Votação"); |
|
||||
$("#resultado_votacao_div").show(); |
|
||||
} |
|
||||
else{ |
|
||||
$("#resultado_votacao_div").hide(); |
|
||||
$("#mat_em_votacao").text("Matéria em Leitura"); |
|
||||
} |
|
||||
console.log(data["tipo_resultado"], data['tipo_votacao']); |
|
||||
$("#resultado_votacao").text(data["tipo_resultado"]); |
|
||||
|
|
||||
var resultado_votacao_upper = $("#resultado_votacao").text().toUpperCase(); |
|
||||
console.log(resultado_votacao_upper, data['tipo_resultado']); |
|
||||
if (resultado_votacao_upper.search("APROV") != -1){ |
|
||||
$("#resultado_votacao").css("color", "#7CFC00"); |
|
||||
$("#mat_em_votacao").text("Matéria Votada"); |
|
||||
} |
|
||||
else if (resultado_votacao_upper.search("REJEIT") != -1){ |
|
||||
$("#resultado_votacao").css("color", "red"); |
|
||||
$("#mat_em_votacao").text("Matéria Votada"); |
|
||||
} |
|
||||
else if (resultado_votacao_upper.search("LIDA") != -1){ |
|
||||
$("#mat_em_votacao").text("Matéria Lida"); |
|
||||
} |
|
||||
} |
|
||||
else{ |
|
||||
$("#resultado_votacao").text(''); |
|
||||
if(data['tipo_votacao'] != 'Leitura') |
|
||||
$("#mat_em_votacao").text("Matéria em Votação"); |
|
||||
else{ |
|
||||
$("#mat_em_votacao").text("Matéria em Leitura"); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// Sem fallback de polling: esta página vive inteiramente do |
|
||||
// WebSocket. PainelConsumer.connect() (sapl/painel/consumers.py) |
|
||||
// manda um snapshot completo assim que a conexão é aceita — então |
|
||||
// tanto a carga inicial quanto toda atualização depois vêm daqui. |
|
||||
// Se a conexão não sobe (Redis/Daphne fora do ar), showWsBanner() |
|
||||
// deixa isso visível na página em vez de deixá-la muda em silêncio. |
|
||||
(function() { |
|
||||
var banner = document.getElementById('ws-status-banner'); |
|
||||
|
|
||||
function showWsBanner(message, isError) { |
|
||||
if (!banner) return; |
|
||||
banner.textContent = message; |
|
||||
banner.style.display = 'block'; |
|
||||
banner.style.background = isError ? '#b00020' : '#b8860b'; |
|
||||
} |
|
||||
|
|
||||
function hideWsBanner() { |
|
||||
if (!banner) return; |
|
||||
banner.style.display = 'none'; |
|
||||
} |
|
||||
|
|
||||
// Fechados explicitamente por PainelConsumer.connect() para |
|
||||
// condições que uma nova tentativa não resolve sozinha. |
|
||||
var PERMANENT_CLOSE_MESSAGES = { |
|
||||
4401: 'Sessão expirada ou usuário não autenticado. Faça login novamente e recarregue a página.', |
|
||||
4403: 'Seu usuário não tem permissão para acessar esta tela.', |
|
||||
4404: 'Sessão plenária não encontrada.' |
|
||||
}; |
|
||||
|
|
||||
var wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; |
|
||||
var wsUrl = wsProtocol + '//' + window.location.host + '/ws/painel/{{ sessao_id }}/'; |
|
||||
var MIN_RECONNECT_DELAY_MS = 1000; |
|
||||
var MAX_RECONNECT_DELAY_MS = 30000; |
|
||||
var reconnectDelayMs = MIN_RECONNECT_DELAY_MS; |
|
||||
var socket = null; |
|
||||
|
|
||||
function nextDelay() { |
|
||||
var base = Math.min(reconnectDelayMs * 2, MAX_RECONNECT_DELAY_MS); |
|
||||
// +/-30% de jitter — evita que várias telas conectadas na mesma |
|
||||
// sessão reconectem todas no mesmo instante após uma queda do |
|
||||
// Daphne, batendo em build_dados_painel() ao mesmo tempo. |
|
||||
return Math.round(base * (0.7 + Math.random() * 0.6)); |
|
||||
} |
|
||||
|
|
||||
function connect() { |
|
||||
socket = new WebSocket(wsUrl); |
|
||||
|
|
||||
socket.onopen = function() { |
|
||||
reconnectDelayMs = MIN_RECONNECT_DELAY_MS; |
|
||||
hideWsBanner(); |
|
||||
}; |
|
||||
|
|
||||
socket.onmessage = function(event) { |
|
||||
var message; |
|
||||
try { |
|
||||
message = JSON.parse(event.data); |
|
||||
} catch (e) { |
|
||||
return; |
|
||||
} |
|
||||
if (message && message.type === 'data') { |
|
||||
renderDadosPainel(message.payload); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
socket.onclose = function(event) { |
|
||||
var permanentMessage = PERMANENT_CLOSE_MESSAGES[event.code]; |
|
||||
if (permanentMessage) { |
|
||||
showWsBanner(permanentMessage, true); |
|
||||
return; |
|
||||
} |
|
||||
showWsBanner( |
|
||||
'Conexão em tempo real perdida. Verifique se o Redis e o ' + |
|
||||
'Daphne (ou "./manage.py runserver") estão em execução. ' + |
|
||||
'Tentando reconectar…', |
|
||||
false |
|
||||
); |
|
||||
setTimeout(connect, reconnectDelayMs); |
|
||||
reconnectDelayMs = nextDelay(); |
|
||||
}; |
|
||||
|
|
||||
socket.onerror = function() { |
|
||||
socket.close(); |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
connect(); |
|
||||
})(); |
|
||||
}); |
|
||||
|
|
||||
function show_voto(parlamentar) { |
|
||||
color = 'white' |
|
||||
if (parlamentar.voto == "Sim"){ |
|
||||
color = 'green' |
|
||||
} |
|
||||
else if (parlamentar.voto == "Não"){ |
|
||||
color = 'red' |
|
||||
} |
|
||||
|
|
||||
return ('<tr> <td style="padding-right:20px">' + |
|
||||
`<font color="`+color+`">${parlamentar.nome}</font> </td> <td style="padding-right:20px">` + |
|
||||
`<font color="`+color+`">${parlamentar.partido}</font> </td> <td style="padding-right:20px">` + |
|
||||
`<font color="`+color+`">${parlamentar.voto}</font> </td></tr>`) |
|
||||
} |
|
||||
|
|
||||
function changeFontSize(elementId, increment) { |
|
||||
let element = document.getElementById(elementId); |
|
||||
if (element) { |
|
||||
let currentSize = parseFloat(window.getComputedStyle(element, null).getPropertyValue('font-size')); |
|
||||
element.style.fontSize = (currentSize + increment) + 'px'; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
</script> |
|
||||
</html> |
|
||||
|
|
||||
@ -1,323 +0,0 @@ |
|||||
{% load i18n %} |
|
||||
{% load common_tags %} |
|
||||
{% load render_bundle from webpack_loader %} |
|
||||
{% load webpack_static from webpack_loader %} |
|
||||
|
|
||||
<!DOCTYPE HTML> |
|
||||
<html lang="pt-br"> |
|
||||
<head> |
|
||||
<meta charset="UTF-8"> |
|
||||
<title>{% block head_title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %}</title> |
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
||||
|
|
||||
{% render_chunk_vendors 'css' %} |
|
||||
{% render_bundle 'global' 'css' %} |
|
||||
{% render_bundle 'painel' 'css' %} |
|
||||
|
|
||||
<style type="text/css"> |
|
||||
html, body { |
|
||||
max-width: 100%; |
|
||||
overflow-x: hidden; |
|
||||
} |
|
||||
@media screen { |
|
||||
body { |
|
||||
background: #1c1b1b; |
|
||||
} |
|
||||
ul, li { |
|
||||
list-style-type: none; |
|
||||
} |
|
||||
#date, #relogio, #resultado_votacao, #blocoprincipal, #blocoerro { |
|
||||
font-family: Verdana; |
|
||||
} |
|
||||
#votos |
|
||||
{ |
|
||||
text-align:center; |
|
||||
} |
|
||||
#votosim, #votonao, #votoabstencao |
|
||||
{ |
|
||||
display:inline; |
|
||||
} |
|
||||
|
|
||||
#voltar { |
|
||||
margin-left: 5rem; |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body> |
|
||||
|
|
||||
<div id="ws-status-banner" style="display:none; position:fixed; top:0; left:0; right:0; z-index:2000; padding:10px 16px; text-align:center; font-weight:bold; color:#fff;"></div> |
|
||||
|
|
||||
{% if not error_message %} |
|
||||
<div id="blocoprincipal" style="display:block"> |
|
||||
<h1><b><font color="#4FA64D"><p align="center">{{sessao}}</p></font></b></h1> |
|
||||
<table style="width:90%"> |
|
||||
<tr> |
|
||||
<td style="text-align:center"><font color="white" size="4">Data Início: {{data}}</font></td> |
|
||||
<td style="text-align:center"><font color="white" size="4">Hora Início: {{hora}}</font></td> |
|
||||
</tr> |
|
||||
|
|
||||
<tr> |
|
||||
<td style="text-align:center"><font color="white" size="6"><span id="date"></span></font></td> |
|
||||
|
|
||||
<td style="text-align:center"><font color="white" size="6"><span id="relogio"></span></font></td> |
|
||||
</tr> |
|
||||
</table> |
|
||||
|
|
||||
</br> |
|
||||
</br> |
|
||||
<h2> |
|
||||
<font color="white"> |
|
||||
<p align="center" style="font-family:Verdana">Voto: |
|
||||
{% if voto_parlamentar == "Sim" %} |
|
||||
<font color="#449d44">{{voto_parlamentar}}</font> |
|
||||
{% elif voto_parlamentar == "Não" %} |
|
||||
<font color="#d9534f">{{voto_parlamentar}}</font> |
|
||||
{% elif voto_parlamentar == "Abstenção" %} |
|
||||
<font color="#eaeaea">{{voto_parlamentar}}</font> |
|
||||
{% endif %} |
|
||||
</p> |
|
||||
</font> |
|
||||
</h2> |
|
||||
{% if status_message %} |
|
||||
<p align="center" style="font-family:Verdana"> |
|
||||
<font color="#8fbfe0">{{status_message}}</font> |
|
||||
</p> |
|
||||
{% endif %} |
|
||||
</br> |
|
||||
</br> |
|
||||
|
|
||||
<h2><font color="#459170"><p align="center" style="font-family:Verdana">Matéria em Votação</p></font></h2> |
|
||||
<table style="width:75%; border:1px;" align="center"> |
|
||||
<tr><th style="text-align:center"><h4><font color="white" size="5">{{materia}}</font></h4></th></tr> |
|
||||
<tr><th style="text-align:center"><h4><font color="white">{{ementa}}</font></h4></th></tr> |
|
||||
<tr><th style="text-align:center"><font color="#45919D"><span id="resultado_votacao"></span></font></th></tr> |
|
||||
</table> |
|
||||
|
|
||||
<br /><br /> |
|
||||
<form method='POST'> |
|
||||
{% csrf_token %} |
|
||||
<div class="row" align="center"> |
|
||||
<div class="col-md-12" id="votos"> |
|
||||
<div id="votosim"><input type="submit" class="btn btn-lg btn-success" id="voto" name="voto" type="submit" value="Sim" /></div> |
|
||||
|
|
||||
<div id="votonao"><input type="submit" class="btn btn-lg btn-danger" id="voto" name="voto" type="submit" value="Não"/></div> |
|
||||
|
|
||||
<div id="votoabstencao"><input type="submit" class="btn btn-lg btn-secondary" id="voto" name="voto" type="submit" value="Abstenção"/></div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</br> |
|
||||
</br> |
|
||||
<center><table style="width:30%"> |
|
||||
<tr> |
|
||||
<td style="text-align:center"><button type="button" class="btn btn-lg btn-primary" onclick="javascript:window.location.reload(true)">Atualizar</button></td> |
|
||||
<td style="text-align:center"><button type="button" class="btn btn-lg btn-secondary" onclick="javascript:window.close()">Sair</button></td> |
|
||||
</tr> |
|
||||
</table></center> |
|
||||
</form> |
|
||||
</div> |
|
||||
{% else %} |
|
||||
<div id="blocoerro" style="display:block"> |
|
||||
<h1><font color="#eaeaea"><p align="center" style="font-family:Verdana">⏸</p></font></h1> |
|
||||
<h2><font color="#f0ad4e"><p align="center" style="font-family:Verdana">{{error_message}}</p></font></h2> |
|
||||
</br> |
|
||||
</br> |
|
||||
</br> |
|
||||
<center><table style="width:30%"> |
|
||||
<tr> |
|
||||
<td style="text-align:center"><button type="button" class="btn btn-lg btn-primary" onclick="javascript:window.location.reload(true)">Atualizar</button></td> |
|
||||
<td style="text-align:center"><button type="button" class="btn btn-lg btn-secondary" onclick="javascript:window.close()">Sair</button></td> |
|
||||
</tr> |
|
||||
</table></center> |
|
||||
|
|
||||
</div> |
|
||||
{% endif %} |
|
||||
</body> |
|
||||
</html> |
|
||||
|
|
||||
{% if not error_message %} |
|
||||
{% render_chunk_vendors 'js' %} |
|
||||
{% render_bundle 'global' 'js' %} |
|
||||
{% render_bundle 'painel' 'js' %} |
|
||||
|
|
||||
<script type="text/javascript"> |
|
||||
|
|
||||
$(window).on('beforeunload', function () { |
|
||||
$("input[type=submit], input[type=button]").prop("disabled", "disabled"); |
|
||||
}); |
|
||||
|
|
||||
//TODO: Este código é necessário? |
|
||||
// $( "#votosim" ).mouseleave(function(){document.location.reload(true);}); |
|
||||
// $( "#votonao" ).mouseleave(function(){document.location.reload(true);}); |
|
||||
// $( "#votoabstencao" ).mouseleave(function(){document.location.reload(true);}); |
|
||||
|
|
||||
$(document).on('keyup', (e) => { |
|
||||
var tecla_press = e.keyCode; |
|
||||
switch (tecla_press) { |
|
||||
case 83: // 83 = valor da tecla S |
|
||||
document.querySelectorAll("#votosim input")[0].click(); |
|
||||
break; |
|
||||
case 78: //78 = valor da tecla N |
|
||||
document.querySelectorAll("#votonao input")[0].click(); |
|
||||
break; |
|
||||
case 65: //65 = valor da tecla A |
|
||||
document.querySelectorAll("#votoabstencao input")[0].click(); |
|
||||
break; |
|
||||
case 86: //86 = valor da tecla V |
|
||||
document.querySelectorAll("#voltar button")[0].click(); |
|
||||
break; |
|
||||
}; |
|
||||
}); |
|
||||
|
|
||||
function checkTime(i) { |
|
||||
if (i<10) |
|
||||
i = "0" + i; // add zero in front of numbers < 10 |
|
||||
return i; |
|
||||
} |
|
||||
|
|
||||
function startTime() { |
|
||||
var today=new Date(); |
|
||||
var h=today.getHours(); |
|
||||
var m=today.getMinutes(); |
|
||||
var s=today.getSeconds(); |
|
||||
m = checkTime(m); |
|
||||
s = checkTime(s); |
|
||||
$("#relogio").text(h+":"+m+":"+s) |
|
||||
var t = setTimeout(() => startTime(), 500); |
|
||||
} |
|
||||
|
|
||||
$(document).ready(function(){ |
|
||||
var d = new Date(); |
|
||||
var n = d.toLocaleDateString(); |
|
||||
$("#date").text(n); |
|
||||
|
|
||||
startTime(); |
|
||||
}); |
|
||||
|
|
||||
</script> |
|
||||
{% endif %} |
|
||||
|
|
||||
<script type="text/javascript"> |
|
||||
// Sem poll de segurança: esta tela vive do WebSocket. O broadcast |
|
||||
// (build_dados_painel) carrega o estado compartilhado do painel, não o |
|
||||
// status pessoal deste vereador — então cada 'data' recebido apenas |
|
||||
// dispara verificaEstado(), que busca o status pessoal de verdade e |
|
||||
// recarrega a página só se algo relevante mudou. |
|
||||
(function() { |
|
||||
var estadoAtual = { |
|
||||
materiaId: "{% if materia %}{{ materia.id }}{% endif %}", |
|
||||
errorMessage: "{{ error_message|default:''|escapejs }}", |
|
||||
statusMessage: "{{ status_message|default:''|escapejs }}", |
|
||||
votoParlamentar: "{{ voto_parlamentar|default:''|escapejs }}" |
|
||||
}; |
|
||||
|
|
||||
function verificaEstado() { |
|
||||
fetch("{% url 'sapl.painel:voto_individual_status' %}", {credentials: 'same-origin'}) |
|
||||
.then(function(resp) { return resp.json(); }) |
|
||||
.then(function(data) { |
|
||||
var novo = { |
|
||||
materiaId: data.materia_id ? String(data.materia_id) : "", |
|
||||
errorMessage: data.error_message || "", |
|
||||
statusMessage: data.status_message || "", |
|
||||
votoParlamentar: data.voto_parlamentar || "" |
|
||||
}; |
|
||||
if (novo.materiaId !== estadoAtual.materiaId || |
|
||||
novo.errorMessage !== estadoAtual.errorMessage || |
|
||||
novo.statusMessage !== estadoAtual.statusMessage || |
|
||||
novo.votoParlamentar !== estadoAtual.votoParlamentar) { |
|
||||
document.location.reload(); |
|
||||
} |
|
||||
}) |
|
||||
.catch(function() { /* sem poll — só tenta de novo no próximo broadcast */ }); |
|
||||
} |
|
||||
|
|
||||
var banner = document.getElementById('ws-status-banner'); |
|
||||
|
|
||||
function showWsBanner(message, isError) { |
|
||||
if (!banner) return; |
|
||||
banner.textContent = message; |
|
||||
banner.style.display = 'block'; |
|
||||
banner.style.background = isError ? '#b00020' : '#b8860b'; |
|
||||
} |
|
||||
|
|
||||
function hideWsBanner() { |
|
||||
if (!banner) return; |
|
||||
banner.style.display = 'none'; |
|
||||
} |
|
||||
|
|
||||
var PERMANENT_CLOSE_MESSAGES = { |
|
||||
4401: 'Sessão expirada ou usuário não autenticado. Faça login novamente e recarregue a página.', |
|
||||
4403: 'Seu usuário não tem permissão para acessar esta tela.', |
|
||||
4404: 'Sessão plenária não encontrada.' |
|
||||
}; |
|
||||
|
|
||||
// Antes, a conexão WS só era aberta condicionalmente a haver matéria em |
|
||||
// votação: sem isso, a tela nunca abria WebSocket enquanto nenhuma |
|
||||
// matéria estivesse aberta, e dependia inteiramente do poll (agora |
|
||||
// removido) para notar quando uma matéria abrisse. Conecta sempre que |
|
||||
// houver uma sessão (can_vote()/sessao_votacao() em sapl/painel/views.py |
|
||||
// só preenchem sessao_id quando existe uma SessaoPlenaria com votação |
|
||||
// aberta — com ou sem matéria aberta dentro dela) — abrir_votacao já |
|
||||
// dispara broadcast_dados_painel(). Sem sessao_id não há URL de WS |
|
||||
// válida pra montar (nenhuma sessão aberta agora é um estado normal, |
|
||||
// não uma falha de conexão), então nem tenta. |
|
||||
{% if sessao_id %} |
|
||||
(function() { |
|
||||
var wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; |
|
||||
var wsUrl = wsProtocol + '//' + window.location.host + '/ws/painel/{{ sessao_id }}/'; |
|
||||
var MIN_RECONNECT_DELAY_MS = 1000; |
|
||||
var MAX_RECONNECT_DELAY_MS = 30000; |
|
||||
var reconnectDelayMs = MIN_RECONNECT_DELAY_MS; |
|
||||
|
|
||||
function nextDelay() { |
|
||||
var base = Math.min(reconnectDelayMs * 2, MAX_RECONNECT_DELAY_MS); |
|
||||
return Math.round(base * (0.7 + Math.random() * 0.6)); |
|
||||
} |
|
||||
|
|
||||
function connect() { |
|
||||
var socket = new WebSocket(wsUrl); |
|
||||
|
|
||||
socket.onopen = function() { |
|
||||
reconnectDelayMs = MIN_RECONNECT_DELAY_MS; |
|
||||
hideWsBanner(); |
|
||||
verificaEstado(); |
|
||||
}; |
|
||||
|
|
||||
socket.onmessage = function(event) { |
|
||||
var message; |
|
||||
try { |
|
||||
message = JSON.parse(event.data); |
|
||||
} catch (e) { |
|
||||
return; |
|
||||
} |
|
||||
if (message && message.type === 'data') { |
|
||||
verificaEstado(); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
socket.onclose = function(event) { |
|
||||
var permanentMessage = PERMANENT_CLOSE_MESSAGES[event.code]; |
|
||||
if (permanentMessage) { |
|
||||
showWsBanner(permanentMessage, true); |
|
||||
return; |
|
||||
} |
|
||||
showWsBanner( |
|
||||
'Conexão em tempo real perdida. Verifique se o Redis e o ' + |
|
||||
'Daphne (ou "./manage.py runserver") estão em execução. ' + |
|
||||
'Tentando reconectar…', |
|
||||
false |
|
||||
); |
|
||||
setTimeout(connect, reconnectDelayMs); |
|
||||
reconnectDelayMs = nextDelay(); |
|
||||
}; |
|
||||
|
|
||||
socket.onerror = function() { |
|
||||
socket.close(); |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
connect(); |
|
||||
})(); |
|
||||
{% endif %} |
|
||||
})(); |
|
||||
</script> |
|
||||
Loading…
Reference in new issue