├── LICENSE.txt ├── README.md ├── index.js └── src ├── assets └── colorData.json ├── components ├── app-footer.js ├── app-header.js ├── app-main.js ├── custom-cropper.js ├── default-dp.js ├── error-dart.js ├── error-rabbit.js ├── loading.js ├── maintainer-view.js ├── masonry.js ├── no-match.js ├── non-maintainer-view.js ├── notifications-list-view.js ├── search.js ├── surprise.js ├── tile-card.js ├── tiles.js └── user-card.js ├── constants └── years.js ├── css ├── app-footer.css ├── app-header.css ├── app.css ├── custom-cropper.css ├── default-dp.css ├── error-dart.css ├── error-rabbit.css ├── hamburger.css ├── inline.css ├── no-match.css ├── search.css ├── tiles.css └── user-card.css ├── urls.js └── utils ├── index.js └── themeHOC.js /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Formula 1 2 | 3 | > Frontend development at the speed of light 4 | 5 | Formula One on the frontend is a collection of frequently used Omniport UI 6 | components and common utility functions that can be used across the frontend of 7 | any Omniport app or service. 8 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import AppHeader from './src/components/app-header' 2 | import AppMain from './src/components/app-main' 3 | import AppFooter from './src/components/app-footer' 4 | import DefaultDP from './src/components/default-dp' 5 | import Loading from './src/components/loading' 6 | import UserCard from './src/components/user-card' 7 | import TileCard from './src/components/tile-card' 8 | import Tiles from './src/components/tiles' 9 | import MaintainerView from './src/components/maintainer-view' 10 | import NonMaintainerView from './src/components/non-maintainer-view' 11 | import { MasonryLayout } from './src/components/masonry' 12 | import CustomCropper from './src/components/custom-cropper' 13 | import NoMatch from './src/components/no-match' 14 | import ErrorDart from './src/components/error-dart' 15 | import ErrorRabbit from './src/components/error-rabbit' 16 | import Surprise from './src/components/surprise' 17 | import Search from './src/components/search' 18 | import { 19 | ifRole, 20 | getCookie, 21 | consoleIMG, 22 | appDetails, 23 | commonApps, 24 | getTheme, 25 | getThemeObject, 26 | setCookie 27 | } from './src/utils' 28 | import { 29 | urlErrorAssets, 30 | urlGravatarProfileAvatar, 31 | urlGetMaintainers, 32 | urlGif, 33 | urlRedirectLogin, 34 | urlRoulette, 35 | urlRights, 36 | urlWhoAmI, 37 | urlAppList, 38 | urlInstituteBranding, 39 | urlAppBranding, 40 | urlMaintainersBranding, 41 | urlSiteBranding, 42 | urlDefaultNotificationIcon, 43 | urlGetBranchAndDegreeData, 44 | urlGetFilteredStudents, 45 | } from './src/urls' 46 | export { 47 | AppHeader, 48 | AppFooter, 49 | AppMain, 50 | DefaultDP, 51 | appDetails, 52 | commonApps, 53 | getTheme, 54 | getThemeObject, 55 | setCookie, 56 | Loading, 57 | TileCard, 58 | Tiles, 59 | UserCard, 60 | MaintainerView, 61 | MasonryLayout, 62 | CustomCropper, 63 | NonMaintainerView, 64 | ifRole, 65 | getCookie, 66 | consoleIMG, 67 | urlAppList, 68 | urlInstituteBranding, 69 | urlAppBranding, 70 | urlErrorAssets, 71 | urlGravatarProfileAvatar, 72 | urlMaintainersBranding, 73 | urlSiteBranding, 74 | urlGetMaintainers, 75 | urlWhoAmI, 76 | urlGif, 77 | urlRoulette, 78 | urlRights, 79 | urlRedirectLogin, 80 | urlDefaultNotificationIcon, 81 | NoMatch, 82 | ErrorDart, 83 | ErrorRabbit, 84 | Surprise, 85 | urlGetBranchAndDegreeData, 86 | urlGetFilteredStudents, 87 | Search, 88 | } 89 | -------------------------------------------------------------------------------- /src/assets/colorData.json: -------------------------------------------------------------------------------- 1 | { 2 | "list": [ 3 | { 4 | "name": "red", 5 | "verboseName": "Luscious Red", 6 | "description": "Passionate and driven", 7 | "hexCode": "#db2828" 8 | }, 9 | { 10 | "name": "orange", 11 | "verboseName": "Maverick Orange", 12 | "description": "Unorthodox and chaotic", 13 | "hexCode": "#f2711c" 14 | }, 15 | { 16 | "name": "yellow", 17 | "verboseName": "Sunkissed Yellow", 18 | "description": "Lucky and happy", 19 | "hexCode": "#fbbd08" 20 | }, 21 | { 22 | "name": "olive", 23 | "verboseName": "Disgusting Olive", 24 | "description": "Niche and nice", 25 | "hexCode": "#b5cc18" 26 | }, 27 | { 28 | "name": "green", 29 | "verboseName": "Earthly Green", 30 | "description": "Patient and healing", 31 | "hexCode": "#21ba45" 32 | }, 33 | { 34 | "name": "teal", 35 | "verboseName": "Aqua Teal", 36 | "description": "Gentle and powerful", 37 | "hexCode": "#00b5ad" 38 | }, 39 | { 40 | "name": "blue", 41 | "verboseName": "Bland Blue", 42 | "description": "Calming and relaxing", 43 | "hexCode": "#2185d0" 44 | }, 45 | { 46 | "name": "violet", 47 | "verboseName": "Rich Lavender", 48 | "description": "Regal and classy", 49 | "hexCode": "#6435c9" 50 | }, 51 | { 52 | "name": "purple", 53 | "verboseName": "Lightning Purple", 54 | "description": "Fierce and romantic", 55 | "hexCode": "#a333c8" 56 | }, 57 | { 58 | "name": "pink", 59 | "verboseName": "Proud Pink", 60 | "description": "Unique and beautiful", 61 | "hexCode": "#e03997" 62 | }, 63 | { 64 | "name": "black", 65 | "verboseName": "Wicked Black", 66 | "description": "Nightly and sinful", 67 | "hexCode": "#1b1c1d" 68 | } 69 | ] 70 | } -------------------------------------------------------------------------------- /src/components/app-footer.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import axios from 'axios' 3 | import { Icon, Image, Segment, Popup, Transition } from 'semantic-ui-react' 4 | import { BrowserView, MobileView } from 'react-device-detect' 5 | import { includes } from 'lodash' 6 | 7 | import { 8 | consoleIMG, 9 | urlMaintainersBranding, 10 | urlGif, 11 | Surprise 12 | } from 'formula_one' 13 | 14 | import blocks from '../css/app-footer.css' 15 | import inline from '../css/inline.css' 16 | 17 | let logger = [] 18 | const konamiCode = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13] 19 | const konami = '38,38,40,40,37,39,37,39,66,65,13' 20 | class AppFooter extends React.PureComponent { 21 | constructor (props) { 22 | super(props) 23 | const date = new Date() 24 | this.state = { 25 | year: date.getFullYear(), 26 | maintainer: null, 27 | loaded: false, 28 | surprise: 0, 29 | surpriseVisibility: false 30 | } 31 | } 32 | 33 | componentDidMount () { 34 | window.addEventListener('keydown', this.handleKeyPress) 35 | consoleIMG() 36 | this.addBranding() 37 | } 38 | 39 | componentWillUnmount () { 40 | window.removeEventListener('keydown', this.handleKeyPress) 41 | } 42 | 43 | addBranding = () => { 44 | axios 45 | .get(urlMaintainersBranding()) 46 | .then(res => { 47 | this.setState({ 48 | loaded: true, 49 | maintainer: res.data 50 | }) 51 | }) 52 | .catch(err => {}) 53 | } 54 | 55 | surpriseCounter = () => { 56 | this.setState({ 57 | surprise: this.state.surprise + 1 58 | }) 59 | } 60 | 61 | handleKeyPress = e => { 62 | if (includes(konamiCode, e.keyCode)) { 63 | logger.push(e.keyCode) 64 | if (logger.toString().indexOf(konami) >= 0) { 65 | console.log( 66 | '%c ', 67 | `font-size: 15em; background: url(${window.location.origin}${urlGif( 68 | 'hammy' 69 | )}) no-repeat; background-size: contain;` 70 | ) 71 | console.log('Hey Hammy') 72 | logger = [] 73 | } 74 | } else { 75 | logger = [] 76 | } 77 | } 78 | 79 | getReadyForSurprise = () => { 80 | this.setState({ 81 | surpriseVisibility: true 82 | }) 83 | } 84 | 85 | render () { 86 | const { 87 | year, 88 | loaded, 89 | maintainer, 90 | surprise, 91 | surpriseVisibility 92 | } = this.state 93 | const { creators } = this.props 94 | return ( 95 | 101 | 102 |
107 | {surprise < 2 ? ( 108 | 109 |
110 | © {year} 111 | {loaded && maintainer.imagery.favicon ? ( 112 | {maintainer.text.name} 119 | ) : ( 120 | ', ' 121 | )} 122 | 123 | {loaded && maintainer.text.name} 124 | 125 |
126 |
127 | Powered by{' '} 128 | Omniport 135 | 136 | Omniport 137 | 138 |
139 |
140 | ) : ( 141 |
142 | {surpriseVisibility || ( 143 | 150 | } 151 | content='Meet the team' 152 | position='top center' 153 | /> 154 | )} 155 | 160 | 161 | 162 |
163 | )} 164 |
165 |
166 | 167 |
168 | 169 |
170 | {/* 171 | This hidden to preserve valuable space on mobile 172 | 173 | © {year} 174 | 175 |
176 | */} 177 | {loaded && maintainer.imagery.favicon && ( 178 | {maintainer.text.name} 185 | )} 186 | 187 | {loaded && maintainer.text.name} 188 | 189 | {/* 190 |
191 | 192 | {branding.siteInfo && branding.siteInfo['siteVerboseName']} 193 | 194 | */} 195 |
196 |
197 |
198 |
199 |
200 | ) 201 | } 202 | } 203 | 204 | export default AppFooter 205 | -------------------------------------------------------------------------------- /src/components/app-header.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import axios from 'axios' 3 | import Helmet from 'react-helmet' 4 | import { isBrowser } from 'react-device-detect' 5 | import { 6 | Dropdown, 7 | Segment, 8 | Header, 9 | Image, 10 | Icon, 11 | Button, 12 | Popup, 13 | Responsive 14 | } from 'semantic-ui-react' 15 | import { map } from 'lodash' 16 | 17 | import { 18 | urlAppBranding, 19 | urlInstituteBranding, 20 | urlSiteBranding, 21 | urlMaintainersBranding, 22 | urlWhoAmI, 23 | getTheme, 24 | getThemeObject, 25 | appDetails, 26 | DefaultDP 27 | } from 'formula_one' 28 | 29 | import NotificationListView from './notifications-list-view' 30 | import header from '../css/app-header.css' 31 | import inline from '../css/inline.css' 32 | import hamburger from '../css/hamburger.css' 33 | 34 | const hamburgerDefaultOptions = [ 35 | 'hamburger--minus', 36 | 'hamburger--spin', 37 | 'hamburger--squeeze' 38 | ] 39 | class AppHeader extends React.PureComponent { 40 | state = { 41 | site: null, 42 | institute: null, 43 | maintainers: null, 44 | app: null, 45 | loaded: false 46 | } 47 | 48 | getSiteBranding() { 49 | return axios.get(urlSiteBranding()) 50 | } 51 | 52 | getMaintainersBranding() { 53 | return axios.get(urlMaintainersBranding()) 54 | } 55 | 56 | getInstituteBranding() { 57 | return axios.get(urlInstituteBranding()) 58 | } 59 | 60 | getAppBranding() { 61 | return axios.get(urlAppBranding(this.props.appName)) 62 | } 63 | 64 | addBranding = () => { 65 | const api_array = [ 66 | this.getMaintainersBranding(), 67 | this.getSiteBranding(), 68 | this.getInstituteBranding() 69 | ] 70 | this.props.mode === 'app' && api_array.push(this.getAppBranding()) 71 | axios.all(api_array).then( 72 | axios.spread((maintainers, site, institute, app = { data: {} }) => { 73 | this.setState({ 74 | maintainers: maintainers.data, 75 | site: site.data, 76 | institute: institute.data, 77 | app: app.data, 78 | loaded: true 79 | }) 80 | }) 81 | ) 82 | } 83 | 84 | setUser = () => { 85 | axios 86 | .get(urlWhoAmI()) 87 | .then(res => { 88 | this.setState({ 89 | whoAmI: res.data 90 | }) 91 | }) 92 | .catch(() => { 93 | this.setState({ 94 | whoAmI: null 95 | }) 96 | }) 97 | } 98 | 99 | componentDidMount() { 100 | this.addBranding() 101 | this.setUser() 102 | } 103 | 104 | /** 105 | * Renders favicon on the tab 106 | */ 107 | faviconUrlRenderer = () => { 108 | const { site, app, loaded } = this.state 109 | const { mode } = this.props 110 | 111 | // Wait for the 200 response from all the API's 112 | if (loaded) { 113 | // If the mode of the header is 'app' 114 | if (mode === 'app') { 115 | // Renders favicon of app provided by backend, if it exists 116 | if (app.assets && app.assets.favicon) { 117 | return `/static/${app.baseUrls.static}${app.assets && 118 | app.assets.favicon}` 119 | } 120 | 121 | // Renders favicon of site provided by backend, if it exists and app favicon doesn't 122 | else { 123 | if (site.imagery && site.imagery.favicon) { 124 | return site.imagery.favicon 125 | } 126 | } 127 | } 128 | 129 | // By default, selected mode is 'site' 130 | // Renders favicon of site provided by backend, if it exists 131 | else if (site.imagery && site.imagery.favicon) { 132 | return site.imagery.favicon 133 | } 134 | } 135 | } 136 | 137 | /** 138 | * Renders title of the page 139 | */ 140 | pageHead = () => { 141 | const { site, app, loaded } = this.state 142 | const { mode } = this.props 143 | 144 | // Wait for 200 response of all branding APIs 145 | if (loaded) { 146 | // If the mode of the header is 'app' 147 | if (mode === 'app') { 148 | // Render app verboseName from backend 149 | return {app.nomenclature.verboseName} 150 | } 151 | 152 | // By default, mode is 'site' 153 | else { 154 | // Render site verboseName from backend 155 | return {site.nomenclature.verboseName} 156 | } 157 | } 158 | // While retrieving data form APIs, render an empty string 159 | return {site.nomenclature.verboseName} 160 | } 161 | 162 | /** 163 | * Returns the logo details for the left logo in the header 164 | loaded && */ 165 | headerLogoDetail = () => { 166 | const { site, app, loaded } = this.state 167 | const { mode } = this.props 168 | 169 | // Wait for the 200 response from all the APIs 170 | if (loaded) { 171 | // If the mode of the header is 'app' 172 | if (mode === 'app') { 173 | // Check if selected mode is 'app' and logo exists at backend in assets 174 | // Return the app logo from backend as logo 175 | if (app.assets && app.assets.logo) { 176 | return { 177 | image: true, 178 | src: `/static/${app.baseUrls.static}${app.assets.logo}`, 179 | text: app.nomenclature.verboseName 180 | } 181 | } 182 | 183 | // If app logo doesn't exist at backend, 184 | // Check if site logo is present, and return the site logo as logo 185 | else if (site.imagery.logo) { 186 | return { 187 | image: true, 188 | src: site.imagery.logo, 189 | text: site.nomenclature.verboseName 190 | } 191 | } 192 | 193 | // If app logo as well as site logo doesn't exist at backend, 194 | // Check if site wordmark is present, and return the site wordmark as logo 195 | else if (site.imagery.wordmark) { 196 | return { 197 | image: true, 198 | src: site.imagery.wordmark, 199 | text: site.nomenclature.verboseName 200 | } 201 | } 202 | 203 | // If app logo, site logo as well as site wordmark isn't present at backend, 204 | // Return the site verboseName as logo 205 | else { 206 | return { 207 | image: false, 208 | src: '', 209 | text: site.nomenclature.verboseName 210 | } 211 | } 212 | } 213 | 214 | else if (mode === 'public') { 215 | 216 | // If mode is public then use site logo 217 | if (site.imagery.logo) { 218 | return { 219 | image: true, 220 | src: site.imagery.logo, 221 | text: site.nomenclature.verboseName 222 | } 223 | } 224 | 225 | // If site logo is not present use site wordmark instead 226 | else if (site.imagery.wordmark) { 227 | return { 228 | image: true, 229 | src: site.imagery.wordmark, 230 | text: site.nomenclature.verboseName 231 | } 232 | } 233 | 234 | // If site wordmark is not present use site name instead 235 | else { 236 | return { 237 | image: false, 238 | src: '', 239 | text: site.nomenclature.verboseName 240 | } 241 | } 242 | } 243 | 244 | // By default, selected mode is 'site' 245 | // Check if site logo is provided and set site logo as logo 246 | else if (site.imagery.logo) { 247 | return { 248 | image: true, 249 | src: site.imagery.logo, 250 | text: site.nomenclature.verboseName 251 | } 252 | } 253 | 254 | // If site logo is not present use site wordmark instead 255 | else if (site.imagery.wordmark) { 256 | return { 257 | image: true, 258 | src: site.imagery.wordmark, 259 | text: site.nomenclature.verboseName 260 | } 261 | } 262 | 263 | // If site wordmark is not present use site name instead 264 | else { 265 | return { 266 | image: false, 267 | src: '', 268 | text: site.nomenclature.verboseName 269 | } 270 | } 271 | } 272 | } 273 | 274 | /** 275 | * Renders the logo on the left in the header 276 | loaded && */ 277 | headerLogoRenderer = () => { 278 | const { loaded } = this.state 279 | 280 | // Wait for the 200 response from all the APIs 281 | if (loaded) { 282 | if (this.headerLogoDetail().image) { 283 | return ( 284 | {this.headerLogoDetail().text} 290 | ) 291 | } else { 292 | return ( 293 |
294 |
{this.headerLogoDetail().text}
295 |
296 | ) 297 | } 298 | } 299 | } 300 | 301 | /** 302 | * Gives link to the logo on the left in the header 303 | */ 304 | headerLeftLogoLinks = () => { 305 | const { app, loaded } = this.state 306 | const { appName, mode } = this.props 307 | 308 | // Wait for the 200 response from all the APIs 309 | // Only renders app baseURL from frontend config if 310 | // - selected mode is app 311 | // - app logo exists (because if app logo doesn't exist, site logo will be on display and it should point to site) 312 | // - app is present in common list of apps from backend and frontend i.e. app exists 313 | if ( 314 | loaded && 315 | mode === 'app' && 316 | app.assets && 317 | app.assets.logo && 318 | appDetails(appName).present 319 | ) { 320 | return appDetails(appName).details.baseUrl 321 | } 322 | return '/' 323 | } 324 | 325 | /** 326 | * Renders display name on left in the header 327 | */ 328 | headerName = () => { 329 | const { site, app, loaded } = this.state 330 | const { mode } = this.props 331 | 332 | // Wait for 200 response of all branding APIs 333 | if (loaded) { 334 | // If the mode of the header is 'app' 335 | if (mode === 'app') { 336 | // Render app verboseName from backend 337 | return app.nomenclature.verboseName 338 | } 339 | 340 | // By default, mode is 'site' 341 | else { 342 | // Render site verboseName from backend 343 | return site.nomenclature.verboseName 344 | } 345 | } 346 | // While retrieving data form APIs, render an empty string 347 | return '' 348 | } 349 | 350 | headerSecondaryTitle = () => { 351 | const { site, loaded } = this.state 352 | const { mode } = this.props 353 | 354 | // Wait for 200 response of all branding APIs 355 | if (loaded) { 356 | // If the mode of the header is not 'app' 357 | if (mode != 'app') { 358 | // Render app tagline from backend 359 | return site.nomenclature.tagline 360 | } 361 | } 362 | // While retrieving data form APIs or in case of an app, render an empty string 363 | return '' 364 | } 365 | 366 | /** 367 | * Gives link to the display name on left 368 | */ 369 | headerNameLink = () => { 370 | const { loaded } = this.state 371 | const { appName, mode } = this.props 372 | 373 | // Wait for the 200 response from all the APIs 374 | // Only renders app baseURL from frontend config if 375 | // - selected mode is app 376 | // - app is present in common list of apps from backend and frontend i.e. app exists 377 | if (loaded && mode === 'app' && appDetails(appName).present) { 378 | return appDetails(appName).details.baseUrl 379 | } 380 | return '/' 381 | } 382 | 383 | /** 384 | * Renders logo on right in case userDropdown is set to false 385 | */ 386 | headerRightLogoRenderer = () => { 387 | const { institute, loaded } = this.state 388 | 389 | // Wait for 200 response of all branding APIs 390 | if (loaded) { 391 | // Check if institue logo exist renders institute logo 392 | if (institute.imagery.logo) { 393 | return ( 394 | {institute.text.name} 400 | ) 401 | } 402 | 403 | // If institute logo doesn't exist but wordmark exist, renders wordmark 404 | else if (institute.imagery.wordmark) { 405 | return 406 | {institute.text.name} 412 | } 413 | 414 | // If neither of institute logo or wordmark exist, renders institute text name as heading 415 | else { 416 | return
{institute.text.name}
417 | } 418 | } 419 | } 420 | 421 | user = () => { 422 | const { whoAmI } = this.state 423 | if (whoAmI && whoAmI['displayPicture'] !== '' && whoAmI['displayPicture']) { 424 | return ( 425 | {whoAmI 432 | ) 433 | } 434 | return ( 435 | 436 | 438 | 439 | ) 440 | } 441 | 442 | render() { 443 | const { loaded, whoAmI } = this.state 444 | const { 445 | appName, 446 | mode, 447 | userDropdown, 448 | hamburgerOptions, 449 | onSidebarClick, 450 | sideBarButton, 451 | sideBarVisibility, 452 | middle, 453 | right 454 | } = this.props 455 | return ( 456 | 457 | 458 | 459 | {loaded && this.pageHead()} 460 | {loaded && } 461 | 462 | 463 |
464 |
465 | {sideBarButton && ( 466 | 484 | )} 485 | 486 | 487 | {this.headerLogoRenderer()} 488 | 489 | 493 | 494 |
495 |
{this.headerName()} 496 | 497 | {this.headerSecondaryTitle()} 498 | 499 |
500 |
501 |
502 |
503 |
504 | {middle && middle} 505 |
506 | {right && right} 507 | {userDropdown === true ? ( 508 | whoAmI ? ( 509 | 510 | 513 | 514 | 515 | } 516 | pointing='top right' 517 | icon={null} 518 | styleName='inline.margin-right-one' 519 | > 520 | 521 | 522 | 523 | 524 | 532 |
533 |
534 | {whoAmI && 535 | whoAmI.displayPicture && 536 | whoAmI.displayPicture !== '' ? ( 537 | user 547 | ) : ( 548 | 553 | )} 554 |
555 |
556 |
557 | {whoAmI.fullName} 558 | 559 | {map(whoAmI.roles, 'role').join(', ')} 560 | 561 |
562 |
563 |
564 |
565 | 572 |
609 |
610 |
611 | ) : ( 612 |
625 |
626 |
627 |
628 | ) 629 | } 630 | } 631 | 632 | export default AppHeader 633 | -------------------------------------------------------------------------------- /src/components/app-main.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import axios from 'axios' 3 | 4 | import { urlGif, urlRoulette } from 'formula_one' 5 | 6 | import blocks from '../css/app.css' 7 | class AppMain extends React.PureComponent { 8 | state = { 9 | appMainSurprise: {} 10 | } 11 | componentDidMount () { 12 | if ( 13 | window.localStorage.getItem('selectedColor') || 14 | window.localStorage.getItem('selectedColor') !== 'roulette' 15 | ) { 16 | localStorage.setItem( 17 | 'hint', 18 | 'Try to set value of selectedColor to roulette' 19 | ) 20 | } 21 | if (window.localStorage.getItem('selectedColor') === 'roulette') { 22 | localStorage.setItem('hint', 'To go back, Remove roulette!!') 23 | axios 24 | .get(urlRoulette()) 25 | .then(res => { 26 | console.log( 27 | '' + 28 | 'Never gonna give you up, \n' + 29 | 'Never gonna let you down, \n' + 30 | 'Never gonna run around and desert you \n' + 31 | 'Never gonna make you cry, \n' + 32 | 'Never gonna say goodbye, \n' + 33 | 'Never gonna tell a lie and hurt you' 34 | ) 35 | }) 36 | .catch(err => { 37 | if (err.response.data) { 38 | const index = Math.floor(Math.random() * err.response.data.count) 39 | this.setState({ 40 | appMainSurprise: { 41 | flexGrow: '1', 42 | display: 'flex', 43 | flexDirection: 'row', 44 | height: '100%', 45 | justifyContent: 'center', 46 | background: `url(${window.location.origin + 47 | urlGif('roulette/' + index)})`, 48 | backgroundPosition: 'center' 49 | } 50 | }) 51 | } 52 | }) 53 | } 54 | } 55 | render () { 56 | const { appMainSurprise } = this.state 57 | return ( 58 | 59 | {window.localStorage.getItem('selectedColor') === 'roulette' ? ( 60 |
61 | ) : ( 62 | this.props.children 63 | )} 64 | 65 | ) 66 | } 67 | } 68 | 69 | export default AppMain 70 | -------------------------------------------------------------------------------- /src/components/custom-cropper.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactCrop from 'react-image-crop' 3 | 4 | import '../css/custom-cropper.css' 5 | 6 | class CustomCropper extends React.PureComponent { 7 | render() { 8 | return ( 9 | 10 | ) 11 | } 12 | } 13 | 14 | export default CustomCropper 15 | -------------------------------------------------------------------------------- /src/components/default-dp.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import axios from 'axios' 3 | import { Placeholder } from 'semantic-ui-react' 4 | 5 | import { getThemeObject, urlGravatarProfileAvatar } from 'formula_one' 6 | 7 | import '../css/default-dp.css' 8 | 9 | var getInitials = function (string) { 10 | var names = string.split(' '), 11 | initials = names[0].substring(0, 1).toUpperCase() 12 | 13 | if (names.length > 1) { 14 | initials += names[names.length - 1].substring(0, 1).toUpperCase() 15 | } 16 | return initials 17 | } 18 | class DefaultDP extends React.Component { 19 | constructor (props) { 20 | super(props) 21 | this.state = { 22 | loading: true, 23 | gravatar: false 24 | } 25 | } 26 | componentDidMount () { 27 | const { gravatarHash, size } = this.props 28 | if (gravatarHash) { 29 | axios 30 | .get(urlGravatarProfileAvatar(gravatarHash), { 31 | responseType: 'arraybuffer', 32 | params: { 33 | d: 404, 34 | s: size ? size.slice(0, -2) * 14 : 21 35 | } 36 | }) 37 | .then(res => { 38 | const image = btoa( 39 | new Uint8Array(res.data).reduce( 40 | (data, byte) => data + String.fromCharCode(byte), 41 | '' 42 | ) 43 | ) 44 | this.setState({ 45 | loading: false, 46 | gravatar: `data:${res.headers[ 47 | 'content-type' 48 | ].toLowerCase()};base64,${image}` 49 | }) 50 | }) 51 | .catch(err => { 52 | this.setState({ 53 | loading: false, 54 | gravatar: false 55 | }) 56 | }) 57 | } else { 58 | this.setState({ 59 | loading: false, 60 | gravatar: false 61 | }) 62 | } 63 | } 64 | render () { 65 | const { name, size } = this.props 66 | const { loading, gravatar } = this.state 67 | const { dualInitials } = this.props 68 | return ( 69 | 70 | {loading ? ( 71 | 77 | 78 | 79 | ) : gravatar ? ( 80 | 81 | ) : ( 82 |
86 | {dualInitials ? getInitials(name) : `${name && name[0].toUpperCase()}`} 90 |
91 | )} 92 |
93 | ) 94 | } 95 | } 96 | 97 | export default DefaultDP 98 | -------------------------------------------------------------------------------- /src/components/error-dart.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Header, Button } from 'semantic-ui-react' 3 | 4 | import { getTheme, urlErrorAssets } from 'formula_one' 5 | 6 | import blocks from '../css/error-dart.css' 7 | 8 | export default class ErrorDart extends React.PureComponent { 9 | render () { 10 | return ( 11 |
12 |
13 |
14 |
15 | 404: Foundn't 16 | Content not found 17 |
18 | 27 |
28 |
29 | 33 |
34 |
35 |
36 |
37 | 41 |
42 |
43 | 44 |
45 |
46 |
47 | ) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/components/error-rabbit.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Header, Button } from 'semantic-ui-react' 3 | 4 | import { getTheme, urlErrorAssets } from 'formula_one' 5 | 6 | import blocks from '../css/error-rabbit.css' 7 | 8 | export default class ErrorRabbit extends React.PureComponent { 9 | render () { 10 | return ( 11 |
12 |
13 |
14 |
15 | 404: Foundn't 16 | Content not found 17 |
18 | 27 |
28 |
29 | 33 | 37 | 41 |
42 |
43 | 44 |
45 |
46 |
47 | ) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/components/loading.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Dimmer, Loader, Segment } from 'semantic-ui-react' 3 | 4 | export default function Loading (props) { 5 | if (props.isLoading || true) { 6 | if (props.timedOut) { 7 | return
Loader timed out!
8 | } else if (props.pastDelay || true) { 9 | return ( 10 | 20 | 21 | 22 | 23 | 24 | ) 25 | } else { 26 | return null 27 | } 28 | } else if (props.error) { 29 | return
Error! Component failed to load
30 | } else { 31 | return null 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/components/maintainer-view.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import axios from 'axios' 3 | 4 | import { urlRights } from 'formula_one' 5 | class MaintainerView extends React.PureComponent { 6 | state = { 7 | hasRights: false 8 | } 9 | getSpecialRights = () => { 10 | axios 11 | .get(urlRights(this.props.which)) 12 | .then(res => { 13 | this.setState({ 14 | hasRights: res.data['hasRights'] 15 | }) 16 | }) 17 | .catch(err => { 18 | this.setState({ 19 | hasRights: false 20 | }) 21 | }) 22 | } 23 | componentDidMount () { 24 | this.getSpecialRights() 25 | } 26 | 27 | render () { 28 | const { children } = this.props 29 | return {this.state.hasRights && children} 30 | } 31 | } 32 | 33 | export default MaintainerView 34 | -------------------------------------------------------------------------------- /src/components/masonry.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | function getMinColumn (data) { 5 | let minObject = data['column0'] 6 | let min = data['column0'].height 7 | let minProperty = 'column0' 8 | for (var property in data) { 9 | if (data.hasOwnProperty(property)) { 10 | if (min > data[property].height) { 11 | min = data[property].height 12 | minObject = data[property] 13 | minProperty = property 14 | } 15 | } 16 | } 17 | return { prop: minProperty, obj: minObject } 18 | } 19 | export const MasonryLayout = props => { 20 | const columnWrapper = {} // data 21 | const result = [] 22 | for (let i = 0; i < props.columns; i++) { 23 | columnWrapper[`column${i}`] = { height: 0, data: [] } 24 | } 25 | 26 | for (let i = 0; i < props.children.length; i++) { 27 | const columnIndex = getMinColumn(columnWrapper).prop 28 | columnWrapper[columnIndex].height = columnWrapper[columnIndex].height + 1 29 | if (props.children[i].props.image) { 30 | columnWrapper[columnIndex].height = columnWrapper[columnIndex].height + 1 31 | } 32 | columnWrapper[columnIndex].data.push( 33 | {props.children[i]} 34 | ) 35 | } 36 | for (let i = 0; i < props.columns; i++) { 37 | result.push( 38 |
0 ? props.gap : 0}px`, 41 | flex: 1 42 | }} 43 | key={i} 44 | > 45 | {columnWrapper[`column${i}`].data} 46 |
47 | ) 48 | } 49 | return
{result}
50 | } 51 | 52 | MasonryLayout.propTypes = { 53 | columns: PropTypes.number.isRequired, 54 | gap: PropTypes.number.isRequired, 55 | children: PropTypes.arrayOf(PropTypes.element) 56 | } 57 | MasonryLayout.defaultProps = { 58 | columns: 2, 59 | gap: 10 60 | } 61 | -------------------------------------------------------------------------------- /src/components/no-match.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import axios from 'axios' 4 | import { isBrowser } from 'react-device-detect' 5 | import { Container } from 'semantic-ui-react' 6 | import { Scrollbars } from 'react-custom-scrollbars' 7 | import { Redirect } from 'react-router' 8 | 9 | import { 10 | AppHeader, 11 | AppFooter, 12 | AppMain, 13 | ErrorDart, 14 | ErrorRabbit, 15 | urlWhoAmI 16 | } from 'formula_one' 17 | 18 | import main from '../css/app.css' 19 | import blocks from '../css/no-match.css' 20 | 21 | export default class NoMatch extends React.PureComponent { 22 | state= { 23 | whoAmI: null, 24 | userLoaded : false 25 | } 26 | setUser = () => { 27 | axios 28 | .get(urlWhoAmI()) 29 | .then(res => { 30 | this.setState({ 31 | whoAmI: res.data, 32 | userLoaded : true 33 | }) 34 | }) 35 | .catch(() => { 36 | this.setState({ 37 | whoAmI: null, 38 | userLoaded : true 39 | }) 40 | }) 41 | } 42 | componentDidMount () { 43 | this.setUser() 44 | } 45 | render() { 46 | const { whoAmI, userLoaded } = this.state 47 | const creators = [ 48 | { 49 | name: 'Dhruv Bhanushali', 50 | role: 'Mentor', 51 | link: 'https://dhruvkb.github.io/' 52 | }, 53 | { 54 | name: 'Divyanshu Tiwari', 55 | role: 'Designer', 56 | link: 'https://github.com/clinckzone' 57 | }, 58 | { 59 | name: 'Praduman Goyal', 60 | role: 'Frontend Developer', 61 | link: 'https://pradumangoyal.github.io' 62 | } 63 | ] 64 | return ( 65 | 66 | {(whoAmI || !userLoaded)? ( 67 | 68 |
69 | 70 | 71 |
72 | 73 |
74 | 75 | {isBrowser ? : } 76 | 77 |
78 |
79 |
80 |
81 | 82 |
83 |
84 | ) : ( 85 | 88 | )} 89 |
90 | ) 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/components/non-maintainer-view.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import axios from 'axios' 3 | 4 | import { urlRights } from 'formula_one' 5 | class NonMaintainerView extends React.PureComponent { 6 | state = { 7 | hasRights: false 8 | } 9 | getSpecialRights = () => { 10 | axios 11 | .get(urlRights(this.props.which)) 12 | .then(res => { 13 | this.setState({ 14 | hasRights: res.data['hasRights'] 15 | }) 16 | }) 17 | .catch(err => { 18 | this.setState({ 19 | hasRights: false 20 | }) 21 | }) 22 | } 23 | componentDidMount () { 24 | this.getSpecialRights() 25 | } 26 | 27 | render () { 28 | const { children } = this.props 29 | return {!this.state.hasRights && children} 30 | } 31 | } 32 | 33 | export default NonMaintainerView 34 | -------------------------------------------------------------------------------- /src/components/notifications-list-view.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import axios from 'axios' 3 | import path from 'path' 4 | import { Link } from 'react-router-dom' 5 | import { Dropdown, Header, Image, Icon } from 'semantic-ui-react' 6 | 7 | import { getThemeObject } from 'formula_one' 8 | import { 9 | urlUserNotifications, 10 | urlAllNotifications, 11 | urlDefaultNotificationIcon 12 | } from '../urls' 13 | import '../css/inline.css' 14 | 15 | class NotificationsListView extends React.Component { 16 | state = { 17 | notifications: [], 18 | count: 0 19 | } 20 | getNotifications = () => { 21 | axios 22 | .get(urlUserNotifications()) 23 | .then(res => { 24 | this.setState({ 25 | notifications: res.data['results'], 26 | count: res.data['count'] 27 | }) 28 | }) 29 | .catch(err => { 30 | // TODO: Remove console.log, use error handlers 31 | }) 32 | } 33 | 34 | componentDidMount () { 35 | this.getNotifications() 36 | } 37 | 38 | render () { 39 | const unreadStyle = { 40 | backgroundColor: getThemeObject().hexCode + '07' // Opacity 41 | } 42 | return ( 43 | <> 44 | {this.state.count ? ( 45 | this.state.notifications.map((notification, index) => { 46 | const app = notification.category.appInfo 47 | return ( 48 | 56 | 64 | 65 | {!notification.category.isApp 66 | ? `${app.nomenclature.verboseName}: ` 67 | : ''} 68 | {notification.category.name} 69 | 70 | {notification.template} 71 | 72 | 73 | 74 | } 75 | /> 76 | ) 77 | }) 78 | ) : ( 79 | 80 | )} 81 | {this.state.count && this.state.notifications ? ( 82 | 88 | ) : null} 89 | 90 | ) 91 | } 92 | } 93 | 94 | export default NotificationsListView 95 | -------------------------------------------------------------------------------- /src/components/search.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import axios from 'axios' 3 | import { Divider, Dropdown, Button } from 'semantic-ui-react'; 4 | import {yearOptions} from '../constants/years' 5 | import { 6 | urlGetBranchAndDegreeData, 7 | urlGetFilteredStudents, 8 | } from '../urls' 9 | 10 | import '../css/search.css' 11 | 12 | class Search extends React.Component { 13 | constructor(props) { 14 | super(props); 15 | this.state = { 16 | filterYear: [], 17 | filterBranch: [], 18 | filterDegree: [], 19 | filterBY: [], 20 | branches: {}, 21 | degrees: {}, 22 | filterStudents: [], 23 | } 24 | } 25 | 26 | componentDidMount() { 27 | this.getBranchAndDegrees() 28 | } 29 | 30 | getBranchAndDegrees() { 31 | axios 32 | .get(urlGetBranchAndDegreeData()) 33 | .then(res => { 34 | this.setState({ 35 | branches: res.data.branches, 36 | degrees: res.data.degrees, 37 | }) 38 | }) 39 | .catch(() => { 40 | 41 | }) 42 | } 43 | 44 | onChange = (event, { name, value }) => { 45 | let filter = '' 46 | if (this.state.hasOwnProperty(name)) { 47 | this.setState({ [name]: value }, () => { 48 | 49 | if (this.state.filterBranch != '') { 50 | filter = `${filter}branch=${this.state.filterBranch}&` 51 | } 52 | 53 | if (this.state.filterDegree != '') { 54 | filter = `${filter}degree=${this.state.filterDegree}&` 55 | } 56 | 57 | if (this.state.filterYear != '') { 58 | filter = `${filter}year=${this.state.filterYear}&` 59 | } 60 | 61 | if (this.state.filterBY != '') { 62 | filter = `${filter}branch_year=${this.state.filterBY}&` 63 | } 64 | 65 | axios 66 | .get(urlGetFilteredStudents(filter)) 67 | .then(res => { 68 | this.setState({ 69 | filterStudents: res.data, 70 | }) 71 | let filteredArray = res.data 72 | if (this.props.ids) { 73 | var idArray = filteredArray.map(s => s.id); 74 | this.props.addFilteredStudents(idArray) 75 | } else { 76 | this.props.addFilteredStudents(filteredArray) 77 | } 78 | }) 79 | .catch(() => { 80 | 81 | }) 82 | 83 | }) 84 | } 85 | } 86 | 87 | render() { 88 | const { branches, degrees, filterYear, filterBranch, filterDegree, filterBY } = this.state 89 | const { shareWithAll } = this.props 90 | let branchOptions = [] 91 | let degreeOptions = [] 92 | let byOptions = [] 93 | 94 | for (const i in branches) { 95 | branchOptions.push({ 96 | key: i.toString(), 97 | value: i.toString(), 98 | text: branches[i].toString(), 99 | }); 100 | } 101 | for (const i in degrees) { 102 | degreeOptions.push({ 103 | key: i.toString(), 104 | value: i.toString(), 105 | text: degrees[i].toString(), 106 | }); 107 | } 108 | 109 | for (const i in yearOptions) { 110 | for (const j in branches) { 111 | byOptions.push({ 112 | key: yearOptions[i].value.toString() + '.' + j.toString(), 113 | value: yearOptions[i].value.toString() + '.' + j.toString(), 114 | text: yearOptions[i].text + " " + branches[j].toString(), 115 | }); 116 | } 117 | } 118 | 119 | return ( 120 |
121 |
122 |
123 | 135 | 147 | 159 |
160 | 161 |
162 | 174 |
175 |
176 |
177 | ) 178 | } 179 | } 180 | 181 | export default Search 182 | -------------------------------------------------------------------------------- /src/components/surprise.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { Label } from 'semantic-ui-react' 3 | 4 | const colors = ['blue', 'orange', 'red', 'green', 'violet', 'yellow'] 5 | 6 | class Surprise extends Component { 7 | render () { 8 | const { creators } = this.props 9 | return ( 10 |
11 | {creators && 12 | creators.map((creator, index) => { 13 | return ( 14 | 25 | ) 26 | })} 27 |
28 | ) 29 | } 30 | } 31 | 32 | export default Surprise 33 | -------------------------------------------------------------------------------- /src/components/tile-card.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import { Card, Header, Icon, Image } from 'semantic-ui-react' 4 | 5 | import { getTheme } from 'formula_one' 6 | 7 | import inline from 'formula_one/src/css/inline.css' 8 | 9 | const TileCard = props => { 10 | const { name, desc, className, iconName, imageUrl, ...otherProps } = props 11 | return ( 12 | 17 | 18 |
19 |
20 | {imageUrl ? ( 21 | 22 | ) : ( 23 | 29 | )} 30 |
31 |
32 |
33 | {name} 34 | {desc} 35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | ) 43 | } 44 | TileCard.propTypes = { 45 | name: PropTypes.string.isRequired, 46 | desc: PropTypes.object, 47 | className: PropTypes.string 48 | } 49 | 50 | export default TileCard 51 | -------------------------------------------------------------------------------- /src/components/tiles.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Link } from 'react-router-dom' 3 | import { Card, Container } from 'semantic-ui-react' 4 | 5 | import { TileCard } from 'formula_one' 6 | 7 | import '../css/tiles.css' 8 | 9 | class Tiles extends React.PureComponent { 10 | getTileCards = () => { 11 | const { tiles } = this.props 12 | return tiles.map((tile, index) => { 13 | return ( 14 | 24 | ) 25 | }) 26 | } 27 | 28 | render() { 29 | return ( 30 | 31 | 32 | {this.getTileCards()} 33 | 34 | 35 | ) 36 | } 37 | } 38 | 39 | export default Tiles 40 | -------------------------------------------------------------------------------- /src/components/user-card.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Card, Image, Header } from 'semantic-ui-react' 3 | import { startCase } from 'lodash' 4 | 5 | import { DefaultDP } from 'formula_one' 6 | 7 | import '../css/user-card.css' 8 | 9 | export default class UserCard extends React.Component { 10 | render () { 11 | const { 12 | gravatarHash, 13 | image, 14 | name, 15 | size, 16 | username, 17 | roles, 18 | right 19 | } = this.props 20 | return ( 21 | 22 | 23 |
24 |
25 | {image ? ( 26 | {name} 27 | ) : ( 28 | 33 | )} 34 |
35 |
36 |
37 | {name} 38 | {username} 39 | {roles && ( 40 | 41 | {roles 42 | .map(role => { 43 | return startCase(role) 44 | }) 45 | .join(', ')} 46 | 47 | )} 48 |
49 |
50 | {right &&
{right}
} 51 |
52 |
53 |
54 | ) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/constants/years.js: -------------------------------------------------------------------------------- 1 | export const yearOptions = [ 2 | { key: 1, text: '1st Year', value: 1 }, 3 | { key: 2, text: '2nd Year', value: 2 }, 4 | { key: 3, text: '3rd Year', value: 3 }, 5 | { key: 4, text: '4th Year', value: 4 }, 6 | { key: 5, text: '5th Year', value: 5 }, 7 | { key: 6, text: '6th Year', value: 6 }, 8 | { key: 7, text: '7th Year', value: 7 }, 9 | { key: 8, text: '8th Year', value: 8 }, 10 | { key: 9, text: '9th Year', value: 9 }, 11 | { key: 10, text: '10th Year', value: 10 }, 12 | ] -------------------------------------------------------------------------------- /src/css/app-footer.css: -------------------------------------------------------------------------------- 1 | .footer-container { 2 | outline: none; 3 | display: flex; 4 | flex-direction: row; 5 | align-items: center; 6 | justify-content: space-between; 7 | min-height: 2em; 8 | } 9 | .footer-wrapper{ 10 | display: flex; 11 | align-items: center; 12 | } 13 | .footer-container-mobile { 14 | display: flex; 15 | flex-direction: row; 16 | align-items: center; 17 | justify-content: center; 18 | height: 0.5em; 19 | } 20 | .footer-logo { 21 | margin: 0 0.5em; 22 | height: 16px; 23 | } 24 | -------------------------------------------------------------------------------- /src/css/app-header.css: -------------------------------------------------------------------------------- 1 | .app-header-segment{ 2 | padding: 0.5em !important; 3 | } 4 | 5 | .header-container { 6 | display: flex; 7 | flex-direction: row; 8 | justify-content: space-between; 9 | align-items: center; 10 | } 11 | 12 | .popup { 13 | cursor: pointer; 14 | } 15 | 16 | .header-text { 17 | display: inline-flex; 18 | height: 3.5em; 19 | vertical-align: bottom; 20 | align-items: center; 21 | } 22 | 23 | .app-name { 24 | border-left: 1px solid #d4d4d4; 25 | padding-left: 0.5em; 26 | margin-left: 0.5em; 27 | } 28 | 29 | .user-area-style { 30 | display: inline-flex; 31 | align-items: center; 32 | } 33 | 34 | .site-logo { 35 | height: 3.5em; 36 | } 37 | -------------------------------------------------------------------------------- /src/css/app.css: -------------------------------------------------------------------------------- 1 | .app-header { 2 | flex-grow: 0; 3 | } 4 | 5 | .app { 6 | display: flex; 7 | flex-direction: column; 8 | height: 100%; 9 | max-height: 100%; 10 | } 11 | 12 | .app-main { 13 | flex-grow: 1; 14 | display: flex; 15 | flex-direction: row; 16 | height: 100%; 17 | } 18 | 19 | .app-footer { 20 | flex-grow: 0; 21 | } -------------------------------------------------------------------------------- /src/css/custom-cropper.css: -------------------------------------------------------------------------------- 1 | :global .ReactCrop { 2 | position: relative; 3 | display: inline-block; 4 | cursor: crosshair; 5 | overflow: hidden; 6 | max-width: 100%; 7 | background-color: #000; 8 | } 9 | 10 | :global .ReactCrop:focus { 11 | outline: none; 12 | } 13 | 14 | :global .ReactCrop--disabled, 15 | :global .ReactCrop--locked { 16 | cursor: inherit; 17 | } 18 | 19 | :global .ReactCrop__image { 20 | /* autoprefixer: off */ 21 | display: block; 22 | max-width: 100%; 23 | max-height: -webkit-fill-available; 24 | max-height: -moz-available; 25 | max-height: fill-available; 26 | } 27 | 28 | :global .ReactCrop--crop-invisible :global .ReactCrop__image { 29 | opacity: 0.5; 30 | } 31 | 32 | :global .ReactCrop__crop-selection { 33 | position: absolute; 34 | top: 0; 35 | left: 0; 36 | transform: translate3d(0, 0, 0); 37 | box-sizing: border-box; 38 | cursor: move; 39 | box-shadow: 0 0 0 9999em rgba(0, 0, 0, 0.5); 40 | border: 1px solid; 41 | border-image-source: url("data:image/gif;base64,R0lGODlhCgAKAJECAAAAAP///////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEI5RDc5MTFDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEI5RDc5MTBDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEBQoAAgAsAAAAAAoACgAAAhWEERkn7W3ei7KlagMWF/dKgYeyGAUAIfkEBQoAAgAsAAAAAAoACgAAAg+UYwLJ7RnQm7QmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYgLJHdiinNSAVfOEKoUCACH5BAUKAAIALAAAAAAKAAoAAAIRVISAdusPo3RAzYtjaMIaUQAAIfkEBQoAAgAsAAAAAAoACgAAAg+MDiem7Q8bSLFaG5il6xQAIfkEBQoAAgAsAAAAAAoACgAAAg+UYRLJ7QnQm7SmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYBLJDdiinNSEVfOEKoECACH5BAUKAAIALAAAAAAKAAoAAAIRFISBdusPo3RBzYsjaMIaUQAAOw=="); 42 | border-image-slice: 1; 43 | border-image-repeat: repeat; 44 | } 45 | 46 | :global .ReactCrop--disabled :global .ReactCrop__crop-selection { 47 | cursor: inherit; 48 | } 49 | 50 | :global .ReactCrop__drag-handle { 51 | position: absolute; 52 | width: 9px; 53 | height: 9px; 54 | background-color: rgba(0, 0, 0, 0.2); 55 | border: 1px solid rgba(255, 255, 255, 0.7); 56 | box-sizing: border-box; 57 | outline: 1px solid transparent; 58 | } 59 | 60 | :global .ReactCrop .ord-nw { 61 | top: 0; 62 | left: 0; 63 | margin-top: -5px; 64 | margin-left: -5px; 65 | cursor: nw-resize; 66 | } 67 | 68 | :global .ReactCrop .ord-n { 69 | top: 0; 70 | left: 50%; 71 | margin-top: -5px; 72 | margin-left: -5px; 73 | cursor: n-resize; 74 | } 75 | 76 | :global .ReactCrop .ord-ne { 77 | top: 0; 78 | right: 0; 79 | margin-top: -5px; 80 | margin-right: -5px; 81 | cursor: ne-resize; 82 | } 83 | 84 | :global .ReactCrop .ord-e { 85 | top: 50%; 86 | right: 0; 87 | margin-top: -5px; 88 | margin-right: -5px; 89 | cursor: e-resize; 90 | } 91 | 92 | :global .ReactCrop .ord-se { 93 | bottom: 0; 94 | right: 0; 95 | margin-bottom: -5px; 96 | margin-right: -5px; 97 | cursor: se-resize; 98 | } 99 | 100 | :global .ReactCrop .ord-s { 101 | bottom: 0; 102 | left: 50%; 103 | margin-bottom: -5px; 104 | margin-left: -5px; 105 | cursor: s-resize; 106 | } 107 | 108 | :global .ReactCrop .ord-sw { 109 | bottom: 0; 110 | left: 0; 111 | margin-bottom: -5px; 112 | margin-left: -5px; 113 | cursor: sw-resize; 114 | } 115 | 116 | :global .ReactCrop .ord-w { 117 | top: 50%; 118 | left: 0; 119 | margin-top: -5px; 120 | margin-left: -5px; 121 | cursor: w-resize; 122 | } 123 | 124 | :global .ReactCrop__disabled :global .ReactCrop__drag-handle { 125 | cursor: inherit; 126 | } 127 | 128 | :global .ReactCrop__drag-bar { 129 | position: absolute; 130 | } 131 | 132 | :global .ReactCrop__drag-bar.ord-n { 133 | top: 0; 134 | left: 0; 135 | width: 100%; 136 | height: 6px; 137 | margin-top: -3px; 138 | } 139 | 140 | :global .ReactCrop__drag-bar.ord-e { 141 | right: 0; 142 | top: 0; 143 | width: 6px; 144 | height: 100%; 145 | margin-right: -3px; 146 | } 147 | 148 | :global .ReactCrop__drag-bar.ord-s { 149 | bottom: 0; 150 | left: 0; 151 | width: 100%; 152 | height: 6px; 153 | margin-bottom: -3px; 154 | } 155 | 156 | :global .ReactCrop__drag-bar.ord-w { 157 | top: 0; 158 | left: 0; 159 | width: 6px; 160 | height: 100%; 161 | margin-left: -3px; 162 | } 163 | 164 | :global .ReactCrop--new-crop :global .ReactCrop__drag-bar, 165 | :global .ReactCrop--new-crop :global .ReactCrop__drag-handle, 166 | :global .ReactCrop--fixed-aspect :global .ReactCrop__drag-bar { 167 | display: none; 168 | } 169 | 170 | :global .ReactCrop--fixed-aspect :global .ReactCrop__drag-handle.ord-n, 171 | :global .ReactCrop--fixed-aspect :global .ReactCrop__drag-handle.ord-e, 172 | :global .ReactCrop--fixed-aspect :global .ReactCrop__drag-handle.ord-s, 173 | :global .ReactCrop--fixed-aspect :global .ReactCrop__drag-handle.ord-w { 174 | display: none; 175 | } 176 | 177 | @media (max-width: 768px), 178 | (pointer: coarse) { 179 | :global .ReactCrop__drag-handle { 180 | width: 17px; 181 | height: 17px; 182 | } 183 | :global .ReactCrop .ord-nw { 184 | margin-top: -9px; 185 | margin-left: -9px; 186 | } 187 | :global .ReactCrop .ord-n { 188 | margin-top: -9px; 189 | margin-left: -9px; 190 | } 191 | :global .ReactCrop .ord-ne { 192 | margin-top: -9px; 193 | margin-right: -9px; 194 | } 195 | :global .ReactCrop .ord-e { 196 | margin-top: -9px; 197 | margin-right: -9px; 198 | } 199 | :global .ReactCrop .ord-se { 200 | margin-bottom: -9px; 201 | margin-right: -9px; 202 | } 203 | :global .ReactCrop .ord-s { 204 | margin-bottom: -9px; 205 | margin-left: -9px; 206 | } 207 | :global .ReactCrop .ord-sw { 208 | margin-bottom: -9px; 209 | margin-left: -9px; 210 | } 211 | :global .ReactCrop .ord-w { 212 | margin-top: -9px; 213 | margin-left: -9px; 214 | } 215 | :global .ReactCrop__drag-bar.ord-n { 216 | height: 14px; 217 | margin-top: -7px; 218 | } 219 | :global .ReactCrop__drag-bar.ord-e { 220 | width: 14px; 221 | margin-right: -7px; 222 | } 223 | :global .ReactCrop__drag-bar.ord-s { 224 | height: 14px; 225 | margin-bottom: -7px; 226 | } 227 | :global .ReactCrop__drag-bar.ord-w { 228 | width: 14px; 229 | margin-left: -7px; 230 | } 231 | } -------------------------------------------------------------------------------- /src/css/default-dp.css: -------------------------------------------------------------------------------- 1 | .avatar-image{ 2 | display: flex; 3 | align-items: center; 4 | justify-content: center; 5 | border-radius: 9999em; /* Infinity */ 6 | } 7 | 8 | .avatar-image::after{ 9 | content: ""; 10 | padding-bottom: 100%; 11 | } 12 | 13 | .avatar-image-text{ 14 | font-size: 1.5em; /* Default in case props is not passed */ 15 | font-family: monospace; 16 | color: white; 17 | padding: 0em 0.5em; 18 | display: inline-block; 19 | user-select: none; 20 | -webkit-touch-callout: none; 21 | -webkit-user-select: none; 22 | -khtml-user-select: none; 23 | -moz-user-select: none; 24 | -ms-user-select: none; 25 | } 26 | -------------------------------------------------------------------------------- /src/css/error-dart.css: -------------------------------------------------------------------------------- 1 | .wrapper{ 2 | width: 100%; 3 | height: 100%; 4 | min-height: inherit; 5 | display: flex; 6 | flex-direction: column; 7 | } 8 | .error-header{ 9 | display: flex; 10 | justify-content: space-between; 11 | } 12 | 13 | .error-body{ 14 | display: flex; 15 | } 16 | 17 | .dart-container{ 18 | display: flex; 19 | flex-grow: 1; 20 | } 21 | .dart-text-container{ 22 | } 23 | 24 | .person-container{ 25 | display: flex; 26 | align-items: flex-end; 27 | } 28 | 29 | .board-container{ 30 | display: flex; 31 | align-items: flex-end; 32 | } 33 | 34 | .person{ 35 | width: auto; 36 | margin-top: 100px; 37 | height: 360px; 38 | content: url('/static/errors/person_stressed.svg'); 39 | animation: sweat 0.75s ease-in; 40 | } 41 | 42 | .dartboard{ 43 | height: 80px; 44 | } 45 | 46 | .dart{ 47 | position: relative; 48 | height: 50px; 49 | left: calc(100% - 120px); 50 | animation: throw-dart 0.25s ease; 51 | transform: rotate(-35deg) scale(0.65); 52 | } 53 | 54 | @keyframes throw-dart { 55 | from { 56 | transform: translateX(-20vw) rotate(-35deg) translateY(5.3vw) scale(1); 57 | } 58 | to { 59 | transform: translateX(0) rotate(-35deg) scale(0.65); 60 | } 61 | } 62 | 63 | @keyframes sweat { 64 | from { 65 | content: url('/static/errors/person.svg'); 66 | } 67 | to { 68 | content: url('/static/errors/person_stressed.svg') 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/css/error-rabbit.css: -------------------------------------------------------------------------------- 1 | .wrapper{ 2 | width: 100%; 3 | height: 100%; 4 | min-height: inherit; 5 | display: flex; 6 | justify-content: center; 7 | } 8 | .container{ 9 | width: 100%; 10 | min-height: 400px; 11 | display: flex; 12 | flex-direction: column; 13 | } 14 | .error-header{ 15 | display: flex; 16 | flex-direction: column; 17 | align-items: center; 18 | margin-bottom: 1em; 19 | } 20 | .rabbit{ 21 | height: 300px; 22 | display: flex; 23 | justify-content: center; 24 | } 25 | .rabit-container{ 26 | display: flex; 27 | flex-direction: column; 28 | align-items: center; 29 | justify-content: center; 30 | } 31 | .confetti-container{ 32 | display: flex; 33 | justify-content: center; 34 | flex-grow: 1; 35 | position: relative; 36 | z-index: 99; 37 | } 38 | .confetti{ 39 | width: 100%; 40 | position: absolute; 41 | top: 100%; 42 | z-index: 99; 43 | opacity: 0.75; 44 | } 45 | .confetti_yellow{ 46 | animation: bomb 2s ease; 47 | } 48 | .confetti_pink{ 49 | animation: bomb 1.5s ease; 50 | } 51 | .confetti_green{ 52 | animation: bomb 1.75s ease; 53 | } 54 | @keyframes bomb { 55 | 0% { 56 | transform: scale(0.25) translateY(0px); 57 | opacity: 0; 58 | } 59 | 20% { 60 | transform: scale(1) translateY(-4em); 61 | opacity: 0.75; 62 | } 63 | 100% { 64 | transform: translateY(0); 65 | opacity: 0.75; 66 | } 67 | } -------------------------------------------------------------------------------- /src/css/hamburger.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Hamburgers 3 | * @description Tasty CSS-animated hamburgers 4 | * @author Jonathan Suh @jonsuh 5 | * @site https://jonsuh.com/hamburgers 6 | * @link https://github.com/jonsuh/hamburgers 7 | */ 8 | .hamburger { 9 | padding: 15px 15px; 10 | display: inline-flex; 11 | margin-left: -1em !important; 12 | vertical-align: middle; 13 | cursor: pointer; 14 | transition-property: opacity, filter; 15 | transition-duration: 0.15s; 16 | transition-timing-function: linear; 17 | font: inherit; 18 | color: inherit; 19 | text-transform: none; 20 | background-color: transparent; 21 | border: 0; 22 | margin: 0; 23 | overflow: visible; 24 | display: inline-flex; 25 | align-items: center; 26 | justify-content: center; 27 | outline: none; 28 | 29 | } 30 | .hamburger:hover { 31 | opacity: 0.7; } 32 | .hamburger.is-active:hover { 33 | opacity: 0.7; } 34 | .hamburger.is-active .hamburger-inner, 35 | .hamburger.is-active .hamburger-inner::before, 36 | .hamburger.is-active .hamburger-inner::after { 37 | background-color: #d4d4d4; } 38 | 39 | .hamburger-box { 40 | margin-right: 15px; 41 | display: inline-block; 42 | position: relative; 43 | outline: none; 44 | } 45 | 46 | .hamburger-inner { 47 | display: block; 48 | top: 50%; 49 | margin-top: -2px; } 50 | .hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { 51 | width: 20px; 52 | height: 2px; 53 | background-color: #d4d4d4; 54 | border-radius: 4px; 55 | position: absolute; 56 | transition-property: transform; 57 | transition-duration: 0.15s; 58 | transition-timing-function: ease; } 59 | .hamburger-inner::before, .hamburger-inner::after { 60 | content: ""; 61 | display: block; } 62 | .hamburger-inner::before { 63 | top: -7px; } 64 | .hamburger-inner::after { 65 | bottom: -7px; } 66 | 67 | /* 68 | * Minus 69 | */ 70 | .hamburger--minus .hamburger-inner::before, .hamburger--minus .hamburger-inner::after { 71 | transition: bottom 0.08s 0s ease-out, top 0.08s 0s ease-out, opacity 0s linear; } 72 | 73 | .hamburger--minus.is-active .hamburger-inner::before, .hamburger--minus.is-active .hamburger-inner::after { 74 | opacity: 0; 75 | transition: bottom 0.08s ease-out, top 0.08s ease-out, opacity 0s 0.08s linear; } 76 | 77 | .hamburger--minus.is-active .hamburger-inner::before { 78 | top: 0; } 79 | 80 | .hamburger--minus.is-active .hamburger-inner::after { 81 | bottom: 0; } 82 | 83 | /* 84 | * Spin 85 | */ 86 | .hamburger--spin .hamburger-inner { 87 | transition-duration: 0.22s; 88 | transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } 89 | .hamburger--spin .hamburger-inner::before { 90 | transition: top 0.1s 0.25s ease-in, opacity 0.1s ease-in; } 91 | .hamburger--spin .hamburger-inner::after { 92 | transition: bottom 0.1s 0.25s ease-in, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19); } 93 | 94 | .hamburger--spin.is-active .hamburger-inner { 95 | transform: rotate(225deg); 96 | transition-delay: 0.12s; 97 | transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } 98 | .hamburger--spin.is-active .hamburger-inner::before { 99 | top: 0; 100 | opacity: 0; 101 | transition: top 0.1s ease-out, opacity 0.1s 0.12s ease-out; } 102 | .hamburger--spin.is-active .hamburger-inner::after { 103 | bottom: 0; 104 | transform: rotate(-90deg); 105 | transition: bottom 0.1s ease-out, transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1); } 106 | 107 | /* 108 | * Squeeze 109 | */ 110 | .hamburger--squeeze .hamburger-inner { 111 | transition-duration: 0.15s; 112 | transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } 113 | .hamburger--squeeze .hamburger-inner::before { 114 | transition: top 0.15s 0.12s ease, opacity 0.15s ease; } 115 | .hamburger--squeeze .hamburger-inner::after { 116 | transition: bottom 0.15s 0.12s ease, transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); } 117 | 118 | .hamburger--squeeze.is-active .hamburger-inner { 119 | transform: rotate(45deg); 120 | transition-delay: 0.12s; 121 | transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } 122 | .hamburger--squeeze.is-active .hamburger-inner::before { 123 | top: 0; 124 | opacity: 0; 125 | transition: top 0.15s ease, opacity 0.15s 0.12s ease; } 126 | .hamburger--squeeze.is-active .hamburger-inner::after { 127 | bottom: 0; 128 | transform: rotate(-90deg); 129 | transition: bottom 0.15s ease, transform 0.1s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1); } -------------------------------------------------------------------------------- /src/css/inline.css: -------------------------------------------------------------------------------- 1 | .align-self-center { 2 | align-self: center !important; 3 | } 4 | 5 | .color-586069 { 6 | color: #586069 !important; 7 | } 8 | 9 | .cursor-pointer{ 10 | cursor: pointer !important; 11 | } 12 | .display-none { 13 | display: none !important; 14 | } 15 | .flex { 16 | display: flex !important; 17 | } 18 | 19 | .flex-column { 20 | display: flex !important; 21 | flex-direction: column !important; 22 | } 23 | 24 | .font-weight-bold { 25 | font-weight: bold !important; 26 | } 27 | .height-full { 28 | min-height: 100vh !important; 29 | } 30 | 31 | .height-3_5em { 32 | height: 3.5em !important; 33 | } 34 | .margin-0 { 35 | margin: 0 !important; 36 | } 37 | .margin-1em { 38 | margin: 1em !important; 39 | } 40 | .margin-2em { 41 | margin: 2em !important; 42 | } 43 | .margin-bottom-half { 44 | margin-bottom: 0.5em !important; 45 | } 46 | .margin-half { 47 | margin: 0.5em !important; 48 | } 49 | 50 | .margin-right-half { 51 | margin-right: 0.5em !important; 52 | } 53 | 54 | .margin-top-half { 55 | margin-top: 0.5em !important; 56 | } 57 | 58 | .margin-1_5em { 59 | margin: 1.5em !important; 60 | } 61 | 62 | .margin-bottom-0 { 63 | margin-bottom: 0 !important; 64 | } 65 | .margin-bottom-1em { 66 | margin-bottom: 1em !important; 67 | } 68 | .margin-bottom-1_5em { 69 | margin-bottom: 1.5em !important; 70 | } 71 | .margin-bottom-2em { 72 | margin-bottom: 2em !important; 73 | } 74 | .margin-left-1_5em { 75 | margin-left: 1.5em !important; 76 | } 77 | 78 | .margin-right-half { 79 | margin-right: 0.5em !important; 80 | } 81 | 82 | .margin-right-one { 83 | margin-right: 1em !important; 84 | } 85 | 86 | .margin-top-0 { 87 | margin-top: 0 !important; 88 | } 89 | 90 | .margin-top-1em { 91 | margin-top: 1em !important; 92 | } 93 | 94 | .margin-top-2em { 95 | margin-top: 2em !important; 96 | } 97 | 98 | .min-height-200px { 99 | min-height: 200px !important; 100 | } 101 | .min-width-300px { 102 | min-width: 300px !important; 103 | } 104 | 105 | .max-width-200px { 106 | max-width: 200px !important; 107 | } 108 | 109 | .text-align-left { 110 | text-align: left !important; 111 | } 112 | 113 | .padding-0 { 114 | padding: 0em !important; 115 | } 116 | .padding-half { 117 | padding: 0.5em !important; 118 | } 119 | 120 | .white-space-pre-wrap { 121 | white-space: pre-wrap !important; 122 | } 123 | .max-width-500px { 124 | max-width: 500px !important; 125 | } 126 | .width-80vw { 127 | width: 80vw !important; 128 | } 129 | .max-width-95p { 130 | width: 95%; 131 | } 132 | .ellipsis { 133 | white-space: nowrap; 134 | box-sizing: content-box; 135 | overflow: hidden; 136 | text-overflow: ellipsis; 137 | width: 100%; 138 | } -------------------------------------------------------------------------------- /src/css/no-match.css: -------------------------------------------------------------------------------- 1 | .app-wrapper { 2 | min-height: 100%; 3 | min-width: 100%; 4 | display: flex; 5 | align-items: center; 6 | justify-content: center; 7 | } 8 | 9 | .main { 10 | } -------------------------------------------------------------------------------- /src/css/search.css: -------------------------------------------------------------------------------- 1 | .container { 2 | width: 100%; 3 | padding: 1rem; 4 | border: 0.75px solid rgb(218, 217, 217); 5 | border-radius: 10px; 6 | margin: 1rem 0; 7 | display: flex; 8 | } 9 | 10 | .filterContainer { 11 | width: 100%; 12 | display: flex; 13 | flex-direction: column; 14 | justify-content: space-evenly; 15 | margin-right: 1rem; 16 | } 17 | 18 | .filter-1 { 19 | width: 100%; 20 | display: flex; 21 | justify-content: flex-start; 22 | flex-wrap: wrap; 23 | } 24 | 25 | .filter-1 > div { 26 | margin-right: 0.5rem; 27 | margin-bottom: 0.2rem; 28 | } 29 | 30 | .filter-2 { 31 | 32 | } 33 | 34 | .addButton { 35 | display: flex; 36 | align-items: center; 37 | } -------------------------------------------------------------------------------- /src/css/tiles.css: -------------------------------------------------------------------------------- 1 | .tile-container{ 2 | } -------------------------------------------------------------------------------- /src/css/user-card.css: -------------------------------------------------------------------------------- 1 | .user-card-wrapper{ 2 | display: flex; 3 | align-items: center; 4 | } 5 | .user-card-container{ 6 | display: flex; 7 | align-items: center; 8 | width: 100%; 9 | } 10 | .user-card-desc{ 11 | flex-grow: 1; 12 | } 13 | .user-image-container{ 14 | margin-right: 1em; 15 | } 16 | .user-image-container img{ 17 | width: 2.5em !important; 18 | height: 2.5em !important; 19 | border-radius: 9999em !important; /* Infinity */ 20 | } -------------------------------------------------------------------------------- /src/urls.js: -------------------------------------------------------------------------------- 1 | export function urlSiteBranding () { 2 | return '/bootstrap/site_branding/' 3 | } 4 | 5 | export function urlInstituteBranding () { 6 | return '/bootstrap/institute_branding/' 7 | } 8 | 9 | export function urlMaintainersBranding () { 10 | return '/bootstrap/maintainers_branding/' 11 | } 12 | 13 | export function urlAppList () { 14 | return `/api/apps/app/` 15 | } 16 | 17 | export function urlAppBranding (appName) { 18 | return `${urlAppList()}${appName}` 19 | } 20 | 21 | export function urlWhoAmI () { 22 | return '/kernel/who_am_i/' 23 | } 24 | 25 | export function urlGetMaintainers () { 26 | return '/api/yellow_pages/maintainer/' 27 | } 28 | 29 | export function urlRedirectLogin () { 30 | return '/rest/login' 31 | } 32 | 33 | export function urlRights (which) { 34 | return `/kernel/rights/?which=${which}` 35 | } 36 | 37 | export function urlRoulette () { 38 | return '/api/gif/roulette' 39 | } 40 | 41 | export function urlGif (name) { 42 | return `/static/gif/${name}.gif` 43 | } 44 | 45 | export function urlErrorAssets (name) { 46 | return `/static/errors/${name}.svg` 47 | } 48 | 49 | export function urlGravatarProfileAvatar (hash) { 50 | return `https://en.gravatar.com/avatar/${hash}` 51 | } 52 | 53 | export function urlUserNotifications () { 54 | return '/api/notifications/user_notifications' 55 | } 56 | 57 | export function urlAllNotifications () { 58 | return '/notifications/' 59 | } 60 | 61 | export function urlDefaultNotificationIcon () { 62 | return '/static/notifications/bell_icon.svg' 63 | } 64 | 65 | //urls for search component 66 | export function urlGetBranchAndDegreeData () { 67 | return `/api/yellow_pages/filter/get_branches_degrees/` 68 | } 69 | 70 | export function urlGetFilteredStudents (query) { 71 | return `/api/yellow_pages/filter/?${query}` 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/utils/index.js: -------------------------------------------------------------------------------- 1 | import { groupBy, spread, merge, reject, orderBy } from 'lodash' 2 | 3 | import config from 'core/src/configs/configs.json' 4 | import colorData from '../assets/colorData.json' 5 | 6 | /** 7 | * Determine whether a role exists in the given array 8 | * 9 | * @param {array} roles - The array of roles a person has 10 | * @param {string} role - The role whose existence is being checked 11 | * @returns {string} The ActiveStatus enum or NOT_ROLE 12 | */ 13 | export const ifRole = (roles, role) => { 14 | if (roles === undefined) { 15 | return 'EMPTY_ROLES_ARRAY' 16 | } 17 | let a = roles.filter(x => { 18 | return x['role'] === role 19 | }) 20 | if (a.length !== 0) { 21 | switch (a[0]['activeStatus']) { 22 | case 'ActiveStatus.IS_ACTIVE': 23 | return 'IS_ACTIVE' 24 | case 'ActiveStatus.HAS_BEEN_ACTIVE': 25 | return 'HAS_BEEN_ACTIVE' 26 | case 'ActiveStatus.WILL_BE_ACTIVE': 27 | return 'WILL_BE_ACTIVE' 28 | default: 29 | return 'NOT_ROLE' 30 | } 31 | } else { 32 | return 'NOT_ROLE' 33 | } 34 | } 35 | 36 | /** 37 | * Returns cookie corresponding to key 38 | * 39 | * @param {string} cname - The key corresponding to which cookie is required 40 | * @returns {string} The cookie key's value or null 41 | */ 42 | export const getCookie = cname => { 43 | let name = cname + '=' 44 | let decodedCookie = decodeURIComponent(document.cookie) 45 | let ca = decodedCookie.split(';') 46 | for (let i = 0; i < ca.length; i++) { 47 | var c = ca[i] 48 | while (c.charAt(0) == ' ') { 49 | c = c.substring(1) 50 | } 51 | if (c.indexOf(name) == 0) { 52 | return c.substring(name.length, c.length) 53 | } 54 | } 55 | return '' 56 | } 57 | 58 | /** 59 | * It's cool 😎 60 | */ 61 | export const consoleIMG = () => { 62 | const logo = 63 | '\n' + 64 | '█████████████████████████████████████████████\n' + 65 | '█████████████████████████████████████████████\n' + 66 | '█████████████████████████████████████████████\n' + 67 | '█████████████████████████████████████████████\n' + 68 | '█████████████████████████████████████████████\n' + 69 | '█████████ █████████ █████████\n' + 70 | '█████████ █████████ █████████\n' + 71 | '█████████ █████████ █████████\n' + 72 | '█████████ █████████ █████████\n' + 73 | '█████████ █████████ █████████\n' + 74 | '█████████ ███████████████████████████\n' + 75 | '█████████ ███████████████████████████\n' + 76 | '█████████ ███████████████████████████\n' + 77 | '█████████ ███████████████████████████\n' + 78 | '█████████ ███████████████████████████\n' + 79 | ' █████████\n' + 80 | ' █████████\n' + 81 | ' █████████\n' + 82 | ' █████████\n' + 83 | ' █████████\n' + 84 | '█████████ ███████████████████████████\n' + 85 | '█████████ ███████████████████████████\n' + 86 | '█████████ ███████████████████████████\n' + 87 | '█████████ ███████████████████████████\n' + 88 | '█████████ ███████████████████████████' 89 | console.log(`%c${logo}`, 'border-left: 4px solid #0D68AF; padding-left: 8px;') 90 | console.log( 91 | '%cMade with ❤️ by IMG', 92 | 'border-left: 4px solid #379FFF; padding-left: 8px; font-family: "Arial"; font-size: 16px;' 93 | ) 94 | } 95 | 96 | /** 97 | * 98 | * @param {array} apiList List of apps by backend. 99 | * @return {array} List containing common apps, 100 | */ 101 | export function commonApps (apiList) { 102 | // Concatenate two arrays to add up all objects in one array. 103 | var commonList = apiList.concat(config.apps) // config.apps contain apps registered on frontend. 104 | // Group objects in array with same app name. 105 | commonList = groupBy(commonList, obj => obj.nomenclature.name) 106 | // Remove the objects which were not matched. 107 | commonList = reject(commonList, { length: 1 }) 108 | // Spread the arrays in array. 109 | commonList = commonList.map(spread(merge)) 110 | // Sort the list according to verbose name. 111 | commonList = orderBy(commonList, obj => obj.nomenclature.verboseName, ['asc']) 112 | return commonList 113 | } 114 | 115 | /** 116 | * To return app details from frontend 117 | * 118 | * @param {string} appName - The name of app corresponding to which details are required 119 | * @returns {object} The object containing if app or service exist and its details 120 | */ 121 | export const appDetails = appName => { 122 | let details 123 | let present = false 124 | let service = config.services.find( 125 | service => service.nomenclature.name === appName 126 | ) 127 | let app = config.apps.find(app => app.nomenclature.name === appName) 128 | if (!service && !app) { 129 | present = false 130 | } else { 131 | present = true 132 | details = app || service 133 | } 134 | return { 135 | present: present, 136 | details: details 137 | } 138 | } 139 | 140 | /** 141 | *To return active semantic color theme 142 | * 143 | * @returns {string} Active semantic color theme 144 | */ 145 | export const getTheme = () => { 146 | const theme = localStorage.getItem('selectedColor') 147 | if (theme && colorData.list.some(e => e.name === theme)) { 148 | return theme 149 | } else if (theme === 'roulette') { 150 | } else { 151 | localStorage.setItem('selectedColor', 'violet') 152 | } 153 | return 'violet' 154 | } 155 | 156 | /** 157 | *To return active semantic color theme object 158 | * 159 | * @returns {object} Active semantic color theme object 160 | */ 161 | export const getThemeObject = () => { 162 | return colorData.list.find(x => { 163 | return x.name === getTheme() 164 | }) 165 | } 166 | 167 | /** 168 | * Set cookie corresponding to key 169 | * 170 | * @param {string} cname - The key corresponding to which cookie is to set 171 | * @param {string} cvalue - Value of the cookie to be set 172 | * @param {number} days - Number of days until the set cookie expires 173 | * @returns {object} Object of the set cookie 174 | */ 175 | export const setCookie = (cname, cvalue, days) => { 176 | let expires = '' 177 | if (days) { 178 | let date = new Date() 179 | date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000) 180 | expires = '; expires=' + date.toUTCString() 181 | } 182 | document.cookie = cname + '=' + (cvalue || '') + expires + '; path=/' 183 | return { key: cname, value: cvalue, days: days } 184 | } 185 | -------------------------------------------------------------------------------- /src/utils/themeHOC.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import { connect } from 'react-redux' 4 | 5 | /** 6 | * This adds the prop 'color' to any Semantic UI component 7 | * (HOC means Higher Order Component, in case you were wondering) 8 | * 9 | * @param WrappedComponent: the component to apply colour to 10 | */ 11 | const withThemeColor = WrappedComponent => { 12 | class NewComponent extends React.Component { 13 | render () { 14 | return 15 | } 16 | } 17 | 18 | NewComponent.propTypes = { 19 | color: PropTypes.string 20 | } 21 | 22 | const mapStateToProps = state => { 23 | return { 24 | color: state.getIn(['theme', 'selectedColor']) 25 | } 26 | } 27 | 28 | return connect(mapStateToProps, {})(NewComponent) 29 | } 30 | 31 | export default withThemeColor 32 | --------------------------------------------------------------------------------