├── log └── .gitkeep ├── tmp └── .gitkeep ├── public ├── .htaccess ├── cache │ └── .gitkeep ├── files │ └── .gitkeep ├── images │ ├── rss.png │ ├── border.png │ ├── rdown.png │ ├── controls.png │ ├── grippie.png │ ├── loading.gif │ ├── overlay.png │ ├── sort_asc.png │ ├── swift16.png │ ├── swift32.png │ ├── swift64.png │ ├── error-404.png │ ├── error-500.png │ ├── grey-thumb.png │ ├── loading-big.gif │ ├── mime │ │ ├── audio.png │ │ ├── text │ │ │ ├── x-c.png │ │ │ ├── html.png │ │ │ ├── plain.png │ │ │ ├── x-chdr.png │ │ │ ├── x-csrc.png │ │ │ ├── x-java.png │ │ │ ├── x-sh.png │ │ │ ├── x-tex.png │ │ │ ├── x-c++src.png │ │ │ └── x-python.png │ │ ├── audio │ │ │ ├── mid.png │ │ │ ├── x-generic.png │ │ │ ├── x-realaudio.png │ │ │ └── x-pn-realaudio.png │ │ ├── image │ │ │ ├── gif.png │ │ │ ├── jpeg.png │ │ │ ├── png.png │ │ │ ├── svg+xml.png │ │ │ └── x-generic.png │ │ ├── application │ │ │ ├── pdf.png │ │ │ ├── zip.png │ │ │ ├── msword.png │ │ │ ├── x-core.png │ │ │ ├── x-dvi.png │ │ │ ├── x-font.png │ │ │ ├── x-tar.png │ │ │ ├── x-xcf.png │ │ │ ├── postscript.png │ │ │ ├── x-font-ttf.png │ │ │ ├── x-httpd-php.png │ │ │ ├── x-troff-man.png │ │ │ ├── octet-stream.png │ │ │ ├── vnd.ms-excel.png │ │ │ ├── x-7z-compressed.png │ │ │ ├── x-debian-package.png │ │ │ ├── x-iso9660-image.png │ │ │ ├── vnd.ms-powerpoint.png │ │ │ ├── x-shockwave-flash.png │ │ │ ├── x-redhat-package-manager.png │ │ │ ├── vnd.oasis.opendocument.chart.png │ │ │ ├── vnd.oasis.opendocument.image.png │ │ │ ├── vnd.oasis.opendocument.text.png │ │ │ ├── vnd.oasis.opendocument.database.png │ │ │ ├── vnd.oasis.opendocument.formula.png │ │ │ ├── vnd.oasis.opendocument.graphics.png │ │ │ ├── vnd.oasis.opendocument.spreadsheet.png │ │ │ └── vnd.oasis.opendocument.presentation.png │ │ └── video │ │ │ ├── quicktime.png │ │ │ └── x-generic.png │ ├── slider_knob.gif │ ├── sort_both.png │ ├── sort_desc.png │ ├── image_missing.png │ ├── social │ │ ├── google.png │ │ └── yandex.png │ ├── glyphicons-big.png │ ├── loading_background.png │ ├── sort_asc_disabled.png │ ├── sort_desc_disabled.png │ ├── Markdown.Editor.Icons.png │ ├── glyphicons-halflings.png │ ├── glyphicons-halflings-white.png │ └── extname │ │ ├── 16 │ │ ├── file_extension_7z.png │ │ ├── file_extension_ai.png │ │ ├── file_extension_gz.png │ │ ├── file_extension_ps.png │ │ ├── file_extension_rm.png │ │ ├── file_extension_ss.png │ │ ├── file_extension_3gp.png │ │ ├── file_extension_ace.png │ │ ├── file_extension_aif.png │ │ ├── file_extension_aiff.png │ │ ├── file_extension_amr.png │ │ ├── file_extension_asf.png │ │ ├── file_extension_asx.png │ │ ├── file_extension_bat.png │ │ ├── file_extension_bin.png │ │ ├── file_extension_bmp.png │ │ ├── file_extension_bup.png │ │ ├── file_extension_cab.png │ │ ├── file_extension_cbr.png │ │ ├── file_extension_cda.png │ │ ├── file_extension_cdl.png │ │ ├── file_extension_cdr.png │ │ ├── file_extension_chm.png │ │ ├── file_extension_dat.png │ │ ├── file_extension_divx.png │ │ ├── file_extension_dll.png │ │ ├── file_extension_dmg.png │ │ ├── file_extension_doc.png │ │ ├── file_extension_dss.png │ │ ├── file_extension_dvf.png │ │ ├── file_extension_dwg.png │ │ ├── file_extension_eml.png │ │ ├── file_extension_eps.png │ │ ├── file_extension_exe.png │ │ ├── file_extension_fla.png │ │ ├── file_extension_flv.png │ │ ├── file_extension_gif.png │ │ ├── file_extension_hqx.png │ │ ├── file_extension_htm.png │ │ ├── file_extension_html.png │ │ ├── file_extension_ifo.png │ │ ├── file_extension_indd.png │ │ ├── file_extension_iso.png │ │ ├── file_extension_jar.png │ │ ├── file_extension_jpeg.png │ │ ├── file_extension_jpg.png │ │ ├── file_extension_lnk.png │ │ ├── file_extension_log.png │ │ ├── file_extension_m4a.png │ │ ├── file_extension_m4b.png │ │ ├── file_extension_m4p.png │ │ ├── file_extension_m4v.png │ │ ├── file_extension_mcd.png │ │ ├── file_extension_mdb.png │ │ ├── file_extension_mid.png │ │ ├── file_extension_mov.png │ │ ├── file_extension_mp2.png │ │ ├── file_extension_mp4.png │ │ ├── file_extension_mpeg.png │ │ ├── file_extension_mpg.png │ │ ├── file_extension_msi.png │ │ ├── file_extension_mswmm.png │ │ ├── file_extension_ogg.png │ │ ├── file_extension_pdf.png │ │ ├── file_extension_png.png │ │ ├── file_extension_pps.png │ │ ├── file_extension_ppt.png │ │ ├── file_extension_psd.png │ │ ├── file_extension_pst.png │ │ ├── file_extension_ptb.png │ │ ├── file_extension_pub.png │ │ ├── file_extension_qbb.png │ │ ├── file_extension_qbw.png │ │ ├── file_extension_qxd.png │ │ ├── file_extension_ram.png │ │ ├── file_extension_rar.png │ │ ├── file_extension_rmvb.png │ │ ├── file_extension_rtf.png │ │ ├── file_extension_sea.png │ │ ├── file_extension_ses.png │ │ ├── file_extension_sit.png │ │ ├── file_extension_sitx.png │ │ ├── file_extension_swf.png │ │ ├── file_extension_tgz.png │ │ ├── file_extension_thm.png │ │ ├── file_extension_tif.png │ │ ├── file_extension_tmp.png │ │ ├── file_extension_ttf.png │ │ ├── file_extension_txt.png │ │ ├── file_extension_vcd.png │ │ ├── file_extension_vob.png │ │ ├── file_extension_wav.png │ │ ├── file_extension_wma.png │ │ ├── file_extension_wmv.png │ │ ├── file_extension_wps.png │ │ ├── file_extension_xls.png │ │ ├── file_extension_xpi.png │ │ ├── file_extension_zip.png │ │ └── file_extension_torrent.png │ │ └── 32 │ │ ├── file_extension_7z.png │ │ ├── file_extension_ai.png │ │ ├── file_extension_gz.png │ │ ├── file_extension_ps.png │ │ ├── file_extension_rm.png │ │ ├── file_extension_ss.png │ │ ├── file_extension_3gp.png │ │ ├── file_extension_ace.png │ │ ├── file_extension_aif.png │ │ ├── file_extension_aiff.png │ │ ├── file_extension_amr.png │ │ ├── file_extension_asf.png │ │ ├── file_extension_asx.png │ │ ├── file_extension_bat.png │ │ ├── file_extension_bin.png │ │ ├── file_extension_bmp.png │ │ ├── file_extension_bup.png │ │ ├── file_extension_cab.png │ │ ├── file_extension_cbr.png │ │ ├── file_extension_cda.png │ │ ├── file_extension_cdl.png │ │ ├── file_extension_cdr.png │ │ ├── file_extension_chm.png │ │ ├── file_extension_dat.png │ │ ├── file_extension_divx.png │ │ ├── file_extension_dll.png │ │ ├── file_extension_dmg.png │ │ ├── file_extension_doc.png │ │ ├── file_extension_dss.png │ │ ├── file_extension_dvf.png │ │ ├── file_extension_dwg.png │ │ ├── file_extension_eml.png │ │ ├── file_extension_eps.png │ │ ├── file_extension_exe.png │ │ ├── file_extension_fla.png │ │ ├── file_extension_flv.png │ │ ├── file_extension_gif.png │ │ ├── file_extension_hqx.png │ │ ├── file_extension_htm.png │ │ ├── file_extension_html.png │ │ ├── file_extension_ifo.png │ │ ├── file_extension_indd.png │ │ ├── file_extension_iso.png │ │ ├── file_extension_jar.png │ │ ├── file_extension_jpeg.png │ │ ├── file_extension_jpg.png │ │ ├── file_extension_lnk.png │ │ ├── file_extension_log.png │ │ ├── file_extension_m4a.png │ │ ├── file_extension_m4b.png │ │ ├── file_extension_m4p.png │ │ ├── file_extension_m4v.png │ │ ├── file_extension_mcd.png │ │ ├── file_extension_mdb.png │ │ ├── file_extension_mid.png │ │ ├── file_extension_mov.png │ │ ├── file_extension_mp2.png │ │ ├── file_extension_mp4.png │ │ ├── file_extension_mpeg.png │ │ ├── file_extension_mpg.png │ │ ├── file_extension_msi.png │ │ ├── file_extension_mswmm.png │ │ ├── file_extension_ogg.png │ │ ├── file_extension_pdf.png │ │ ├── file_extension_png.png │ │ ├── file_extension_pps.png │ │ ├── file_extension_psd.png │ │ ├── file_extension_pst.png │ │ ├── file_extension_ptb.png │ │ ├── file_extension_pub.png │ │ ├── file_extension_qbb.png │ │ ├── file_extension_qbw.png │ │ ├── file_extension_qxd.png │ │ ├── file_extension_ram.png │ │ ├── file_extension_rar.png │ │ ├── file_extension_rmvb.png │ │ ├── file_extension_rtf.png │ │ ├── file_extension_sea.png │ │ ├── file_extension_ses.png │ │ ├── file_extension_sit.png │ │ ├── file_extension_sitx.png │ │ ├── file_extension_swf.png │ │ ├── file_extension_tgz.png │ │ ├── file_extension_thm.png │ │ ├── file_extension_tif.png │ │ ├── file_extension_tmp.png │ │ ├── file_extension_ttf.png │ │ ├── file_extension_txt.png │ │ ├── file_extension_vcd.png │ │ ├── file_extension_vob.png │ │ ├── file_extension_wav.png │ │ ├── file_extension_wma.png │ │ ├── file_extension_wmv.png │ │ ├── file_extension_wps.png │ │ ├── file_extension_xls.png │ │ ├── file_extension_xpi.png │ │ ├── file_extension_zip.png │ │ └── file_extension_torrent.png ├── robots.txt.default └── javascripts │ └── html5ie8tags.js ├── admin ├── views │ ├── base │ │ ├── _help.slim │ │ ├── _index_operations_show.slim │ │ ├── _index_operations.slim │ │ ├── _meta.slim │ │ ├── _data-table.slim │ │ ├── _flash.slim │ │ ├── _edit_operations_multiple.slim │ │ ├── _show_operations.slim │ │ ├── error.slim │ │ ├── _edit_operations_show.slim │ │ ├── _group-select.slim │ │ ├── _index_operations_bottom.slim │ │ ├── _edit_operations.slim │ │ └── _group-select-for-bonds.slim │ ├── layouts │ │ ├── ajax.slim │ │ ├── _form.slim │ │ ├── pick.slim │ │ ├── dialog_slim.slim │ │ ├── new.slim │ │ ├── pick_one.slim │ │ ├── edit.slim │ │ ├── login.slim │ │ ├── pick_many.slim │ │ ├── dialog.slim │ │ └── index.slim │ ├── dialogs │ │ ├── preview.slim │ │ ├── bonds_ajax.json.slim │ │ ├── create_parent.json.slim │ │ ├── folder_images_object.slim │ │ ├── pick_pages.slim │ │ ├── dropdown_codes.slim │ │ ├── create_parent.slim │ │ ├── pick_blocks.slim │ │ ├── cat_cards.slim │ │ ├── cat_groups.slim │ │ ├── bonds_tab.slim │ │ ├── forms_cards.slim │ │ ├── news_rubrics.slim │ │ ├── folders.slim │ │ ├── pick_codes.slim │ │ ├── _folder_images_object.slim │ │ ├── folder_images.slim │ │ ├── folder_assets.slim │ │ ├── pick_images.slim │ │ ├── _tree.slim │ │ └── bonds.slim │ ├── elements │ │ ├── _form.slim │ │ ├── new.slim │ │ ├── edit.slim │ │ └── index.slim │ ├── news_rubrics │ │ ├── _form.slim │ │ ├── new.slim │ │ ├── edit.slim │ │ └── index.slim │ ├── mailers │ │ ├── reset_account_done.slim │ │ └── reset_account.slim │ ├── pages │ │ ├── new.slim │ │ ├── edit.slim │ │ └── index.slim │ ├── blocks │ │ ├── new.slim │ │ ├── edit.slim │ │ ├── index.slim │ │ └── _form.slim │ ├── folders │ │ ├── new.slim │ │ ├── _form.slim │ │ ├── index.slim │ │ ├── edit.slim │ │ └── _tree.slim │ ├── options │ │ ├── _form.slim │ │ ├── new.slim │ │ ├── edit.slim │ │ └── index.slim │ ├── codes │ │ ├── _form.slim │ │ ├── new.slim │ │ ├── edit.slim │ │ └── index.slim │ ├── images │ │ ├── new.slim │ │ ├── edit.slim │ │ ├── index.slim │ │ └── _form.slim │ ├── cat_cards │ │ ├── new.slim │ │ ├── edit.slim │ │ └── index.slim │ ├── fragments │ │ ├── new.slim │ │ ├── _pages.slim │ │ ├── edit.slim │ │ ├── _form.slim │ │ └── index.slim │ ├── accounts │ │ ├── show.slim │ │ ├── new.slim │ │ ├── edit.slim │ │ ├── _form.slim │ │ └── index.slim │ ├── cat_groups │ │ ├── new.slim │ │ ├── edit.slim │ │ ├── index.slim │ │ └── _form.slim │ ├── forms_faqs │ │ ├── new.slim │ │ ├── edit.slim │ │ ├── index.slim │ │ └── _form.slim │ ├── assets │ │ ├── new.slim │ │ ├── edit.slim │ │ ├── index.slim │ │ └── _form.slim │ ├── forms_cards │ │ ├── new.slim │ │ ├── edit.slim │ │ └── index.slim │ ├── news_articles │ │ ├── new.slim │ │ ├── edit.slim │ │ ├── index.slim │ │ └── _form.slim │ ├── cat_nodes │ │ ├── new.slim │ │ ├── edit.slim │ │ └── index.slim │ ├── forms_results │ │ ├── edit.slim │ │ ├── index.slim │ │ └── _form.slim │ ├── protocols │ │ └── _step.slim │ ├── forms_stats │ │ └── index.slim │ ├── multiple │ │ └── edit.slim │ └── login │ │ └── new.slim ├── controllers │ ├── base.rb │ └── forms_stats.rb └── helpers │ └── view_helpers.rb ├── app ├── views │ ├── fragments │ │ └── .gitkeep │ ├── elements │ │ ├── Cat │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── Folders │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── Gallery │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── Block │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── Date │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── Image │ │ │ ├── view.slim │ │ │ ├── view-original.slim │ │ │ ├── view-thumbnail.slim │ │ │ ├── view-link.slim │ │ │ ├── view-thumbnail-link.slim │ │ │ └── core.rb │ │ ├── LegacyLinkCheck │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── PageURL │ │ │ └── view.slim │ │ ├── NewsRubrics │ │ │ ├── core.rb │ │ │ └── view.slim │ │ ├── PageContent │ │ │ └── view.slim │ │ ├── PageHeader │ │ │ └── view.slim │ │ ├── Meta │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── PageTitle │ │ │ └── view.slim │ │ ├── NewsArticle │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── PageLink │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── Forms │ │ │ ├── inquiry.slim │ │ │ ├── view.slim │ │ │ ├── input.slim │ │ │ └── core.rb │ │ ├── File │ │ │ ├── core.rb │ │ │ └── view.slim │ │ ├── PagesLastUpdated │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── Notice │ │ │ └── view.slim │ │ ├── CatNode │ │ │ ├── core.rb │ │ │ └── view.slim │ │ ├── FoldersRandomImage │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── NewsTop │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── GalleryList │ │ │ ├── core.rb │ │ │ └── view.slim │ │ ├── FreshPages │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── NewsToday │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── BlockSlider │ │ │ └── core.rb │ │ ├── GalleryRandomImage │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── GalleryFolder │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── NewsPager │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── Breadcrumbs │ │ │ └── view.slim │ │ ├── News │ │ │ ├── article_body.slim │ │ │ └── article_description.slim │ │ ├── CatGroups │ │ │ └── view.slim │ │ ├── RecentUpdates │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── FoldersImages │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── MapTree │ │ │ └── view.slim │ │ ├── FoldersList │ │ │ ├── core.rb │ │ │ └── view.slim │ │ ├── FoldersCarousel │ │ │ ├── view.slim │ │ │ └── core.rb │ │ ├── LocaleLinks │ │ │ └── view.slim │ │ ├── FormsForm │ │ │ ├── core.rb │ │ │ └── view.slim │ │ ├── NewsCalendar │ │ │ └── view.slim │ │ ├── Pager │ │ │ └── view.slim │ │ ├── CatNodes │ │ │ └── core.rb │ │ └── FormsInquiry │ │ │ └── view.slim │ ├── layouts │ │ ├── raw.slim │ │ ├── sitemap.xml.slim │ │ ├── application.slim │ │ └── news.xml.slim │ └── mailers │ │ └── form_saved.slim └── locale │ ├── en.yml │ └── ru.yml ├── assets └── stylesheets │ ├── app │ └── .gitkeep │ ├── admin │ ├── 12-block.css │ ├── 01-colors.css │ ├── 97-glyph.css │ ├── 95-stats.css │ └── 13-fileupload.css │ ├── login.css │ └── elements │ └── Image.css ├── config ├── legacy.yml.default ├── setup.rb ├── database.yml.default ├── database.rb ├── apps.rb └── setup-options.yml ├── config.ru ├── README.md ├── .components ├── lib ├── swift.rb ├── swift │ ├── monkey.rb │ ├── monkey │ │ ├── i18n.rb │ │ ├── sinatra.rb │ │ ├── http_router.rb │ │ ├── rack.rb │ │ └── datamapper.rb │ ├── engine.rb │ ├── model_plugins │ │ ├── uuid.rb │ │ ├── metable.rb │ │ ├── dateable.rb │ │ ├── stamps.rb │ │ └── loggable.rb │ ├── deprecate.rb │ ├── helpers.rb │ ├── helpers │ │ ├── defer.rb │ │ ├── legacy.rb │ │ └── error.rb │ └── model_plugins.rb └── tasks │ ├── fill_path.rake │ ├── rebuild_tree.rake │ ├── se.rake │ ├── db.rake │ └── load_events.rake ├── UPGRADE.md ├── test ├── minitest_helper.rb ├── elements │ ├── meta_test.rb │ ├── file_test.rb │ ├── pagelink_test.rb │ ├── pagetitle_test.rb │ ├── breadcrumbs_test.rb │ ├── forms_test.rb │ └── sitemap_test.rb └── elements_helper.rb ├── models ├── element.rb ├── access.rb ├── translation.rb ├── cat_group.rb ├── code.rb ├── layout.rb ├── news_rubric.rb ├── fragment.rb ├── forms_faq.rb └── block.rb ├── Rakefile ├── .gitignore ├── vendor └── javascripts │ └── bootstrap │ └── bootstrap-datetimepicker.ru.js └── Gemfile /log/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/cache/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/files/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /admin/views/base/_help.slim: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/fragments/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/elements/Cat/view.slim: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/stylesheets/app/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /admin/views/layouts/ajax.slim: -------------------------------------------------------------------------------- 1 | = yield -------------------------------------------------------------------------------- /app/views/elements/Folders/view.slim: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/elements/Gallery/view.slim: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/layouts/raw.slim: -------------------------------------------------------------------------------- 1 | = yield 2 | -------------------------------------------------------------------------------- /admin/views/dialogs/preview.slim: -------------------------------------------------------------------------------- 1 | = @content -------------------------------------------------------------------------------- /app/views/elements/Block/view.slim: -------------------------------------------------------------------------------- 1 | = @text 2 | -------------------------------------------------------------------------------- /app/views/elements/Date/view.slim: -------------------------------------------------------------------------------- 1 | h3= @today 2 | -------------------------------------------------------------------------------- /admin/views/dialogs/bonds_ajax.json.slim: -------------------------------------------------------------------------------- 1 | == @answer.to_json -------------------------------------------------------------------------------- /app/locale/en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | home: Home 3 | news: News 4 | -------------------------------------------------------------------------------- /app/locale/ru.yml: -------------------------------------------------------------------------------- 1 | ru: 2 | home: Главная 3 | news: Новости 4 | -------------------------------------------------------------------------------- /app/views/elements/Image/view.slim: -------------------------------------------------------------------------------- 1 | img *@identity src=@outlet.url 2 | -------------------------------------------------------------------------------- /app/views/elements/Image/view-original.slim: -------------------------------------------------------------------------------- 1 | img *@identity src=@image.file.url 2 | -------------------------------------------------------------------------------- /app/views/elements/Image/view-thumbnail.slim: -------------------------------------------------------------------------------- 1 | img *@identity src=@outlet.url 2 | -------------------------------------------------------------------------------- /app/views/elements/LegacyLinkCheck/view.slim: -------------------------------------------------------------------------------- 1 | a href=@legacy_uri = @legacy_uri 2 | -------------------------------------------------------------------------------- /app/views/elements/PageURL/view.slim: -------------------------------------------------------------------------------- 1 | = "http://#{swift.host}#{swift.uri}" rescue '/' 2 | -------------------------------------------------------------------------------- /public/images/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/rss.png -------------------------------------------------------------------------------- /public/images/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/border.png -------------------------------------------------------------------------------- /public/images/rdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/rdown.png -------------------------------------------------------------------------------- /app/views/elements/NewsRubrics/core.rb: -------------------------------------------------------------------------------- 1 | swift.module_path_ids = [] 2 | @rubrics = NewsRubric.all 3 | -------------------------------------------------------------------------------- /app/views/elements/PageContent/view.slim: -------------------------------------------------------------------------------- 1 | - @page ||= @opts[:page] 2 | = engine_render( @page.text ) 3 | -------------------------------------------------------------------------------- /app/views/elements/PageHeader/view.slim: -------------------------------------------------------------------------------- 1 | h2= swift.resource ? swift.resource.title : @page.title 2 | -------------------------------------------------------------------------------- /public/images/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/controls.png -------------------------------------------------------------------------------- /public/images/grippie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/grippie.png -------------------------------------------------------------------------------- /public/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/loading.gif -------------------------------------------------------------------------------- /public/images/overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/overlay.png -------------------------------------------------------------------------------- /public/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/sort_asc.png -------------------------------------------------------------------------------- /public/images/swift16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/swift16.png -------------------------------------------------------------------------------- /public/images/swift32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/swift32.png -------------------------------------------------------------------------------- /public/images/swift64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/swift64.png -------------------------------------------------------------------------------- /app/views/elements/Date/core.rb: -------------------------------------------------------------------------------- 1 | date = Date.today 2 | @today = I18n.l( date, :format => @opts[:format]) 3 | -------------------------------------------------------------------------------- /app/views/elements/Meta/view.slim: -------------------------------------------------------------------------------- 1 | - @meta.each do |k,v| 2 | = meta_tag( v, :name => k ) if v.present? 3 | -------------------------------------------------------------------------------- /app/views/elements/PageTitle/view.slim: -------------------------------------------------------------------------------- 1 | title #{Option(:site_title)} — #{swift.path_pages.last.title} 2 | -------------------------------------------------------------------------------- /public/images/error-404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/error-404.png -------------------------------------------------------------------------------- /public/images/error-500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/error-500.png -------------------------------------------------------------------------------- /public/images/grey-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/grey-thumb.png -------------------------------------------------------------------------------- /public/images/loading-big.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/loading-big.gif -------------------------------------------------------------------------------- /public/images/mime/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/audio.png -------------------------------------------------------------------------------- /public/images/slider_knob.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/slider_knob.gif -------------------------------------------------------------------------------- /public/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/sort_both.png -------------------------------------------------------------------------------- /public/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/sort_desc.png -------------------------------------------------------------------------------- /config/legacy.yml.default: -------------------------------------------------------------------------------- 1 | --- 2 | url_base: "legacy/" 3 | url_map: 4 | example: "/" 5 | about: "/info" 6 | -------------------------------------------------------------------------------- /public/images/image_missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/image_missing.png -------------------------------------------------------------------------------- /public/images/mime/text/x-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/x-c.png -------------------------------------------------------------------------------- /public/images/social/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/social/google.png -------------------------------------------------------------------------------- /public/images/social/yandex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/social/yandex.png -------------------------------------------------------------------------------- /app/views/elements/NewsArticle/view.slim: -------------------------------------------------------------------------------- 1 | = element_view 'News/article_body', :locals => { :article => @article } 2 | -------------------------------------------------------------------------------- /app/views/elements/PageLink/view.slim: -------------------------------------------------------------------------------- 1 | = link_to @opts[:title].blank? ? @link.title : @opts[:title], @link.path 2 | -------------------------------------------------------------------------------- /public/images/glyphicons-big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/glyphicons-big.png -------------------------------------------------------------------------------- /public/images/mime/audio/mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/audio/mid.png -------------------------------------------------------------------------------- /public/images/mime/image/gif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/image/gif.png -------------------------------------------------------------------------------- /public/images/mime/image/jpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/image/jpeg.png -------------------------------------------------------------------------------- /public/images/mime/image/png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/image/png.png -------------------------------------------------------------------------------- /public/images/mime/text/html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/html.png -------------------------------------------------------------------------------- /public/images/mime/text/plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/plain.png -------------------------------------------------------------------------------- /public/images/mime/text/x-chdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/x-chdr.png -------------------------------------------------------------------------------- /public/images/mime/text/x-csrc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/x-csrc.png -------------------------------------------------------------------------------- /public/images/mime/text/x-java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/x-java.png -------------------------------------------------------------------------------- /public/images/mime/text/x-sh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/x-sh.png -------------------------------------------------------------------------------- /public/images/mime/text/x-tex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/x-tex.png -------------------------------------------------------------------------------- /public/robots.txt.default: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /admin/ 3 | 4 | Sitemap: http://example.com/sitemap.xml 5 | -------------------------------------------------------------------------------- /public/images/loading_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/loading_background.png -------------------------------------------------------------------------------- /public/images/mime/image/svg+xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/image/svg+xml.png -------------------------------------------------------------------------------- /public/images/mime/text/x-c++src.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/x-c++src.png -------------------------------------------------------------------------------- /public/images/mime/text/x-python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/text/x-python.png -------------------------------------------------------------------------------- /public/images/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/sort_asc_disabled.png -------------------------------------------------------------------------------- /public/images/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/sort_desc_disabled.png -------------------------------------------------------------------------------- /admin/views/dialogs/create_parent.json.slim: -------------------------------------------------------------------------------- 1 | == { :field => params[:field], :key => @object.id, :value => @object.title }.to_json -------------------------------------------------------------------------------- /app/views/elements/Forms/inquiry.slim: -------------------------------------------------------------------------------- 1 | = @f.inquiry key, :as => value[0].to_sym, :options => value[1].split(/[\r\n]+/) 2 | 3 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rackup 2 | require File.expand_path("../config/boot.rb", __FILE__) 3 | 4 | run Padrino.application 5 | -------------------------------------------------------------------------------- /public/images/Markdown.Editor.Icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/Markdown.Editor.Icons.png -------------------------------------------------------------------------------- /public/images/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/glyphicons-halflings.png -------------------------------------------------------------------------------- /public/images/mime/application/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/pdf.png -------------------------------------------------------------------------------- /public/images/mime/application/zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/zip.png -------------------------------------------------------------------------------- /public/images/mime/audio/x-generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/audio/x-generic.png -------------------------------------------------------------------------------- /public/images/mime/image/x-generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/image/x-generic.png -------------------------------------------------------------------------------- /public/images/mime/video/quicktime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/video/quicktime.png -------------------------------------------------------------------------------- /public/images/mime/video/x-generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/video/x-generic.png -------------------------------------------------------------------------------- /app/views/elements/PageLink/core.rb: -------------------------------------------------------------------------------- 1 | @link = Page.get(@args[0]) 2 | throw :output, "[Page ##{@args[0]} missing]" unless @link 3 | -------------------------------------------------------------------------------- /config/setup.rb: -------------------------------------------------------------------------------- 1 | # load initial objects 2 | load 'config/seed.rb' 3 | 4 | # load additional objects 5 | load 'config/grow.rb' 6 | -------------------------------------------------------------------------------- /public/images/mime/application/msword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/msword.png -------------------------------------------------------------------------------- /public/images/mime/application/x-core.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-core.png -------------------------------------------------------------------------------- /public/images/mime/application/x-dvi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-dvi.png -------------------------------------------------------------------------------- /public/images/mime/application/x-font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-font.png -------------------------------------------------------------------------------- /public/images/mime/application/x-tar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-tar.png -------------------------------------------------------------------------------- /public/images/mime/application/x-xcf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-xcf.png -------------------------------------------------------------------------------- /public/images/mime/audio/x-realaudio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/audio/x-realaudio.png -------------------------------------------------------------------------------- /admin/views/elements/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title 2 | = f.input :text, :as => :text, :markdown => true 3 | = f.input :id 4 | = f.submits -------------------------------------------------------------------------------- /app/views/elements/File/core.rb: -------------------------------------------------------------------------------- 1 | @file = Asset.first :id => @args[0] 2 | throw :output, "[Asset ##{@args[0]} missing]" unless @file 3 | -------------------------------------------------------------------------------- /public/images/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /public/images/mime/audio/x-pn-realaudio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/audio/x-pn-realaudio.png -------------------------------------------------------------------------------- /admin/views/base/_index_operations_show.slim: -------------------------------------------------------------------------------- 1 | ul.nav.nav-tabs.operations 2 | li.first.active= mk_single_op :list, url(@models, :index) 3 | -------------------------------------------------------------------------------- /app/views/elements/Forms/view.slim: -------------------------------------------------------------------------------- 1 | dl 2 | - @forms.each do |o| 3 | dt= link_to o.title, se_url(o) 4 | dd= engine_render( o.text ) 5 | -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_7z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_7z.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ai.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_gz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_gz.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ps.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_rm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_rm.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ss.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_7z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_7z.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ai.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_gz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_gz.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ps.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_rm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_rm.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ss.png -------------------------------------------------------------------------------- /public/images/mime/application/postscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/postscript.png -------------------------------------------------------------------------------- /public/images/mime/application/x-font-ttf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-font-ttf.png -------------------------------------------------------------------------------- /public/images/mime/application/x-httpd-php.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-httpd-php.png -------------------------------------------------------------------------------- /public/images/mime/application/x-troff-man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-troff-man.png -------------------------------------------------------------------------------- /admin/views/dialogs/folder_images_object.slim: -------------------------------------------------------------------------------- 1 | - @objects.each do |o| 2 | = partial 'dialogs/folder_images_object', :locals => { :image => o } 3 | -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_3gp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_3gp.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ace.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_aif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_aif.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_aiff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_aiff.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_amr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_amr.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_asf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_asf.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_asx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_asx.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_bat.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_bin.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_bmp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_bmp.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_bup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_bup.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_cab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_cab.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_cbr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_cbr.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_cda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_cda.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_cdl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_cdl.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_cdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_cdr.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_chm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_chm.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_dat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_dat.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_divx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_divx.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_dll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_dll.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_dmg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_dmg.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_doc.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_dss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_dss.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_dvf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_dvf.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_dwg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_dwg.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_eml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_eml.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_eps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_eps.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_exe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_exe.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_fla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_fla.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_flv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_flv.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_gif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_gif.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_hqx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_hqx.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_htm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_htm.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_html.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ifo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ifo.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_indd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_indd.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_iso.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_iso.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_jar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_jar.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_jpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_jpeg.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_jpg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_jpg.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_lnk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_lnk.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_log.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_m4a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_m4a.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_m4b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_m4b.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_m4p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_m4p.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_m4v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_m4v.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mcd.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mdb.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mid.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mov.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mp2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mp2.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mp4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mp4.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mpeg.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mpg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mpg.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_msi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_msi.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_mswmm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_mswmm.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ogg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ogg.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_pdf.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_png.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_pps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_pps.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ppt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ppt.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_psd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_psd.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_pst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_pst.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ptb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ptb.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_pub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_pub.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_qbb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_qbb.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_qbw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_qbw.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_qxd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_qxd.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ram.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_rar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_rar.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_rmvb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_rmvb.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_rtf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_rtf.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_sea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_sea.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ses.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_sit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_sit.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_sitx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_sitx.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_swf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_swf.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_tgz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_tgz.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_thm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_thm.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_tif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_tif.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_tmp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_tmp.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_ttf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_ttf.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_txt.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_vcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_vcd.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_vob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_vob.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_wav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_wav.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_wma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_wma.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_wmv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_wmv.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_wps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_wps.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_xls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_xls.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_xpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_xpi.png -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_zip.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_3gp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_3gp.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ace.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_aif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_aif.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_aiff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_aiff.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_amr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_amr.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_asf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_asf.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_asx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_asx.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_bat.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_bin.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_bmp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_bmp.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_bup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_bup.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_cab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_cab.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_cbr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_cbr.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_cda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_cda.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_cdl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_cdl.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_cdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_cdr.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_chm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_chm.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_dat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_dat.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_divx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_divx.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_dll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_dll.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_dmg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_dmg.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_doc.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_dss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_dss.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_dvf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_dvf.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_dwg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_dwg.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_eml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_eml.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_eps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_eps.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_exe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_exe.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_fla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_fla.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_flv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_flv.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_gif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_gif.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_hqx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_hqx.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_htm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_htm.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_html.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ifo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ifo.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_indd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_indd.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_iso.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_iso.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_jar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_jar.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_jpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_jpeg.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_jpg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_jpg.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_lnk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_lnk.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_log.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_m4a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_m4a.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_m4b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_m4b.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_m4p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_m4p.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_m4v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_m4v.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mcd.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mdb.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mid.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mov.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mp2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mp2.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mp4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mp4.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mpeg.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mpg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mpg.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_msi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_msi.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_mswmm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_mswmm.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ogg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ogg.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_pdf.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_png.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_pps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_pps.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_psd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_psd.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_pst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_pst.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ptb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ptb.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_pub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_pub.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_qbb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_qbb.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_qbw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_qbw.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_qxd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_qxd.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ram.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_rar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_rar.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_rmvb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_rmvb.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_rtf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_rtf.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_sea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_sea.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ses.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_sit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_sit.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_sitx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_sitx.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_swf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_swf.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_tgz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_tgz.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_thm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_thm.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_tif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_tif.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_tmp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_tmp.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_ttf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_ttf.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_txt.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_vcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_vcd.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_vob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_vob.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_wav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_wav.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_wma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_wma.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_wmv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_wmv.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_wps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_wps.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_xls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_xls.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_xpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_xpi.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_zip.png -------------------------------------------------------------------------------- /public/images/mime/application/octet-stream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/octet-stream.png -------------------------------------------------------------------------------- /public/images/mime/application/vnd.ms-excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.ms-excel.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | git clone https://github.com/ujifgc/swift.git new-app 4 | cd new-app 5 | bundle 6 | rake se:setup 7 | -------------------------------------------------------------------------------- /public/images/extname/16/file_extension_torrent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/16/file_extension_torrent.png -------------------------------------------------------------------------------- /public/images/extname/32/file_extension_torrent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/extname/32/file_extension_torrent.png -------------------------------------------------------------------------------- /public/images/mime/application/x-7z-compressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-7z-compressed.png -------------------------------------------------------------------------------- /public/images/mime/application/x-debian-package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-debian-package.png -------------------------------------------------------------------------------- /public/images/mime/application/x-iso9660-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-iso9660-image.png -------------------------------------------------------------------------------- /public/images/mime/application/vnd.ms-powerpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.ms-powerpoint.png -------------------------------------------------------------------------------- /public/images/mime/application/x-shockwave-flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-shockwave-flash.png -------------------------------------------------------------------------------- /.components: -------------------------------------------------------------------------------- 1 | --- 2 | :orm: datamapper 3 | :test: none 4 | :mock: none 5 | :script: jquery 6 | :renderer: slim 7 | :stylesheet: css 8 | :admin_renderer: slim 9 | -------------------------------------------------------------------------------- /app/views/elements/PagesLastUpdated/view.slim: -------------------------------------------------------------------------------- 1 | dl *@identity 2 | - @pages.each do |p| 3 | dt= link_to p.title, se_url(p) 4 | dd= p.meta['description'] 5 | -------------------------------------------------------------------------------- /assets/stylesheets/admin/12-block.css: -------------------------------------------------------------------------------- 1 | .edit-table td, .edit-table th { 2 | white-space: pre; 3 | } 4 | div.inline-block { 5 | display: inline-block; 6 | } 7 | -------------------------------------------------------------------------------- /public/images/mime/application/x-redhat-package-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/x-redhat-package-manager.png -------------------------------------------------------------------------------- /app/views/elements/Notice/view.slim: -------------------------------------------------------------------------------- 1 | - if flash.any? 2 | .flash 3 | - [:error, :warning, :notice].each do |type| 4 | = flash_tag type, :class => "message #{type}" 5 | -------------------------------------------------------------------------------- /public/images/mime/application/vnd.oasis.opendocument.chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.oasis.opendocument.chart.png -------------------------------------------------------------------------------- /public/images/mime/application/vnd.oasis.opendocument.image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.oasis.opendocument.image.png -------------------------------------------------------------------------------- /public/images/mime/application/vnd.oasis.opendocument.text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.oasis.opendocument.text.png -------------------------------------------------------------------------------- /admin/views/base/_index_operations.slim: -------------------------------------------------------------------------------- 1 | ul.nav.nav-tabs.operations 2 | li.first.active= mk_single_op :list, url(@models, :index) 3 | li= mk_single_op :new, url(@models, :new) 4 | -------------------------------------------------------------------------------- /admin/views/dialogs/pick_pages.slim: -------------------------------------------------------------------------------- 1 | .dialog-pages 2 | = partial 'dialogs/tree', :locals => { :tree => @tree, :level => 0 } 3 | javascript: 4 | addCheckboxes('.dialog-pages'); 5 | -------------------------------------------------------------------------------- /admin/views/news_rubrics/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title 2 | = f.input :text, :as => :text, :markdown => true 3 | = f.input :slug 4 | = f.submits :append => mk_timestamps( @object ) 5 | -------------------------------------------------------------------------------- /public/images/mime/application/vnd.oasis.opendocument.database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.oasis.opendocument.database.png -------------------------------------------------------------------------------- /public/images/mime/application/vnd.oasis.opendocument.formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.oasis.opendocument.formula.png -------------------------------------------------------------------------------- /public/images/mime/application/vnd.oasis.opendocument.graphics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.oasis.opendocument.graphics.png -------------------------------------------------------------------------------- /public/javascripts/html5ie8tags.js: -------------------------------------------------------------------------------- 1 | var tags='article,aside,footer,header,hgroup,nav,section,main,time,address'.split(','); 2 | for(var i in tags) { document.createElement(tags[i]) } -------------------------------------------------------------------------------- /admin/views/layouts/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title 2 | = f.input :code, :as => :text, :code => true, :value => @code 3 | = f.input :id 4 | = f.submits :append => mk_timestamps( @object ) 5 | -------------------------------------------------------------------------------- /app/views/elements/CatNode/core.rb: -------------------------------------------------------------------------------- 1 | @node ||= CatNode.by_slug swift.slug 2 | not_found unless @node 3 | swift.path_pages[-1] = Page.new :title => @node.title 4 | swift.resource = @node 5 | -------------------------------------------------------------------------------- /public/images/mime/application/vnd.oasis.opendocument.spreadsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.oasis.opendocument.spreadsheet.png -------------------------------------------------------------------------------- /app/views/elements/FoldersRandomImage/view.slim: -------------------------------------------------------------------------------- 1 | .random-image 2 | a href=('/gallery/'+@folder.slug) 3 | = image_tag @image_src, :alt => @image.title 4 | .caption= @image.title 5 | -------------------------------------------------------------------------------- /app/views/elements/NewsTop/view.slim: -------------------------------------------------------------------------------- 1 | section.news-top.news-list 2 | - @articles.each do |article| 3 | = element_view 'News/article_description', :locals => { :article => article } 4 | -------------------------------------------------------------------------------- /lib/swift.rb: -------------------------------------------------------------------------------- 1 | require 'swift/nozzle' 2 | require 'swift/model_plugins' 3 | require 'swift/core_ext' 4 | require 'swift/monkey' 5 | 6 | require 'swift/engine' 7 | require 'swift/helpers' 8 | -------------------------------------------------------------------------------- /public/images/mime/application/vnd.oasis.opendocument.presentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ujifgc/swift/master/public/images/mime/application/vnd.oasis.opendocument.presentation.png -------------------------------------------------------------------------------- /admin/controllers/base.rb: -------------------------------------------------------------------------------- 1 | Admin.controllers :base do 2 | set_access :admin, :designer, :auditor, :editor, :user 3 | 4 | get :index, :map => "/" do 5 | render "base/index" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /admin/views/base/_meta.slim: -------------------------------------------------------------------------------- 1 | = f.input 'meta[description]', :value => @object.meta['description'], :class => :long 2 | = f.input 'meta[keywords]', :value => @object.meta['keywords'], :class => :long 3 | -------------------------------------------------------------------------------- /UPGRADE.md: -------------------------------------------------------------------------------- 1 | ## b3020943cd99c 2 | 3 | $ rake se:grow 4 | $ rake set:paths 5 | Move folders from `public/img` and `public/doc` to `public/files` 6 | Move files from `public/img` to `public/files/images` 7 | -------------------------------------------------------------------------------- /admin/views/mailers/reset_account_done.slim: -------------------------------------------------------------------------------- 1 | | Пароль успешно сброшен. 2 | br 3 | br 4 | | Адрес панели управления: #{admin} 5 | br 6 | | Логин для входа: #{email} 7 | br 8 | | Новый пароль: #{password} 9 | -------------------------------------------------------------------------------- /admin/views/pages/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:pages, :create), :class => 'form form-horizontal edit' do |f| 3 | = partial "pages/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /app/views/elements/GalleryList/core.rb: -------------------------------------------------------------------------------- 1 | @galleries = [] 2 | folders = Bond.all.children_for @page, 'Folder' 3 | folders.each do |f| 4 | if f.images.count > 0 5 | @galleries << f 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /admin/views/base/_data-table.slim: -------------------------------------------------------------------------------- 1 | table.table.smart class=@dynamic 2 | thead 3 | tr 4 | - @columns.each do |k,v| 5 | th class=v[:head_class] data=v[:data] = I18n.t(v[:header_title_key]) 6 | -------------------------------------------------------------------------------- /admin/views/blocks/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:blocks, :create), :class => 'form form-horizontal edit' do |f| 3 | = partial "blocks/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/folders/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:folders, :create), :class => 'form form-horizontal edit' do |f| 3 | = partial "folders/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /app/views/elements/Forms/input.slim: -------------------------------------------------------------------------------- 1 | = @f.input key, :as => value[0].to_sym, :options => value[1].split(/[\r\n]+/), :required => value[2], :label => { :caption => "#{value[2]?'* ':''}#{key}" } 2 | 3 | -------------------------------------------------------------------------------- /assets/stylesheets/admin/01-colors.css: -------------------------------------------------------------------------------- 1 | .red { 2 | color: #DA4F49; 3 | } 4 | .green { 5 | color: #5BB75B; 6 | } 7 | .white { 8 | color: #fff; 9 | } 10 | .white:hover { 11 | color: #fff; 12 | } 13 | -------------------------------------------------------------------------------- /app/views/elements/File/view.slim: -------------------------------------------------------------------------------- 1 | .download 2 | i.mime-icon 3 | = icon_for(@file.file.filename) 4 | = link_to @opts[:title].blank? ? @file.title : @opts[:title], @file.file.url, :target => @opts[:target] 5 | -------------------------------------------------------------------------------- /app/views/mailers/form_saved.slim: -------------------------------------------------------------------------------- 1 | dl 2 | - @result.json.each do |k,v| 3 | dt= k 4 | - if @card.json[k][0] == 'file' 5 | dd= Asset.all(:id => v).map(&:info).join(', ') 6 | - else 7 | dd= v 8 | -------------------------------------------------------------------------------- /admin/views/options/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :id 2 | = f.input :title 3 | = f.input :value, :as => :text, :value => @object.json['value'].kind_of?(String) ? "\"#{@object.json['value']}\"" : @object.json['value'] 4 | = f.submits -------------------------------------------------------------------------------- /app/views/elements/Image/view-link.slim: -------------------------------------------------------------------------------- 1 | - databox = @image.file.outlets[:box] ? { :'data-box' => @image.file.outlets[:box].url } : {} 2 | a rel='box-image' href=@image.file.url title=@identity[:alt] *databox = @image.title 3 | -------------------------------------------------------------------------------- /app/views/elements/FreshPages/view.slim: -------------------------------------------------------------------------------- 1 | - @fresh_pages.each do |page| 2 | article 3 | header 4 | time pubdate=true datetime=page.updated_at = page.updated_at.as_date 5 | h4.title= link_to(page.title, page.path) 6 | -------------------------------------------------------------------------------- /admin/views/codes/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title 2 | = f.input :text, :as => :text, :markdown => true 3 | = f.input :html, :as => :text 4 | = f.input :placeholder 5 | = f.input :is_single, :as => :boolean 6 | = f.input :slug 7 | = f.submits -------------------------------------------------------------------------------- /app/views/elements/NewsToday/view.slim: -------------------------------------------------------------------------------- 1 | dl 2 | span class='label label-info' 3 | = 'Сегодня' + Date.today.as_date.to_s 4 | - @news.each do |o| 5 | dt 6 | = link_to o.title, se_url(o) 7 | dd= engine_render( o.info ) 8 | -------------------------------------------------------------------------------- /admin/views/base/_flash.slim: -------------------------------------------------------------------------------- 1 | - [:error, :warning, :success, :notice].each do |type| 2 | - next if flash[type].blank? 3 | .alert.alert-message class=('alert-' + (type == :notice ? :info : type).to_s) data-alert=true 4 | = flash[type] 5 | -------------------------------------------------------------------------------- /admin/views/codes/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:codes, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-codes" do |f| 3 | = partial "codes/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /app/views/elements/BlockSlider/core.rb: -------------------------------------------------------------------------------- 1 | block = Block.by_slug(@args[0] || 'sliders') 2 | throw :output, "[Block ##{@args[0]} missing]" unless block 3 | @sliders = block.text.split(/---+/).map(&:strip).reject(&:blank?).map(&method(:split_image)) 4 | -------------------------------------------------------------------------------- /admin/views/images/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:images, :create), :class => 'form form-horizontal edit', :id => "edit-images", :multipart => true do |f| 3 | = partial "images/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/layouts/pick.slim: -------------------------------------------------------------------------------- 1 | .modal-header 2 | a.close data-dismiss=:modal × 3 | h3= @title 4 | .modal-body 5 | = yield 6 | .modal-footer 7 | = link_to pat('cancel'), 'javascript:;', :class => 'btn cancel-dialog', :'data-dismiss' => :modal 8 | -------------------------------------------------------------------------------- /app/views/elements/GalleryRandomImage/view.slim: -------------------------------------------------------------------------------- 1 | .thumbnail 2 | - href = '/gallery/' + @folder.slug 3 | a href=href 4 | = image_tag @image.file.thumb.url 5 | .caption 6 | = @image.title 7 | br 8 | = link_to @folder.title, href 9 | -------------------------------------------------------------------------------- /admin/views/elements/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:elements, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-elements" do |f| 3 | = partial "elements/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/layouts/dialog_slim.slim: -------------------------------------------------------------------------------- 1 | .modal-header 2 | a.close data-dismiss=:modal × 3 | h3= @title 4 | .modal-body 5 | = yield 6 | .modal-footer 7 | = link_to pat('close'), 'javascript:;', :class => 'btn cancel-dialog', :'data-dismiss' => :modal 8 | -------------------------------------------------------------------------------- /admin/views/layouts/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:layouts, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-layouts" do |f| 3 | = partial "layouts/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/layouts/pick_one.slim: -------------------------------------------------------------------------------- 1 | .modal-header 2 | a.close data-dismiss=:modal × 3 | h3= @title 4 | .modal-body 5 | = yield 6 | .modal-footer 7 | = link_to pat('cancel'), 'javascript:;', :class => 'btn cancel-dialog', :'data-dismiss' => :modal 8 | -------------------------------------------------------------------------------- /admin/views/options/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:options, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-options" do |f| 3 | = partial "options/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /app/views/elements/Image/view-thumbnail-link.slim: -------------------------------------------------------------------------------- 1 | - databox = @image.file.outlets[:box] ? { :'data-box' => @image.file.outlets[:box].url } : {} 2 | a rel='box-image' href=@image.file.url title=@identity[:alt] *databox 3 | img *@identity src=@outlet.url 4 | -------------------------------------------------------------------------------- /admin/views/cat_cards/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:cat_cards, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-cat_cards" do |f| 3 | = partial "cat_cards/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/fragments/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:fragments, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-fragments" do |f| 3 | = partial "fragments/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /app/views/elements/GalleryFolder/view.slim: -------------------------------------------------------------------------------- 1 | ul.gallery_images 2 | - @pics.each do |pic| 3 | li 4 | a rel="box-image" href=pic.file.url title=pic.title 5 | = image_tag pic.file.thumb.url 6 | a id="image_title" 7 | = pic.title 8 | -------------------------------------------------------------------------------- /app/views/elements/NewsPager/view.slim: -------------------------------------------------------------------------------- 1 | section.news-pager.news-list 2 | - @articles.each do |article| 3 | = element_view 'News/article_description', :locals => { :article => article } 4 | - if @pages_count > 1 5 | = element 'Pager', :allow => [] 6 | -------------------------------------------------------------------------------- /test/minitest_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RACK_ENV'] = 'test' 2 | require File.expand_path('../../config/boot.rb', __FILE__) 3 | require 'minitest/autorun' 4 | 5 | class MiniTest::Spec 6 | def swift 7 | @test_swift ||= OpenStruct.new 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /admin/views/accounts/show.slim: -------------------------------------------------------------------------------- 1 | - @by_user = @subject 2 | - @by_object = @object 3 | - @object = @subject 4 | = partial 'base/show_operations' 5 | - Protocol.for( @by_user, @by_object ).each do |step| 6 | = partial 'protocols/step', :locals => { :step => step } 7 | -------------------------------------------------------------------------------- /admin/views/cat_groups/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:cat_groups, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-cat_groups" do |f| 3 | = partial "cat_groups/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/codes/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:codes, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-codes" do |f| 3 | = partial "codes/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/forms_faqs/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:forms_faqs, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-forms_faqs" do |f| 3 | = partial "forms_faqs/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/pages/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:pages, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-pages" do |f| 3 | = partial "pages/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /app/views/elements/FreshPages/core.rb: -------------------------------------------------------------------------------- 1 | filter = {} 2 | filter[:limit] = @opts[:limit].to_i if @opts[:limit] 3 | filter[:limit] ||= 5 4 | filter[:order] = [ :updated_at.desc, :id.desc ] 5 | filter[:is_system] = false 6 | @fresh_pages = Page.published.all(filter) 7 | -------------------------------------------------------------------------------- /app/views/elements/NewsArticle/core.rb: -------------------------------------------------------------------------------- 1 | @article = NewsArticle.by_slug swift.slug 2 | not_found unless @article 3 | @article.text = @article.info if @article.text.blank? 4 | swift.path_pages[-1] = Page.new :title => @article.title 5 | swift.resource = @article 6 | -------------------------------------------------------------------------------- /assets/stylesheets/login.css: -------------------------------------------------------------------------------- 1 | legend { 2 | margin-bottom: 14px; 3 | } 4 | legend + .control-group { 5 | margin-top: 14px; 6 | } 7 | .alert { 8 | padding-right: 14px; 9 | } 10 | .login .well { 11 | box-shadow: 0 1px 4px rgba(0, 0, 0, 0.067); 12 | } 13 | -------------------------------------------------------------------------------- /lib/swift/monkey.rb: -------------------------------------------------------------------------------- 1 | require 'swift/monkey/datamapper' 2 | require 'swift/monkey/http_router' 3 | require 'swift/monkey/i18n' 4 | require 'swift/monkey/markdown' 5 | require 'swift/monkey/padrino' 6 | require 'swift/monkey/rack' 7 | require 'swift/monkey/sinatra' 8 | -------------------------------------------------------------------------------- /admin/views/assets/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:assets, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-assets", :multipart => true do |f| 3 | = partial "assets/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/blocks/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:blocks, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-blocks" do |f| 3 | = partial "blocks/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/forms_cards/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:forms_cards, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-forms_cards" do |f| 3 | = partial "forms_cards/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/fragments/_pages.slim: -------------------------------------------------------------------------------- 1 | .control-group 2 | label.control-label= mat(:fragment, :pages) 3 | .controls 4 | ul.nav.nav-pills 5 | - @object.pages.each do |page| 6 | li 7 | = link_to page.title, url(:pages, :edit, :id => page.id) 8 | -------------------------------------------------------------------------------- /admin/views/layouts/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:layouts, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-layouts" do |f| 3 | = partial "layouts/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/options/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:options, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-options" do |f| 3 | = partial "options/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /app/views/elements/NewsRubrics/view.slim: -------------------------------------------------------------------------------- 1 | nav.rubrics 2 | ul 3 | - @rubrics.each do |rubric| 4 | li class=(rubric.slug == swift.slug && 'active') 5 | = link_to rubric.title, url_replace(swift.uri, "#{swift.module_root}/#{rubric.slug}", :page => nil) 6 | -------------------------------------------------------------------------------- /lib/swift/monkey/i18n.rb: -------------------------------------------------------------------------------- 1 | module I18n 2 | # Shows full path to translation key instead of "humanizing" it 3 | class MissingTranslation 4 | module Base 5 | def message 6 | "#{keys.join('.')}" 7 | end 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /admin/views/elements/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:elements, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-elements" do |f| 3 | = partial "elements/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/news_articles/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:news_articles, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-news_articles" do |f| 3 | = partial "news_articles/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/news_rubrics/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:news_rubrics, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-news_rubrics" do |f| 3 | = partial "news_rubrics/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/accounts/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:accounts, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-accounts", :autocomplete => :off do |f| 3 | = partial "accounts/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/cat_nodes/new.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:cat_nodes, :create), :method => :post, :class => 'form form-horizontal edit', :id => "edit-cat_nodes", :multipart => true do |f| 3 | = partial "cat_nodes/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/forms_results/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations_show' 2 | = form_for :object, url(:forms_results, :index), :method => :put, :class => 'form form-horizontal edit', :id => "edit-forms_results" do |f| 3 | = partial "forms_results/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/fragments/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:fragments, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-fragments" do |f| 3 | = partial "fragments/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/cat_groups/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:cat_groups, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-cat_groups" do |f| 3 | = partial "cat_groups/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/forms_faqs/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:forms_faqs, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-forms_faqs" do |f| 3 | = partial "forms_faqs/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /lib/swift/monkey/sinatra.rb: -------------------------------------------------------------------------------- 1 | require 'rack/showexceptions' 2 | module Sinatra 3 | class ShowExceptions < Rack::ShowExceptions 4 | def initialize(app) 5 | @app = app 6 | @template = ERB.new( File.read 'lib/error-500.erb' ) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/elements/meta_test.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require 'elements_helper' 3 | 4 | describe Swift do 5 | before do 6 | end 7 | 8 | it 'should write meta' do 9 | skip 10 | el = element('Meta') 11 | el.must_equal "%{placeholder[:meta]}" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /admin/views/assets/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:assets, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-assets", :multipart => true do |f| 3 | = partial "assets/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/base/_edit_operations_multiple.slim: -------------------------------------------------------------------------------- 1 | ul.nav.nav-tabs.operations 2 | li.first= mk_single_op :list, url(@models, :index) 3 | li= mk_single_op :new, url(@models, :new) 4 | li.active= mk_single_op :multiedit, url(:multiple, :edit, :models => @models, :ids => params[:ids]) 5 | -------------------------------------------------------------------------------- /admin/views/forms_cards/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:forms_cards, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-forms_cards" do |f| 3 | = partial "forms_cards/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/images/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:images, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-images", :multipart => true do |f| 3 | = partial "images/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/news_rubrics/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:news_rubrics, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-news_rubrics" do |f| 3 | = partial "news_rubrics/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /app/views/elements/Meta/core.rb: -------------------------------------------------------------------------------- 1 | object = swift.resource || @page 2 | @meta = object.respond_to?(:meta) ? object.meta : {} 3 | if @meta['description'].blank? 4 | @meta['description'] = strip_code( object.respond_to?(:info) && object.info.present? && object.info || object.title ) 5 | end 6 | -------------------------------------------------------------------------------- /app/views/elements/PagesLastUpdated/core.rb: -------------------------------------------------------------------------------- 1 | filter = {} 2 | filter[:offset] = @opts[:offset].to_i if @opts[:offset] 3 | filter[:limit] = @opts[:limit].to_i if @opts[:limit] 4 | filter[:limit] ||= 5 5 | filter[:order] = :updated_at.desc 6 | @pages = Page.published.all( filter ) 7 | 8 | -------------------------------------------------------------------------------- /app/views/layouts/sitemap.xml.slim: -------------------------------------------------------------------------------- 1 | doctype xml 2 | urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 3 | - @pages.each do |page| 4 | url 5 | loc= absolute_url(page.path) 6 | lastmod= page.last_update.xmlschema 7 | changefreq monthly 8 | priority 0.5 9 | -------------------------------------------------------------------------------- /admin/views/news_articles/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:news_articles, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-news_articles" do |f| 3 | = partial "news_articles/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/controllers/forms_stats.rb: -------------------------------------------------------------------------------- 1 | Admin.controllers :forms_stats do 2 | set_access :admin, :designer, :auditor 3 | 4 | get :index do 5 | filter = { 6 | :kind => 'inquiry' 7 | } 8 | @objects = FormsCard.all filter 9 | render 'forms_stats/index' 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /admin/views/accounts/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:accounts, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-accounts", :autocomplete => :off do |f| 3 | = partial "accounts/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /admin/views/cat_nodes/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:cat_nodes, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-cat_nodes", :multipart => true do |f| 3 | = partial "cat_nodes/form", :locals => { :f => f } 4 | -------------------------------------------------------------------------------- /models/element.rb: -------------------------------------------------------------------------------- 1 | class Element 2 | include DataMapper::Resource 3 | 4 | property :id, String, :length => 63, :key => true 5 | property :title, String 6 | property :text, Text 7 | 8 | # hookers 9 | before :valid? do 10 | self.id = title if id.blank? 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /config/database.yml.default: -------------------------------------------------------------------------------- 1 | --- 2 | development: &defaults 3 | adapter: mysql 4 | database: swift_site 5 | username: swift 6 | password: XXX 7 | host: 10.6.7.55 8 | 9 | test: 10 | <<: *defaults 11 | 12 | production: 13 | <<: *defaults 14 | 15 | rake: 16 | <<: *defaults 17 | -------------------------------------------------------------------------------- /admin/views/dialogs/dropdown_codes.slim: -------------------------------------------------------------------------------- 1 | ul.dropdown-menu 2 | - @objects.each do |o| 3 | li 4 | a href="#" data={ :single => o.is_single ? 'true' : 'false', :code => o.slug } 5 | - unless o.icon.blank? 6 | i class="icon-#{o.icon}" 7 | code= o.slug 8 | = o.title 9 | -------------------------------------------------------------------------------- /admin/views/layouts/login.slim: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | meta charset="utf-8" 5 | meta name="robots" content="noindex" 6 | title Swift :: #{Option(:site_title)} 7 | == pipeline :login, :css 8 | body.login 9 | .container.login style='width: 287px' 10 | = yield 11 | -------------------------------------------------------------------------------- /admin/views/cat_nodes/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-cat_nodes action=url(:cat_nodes, :index)/:multiple method=:post 3 | = csrf_token_field 4 | = mk_group_selector CatNode, CatCard, params 5 | = mk_data_table CatNode 6 | = partial 'base/index_operations_bottom' 7 | -------------------------------------------------------------------------------- /app/views/elements/Breadcrumbs/view.slim: -------------------------------------------------------------------------------- 1 | nav.breadcrumbs 2 | - swift.path_pages[0..-1].each do |p| 3 | a href=(p.path.blank? ? swift.uri : p.path) 4 | = p.parent || p.new? ? p.title : t('home') 5 | = ' ' 6 | - if @opts[:spacer] && p != swift.path_pages.last 7 | = @opts[:spacer] + ' ' 8 | -------------------------------------------------------------------------------- /admin/views/assets/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-assets action=url(:assets, :index)/:multiple method=:post 3 | = csrf_token_field 4 | = mk_group_selector Asset, Folder, params, :with => :assets 5 | = mk_data_table Asset 6 | = partial 'base/index_operations_bottom' 7 | -------------------------------------------------------------------------------- /admin/views/images/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-images action=url(:images, :index)/:multiple method=:post 3 | = csrf_token_field 4 | = mk_group_selector Image, Folder, params, :with => :images 5 | = mk_data_table Image 6 | = partial 'base/index_operations_bottom' 7 | -------------------------------------------------------------------------------- /admin/views/base/_show_operations.slim: -------------------------------------------------------------------------------- 1 | ul.nav.nav-tabs.operations 2 | li.first= mk_single_op :list, url(@models, :index) 3 | li class=(@object.new? && :active) = mk_single_op :new, url(@models, :new) 4 | - if !@object.new? && @object.respond_to?(:id) 5 | li.active= mk_single_op :show, url(@models, :show, params) 6 | -------------------------------------------------------------------------------- /config/database.rb: -------------------------------------------------------------------------------- 1 | DataMapper::Property::String.length(255) 2 | DataMapper::Logger.new('log/sql.log', Padrino.env == :development ? :debug : :error) 3 | DataMapper::Model.append_extensions(Swift::ModelPlugins::ClassMethods) 4 | 5 | DataMapper.setup(:default, YAML.load_file(Padrino.root('config/database.yml'))[RACK_ENV]) 6 | -------------------------------------------------------------------------------- /admin/views/dialogs/create_parent.slim: -------------------------------------------------------------------------------- 1 | form action=url(:dialogs, :create_parent, :field => params[:field], :parent_model => params[:parent_model]) method=:post 2 | = csrf_token_field 3 | label 4 | | Имя папки 5 | input.text_field#parent_title name=:parent_title value='' 6 | javascript: 7 | bindDialogCreateParent(); 8 | -------------------------------------------------------------------------------- /app/views/elements/Folders/core.rb: -------------------------------------------------------------------------------- 1 | if swift.slug == '' 2 | throw :output, element( 'FoldersList', *@args, @opts ) 3 | else 4 | @folder = Folder.by_slug(swift.slug) 5 | not_found unless @folder 6 | swift.path_pages << Page.new( :title => @folder.title ) 7 | throw :output, element( 'FoldersImages', *@args, @opts ) 8 | end 9 | -------------------------------------------------------------------------------- /admin/views/fragments/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title 2 | = f.input :code, :as => :text, :code => true, :value => @code 3 | = f.input :id 4 | = f.input :is_fragment, :as => :boolean 5 | = f.input :is_module, :as => :boolean 6 | - if @object.pages.count > 0 7 | = partial 'fragments/pages' 8 | = f.submits :append => mk_timestamps( @object ) 9 | -------------------------------------------------------------------------------- /admin/views/layouts/pick_many.slim: -------------------------------------------------------------------------------- 1 | .modal-header 2 | a.close data-dismiss=:modal × 3 | h3= @title 4 | .modal-body 5 | = yield 6 | .modal-footer 7 | = link_to pat('pick'), 'javascript:;', :class => 'btn btn-primary pick-dialog' 8 | = link_to pat('cancel'), 'javascript:;', :class => 'btn cancel-dialog', :'data-dismiss' => :modal 9 | -------------------------------------------------------------------------------- /admin/views/news_articles/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-news_articles action=url(:news_articles, :index)/:multiple method=:post 3 | = csrf_token_field 4 | = mk_group_selector NewsArticle, NewsRubric, params 5 | = mk_data_table NewsArticle 6 | = partial 'base/index_operations_bottom' 7 | -------------------------------------------------------------------------------- /app/views/elements/News/article_body.slim: -------------------------------------------------------------------------------- 1 | article.news-article itemscope=true itemtype='http://schema.org/NewsArticle' 2 | header 3 | time itemprop='datePublished' datetime=article.date.iso8601 = article.date.as_date 4 | h2 itemprop='headline' = article.title 5 | .body itemprop='articleBody' = engine_render(@article.text) 6 | -------------------------------------------------------------------------------- /admin/views/dialogs/pick_blocks.slim: -------------------------------------------------------------------------------- 1 | .dialog-blocks 2 | - @objects.each do |o| 3 | .item 4 | - data = { :id => o.id, :title => o.title, :type => 'block', :single => true } 5 | = link_to( "#{o.title}", o.slug, :data => data, :class => :pick, :onclick => 'return false' ) 6 | javascript: 7 | addCheckboxes('.dialog-blocks'); 8 | -------------------------------------------------------------------------------- /admin/views/forms_results/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations_show' 2 | form.inner.multiple#multiple-forms_results action=url(:forms_results, :index)/:multiple method=:post 3 | = csrf_token_field 4 | = mk_group_selector FormsResult, FormsCard, params 5 | = mk_data_table FormsResult 6 | = partial 'base/index_operations_bottom' 7 | -------------------------------------------------------------------------------- /lib/tasks/fill_path.rake: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | namespace :set do 3 | desc "init database for se" 4 | task :paths => :environment do 5 | folders = Folder.all 6 | folders.each do |folder| 7 | p folder.slug 8 | folder.path = folder.slug 9 | folder.save 10 | p "success" 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /admin/views/mailers/reset_account.slim: -------------------------------------------------------------------------------- 1 | | Введите код сброса пароля #{account.reset_code} 2 | br 3 | | или перейдите по ссылке 4 | - url = absolute_url(:login, :reset, :email => account.email, :reset => account.reset_code) 5 | a href=url 6 | = url 7 | br 8 | br 9 | | Код и ссылка действуют только #{I18n.l Date.today, :format => :long} 10 | -------------------------------------------------------------------------------- /app/views/elements/LegacyLinkCheck/core.rb: -------------------------------------------------------------------------------- 1 | require 'open-uri' 2 | @legacy_uri = 'http://' + @opts[:host] + swift.uri 3 | begin 4 | status = open(@legacy_uri).status 5 | rescue OpenURI::HTTPError => e 6 | @legacy_uri = 'http://' + @opts[:host] 7 | else 8 | redirect @legacy_uri if status.first == "200" && @opts[:redirect] 9 | end 10 | -------------------------------------------------------------------------------- /app/views/elements/Gallery/core.rb: -------------------------------------------------------------------------------- 1 | if swift.slug != '' 2 | @folder = Folder.by_slug(swift.slug) 3 | not_found unless @folder 4 | swift.path_pages << Page.new 5 | @opts[:folder] = swift.slug 6 | throw :output, element( 'GalleryFolder', *@args, @opts ) 7 | else 8 | throw :output, element( 'GalleryList', *@args, @opts ) 9 | end 10 | -------------------------------------------------------------------------------- /lib/tasks/rebuild_tree.rake: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | namespace :se do 3 | def rebuild_tree(root) 4 | root.path = nil 5 | root.save 6 | root.children.each{ |c| rebuild_tree(c) } 7 | end 8 | 9 | desc "rebuild page tree" 10 | task :retree => :environment do 11 | rebuild_tree Page.first( :parent => nil ) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | ENV['RACK_ENV'] = 'test' 2 | 3 | require 'padrino-core/cli/rake' 4 | require 'awesome_print' 5 | require 'rake/testtask' 6 | 7 | PadrinoTasks.use :database 8 | PadrinoTasks.init 9 | 10 | task :default => :test 11 | 12 | Rake::TestTask.new :test do |t| 13 | t.libs << "test" 14 | t.test_files = FileList['test/**/*_test.rb'] 15 | end 16 | -------------------------------------------------------------------------------- /admin/views/blocks/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-blocks action=url(:blocks, :index)/:multiple method=:post 3 | = csrf_token_field 4 | = mk_group_selector Block, { :type => Hash[Block::Types.keys.map{|k| [k,Block.get_type(k)] }] }, params 5 | = mk_data_table Block 6 | = partial 'base/index_operations_bottom' 7 | -------------------------------------------------------------------------------- /admin/views/forms_results/_form.slim: -------------------------------------------------------------------------------- 1 | dl 2 | - @object.json.each do |k,v| 3 | dt= k 4 | - if @object.forms_card.json[k] && @object.forms_card.json[k][0] == 'file' 5 | dd= Asset.all(:id => v).map(&:info).join(', ') 6 | - else 7 | dd= v 8 | 9 | .form-actions.buttons 10 | = f.submit :back 11 | = mk_timestamps( @object ) 12 | -------------------------------------------------------------------------------- /admin/views/layouts/dialog.slim: -------------------------------------------------------------------------------- 1 | .modal-header 2 | a.close data-dismiss=:modal × 3 | h3= @title 4 | .modal-body 5 | = yield 6 | .modal-footer 7 | = link_to pat('save'), 'javascript:;', :class => 'btn btn-primary save-dialog', :'data-dismiss' => :modal 8 | = link_to pat('cancel'), 'javascript:;', :class => 'btn cancel-dialog', :'data-dismiss' => :modal 9 | -------------------------------------------------------------------------------- /app/views/elements/CatGroups/view.slim: -------------------------------------------------------------------------------- 1 | - tree ||= @tree 2 | ul.nav.nav-list 3 | - tree.each do |leaf| 4 | - if leaf[:title] 5 | li class=leaf[:class] 6 | a href=leaf[:href] class=leaf[:class] 7 | = leaf[:title] 8 | - if leaf[:child] 9 | = element_view 'CatGroups/view', :locals => { :tree => leaf[:child] } 10 | -------------------------------------------------------------------------------- /models/access.rb: -------------------------------------------------------------------------------- 1 | class Access 2 | include DataMapper::Resource 3 | 4 | property :id, Serial 5 | 6 | #relations 7 | belongs_to :account, :required => true 8 | property :object_id, Integer, :required => true 9 | property :object_type, String, :required => true 10 | property :deny, Boolean, :required => true, :default => false 11 | end 12 | -------------------------------------------------------------------------------- /app/views/elements/RecentUpdates/view.slim: -------------------------------------------------------------------------------- 1 | section.recent-updates 2 | header 3 | h3 Новое на сайте 4 | - @updated_objects.each do |object| 5 | article class=("recent-#{object.class.name}") 6 | header 7 | time pubdate=true datetime=object.updated_at = object.updated_at.as_date 8 | h4.title= link_to object.title, se_url(object) 9 | -------------------------------------------------------------------------------- /lib/tasks/se.rake: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | namespace :se do 3 | desc "init database for se" 4 | task :setup => :environment do 5 | DataMapper.auto_upgrade! 6 | load 'config/setup.rb' 7 | end 8 | 9 | desc "grow database for se" 10 | task :grow => :environment do 11 | DataMapper.auto_upgrade! 12 | load 'config/grow.rb' 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /models/translation.rb: -------------------------------------------------------------------------------- 1 | class Translation 2 | include DataMapper::Resource 3 | 4 | property :id, Serial 5 | property :locale, String, :length => 7 6 | property :object_model, String, :length => 31 7 | property :object_id, Integer 8 | property :field, String 9 | property :text, Text, :lazy => false 10 | end 11 | -------------------------------------------------------------------------------- /app/views/elements/RecentUpdates/core.rb: -------------------------------------------------------------------------------- 1 | models = @opts[:models] || [Page, NewsArticle] 2 | limit = @opts[:limit] || 5 3 | 4 | @updated_objects = [] 5 | models.each do |model| 6 | @updated_objects += model.published.all( :order => :updated_at ).last(limit).to_a 7 | end 8 | @updated_objects = @updated_objects.sort_by{ |object| -object.updated_at.to_i }.first(limit) 9 | -------------------------------------------------------------------------------- /admin/views/dialogs/cat_cards.slim: -------------------------------------------------------------------------------- 1 | .dialog-cat_cards 2 | ul 3 | - @objects.each do |o| 4 | - data = { :id => o.id, :title => o.title } 5 | - data.merge! :bound => o.bound?( params[:parent_model], params[:parent_id] ), :model => o.class.name if params[:parent_id] 6 | li= link_to "#{o.title}", o.slug, :data => data, :class => :pick, :onclick => 'return false' 7 | -------------------------------------------------------------------------------- /admin/views/dialogs/cat_groups.slim: -------------------------------------------------------------------------------- 1 | .dialog-cat_groups 2 | ul 3 | - @objects.each do |o| 4 | - data = { :id => o.id, :title => o.title } 5 | - data.merge! :bound => o.bound?( params[:parent_model], params[:parent_id] ), :model => o.class.name if params[:parent_id] 6 | li= link_to( "#{o.title}", o.slug, :data => data, :class => :pick, :onclick => 'return false' ) 7 | -------------------------------------------------------------------------------- /lib/swift/engine.rb: -------------------------------------------------------------------------------- 1 | require 'ostruct' 2 | 3 | module Swift 4 | module Engine 5 | module_function 6 | 7 | def registered(app) 8 | app.send(:include, InstanceMethods) 9 | app.helpers Swift::Helpers 10 | end 11 | 12 | module InstanceMethods 13 | def swift 14 | @swift ||= OpenStruct.new 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/swift/monkey/http_router.rb: -------------------------------------------------------------------------------- 1 | class HttpRouter::Request 2 | def initialize(path, rack_request) 3 | @rack_request = rack_request 4 | @path = Rack::Utils.unescape(path).split(/\//) 5 | @path.shift if @path.first == '' 6 | @path.push('') if path[-1] == ?/ 7 | @extra_env = {} 8 | @params = [] 9 | @acceptable_methods = Set.new 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /admin/views/dialogs/bonds_tab.slim: -------------------------------------------------------------------------------- 1 | .active-bonds 2 | - @bonds.each do |bond| 3 | - next unless bond.child 4 | .item 5 | - title = bond.child.title 6 | - data = { :model => bond.child_model, :id => bond.child_id, :title => title, :bound => true } 7 | = link_to "#{title} (#{data[:model]})", 'javascript:;', :data => data, :class => :pick, :onclick => 'return false' 8 | -------------------------------------------------------------------------------- /admin/views/dialogs/forms_cards.slim: -------------------------------------------------------------------------------- 1 | .dialog-forms_cards 2 | ul 3 | - @objects.each do |o| 4 | - data = { :id => o.id, :title => o.title } 5 | - data.merge! :bound => o.bound?( params[:parent_model], params[:parent_id] ), :model => o.class.name if params[:parent_id] 6 | li= link_to( "#{o.title}", o.slug, :data => data, :class => :pick, :onclick => 'return false' ) 7 | -------------------------------------------------------------------------------- /admin/views/dialogs/news_rubrics.slim: -------------------------------------------------------------------------------- 1 | .dialog-news_rubrics 2 | ul 3 | - @objects.each do |o| 4 | - data = { :id => o.id, :title => o.title } 5 | - data.merge! :bound => o.bound?( params[:parent_model], params[:parent_id] ), :model => o.class.name if params[:parent_id] 6 | li= link_to( "#{o.title}", o.slug, :data => data, :class => :pick, :onclick => 'return false' ) 7 | -------------------------------------------------------------------------------- /test/elements/file_test.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require 'elements_helper' 3 | 4 | describe Swift do 5 | before do 6 | end 7 | 8 | it "should file exists" do 9 | el = element("File") 10 | el.must_equal "[Asset # missing]" 11 | end 12 | 13 | it "should throw error" do 14 | el = element("File", -1) 15 | el.must_equal "[Asset #-1 missing]" 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /admin/views/dialogs/folders.slim: -------------------------------------------------------------------------------- 1 | .dialog-folders 2 | ul 3 | - current_account.get_folders.each do |o| 4 | - data = { :id => o.id, :title => o.title } 5 | - data.merge! :bound => o.bound?( params[:parent_model], params[:parent_id] ), :model => o.class.name if params[:parent_id] 6 | li= link_to "#{o.title}", o.slug, :data => data, :class => :pick, :onclick => 'return false' 7 | -------------------------------------------------------------------------------- /app/views/elements/FoldersImages/view.slim: -------------------------------------------------------------------------------- 1 | h2= @page && @page.title 2 | = element 'PageContent' 3 | section.folders-images 4 | - @images.each do |image| 5 | article 6 | = link_to image.file.url, :title => image.title, :rel => 'box-image' do 7 | = image_tag image.file.gallery_thumb.url, :alt => image.title 8 | / 9 | header 10 | h4= image.title 11 | -------------------------------------------------------------------------------- /admin/views/blocks/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title 2 | = f.input :type, :as => :select, :selected => @object.type, :options => Block::Types.map{|k,v|[mat(:object,"type_#{v}"),k]}, :include_blank => false 3 | = f.input :text, :as => :text, :markdown => true 4 | - allow :auditor do 5 | = f.input :slug 6 | = f.submits :append => mk_timestamps( @object ) 7 | 8 | javascript: 9 | bindBlockType(); 10 | -------------------------------------------------------------------------------- /config/apps.rb: -------------------------------------------------------------------------------- 1 | Padrino.configure_apps do 2 | set :session_secret, 'fd3a32d61be75844ffaf63deaeff410cd4d686f0de3154f4497a3cab0d493289' 3 | 4 | `which /usr/sbin/exim` 5 | if $?.success? 6 | set :delivery_method, :smtp 7 | else 8 | set :delivery_method, :sendmail 9 | end 10 | end 11 | 12 | Padrino.mount("Admin").to("/admin") 13 | Padrino.mount("Swift::Application").to('/') 14 | -------------------------------------------------------------------------------- /assets/stylesheets/admin/97-glyph.css: -------------------------------------------------------------------------------- 1 | [class^="glyph-"],[class*=" glyph-"]{display:inline-block;width:28px;height:28px;line-height:28px;vertical-align:text-top;background-image:url("../images/glyphicons-big.png");background-position:28px 28px;background-repeat:no-repeat;*margin-right:.3em;}[class^="glyph-"]:last-child,[class*=" glyph-"]:last-child{*margin-left:0;} 2 | .glyph-glass{background-position:0 0;} 3 | -------------------------------------------------------------------------------- /lib/swift/model_plugins/uuid.rb: -------------------------------------------------------------------------------- 1 | require 'securerandom' 2 | 3 | module Swift 4 | module ModelPlugins 5 | module UUID 6 | module ClassMethods 7 | def uuid! 8 | property :uuid, String, :length => 40 9 | 10 | before :create do 11 | self.uuid = SecureRandom.uuid 12 | end 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /app/views/elements/MapTree/view.slim: -------------------------------------------------------------------------------- 1 | - identity = defined?(tree) ? {} : ( tree = @tree; @identity ) 2 | ul *identity 3 | - tree.each do |leaf| 4 | - if leaf[:title] 5 | li class=leaf[:class] 6 | a href=leaf[:href] class=leaf[:class] 7 | = leaf[:title] 8 | - if leaf[:child].any? 9 | div= element_view 'MapTree/view', :locals => { :tree => leaf[:child] } 10 | -------------------------------------------------------------------------------- /admin/views/protocols/_step.slim: -------------------------------------------------------------------------------- 1 | dl 2 | - unless @by_user 3 | dt 4 | dd 5 | = step.subject.role_title 6 | = step.subject.name 7 | dt 8 | dd 9 | = step.verb 10 | dt 11 | dd 12 | = step.time.as_date 13 | - unless @by_object 14 | dt 15 | dd 16 | = step.object_id 17 | dt 18 | dd 19 | = step.object_type 20 | dt 21 | dd 22 | = step.data 23 | -------------------------------------------------------------------------------- /admin/views/assets/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title, :brackets => pat('not_required') 2 | = f.input :file, { :as => :file }.merge( @object.new? ? { :multiple => true, :brackets => pat(:or_multiple) } : {} ) 3 | = f.input :folder_id, :as => :select, :selected => @object.folder_id, :collection => current_account.get_folders, :fields => [ :title, :id ], :with_create => true 4 | = f.submits :append => mk_timestamps( @object ) 5 | -------------------------------------------------------------------------------- /admin/views/images/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title, :brackets => pat('not_required') 2 | = f.input :file, { :as => :file }.merge( @object.new? ? { :multiple => true, :brackets => pat(:or_multiple) } : {} ) 3 | = f.input :folder_id, :as => :select, :selected => @object.folder_id, :collection => current_account.get_folders, :fields => [ :title, :id ], :with_create => true 4 | = f.submits :append => mk_timestamps( @object ) 5 | -------------------------------------------------------------------------------- /lib/swift/deprecate.rb: -------------------------------------------------------------------------------- 1 | module MultiJson 2 | module_function 3 | 4 | def decode(*args) 5 | warn 'MultiJson in no longer used. Please use ActiveSupport::JSON.decode' 6 | ActiveSupport::JSON.decode(*args) 7 | end 8 | 9 | def encode(*args) 10 | warn 'MultiJson in no longer used. Please use ActiveSupport::JSON.encode' 11 | ActiveSupport::JSON.encode(*args) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /app/views/elements/FoldersList/core.rb: -------------------------------------------------------------------------------- 1 | @folders = if @opts[:folders] 2 | case @opts[:folders] 3 | when Symbol, String 4 | Folder.all( :slug => Array(@opts[:folders]) ) 5 | else 6 | @opts[:folders] 7 | end 8 | else 9 | Bond.children_for(@page, 'Folder') 10 | end 11 | @folders = Folder.with :images unless @folders.any? 12 | throw :output, "[No bound folders for FoldersList]" unless @folders.any? 13 | -------------------------------------------------------------------------------- /app/views/elements/GalleryFolder/core.rb: -------------------------------------------------------------------------------- 1 | if folder = Folder.by_slug( @args[0] || @opts[:folder] || @opts[:gallery] ) 2 | @pics = Image.all :folder => folder 3 | else 4 | @pics = [] 5 | bonds = Bond.bonds_for @page 6 | bonds.map do |bond| 7 | case bond.child_model 8 | when 'Image' 9 | @pics << bond.child 10 | when 'Folder' 11 | @pics += bond.child.images 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /admin/views/base/error.slim: -------------------------------------------------------------------------------- 1 | .content.dashboard 2 | ul.nav.nav-tabs.operations 3 | li.active 4 | = link_to "Ошибка, #{@error}", url(:base, :index) 5 | 6 | h5 7 | | Простите, что-то пошло не так 8 | p 9 | | Ошибка занесена в протокол и будет исправлена в ближайшее время 10 | small 11 | | Если данная ошибка блокирует вашу работу, пожалуйста, сообщите администратору код ошибки: 12 | code #{@time} 13 | -------------------------------------------------------------------------------- /app/views/elements/FoldersCarousel/view.slim: -------------------------------------------------------------------------------- 1 | .carousel 2 | nav.prev 3 | img src='/images/arrow_left.png' alt="Сюда" 4 | section.images 5 | - @folders.each do |folder| 6 | - image = folder.images.last or next 7 | article 8 | a href=('/gallery/'+folder.slug) 9 | = image_tag image.file.gallery_thumb.url, :alt => image.title 10 | nav.next 11 | img src='/images/arrow_right.png' alt="Туда" 12 | -------------------------------------------------------------------------------- /app/views/elements/FoldersCarousel/core.rb: -------------------------------------------------------------------------------- 1 | @folders = if @opts[:folders] 2 | case @opts[:folders] 3 | when Symbol, String 4 | Folder.all( :slug => Array(@opts[:folders]) ) 5 | else 6 | @opts[:folders] 7 | end 8 | else 9 | Bond.children_for(@opts[:page] || @page, 'Folder') 10 | end 11 | @folders = Folder.with :images unless @folders.any? 12 | throw :output, "[No bound folders for FoldersList]" unless @folders.any? 13 | -------------------------------------------------------------------------------- /models/cat_group.rb: -------------------------------------------------------------------------------- 1 | class CatGroup 2 | include DataMapper::Resource 3 | 4 | property :id, Serial 5 | 6 | property :title, String, :required => true 7 | property :text, Text 8 | 9 | sluggable! 10 | timestamps! 11 | userstamps! 12 | loggable! 13 | publishable! 14 | bondable! 15 | amorphous! 16 | recursive! 17 | bondable! 18 | 19 | # relations 20 | belongs_to :cat_card, :required => true 21 | end 22 | -------------------------------------------------------------------------------- /app/views/elements/LocaleLinks/view.slim: -------------------------------------------------------------------------------- 1 | - locale_names = { 'ru' => 'русский', 'udm' => 'удмуртский', 'en' => 'английский' } 2 | nav.locale 3 | ul 4 | - swift.locales.each do |locale| 5 | li 6 | - if locale == swift.locale 7 | = locale_names[locale] 8 | - else 9 | a rel='alternate' hreflang=locale lang='ru' href="#{domain_with_locale(swift.host, locale)}#{swift.uri}" = locale_names[locale] 10 | -------------------------------------------------------------------------------- /app/views/elements/FormsForm/core.rb: -------------------------------------------------------------------------------- 1 | @card = FormsCard.by_slug swift.slug 2 | not_found unless @card 3 | swift.path_pages << Page.new( :title => @card.title ) 4 | swift.resource = @card 5 | case @opts[:method].to_sym 6 | when :post 7 | @result = @card.fill request 8 | if @result.saved? 9 | flash[:notice] = 'Saved' 10 | else 11 | flash[:notice] = 'Error' 12 | end 13 | else 14 | @result = FormsResult.new :forms_card => @card 15 | end 16 | -------------------------------------------------------------------------------- /app/views/elements/NewsToday/core.rb: -------------------------------------------------------------------------------- 1 | inc = @opts[:include] || @opts[:rubrics] 2 | filter = {} 3 | filter['news_rubric.slug'] = inc.to_s.split /\W+/ if inc 4 | filter['news_rubric.slug.not'] = @opts[:exclude].to_s.split /\W+/ if @opts[:exclude] 5 | filter[:offset] = @opts[:offset].to_i if @opts[:offset] 6 | filter[:order] = :date.desc 7 | filter[:date] = Date.today 8 | @news = NewsArticle.published.all( filter ) 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | log/* 3 | tmp/* 4 | bin/* 5 | vendor/gems/* 6 | !vendor/gems/cache/ 7 | .sass-cache/* 8 | uploads/* 9 | public/uploads/* 10 | public/files/* 11 | public/cache/* 12 | public/favicon.ico 13 | private/* 14 | app/views/fragments/* 15 | app/views/layouts/* 16 | config/database.yml 17 | config/legacy.yml 18 | assets/stylesheets/app/* 19 | assets/javascripts/app/* 20 | Gemfile.lock 21 | .bundle/* 22 | vendor/ruby/* 23 | public/robots.txt 24 | -------------------------------------------------------------------------------- /models/code.rb: -------------------------------------------------------------------------------- 1 | class Code 2 | include DataMapper::Resource 3 | 4 | property :id, Serial 5 | property :title, String, :required => true 6 | property :icon, String 7 | property :placeholder, String 8 | property :text, Text 9 | property :html, Text, :lazy => false 10 | property :is_single, Boolean, :default => false 11 | property :is_system, Boolean, :default => false 12 | 13 | sluggable! 14 | end 15 | -------------------------------------------------------------------------------- /admin/views/dialogs/pick_codes.slim: -------------------------------------------------------------------------------- 1 | .dialog-codes 2 | - @objects.each do |o| 3 | - data = { :id => nil, :title => o.placeholder.to_s, :type => o.slug, :single => o.is_single } 4 | - data.merge! :bound => o.bound?( params[:parent_model], params[:parent_id] ), :model => o.class.name if params[:parent_id] 5 | .item= link_to "#{o.title}", o.slug, :data => data, :class => :pick, :onclick => 'return false' 6 | javascript: 7 | addCheckboxes('.dialog-codes'); 8 | -------------------------------------------------------------------------------- /assets/stylesheets/admin/95-stats.css: -------------------------------------------------------------------------------- 1 | /* bootstrap stats bars*/ 2 | .form-horizontal .stats .control-group { 3 | margin-bottom: 0; 4 | } 5 | .form-horizontal .stats .progress { 6 | margin-bottom: 0; 7 | width: 200px; 8 | } 9 | .form-horizontal .stats .control-label { 10 | padding-top: 0; 11 | margin-right: 9px; 12 | } 13 | .form-horizontal .stats { 14 | margin-bottom: 18px; 15 | } 16 | .form-horizontal .stats h3 { 17 | margin-bottom: 9px; 18 | } 19 | -------------------------------------------------------------------------------- /app/views/elements/FoldersList/view.slim: -------------------------------------------------------------------------------- 1 | h2= @page && @page.title 2 | = element 'PageContent' 3 | section.folders-list 4 | - @folders.each do |folder| 5 | article 6 | - if image = folder.bound('Image').last || folder.images.last 7 | = link_to File.join(swift.path, folder.slug) do 8 | = image_tag image.file.gallery_thumb.url, :alt => image.title 9 | header 10 | h4= link_to folder.title, File.join(swift.path, folder.slug) 11 | -------------------------------------------------------------------------------- /lib/swift/model_plugins/metable.rb: -------------------------------------------------------------------------------- 1 | module Swift 2 | module ModelPlugins 3 | module Metable 4 | module ClassMethods 5 | def metable! 6 | send :include, InstanceMethods 7 | property :meta, DataMapper::Property::Json, :default => {} 8 | end 9 | end 10 | 11 | module InstanceMethods 12 | def meta 13 | attribute_get(:meta) || {} 14 | end 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/views/elements/GalleryRandomImage/core.rb: -------------------------------------------------------------------------------- 1 | @folder = if @opts[:folder] 2 | case @opts[:folder] 3 | when Symbol, String 4 | Folder.all( :slug => Array(@opts[:folder]) ).sample 5 | else 6 | @opts[:folder].sample 7 | end 8 | else 9 | Bond.children_for(@page, 'Folder').sample 10 | end 11 | throw :output, "[No bound folders for GalleryRandomImage]" unless @folder 12 | @image = @folder.images.sample 13 | throw :output, "[No images in Folder##{@folder.slug}]" unless @image 14 | -------------------------------------------------------------------------------- /lib/swift/model_plugins/dateable.rb: -------------------------------------------------------------------------------- 1 | module Swift 2 | module ModelPlugins 3 | module Dateable 4 | module ClassMethods 5 | # Resource is dateable 6 | # It has date property and does some fixing before save 7 | def dateable! 8 | property :date, DateTime, :required => true 9 | 10 | before :valid? do |i| 11 | self.date = nil if date.blank? 12 | end 13 | end 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /admin/views/folders/_form.slim: -------------------------------------------------------------------------------- 1 | = f.inputs :title 2 | = f.input :text, :as => :text, :markdown => true 3 | = f.input :parent_id, :as => :select, :collection => Folder.all(:id.not => @object.id, :order => :title), :fields => [:title, :id], :selected => @object.parent_id, :class => 'long', :include_blank => true 4 | 5 | - allow :auditor do 6 | = f.input :slug 7 | 8 | - allow :designer do 9 | = f.input :is_private, :as => :boolean 10 | 11 | = f.submits :append => mk_timestamps( @object ) 12 | -------------------------------------------------------------------------------- /admin/views/dialogs/_folder_images_object.slim: -------------------------------------------------------------------------------- 1 | li.span2 2 | - data = { :id => image.id, :title => image.title, :type => 'image', :single => true } 3 | - data.merge! :bound => image.bound?( params[:parent_model], params[:parent_id] ), :model => image.class.name if params[:parent_id] 4 | = link_to( image.file.url, :class => 'pick thumbnail', :data => data, :onclick => 'return false' ) do 5 | = image_tag image.file.fill_thumb.url 6 | - unless image.title.blank? 7 | .caption= "#{image.title}" 8 | -------------------------------------------------------------------------------- /test/elements/pagelink_test.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require 'elements_helper' 3 | 4 | describe Swift do 5 | before do 6 | @page1 = Page.new :title => "Page 1", :path => "/", :parent => nil 7 | end 8 | 9 | it "should link created" do 10 | skip 11 | el = element("PageLink", @page1) 12 | el.must_equal "[Page ##{@args[0]} missing]" 13 | end 14 | 15 | it "should throw error" do 16 | skip 17 | el = element("PageLink") 18 | el.must_equal "[Page # missing]" 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /admin/views/dialogs/folder_images.slim: -------------------------------------------------------------------------------- 1 | ul.thumbnails 2 | - unless params[:parent_model] 3 | li.span2 4 | a.thumbnail.fileinput-button 5 | input type='file' name='images[]' multiple=true data-url='/admin/assets/upload' 6 | .placeholder 7 | | + 8 | .caption 9 | = pat 'dialog.upload_images' 10 | javascript: 11 | bindDialogFileUpload(); 12 | - @objects.each do |o| 13 | = partial 'dialogs/folder_images_object', :locals => { :image => o } 14 | -------------------------------------------------------------------------------- /app/views/elements/GalleryList/view.slim: -------------------------------------------------------------------------------- 1 | .thumbnails 2 | - @galleries.each do |g| 3 | .thumbnail 4 | - bonds = Bond.bonds_for g 5 | - img = g.images.sample :folder => g 6 | - bonds.map do |bond| 7 | - if bond.child_model == 'Image' 8 | - img = bond.child 9 | a href=('/gallery/' + g.slug) 10 | = image_tag img.file.fill_thumb.url 11 | .caption 12 | = link_to g.title, '/gallery/' + g.slug 13 | br 14 | = engine_render( g.text ) 15 | -------------------------------------------------------------------------------- /app/views/elements/FormsForm/view.slim: -------------------------------------------------------------------------------- 1 | - if @result.errors.any? 2 | .article Ошибка при заполнении формы 3 | - elsif @result.new? 4 | .article 5 | h3= @card.title 6 | .text= engine_render( @card.text ) 7 | = form_for @result, se_url(@card, :post), :class => 'form form-horizontal' do |f| 8 | - @f = f 9 | - @card.json.each do |k,v| 10 | = element_view 'Forms/input', :locals => { :key => k, :value => v } 11 | = f.submits 12 | - else 13 | .article Спасибо за заполнение формы 14 | -------------------------------------------------------------------------------- /lib/tasks/db.rake: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | namespace :db do 3 | desc "backup database" 4 | task :backup => :environment do 5 | connection = YAML.load_file( Padrino.root('config/database.yml') )[RACK_ENV] 6 | dbname = "#{connection['database']}-#{`date +%Y%m%d%H%M%S`.strip}.sql" 7 | `mysqldump #{connection['database']} --host=#{connection['host']} --user=#{connection['username']} --password=#{connection['password']} --databases > #{Padrino.root}/tmp/#{dbname}` 8 | p "tmp/#{dbname}" 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /admin/views/cat_cards/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:cat_cards, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-cat_cards" do |f| 3 | = partial "cat_cards/form", :locals => { :f => f } 4 | 5 | - content_for :help do 6 | li.nav-header= pat('menu.help') 7 | li 8 | = link_to url(:cat_nodes, :new, :cat_card_id => @object.id) do 9 | = mk_glyphs 'folder-close', 'arrow-right', 'inbox' 10 | = pat('menu.add.nodes') 11 | -------------------------------------------------------------------------------- /app/views/layouts/application.slim: -------------------------------------------------------------------------------- 1 | doctype 5 2 | html class=swift.print? 3 | head 4 | meta charset="utf-8" 5 | link rel="shortcut icon" href="/favicon.ico" 6 | link rel="alternate" type="application/rss+xml" title=Option(:site_title) href="/news.xml" 7 | /[if lt IE 9] 8 | script src='/javascripts/html5ie8tags.js' 9 | = element 'PageTitle' 10 | = element 'Meta' 11 | == pipeline :app, :css 12 | == pipeline :app, :js 13 | body class="#{swift.fragment} #{swift.locale}" 14 | = yield 15 | -------------------------------------------------------------------------------- /models/layout.rb: -------------------------------------------------------------------------------- 1 | class Layout 2 | include DataMapper::Resource 3 | 4 | property :id, String, :length => 20, :key => true 5 | property :title, String 6 | 7 | # plugins 8 | timestamps! 9 | userstamps! 10 | loggable! 11 | 12 | # relations 13 | has n, :pages, :child_key => :layout_id 14 | 15 | # hookers 16 | before :valid? do 17 | self.id = title if id.blank? 18 | end 19 | 20 | after :destroy do 21 | FileUtils.rm_f "#{Swift::Application.views}/layouts/#{id}.slim" 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /admin/views/codes/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-codes action=url(:codes, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :title) 9 | th= mat(:object, :slug) 10 | tbody 11 | - @objects.each do |object| 12 | tr 13 | td.last= mk_checkbox object 14 | td= mk_edit object 15 | td= object.slug 16 | = partial 'base/index_operations_bottom' 17 | -------------------------------------------------------------------------------- /app/views/elements/FoldersImages/core.rb: -------------------------------------------------------------------------------- 1 | if @folder ||= Folder.by_slug( @args[0] || @opts[:folder] || @opts[:gallery] ) 2 | @page = @folder 3 | swift.path_pages[-1] = Page.new :title => @folder.title 4 | swift.resource = @folder 5 | @images = @folder.images 6 | else 7 | @images = [] 8 | bonds = Bond.bonds_for @page 9 | bonds.map do |bond| 10 | case bond.child_model 11 | when 'Image' 12 | @images << bond.child 13 | when 'Folder' 14 | @images += bond.child.images 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /test/elements_helper.rb: -------------------------------------------------------------------------------- 1 | require 'minitest_helper' 2 | require 'rack/test' 3 | require 'digest/md5' 4 | 5 | class ElementApp < Padrino::Application 6 | register Swift::Engine 7 | end 8 | 9 | class MiniTest::Spec 10 | include Rack::Test::Methods 11 | 12 | def app 13 | ElementApp 14 | end 15 | 16 | def element(*args) 17 | ElementApp.get(Digest::MD5.hexdigest(args.inspect)) do 18 | element(*args) 19 | end 20 | get Digest::MD5.hexdigest(args.inspect) 21 | last_response.body 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /admin/views/accounts/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :name 2 | = f.input :surname 3 | = f.input :email 4 | = f.input :password, :as => :password 5 | = f.input :password_confirmation, :as => :password 6 | - allow :admin do 7 | = f.input :suggested_password, :value => Account.create_password 8 | = f.input :text, :as => :text 9 | = f.input :group_id, :as => :select, :selected => @object.group_id, :collection => Account.all( :group_id => nil ), :fields => [ :title, :id ], :include_blank => false 10 | = f.submits :append => mk_timestamps( @object ) 11 | -------------------------------------------------------------------------------- /admin/views/base/_edit_operations_show.slim: -------------------------------------------------------------------------------- 1 | ul.nav.nav-tabs.operations 2 | li.first= mk_single_op :list, url(@models, :index) 3 | - if !@object.new? && @object.respond_to?(:id) 4 | li.active= mk_single_op :edit, url(@models, :edit, :id => @object.id) 5 | - if BONDABLE_PARENTS.include? @object.class.name 6 | li.toggle 7 | - bc = @object.bond_count 8 | = mk_dialog_op :bind, url(:dialogs, :bonds, :parent_model => @object.class, :parent_id => @object.id), :title => pat('dialog.bind_objects'), :add => (bc > 0 && " (#{bc})") 9 | -------------------------------------------------------------------------------- /admin/views/base/_group-select.slim: -------------------------------------------------------------------------------- 1 | - @groups.each do |name,variants| 2 | .dataTables_group id="DataTables_Table_0_group_#{name}" 3 | label 4 | = pat("group.#{name}") + ': ' 5 | select name="DataTables_Table_0_group_#{name}" size="1" aria-controls="DataTables_Table_0" data={ :name => name.classify } 6 | - variants.each do |variant| 7 | option value=variant.id selected=(@selected[name][variant.id] && "selected") = variant.title 8 | option value="all" selected=(@selected[name].blank? && "selected") = pat('all') 9 | -------------------------------------------------------------------------------- /admin/views/base/_index_operations_bottom.slim: -------------------------------------------------------------------------------- 1 | .form-actions 2 | label.btn for='check-all' 3 | = check_box_tag :check_all, :checked => false, :id => 'check-all', :class => 'inline' 4 | = pat('select_all') 5 | - allow :auditor do 6 | - if @the_model && Admin::MULTIPLE_EDIT_FIELDS.any?{ |property| @the_model.properties.named?(property) } 7 | = mk_multiple_op :multiedit 8 | - if @the_model.respond_to? :published 9 | = mk_multiple_op :publish 10 | = mk_multiple_op :unpublish 11 | = mk_multiple_op :delete 12 | -------------------------------------------------------------------------------- /admin/views/dialogs/folder_assets.slim: -------------------------------------------------------------------------------- 1 | - @objects.each do |o| 2 | .item 3 | - data = { :id => o.id, :title => o.title, :type => 'file', :single => true } 4 | - data.merge! :bound => o.bound?( params[:parent_model], params[:parent_id] ), :model => o.class.name if params[:parent_id] 5 | = link_to o.file.url, :class => :pick, :data => data, :onclick => 'return false' do 6 | / i.icon-file class="icon-file-#{o.file.content_type.split(/[.\/]/).last}" 7 | span.title= "#{o.title} (#{File.extname(o.file.path)} #{o.file.size.as_size})" 8 | -------------------------------------------------------------------------------- /app/views/elements/NewsCalendar/view.slim: -------------------------------------------------------------------------------- 1 | nav.news-calendar 2 | .years 3 | - @news_years.to_a.reverse.each do |year| 4 | = link_to year.to_s, url_replace(@target, :year => year.to_s, :month => nil, :page => nil), :class => @new_year.to_i == year.to_i ? 'active' : nil 5 | .months 6 | - @news_months.each do |month| 7 | = link_to I18n.t("date.month_names_nominative")[month], url_replace(@target, :year => "#{@new_year||Date.today.year}", :month => month.to_s, :page => nil), :class => @new_month.to_i == month.to_i ? 'active' : nil 8 | -------------------------------------------------------------------------------- /admin/views/cat_cards/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-cat_cards action=url(:cat_cards, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :title) 9 | th= mat(:object, :slug) 10 | tbody 11 | - @objects.each do |object| 12 | tr 13 | td.last= mk_checkbox object 14 | td= mk_edit object 15 | td= object.path 16 | = partial 'base/index_operations_bottom' 17 | -------------------------------------------------------------------------------- /admin/views/forms_faqs/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-forms_faqs action=url(:forms_faqs, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :title) 9 | th= mat(:object, :slug) 10 | tbody 11 | - @objects.each do |object| 12 | tr 13 | td.last= mk_checkbox object 14 | td= mk_edit object 15 | td= object.slug 16 | = partial 'base/index_operations_bottom' 17 | -------------------------------------------------------------------------------- /lib/swift/helpers.rb: -------------------------------------------------------------------------------- 1 | Dir.glob( File.dirname(__FILE__) + '/helpers/*.rb' ).each { |file| require file } 2 | 3 | module Swift 4 | module Helpers 5 | include Swift::Helpers::Init 6 | include Swift::Helpers::Locale 7 | include Swift::Helpers::Defer 8 | include Swift::Helpers::Template 9 | include Swift::Helpers::Render 10 | include Swift::Helpers::Url 11 | include Swift::Helpers::Error 12 | include Swift::Helpers::Utils 13 | include Swift::Helpers::Legacy 14 | include Swift::Helpers::Remote 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/views/elements/NewsTop/core.rb: -------------------------------------------------------------------------------- 1 | inc = @opts[:include] || @opts[:rubrics] 2 | filter = {} 3 | filter['news_rubric.slug'] = inc.to_s.split /\W+/ if inc 4 | filter['news_rubric.slug.not'] = @opts[:exclude].to_s.split /\W+/ if @opts[:exclude] 5 | filter[:offset] = @opts[:offset].to_i if @opts[:offset] 6 | filter[:limit] = @opts[:limit].to_i if @opts[:limit] 7 | filter[:limit] ||= 5 8 | filter[:order] = [ :date.desc, :id.desc ] 9 | @articles = NewsArticle.published.all( filter ) 10 | -------------------------------------------------------------------------------- /admin/views/news_rubrics/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-news_rubrics action=url(:news_rubrics, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :title) 9 | th= mat(:object, :slug) 10 | tbody 11 | - @objects.each do |object| 12 | tr 13 | td.last= mk_checkbox object 14 | td= mk_edit object 15 | td= object.slug 16 | = partial 'base/index_operations_bottom' 17 | -------------------------------------------------------------------------------- /test/elements/pagetitle_test.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require 'elements_helper' 3 | 4 | describe Swift do 5 | before do 6 | @page = Page.new :title => "Page 1", :path => "/", :text => "small text info" 7 | end 8 | 9 | it "should write page title" do 10 | skip 11 | el = element("PageTitle").strip 12 | el.must_equal "Новый сайт — %{placeholder[:html_title]}" 13 | end 14 | 15 | it "should throw error" do 16 | skip 17 | el = element("PageContent").strip 18 | el.must_equal "

small text info

" 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/views/elements/News/article_description.slim: -------------------------------------------------------------------------------- 1 | article itemscope=true itemtype='http://schema.org/NewsArticle' 2 | header 3 | time itemprop='datePublished' datetime=article.date.iso8601 = article.date.as_date 4 | - if article.has_image? 5 | = image_tag article.image.file.mini_thumb.url, :alt => article.image.title, :itemprop => 'image' 6 | h4 itemprop='headline' 7 | = link_to article.title, "/news/show/#{article.slug}" 8 | - if article.info.present? 9 | .description itemprop='description' 10 | = engine_render(article.info) 11 | -------------------------------------------------------------------------------- /admin/views/layouts/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-layouts action=url(:layouts, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :id) 9 | th= mat(:object, :title) 10 | tbody 11 | - @objects.each do |object| 12 | tr 13 | td= mk_checkbox object 14 | td= link_to object.id, url(:layouts, :edit, :id => object.id) 15 | td= mk_edit object 16 | = partial 'base/index_operations_bottom' 17 | -------------------------------------------------------------------------------- /app/views/elements/CatNode/view.slim: -------------------------------------------------------------------------------- 1 | - node = @node 2 | .article 3 | h4= node.title 4 | .text= engine_render( node.text ) 5 | dl 6 | - node.cat_card.json.each do |key, value| 7 | - unless node.json[key].blank? 8 | - if value[0] == 'assets' 9 | dt= key 10 | dd 11 | - node.json[key].each do |asset_id| 12 | - asset = Asset.get(asset_id) 13 | - next unless asset 14 | = show_asset asset 15 | br 16 | - else 17 | dt= key 18 | dd= node.json[key] 19 | -------------------------------------------------------------------------------- /admin/views/options/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-options action=url(:options, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :id) 9 | th= mat(:object, :title) 10 | tbody 11 | - @objects.each do |object| 12 | tr 13 | td.last= mk_checkbox object 14 | td= link_to object.id, url(:options, :edit, :id => object.id) 15 | td= object.title 16 | = partial 'base/index_operations_bottom' 17 | -------------------------------------------------------------------------------- /admin/views/elements/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-elements action=url(:elements, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :id) 9 | th= mat(:object, :title) 10 | tbody 11 | - @objects.each do |object| 12 | tr 13 | td.last= mk_checkbox object 14 | td= link_to object.id, url(:elements, :edit, :id => object.id) 15 | td= object.title 16 | = partial 'base/index_operations_bottom' 17 | -------------------------------------------------------------------------------- /admin/views/dialogs/pick_images.slim: -------------------------------------------------------------------------------- 1 | .dialog-images 2 | - tabs = current_account.get_folders.with(:images).all( :order => :created_at.desc ).to_a 3 | = mk_group_selector Image, Folder, params, :with => :images, :instance => 'for-bonds' 4 | .tab-content 5 | - @first = true 6 | - tabs.each do |folder| 7 | - if @first 8 | - klass = 'active' 9 | - @first = false 10 | - else 11 | - klass = '' 12 | .tab-pane id="images-#{folder.id}" class=klass 13 | .tab-pane#images-all 14 | javascript: 15 | bindCustomFilter('#DataTables_Table_0_group_folder', "images"); 16 | -------------------------------------------------------------------------------- /admin/views/pages/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-pages action=url(:pages, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table.smart 5 | thead 6 | tr 7 | th.first 8 | th data={ :search => 1 } = mat(:object, :title) 9 | th data={ :search => 1 } = mat(:object, :slug) 10 | th data={ :search => 1 } = mat(:object, :path) 11 | th= mat(:object, :fragment) 12 | tbody 13 | - @k = 0 14 | = partial 'pages/tree', :locals => { :tree => @tree, :level => 0 } 15 | = partial 'base/index_operations_bottom' 16 | -------------------------------------------------------------------------------- /app/views/elements/Block/core.rb: -------------------------------------------------------------------------------- 1 | block = Block.by_slug @args[0] 2 | throw :output, "[Block ##{@args[0]} missing]" unless block 3 | @text = 4 | case 5 | when Block::Types[block.type] == :html 6 | # this ensures that tagged HTML content is brought directly to response body without escaping 7 | block.text.html_safe 8 | when Block::Types[block.type] == :table && !@identity[:class].index('notitle') 9 | block.text.gsub!(//m, "\n#{@opts[:title]||block.title}") unless @opts[:instance] == :notitle 10 | engine_render block.text 11 | else 12 | engine_render block.text 13 | end 14 | -------------------------------------------------------------------------------- /admin/views/forms_cards/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-forms_cards action=url(:forms_cards, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :title) 9 | th= mat(:object, :type) 10 | th= mat(:object, :slug) 11 | tbody 12 | - @objects.each do |object| 13 | tr 14 | td.last= mk_checkbox object 15 | td= mk_edit object 16 | td= FormsCard::Kinds.key(object.kind) 17 | td= object.slug 18 | = partial 'base/index_operations_bottom' 19 | -------------------------------------------------------------------------------- /admin/views/news_articles/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title 2 | = f.input :info, :as => :text, :markdown => true 3 | = f.input :text, :as => :text, :markdown => true 4 | = f.input :news_rubric_id, :as => :select, :selected => @object.news_rubric_id, :collection => NewsRubric.all, :fields => [ :title, :id ], :include_blank => false 5 | = f.input :date, :as => :datetime 6 | = f.input :slug 7 | - allow :auditor do 8 | = f.input :is_published, :as => :boolean 9 | = f.input :publish_at, :as => :datetime 10 | 11 | - allow :editor do 12 | = partial 'base/meta', :locals => { :f => f } 13 | 14 | = f.submits :append => mk_timestamps( @object ) 15 | -------------------------------------------------------------------------------- /admin/views/forms_stats/index.slim: -------------------------------------------------------------------------------- 1 | ul.nav.nav-tabs.operations 2 | li.first.active= mk_single_op :list, url(@models, :index) 3 | .form-horizontal 4 | - @objects.each do |object| 5 | .stats 6 | h3= link_to object.title, url( :forms_results, :index, :forms_card => object.slug ) 7 | - object.json.each do |k,v| 8 | - if object.json.count > 1 9 | h5= k 10 | - v[1].split(/[\r\n]+/).each do |var| 11 | .control-group 12 | label.control-label= var 13 | .progress 14 | .bar style="width:#{object.stat(k, var, :percent)}%" 15 | = object.stat(k, var, :count) 16 | -------------------------------------------------------------------------------- /test/elements/breadcrumbs_test.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require 'elements_helper' 3 | 4 | describe Swift do 5 | before do 6 | @page1 = Page.new :title => "Page 1", :path => "/", :parent => nil 7 | @page2 = Page.new :title => "Page 2", :path => "/page2", :parent => @page1 8 | @swift = {} 9 | @swift[:path_pages] = [@page1, @page2] 10 | end 11 | 12 | it "should not nil page" do 13 | skip 14 | p @page1 15 | p @page2 16 | p @swift 17 | el = element("Breadcrumbs", :spacer => ">") 18 | el.must_equal "" 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /admin/views/folders/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-folders action=url(:folders, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table.smart 5 | thead 6 | tr 7 | th.first 8 | th data={ :search => 1 } = mat(:object, :title) 9 | th data={ :search => 1 } = mat(:object, :slug) 10 | th data={ :search => 1 } = mat(:object, :path) 11 | th data={ :search => 1 } = mat(:object, :is_private) 12 | tbody 13 | - @k = 0 14 | = partial 'folders/tree', :locals => { :tree => @tree, :level => 0 } 15 | = partial 'base/index_operations_bottom' 16 | -------------------------------------------------------------------------------- /admin/views/forms_faqs/_form.slim: -------------------------------------------------------------------------------- 1 | = f.input :title, :as => :text, :markdown => true, :label => { :caption => 'Вопрос' } 2 | = f.input :email 3 | = f.input :author 4 | = f.input :address 5 | = f.input :text, :as => :text, :markdown => true, :label => { :caption => 'Ответ' } 6 | - if @object.asset 7 | .control-group.as_string 8 | label.control-label for="forms_faq_asset" 9 | | Дополнительная информация 10 | .controls.no-input 11 | .label= @object.asset.mime 12 | br 13 | = link_to @object.asset.title, @object.asset.file.url 14 | - allow :auditor do 15 | = f.input :slug 16 | = f.input :is_published, :as => :boolean 17 | = f.submits 18 | -------------------------------------------------------------------------------- /admin/views/cat_groups/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-cat_groups action=url(:cat_groups, :index)/:multiple method=:post 3 | = csrf_token_field 4 | table.table 5 | thead 6 | tr 7 | th.first 8 | th= mat(:object, :title) 9 | th= mat(:object, :slug) 10 | th= mat(:object, :path) 11 | tbody 12 | - @objects.each do |object| 13 | tr class=('level-'+(object.path.split('/').length-1).to_s) 14 | td.last= mk_checkbox object 15 | td= mk_edit object 16 | td= object.slug 17 | td= object.path 18 | = partial 'base/index_operations_bottom' 19 | -------------------------------------------------------------------------------- /admin/views/folders/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations' 2 | = form_for :object, url(:folders, :update, :id => @object.id), :method => :put, :class => 'form form-horizontal edit', :id => "edit-folders" do |f| 3 | = partial "folders/form", :locals => { :f => f } 4 | 5 | - content_for :help do 6 | li.nav-header= pat('menu.help') 7 | li 8 | = link_to url(:images, :new, :folder_id => @object.id) do 9 | = mk_glyphs 'picture', 'arrow-right', 'folder-open' 10 | = pat('menu.add.images') 11 | li 12 | = link_to url(:assets, :new, :folder_id => @object.id) do 13 | = mk_glyphs 'file', 'arrow-right', 'folder-open' 14 | = pat('menu.add.assets') 15 | -------------------------------------------------------------------------------- /admin/helpers/view_helpers.rb: -------------------------------------------------------------------------------- 1 | Admin.helpers do 2 | def tag_icon(icon, tag = nil) 3 | content = content_tag(:i, '', :class=> "icon-#{icon}") 4 | content << " #{tag}" 5 | end 6 | 7 | def padrino_admin_translate(word, default=nil) 8 | t("padrino.admin.#{word}", :default => default).to_s.html_safe 9 | end 10 | alias :pat :padrino_admin_translate 11 | 12 | def model_attribute_translate(model, attribute) 13 | t("models.#{model}.attributes.#{attribute}").to_s.html_safe 14 | end 15 | alias :mat :model_attribute_translate 16 | 17 | def model_translate(model) 18 | t("models.#{model}.name").to_s.html_safe 19 | end 20 | alias :mt :model_translate 21 | end 22 | -------------------------------------------------------------------------------- /app/views/elements/Forms/core.rb: -------------------------------------------------------------------------------- 1 | @opts[:kind] ||= :form 2 | if md = swift.slug.match( /(show|post)\/(.*)/ ) 3 | swift.slug = md[2] 4 | @opts[:method] = md[1] 5 | if @opts[:method] == 'post' && swift.http_method != 'POST' 6 | throw :output, redirect( swift.uri.gsub(/\/post\//, '/show/') ) 7 | else 8 | throw :output, element( 'Forms' + @opts[:kind].to_s.camelize, *@args, @opts ) 9 | end 10 | end 11 | if md = swift.slug.match( /(poll)\/(.*)/ ) 12 | @opts[:kind] = :inquiry 13 | @opts[:method] = md[1] 14 | swift.slug = md[2] 15 | throw :output, element( 'Forms' + @opts[:kind].to_s.camelize, *@args, @opts ) 16 | end 17 | @forms = FormsCard.all( :kind => @opts[:kind] ).published 18 | -------------------------------------------------------------------------------- /lib/tasks/load_events.rake: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | namespace :se do 3 | desc "load array of events" 4 | task :load_events => :environment do 5 | filter = {} 6 | filter[:period.not] = '' 7 | NewsEvent.published.all(filter).each do |ne| 8 | while ne.date.to_date < Date.today 9 | ne.date = case ne.period 10 | when 'year' 11 | ne.date >> 12 12 | when 'month' 13 | ne.date >> 1 14 | when 'week' 15 | ne.date + 7 16 | when 'day' 17 | ne.date + 1 18 | else 19 | ne.date 20 | end 21 | end 22 | ne.save 23 | p ne.title 24 | end 25 | p 'inc date in NewsEvent' 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /admin/views/base/_edit_operations.slim: -------------------------------------------------------------------------------- 1 | ul.nav.nav-tabs.operations 2 | li.first= mk_single_op :list, url(@models, :index) 3 | li class=(@object.new? && :active) = mk_single_op :new, url(@models, :new) 4 | - if !@object.new? && @object.respond_to?(:id) 5 | li.active= mk_single_op :edit, url(@models, :edit, :id => @object.id) 6 | - if BONDABLE_PARENTS.include? @object.class.name 7 | li.toggle 8 | - bc = @object.bond_count 9 | = mk_dialog_op :bind, url(:dialogs, :bonds, :parent_model => @object.class, :parent_id => @object.id), :title => pat('dialog.bind_objects'), :add => (bc > 0 && " (#{bc})") 10 | - allow :auditor do 11 | li.last= mk_single_op :history, "../history/#{@object.id}" 12 | -------------------------------------------------------------------------------- /admin/views/dialogs/_tree.slim: -------------------------------------------------------------------------------- 1 | - tree ||= @tree 2 | - k = 0 3 | - (tree||[]).each do |leaf| 4 | - k += 1 5 | - if o = leaf[:page] 6 | div.item class=( (leaf[:child] ? "openable" : "final") + " level-#{level}" ) id="page-#{o.id}" 7 | - name = o.slug.blank? ? 'index' : o.slug 8 | - data = { :id => o.id, :title => o.title, :type => 'page', :single => true } 9 | - data.merge! :bound => o.bound?( params[:parent_model], params[:parent_id] ), :model => o.class.name if params[:parent_id] 10 | = link_to "#{o.title}", o.path, :data => data, :class => :pick, :onclick => 'return false' 11 | - if leaf[:child] 12 | = partial 'dialogs/tree', :locals => { :tree => leaf[:child], :level => level + 1 } 13 | -------------------------------------------------------------------------------- /models/news_rubric.rb: -------------------------------------------------------------------------------- 1 | class NewsRubric 2 | include DataMapper::Resource 3 | 4 | property :id, Serial 5 | 6 | property :title, String, :required => true 7 | property :text, Text 8 | 9 | sluggable! 10 | timestamps! 11 | userstamps! 12 | loggable! 13 | bondable! 14 | 15 | # relations 16 | has n, :news_articles 17 | has n, :news_events 18 | 19 | # hookers 20 | 21 | # instance helpers 22 | 23 | # class helpers 24 | def self.with( type ) 25 | type = type.to_s.pluralize 26 | return [] unless ['news_articles', 'news_events'].include? type 27 | NewsRubric.all(:conditions => [ "0 < (SELECT count(id) FROM `#{type}` WHERE news_rubric_id=`news_rubrics`.id)" ]) 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/swift/model_plugins/stamps.rb: -------------------------------------------------------------------------------- 1 | module Swift 2 | module ModelPlugins 3 | module Stamps 4 | module ClassMethods 5 | # Resource has userstamps 6 | # It fills its creator before creating itself 7 | def userstamps! 8 | belongs_to :created_by, 'Account', :required => false 9 | belongs_to :updated_by, 'Account', :required => false 10 | 11 | before :create do |i| 12 | i.created_by_id = i.updated_by_id 13 | end 14 | end 15 | 16 | # Resource has timestamps 17 | def timestamps! 18 | property :created_at, DateTime 19 | property :updated_at, DateTime 20 | end 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /admin/views/base/_group-select-for-bonds.slim: -------------------------------------------------------------------------------- 1 | - @groups.each do |name,variants| 2 | .dataTables_group id="DataTables_Table_0_group_#{name}" 3 | label 4 | = pat("group.#{name}") + ': ' 5 | select name="DataTables_Table_0_group_#{name}" size="1" aria-controls="DataTables_Table_0" data={ :name => name.classify } 6 | - variants.each do |variant| 7 | option value=variant.id selected=(@selected[name][variant.id] && "selected") data-url=url(:dialogs, :folder, params.merge({:folder_id => variant.id, :object_type => :images})) = variant.title 8 | option value="all" selected=(@selected[name].blank? && "selected") data-url=url(:dialogs, :folder, params.merge({:folder_id => "all", :object_type => :images})) = pat('all') 9 | -------------------------------------------------------------------------------- /lib/swift/monkey/rack.rb: -------------------------------------------------------------------------------- 1 | module Rack 2 | # allow params keys to be utf-8 in multipart mode 3 | module Utils 4 | class KeySpaceConstrainedParams 5 | unless instance_methods.map(&:to_s).include?('old_to_params_hash') 6 | alias_method :old_to_params_hash, :to_params_hash 7 | end 8 | 9 | def to_params_hash 10 | Hash[old_to_params_hash.map{ |k,v| [k.dup.force_encoding('utf-8'), v] }] 11 | end 12 | end 13 | end 14 | 15 | # Adds `addr` method to get ip address of a client 16 | class Request 17 | def parse_multipart(env) 18 | Rack::Multipart.parse_multipart(env) 19 | end 20 | 21 | def addr 22 | @env['HTTP_X_FORWARDED_FOR'] || @env['REMOTE_ADDR'] 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /vendor/javascripts/bootstrap/bootstrap-datetimepicker.ru.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Russian translation for bootstrap-datetimepicker 3 | * Victor Taranenko 4 | */ 5 | ;(function($){ 6 | $.fn.datetimepicker.dates['ru'] = { 7 | days: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье"], 8 | daysShort: ["Вск", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Вск"], 9 | daysMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], 10 | months: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"], 11 | monthsShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"], 12 | today: "Сегодня" 13 | }; 14 | }(jQuery)); -------------------------------------------------------------------------------- /app/views/elements/FoldersRandomImage/core.rb: -------------------------------------------------------------------------------- 1 | @folder = if @opts[:folder] 2 | case @opts[:folder] 3 | when Symbol, String 4 | Folder.all( :slug => Array(@opts[:folder]) ).sample 5 | else 6 | @opts[:folder].sample 7 | end 8 | else 9 | Bond.children_for(@page, 'Folder').sample 10 | end 11 | throw :output, "[No bound folders for GalleryRandomImage]" unless @folder 12 | 13 | @image = @folder.images.sample 14 | throw :output, "[No images in Folder##{@folder.slug}]" unless @image 15 | 16 | @image_src = begin 17 | @opts[:outlet] ? @image.file.outlets[@opts[:outlet].to_sym].url : @image.file.index_thumb.url 18 | rescue NoMethodError 19 | @image.file.url 20 | end 21 | 22 | throw :output, image_tag(@image_src, :alt => @image.title) if @opts[:raw] 23 | -------------------------------------------------------------------------------- /admin/views/multiple/edit.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/edit_operations_multiple' 2 | = form_for :object, url(:multiple, :edit, :models => @models, :ids => params[:ids]), :method => :patch, :class => 'form form-horizontal edit', :id => "edit-multiple" do |f| 3 | - @the_model.properties.each do |property| 4 | - if :news_rubric_id == property.name 5 | = f.input :news_rubric_id, :as => :select, :selected => @selected_values[property.name], :collection => NewsRubric.all, :fields => [ :title, :id ], :include_blank => [@distinct_values[property.name], ''] 6 | - if :folder_id == property.name 7 | = f.input :folder_id, :as => :select, :selected => @selected_values[property.name], :collection => Folder.all, :fields => [ :title, :id ], :include_blank => [@distinct_values[property.name], ''] 8 | = f.submits 9 | -------------------------------------------------------------------------------- /admin/views/dialogs/bonds.slim: -------------------------------------------------------------------------------- 1 | .dialog-bonds 2 | form action=url(:dialogs, :bonds_ajax, params[:parent_model], params[:parent_id]) method=:post 3 | = csrf_token_field 4 | ul.nav.nav-tabs#tabs-bondables 5 | - data = { :url => url(:dialogs, :bond, params[:parent_model], params[:parent_id]), :model => 'Bond', :toggle => :tab, :cached => 1 } 6 | li.tab.active= link_to mt('bonds'), '#Bond', :data => data 7 | - BONDABLE_CHILDREN.each do |model_name| 8 | li.tab= link_to mt(model_name.underscore.pluralize), "##{model_name}", :'data-url' => url(:dialogs, model_name.underscore.pluralize.to_sym, params), :'data-toggle' => :tab 9 | .tab-content 10 | .tab-pane.active#Bond 11 | - BONDABLE_CHILDREN.each do |model_name| 12 | .tab-pane id=model_name 13 | javascript: 14 | bindDialogBonds(); 15 | -------------------------------------------------------------------------------- /config/setup-options.yml: -------------------------------------------------------------------------------- 1 | Option: 2 | site_title: 3 | title: Название сайта 4 | value: Новый сайт 5 | max_protocol_size: 6 | title: Предельный размер протокола (байтов) 7 | value: 2097152 8 | max_protocol_period: 9 | title: Предельная длительность хранения протокола (дней) 10 | value: 280 11 | outlets: 12 | title: Размеры масштабирования картинок 13 | value: 14 | fill_thumb: 15 | fill: 180x135 16 | thumb: 17 | fit: 180x135 18 | mini_thumb: 19 | fit: 80x 20 | gallery_thumb: 21 | fit: x135 22 | index_thumb: 23 | fit: 360x240 24 | box: 25 | fit: '1280x960>' 26 | '': Original 27 | locales: 28 | title: Доступные языки интерфейса 29 | value: [ru] 30 | instance: 31 | title: Вариант визуализаторов 32 | value: default 33 | -------------------------------------------------------------------------------- /admin/views/fragments/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | form.inner.multiple#multiple-fragments action=url(:fragments, :index)/:multiple method=:post 3 | = csrf_token_field 4 | - [:basics, :fragments].each do |var| 5 | - @objects = instance_variable_get :"@#{var}" 6 | table.table 7 | thead 8 | tr 9 | th.first 10 | th= mat(:object, :id) 11 | th= mat(:object, :title) 12 | - if var == :basics 13 | th= mat(:fragment, :usage) 14 | tbody 15 | - @objects.each do |object| 16 | tr 17 | td.last= mk_checkbox object 18 | td= link_to object.id, url(:fragments, :edit, :id => object.id) 19 | td= mk_edit object 20 | - if var == :basics 21 | td= object.usage || '—' 22 | = partial 'base/index_operations_bottom' 23 | -------------------------------------------------------------------------------- /assets/stylesheets/admin/13-fileupload.css: -------------------------------------------------------------------------------- 1 | .fileinput-button { 2 | position: relative; 3 | overflow: hidden; 4 | float: left; 5 | margin-right: 4px; 6 | } 7 | .fileinput-button input { 8 | position: absolute; 9 | top: 0; 10 | right: 0; 11 | margin: 0; 12 | opacity: 0.01; 13 | filter: alpha(opacity=1); 14 | *zoom: 2; 15 | transform: translate(-100%,0) scale(4); 16 | -webkit-transform: translate(0,-50%) scale(4); 17 | width: 100%; 18 | height: 100%; 19 | direction: ltr; 20 | cursor: pointer; 21 | } 22 | .fileupload-buttonbar .btn, 23 | .fileupload-buttonbar .toggle { 24 | margin-bottom: 5px; 25 | } 26 | 27 | /* Fix for IE 6: */ 28 | * html .fileinput-button { 29 | line-height: 24px; 30 | margin: 1px -3px 0 0; 31 | } 32 | 33 | /* Fix for IE 7: */ 34 | * + html .fileinput-button { 35 | padding: 2px 15px; 36 | margin: 1px 0 0 0; 37 | } 38 | -------------------------------------------------------------------------------- /models/fragment.rb: -------------------------------------------------------------------------------- 1 | class Fragment 2 | include DataMapper::Resource 3 | 4 | property :id, String, :length => 20, :key => true 5 | property :title, String 6 | property :is_fragment, Boolean, :default => false 7 | property :is_module, Boolean, :default => false 8 | 9 | # plugins 10 | timestamps! 11 | userstamps! 12 | loggable! 13 | 14 | # relations 15 | has n, :pages, :child_key => :fragment_id 16 | 17 | # hookers 18 | before :valid? do 19 | self.id = title if id.blank? 20 | end 21 | 22 | after :destroy do 23 | FileUtils.rm_f "#{Swift::Application.views}/fragments/#{id}.slim" 24 | end 25 | 26 | def usage 27 | count = pages.count 28 | count > 0 ? count : nil 29 | end 30 | 31 | def self.fragments 32 | all :is_fragment => true 33 | end 34 | 35 | def self.basic 36 | all :is_fragment => false 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /assets/stylesheets/elements/Image.css: -------------------------------------------------------------------------------- 1 | img.leftno { 2 | float: left; 3 | clear: none; 4 | margin-right: 0.75em; 5 | margin-bottom: 0.25em; 6 | } 7 | img.leftof { 8 | float: left; 9 | clear: left; 10 | margin-right: 0.75em; 11 | margin-bottom: 0.25em; 12 | } 13 | img.rightno { 14 | float: right; 15 | clear: none; 16 | margin-left: 0.75em; 17 | margin-bottom: 0.25em; 18 | } 19 | img.rightof { 20 | float: right; 21 | clear: right; 22 | margin-left: 0.75em; 23 | margin-bottom: 0.25em; 24 | } 25 | img.leftno + img.leftno { 26 | margin-left: -0.5em; 27 | } 28 | img.rightno + img.rightno { 29 | margin-right: -0.5em; 30 | } 31 | 32 | img.Image-thumbnail-link { 33 | margin-top: 0.5em; 34 | margin-bottom: 0.5em; 35 | } 36 | img.Image-thumbnail-link.leftno { 37 | margin-right: 1.5em; 38 | } 39 | img.Image-thumbnail-link.rightno { 40 | margin-left: 1.5em; 41 | } 42 | -------------------------------------------------------------------------------- /app/views/elements/Cat/core.rb: -------------------------------------------------------------------------------- 1 | swift.module_path_ids = [] 2 | # FIXME maybe use `children_for`? 3 | bonds = Bond.bonds_for @page, 'CatCard' 4 | @card_ids = bonds.map(&:child).map(&:id) 5 | @groups = CatGroup.all :cat_card_id => @card_ids 6 | 7 | if md = swift.slug.match( /show\/(.*)/ ) 8 | swift.slug = md[1] 9 | swift.path_pages << Page.new 10 | throw :output, element( 'CatNode', @args, @opts ) 11 | end 12 | 13 | if md = swift.slug.match( /.*/ ) 14 | steps = swift.slug.split( '/' ) 15 | steps.each do |step| 16 | group = @groups.by_slug(step) 17 | not_found unless group 18 | not_found if swift.module_path_ids.last && group.parent_id != swift.module_path_ids.last 19 | swift.module_path_ids << group.id 20 | @group = group 21 | end 22 | core = element( 'CatGroups', @args, @opts ) 23 | core += element( 'CatNodes', @args, @opts ) 24 | throw :output, core 25 | end 26 | -------------------------------------------------------------------------------- /app/views/layouts/news.xml.slim: -------------------------------------------------------------------------------- 1 | - title = Option(:site_title) 2 | - description = Page.first( :path => '/news' ) 3 | - description = description.meta['description'] if description 4 | doctype xml 5 | rss version="2.0" 6 | channel 7 | title= title 8 | description= description.present? ? description : I18n.t(:news) 9 | link= absolute_url('/') 10 | - @news_articles.each do |article| 11 | - link = absolute_url(se_url article) 12 | item 13 | title= article.title 14 | link= link 15 | description= strip_tags_for_rss(engine_render(article.text)) 16 | pubDate= article.date.rfc822 17 | - if article.uuid.blank? 18 | guid= link 19 | - else 20 | guid isPermaLink="false" = article.uuid 21 | - if article.has_image? 22 | enclosure url=absolute_url(article.image.file.url) type=article.image.file.content_type 23 | -------------------------------------------------------------------------------- /lib/swift/model_plugins/loggable.rb: -------------------------------------------------------------------------------- 1 | module Swift 2 | module ModelPlugins 3 | module Loggable 4 | module ClassMethods 5 | def loggable! 6 | before :save do 7 | @original_content = Hash[original_attributes.select do |property, value| 8 | if Protocol::IGNORED_PROPERTIES.include?(property.name) || value.kind_of?(DataMapper::Resource) 9 | false 10 | else 11 | value != attribute_get(property.name) 12 | end 13 | end.map{ |property, value| [property.name, value] }] 14 | end 15 | after :save do 16 | Protocol.log( :save => self, :data => @original_content ) if @original_content.any? 17 | end 18 | after :destroy do |object| 19 | Protocol.log :destroy => object 20 | end 21 | end 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /test/elements/forms_test.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require 'elements_helper' 3 | 4 | describe Swift do 5 | before do 6 | @args = { :title => "title", :text => "text"} 7 | @opts1 = { :kind => :form, :method => "show" } 8 | @opts2 = { :kind => :inquiry, :method => "post" } 9 | @swift = {} 10 | @swift[:slug] = "slug1/slug2/slug3" 11 | 12 | @page1 = Page.new :title => "Page 1", :path => "/", :parent => nil 13 | @page2 = Page.new :title => "Page 2", :path => "/page2", :parent => @page1 14 | @swift[:path_pages] = [@page1, @page2] 15 | end 16 | 17 | it 'should kind-form create' do 18 | skip 19 | p '@swift.slug = ' + @swift[:slug] 20 | el = element('Forms', @args, @opts1) 21 | el.must_equal "
" 22 | end 23 | 24 | it 'should kind-inquiry create' do 25 | skip 26 | el = element('Forms', @args, @opts2) 27 | el.must_equal "
" 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /app/views/elements/Image/core.rb: -------------------------------------------------------------------------------- 1 | @image = Image.get @args[0] 2 | throw :output, "[Image ##{@args[0]} missing]" unless @image 3 | 4 | @identity[:class] += ' sized' if @opts[:width] || @opts[:height] 5 | @identity[:alt] = @opts[:title].blank? ? @image.title : @opts[:title] 6 | 7 | @outlet = case @opts[:outlet] 8 | when nil 9 | @opts[:instance] ? @image.file.outlets[:thumb] : @image.file 10 | when '' 11 | @image.file 12 | else 13 | @image.file.outlets[@opts[:outlet].to_sym] 14 | end 15 | throw :output, "[Image ##{@args[0]} outlet '#{@opts[:outlet]||'thumb'}' missing]" unless @outlet 16 | 17 | styles = [] 18 | [:width, :height].each do |dim| 19 | if @opts[dim] 20 | styles << if @opts[dim].index('px') || !@opts[dim].index(/[^\d]/) 21 | @identity[dim] = @opts[dim].to_i 22 | "#{dim}:#{@opts[dim].to_i}px" 23 | else 24 | "#{dim}:#{@opts[dim]}" 25 | end 26 | end 27 | end 28 | @identity[:style] = styles.join(';') if styles.any? 29 | -------------------------------------------------------------------------------- /lib/swift/helpers/defer.rb: -------------------------------------------------------------------------------- 1 | module Swift 2 | module Helpers 3 | module Defer 4 | def placeholders 5 | @placeholders ||= {} 6 | end 7 | 8 | DEFERRED_ELEMENTS = Set.new(%w[Breadcrumbs PageTitle PageHeader Meta]).freeze 9 | 10 | def defer_element( name, args, opts ) 11 | return unless DEFERRED_ELEMENTS.include?(name) 12 | placeholders[name] = [ name, args, opts ] 13 | "%{placeholder[:#{name}]}" 14 | end 15 | 16 | def process_deferred_elements( text ) 17 | text.to_str.gsub /(\s*)\%\{placeholder\[\:([^\]]+)\]\}/ do 18 | if deferred = placeholders[$2] 19 | output = process_element *deferred 20 | if swift.pretty? 21 | $1+output.gsub(/\r|\n|\r\n/, $1)+$1 22 | else 23 | output 24 | end 25 | else 26 | '' 27 | end 28 | end 29 | end 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lib/swift/monkey/datamapper.rb: -------------------------------------------------------------------------------- 1 | require 'swift/monkey/datamapper/dirty_minder' 2 | require 'swift/monkey/datamapper/json' 3 | 4 | # Allows amorphous resources to fill its' json with any attributes 5 | module DataMapper 6 | module Resource 7 | def attributes=(attributes) 8 | model = self.model 9 | attributes.each do |name, value| 10 | case name 11 | when String, Symbol 12 | if model.allowed_writer_methods.include?(setter = "#{name}=") 13 | __send__(setter, value) 14 | else 15 | if self.respond_to? :json 16 | self.json[name] = value 17 | else 18 | raise ArgumentError, "The attribute '#{name}' is not accessible in #{model}" 19 | end 20 | end 21 | when Associations::Relationship, Property 22 | self.persistence_state = persistence_state.set(name, value) 23 | end 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /admin/views/cat_groups/_form.slim: -------------------------------------------------------------------------------- 1 | - if @object.new? 2 | = f.input :cat_card_id, :as => :select, :selected => @object.cat_card_id, :collection => CatCard.all, :fields => [ :title, :id ], :include_blank => false 3 | 4 | = f.input :parent_id, :as => :select, :selected => @object.parent_id, :collection => CatGroup.all( :order => :path, :id.not => @object.id ), :fields => [ :title_tree, :id ], :include_blank => true 5 | 6 | = f.input :title 7 | = f.input :text, :as => :text, :markdown => true 8 | 9 | - unless @object.new? 10 | .well 11 | - @object.cat_card.json.each do |key, type| 12 | - next unless type[0] == 'select' 13 | = f.input key, :as => :select, :label => { :caption => key }, :morphable => true, :options => type[1].split(/[\r\n]+/), :selected => @object.json[key], :include_blank => 'Не учитывать' 14 | 15 | - allow :auditor do 16 | = f.input :is_published, :as => :boolean 17 | = f.input :slug 18 | 19 | = f.submits :append => mk_timestamps( @object ) 20 | -------------------------------------------------------------------------------- /app/views/elements/NewsPager/core.rb: -------------------------------------------------------------------------------- 1 | swift.module_path_ids = [] 2 | filter = {} 3 | filter['news_rubric.slug.not'] = @opts[:exclude].to_s.split /\W+/ if @opts[:exclude] 4 | 5 | if @rubric 6 | filter[:news_rubric_id] = @rubric.id 7 | elsif @active_rubrics.any? 8 | filter[:news_rubric_id] = @active_rubrics.map(&:id) 9 | end 10 | if params[:year] 11 | filter[:date] = Date.new(params[:year].to_i)..Date.new(params[:year].to_i,12,-1) 12 | end 13 | if params[:month] 14 | date_a = Date.new(params[:year].to_i,params[:month].to_i,1) 15 | filter[:date] = date_a..(date_a>>1) 16 | end 17 | @articles_count = NewsArticle.published.count(filter) 18 | 19 | @per_page = @opts[:per_page] || 10 20 | 21 | @pages_count = (@articles_count - 1) / @per_page + 1 22 | @current_page = params[:page] ? params[:page].to_i : 1 23 | filter.merge! :limit => @per_page, :offset => (@current_page - 1) * @per_page, :order => [ :date.desc, :id.desc ] 24 | 25 | @articles = NewsArticle.published.all(filter) 26 | -------------------------------------------------------------------------------- /app/views/elements/Pager/view.slim: -------------------------------------------------------------------------------- 1 | nav.pager class=@opts[:class] 2 | | Страницы: 3 | - (1..@pages_count).each do |page| 4 | - active = page == @current_page 5 | - insert = false 6 | - more = false 7 | - klass = active ? 'active' : nil 8 | - if active 9 | - insert = true 10 | - elsif page == 1 || page == @pages_count 11 | - insert = true 12 | - elsif page == @current_page - 1 || page == @current_page + 1 13 | - insert = true 14 | - elsif page <= 3 + 2 && @current_page - 1 <= 3 15 | - insert = true 16 | - elsif page >= @pages_count + 1 - 3 - 2 && @current_page + 1 >= @pages_count - 3 + 1 17 | - insert = true 18 | - elsif page == 1 + 1 || page == @pages_count - 1 19 | - more = true 20 | - if insert 21 | a href=url_replace( swift.request, :page => page.to_s, :allowed_query_parameters => @opts[:allow] ) class=klass 22 | = page 23 | - if more 24 | span.more = "..." 25 | = " " 26 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # development 4 | group :development, :test do 5 | gem 'rake' 6 | gem 'awesome_print', "~> 1.2.0" 7 | gem 'ruby-progressbar' 8 | gem 'rack-test', ">= 0.5.0" 9 | end 10 | 11 | # templates and content parsing 12 | gem 'slim' 13 | gem 'tight-redcarpet', '~> 3.2', :require => 'redcarpet' 14 | gem 'sinatra-flash', :require => 'sinatra/flash' 15 | gem 'rack', '~> 1.5.0' 16 | 17 | # padrino framework 18 | padrino_version = '0.12.5' 19 | gem 'padrino-core', padrino_version 20 | gem 'padrino-helpers', padrino_version 21 | gem 'padrino-auth', '~> 0.0.12' 22 | 23 | # database ORM 24 | gem 'dm-validations' 25 | gem 'dm-timestamps' 26 | gem 'dm-migrations', :require => false 27 | gem 'dm-constraints' 28 | gem 'dm-aggregates' 29 | gem 'dm-core', '~> 1.2.1' 30 | gem 'dm-mysql-adapter' 31 | 32 | # file, picture, js, css assets 33 | gem 'nozzle', '~> 0.1.8' 34 | gem 'rack-pipeline', '~> 0.0.9' 35 | 36 | # mailing 37 | gem 'system_mail', '~> 0.0.3' 38 | -------------------------------------------------------------------------------- /app/views/elements/CatNodes/core.rb: -------------------------------------------------------------------------------- 1 | if swift.module_root && md = swift.slug.match( /show\/(.*)/ ) 2 | swift.slug = md[1] 3 | swift.path_pages << Page.new 4 | throw :output, element( 'CatNode', @args, @opts ) 5 | end 6 | 7 | @nodes = CatNode.all :cat_card_id => @card_ids 8 | @group ||= @root_group 9 | @nodes = @nodes.published.filter_by(@group) if @group 10 | 11 | @per_page = @opts[:per_page] || 10 12 | 13 | order = [] 14 | if params[:sort] 15 | if cache_field = @card.sort_cache[params[:sort]] 16 | order.unshift(params[:sort].to_sym) 17 | elsif cache_field = @card.sort_cache[params[:sort].sub('.desc','')] 18 | order.unshift(params[:sort].sub('.desc','').to_sym.desc) 19 | end 20 | end 21 | 22 | order = [ :sort2.desc, :sort1, :id ] if order.empty? 23 | 24 | @pages_count = (@nodes.count - 1) / @per_page + 1 25 | @current_page = params[:page] ? params[:page].to_i : 1 26 | @nodes = @nodes.all(:limit => @per_page, :offset => (@current_page - 1) * @per_page, :order => order) 27 | -------------------------------------------------------------------------------- /admin/views/accounts/index.slim: -------------------------------------------------------------------------------- 1 | = partial 'base/index_operations' 2 | - allow :admin do 3 | ul.nav.nav-pills.groups 4 | - klass = params[:group].blank? && 'active' 5 | li class=klass 6 | = link_to pat(:users), url(:accounts, :index) 7 | - klass = 'groups' == params[:group] && 'active' 8 | li class=klass 9 | = link_to pat(:groups), url(:accounts, :index, :group => 'groups') 10 | form.inner.multiple#multiple-accounts action=url(:accounts, :index)/:multiple method=:post 11 | = csrf_token_field 12 | table.table 13 | thead 14 | tr 15 | th.first 16 | th.title= mat(:object, :name) 17 | th= mat(:object, :role) 18 | th= mat(:object, :logged_at) 19 | tbody 20 | - @objects.each do |object| 21 | tr 22 | td.last= mk_checkbox object 23 | td= mk_edit object 24 | td= object.group && object.group.title 25 | td= object.logged_at.as_time 26 | = partial 'base/index_operations_bottom' 27 | -------------------------------------------------------------------------------- /models/forms_faq.rb: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | class FormsFaq 3 | include DataMapper::Resource 4 | 5 | FIELDS = { 6 | 'Сформулируйте свой вопрос' => ['text', '', true, :title], 7 | 'Представьтесь, пожалуйста' => ['string', '', true, :author], 8 | 'Ваш почтовый адрес' => ['string', '', true, :address], 9 | 'E-mail' => ['string', '', false, :email], 10 | 'Дополнительная информация' => ['file', '', false, :asset], 11 | } 12 | 13 | property :id, Serial 14 | property :title, Text, :required => true, :message => 'Требуется вопрос' 15 | property :text, Text 16 | 17 | property :author, String, :required => true, :message => 'Требуется ФИО' 18 | property :address, String, :required => true, :message => 'Требуется почтовый адрес' 19 | property :email, String 20 | 21 | property :asset_id, Integer 22 | belongs_to :asset 23 | 24 | sluggable! :limit => 63 25 | timestamps! 26 | userstamps! 27 | loggable! 28 | publishable! 29 | end 30 | -------------------------------------------------------------------------------- /admin/views/folders/_tree.slim: -------------------------------------------------------------------------------- 1 | - tree ||= @tree 2 | - tree.each do |leaf| 3 | - @k += 1 4 | - if object = leaf[:folder] 5 | tr class=((leaf[:child] ? "openable" : "final") + " level-#{level}") id="folder-#{object.id}" 6 | - name = object.slug.blank? ? 'index' : object.slug 7 | - name = :"check_#{object.class.name.underscore}[#{object.id}]" 8 | td.checkbox 9 | label.checkbox for=name data-sorter=@k 10 | = check_box_tag name, :checked => false, :id => name 11 | td.edit 12 | = mk_published object 13 | = mk_edit object 14 | td.slug= object.slug 15 | td 16 | = object.path 17 | - if current_account.allowed? :designer 18 | td.nowrap= link_to( object.fragment.title, url(:fragments, :edit, :id => object.fragment_id) ) rescue nil 19 | - else 20 | td.nowrap= object.fragment.title rescue nil 21 | - if leaf[:child] 22 | = partial 'folders/tree', :locals => { :tree => leaf[:child], :level => level + 1 } 23 | -------------------------------------------------------------------------------- /app/views/elements/FormsInquiry/view.slim: -------------------------------------------------------------------------------- 1 | - @cards.each do |card| 2 | .article 3 | - if card.json.count > 1 4 | h5= card.title 5 | - session['forms_cards'] ||= Set.new 6 | - session['forms_cards'] << card.id 7 | - @result = FormsResult.first( :origin => request.addr, :forms_card_id => card.id ) || FormsResult.new( :forms_card_id => card.id ) 8 | - if @result.new? 9 | = form_for @result, se_url(card, :poll), :class => 'form', :remote => true do |f| 10 | - @f = f 11 | - card.json.each do |k,v| 12 | = element_view 'Forms/inquiry', :locals => { :key => k, :value => v } 13 | = f.submit 'Лады', :class => 'btn btn-small btn-success' 14 | - else 15 | dl 16 | - count = card.forms_results.count 17 | - card.statistic.each do |k,v| 18 | dt 19 | - v.each do |kk, vv| 20 | small= kk 21 | .progress 22 | - value = 100.0*vv/count 23 | .bar style=("width: "+value.to_s+"%") 24 | -------------------------------------------------------------------------------- /models/block.rb: -------------------------------------------------------------------------------- 1 | class Block 2 | include DataMapper::Resource 3 | 4 | property :id, Serial 5 | 6 | property :title, String 7 | property :text, Text 8 | 9 | property :type, Integer, :default => 0 10 | Types = { 11 | 0 => :text, 12 | 1 => :html, 13 | 2 => :table, 14 | } 15 | 16 | sluggable! 17 | timestamps! 18 | userstamps! 19 | loggable! 20 | datatables!( :id, :title, :type, :slug, 21 | :format => { :type => { :code => 'o.get_type' } } 22 | ) 23 | multilingual! :text, :optional => :text 24 | 25 | # validations 26 | validates_presence_of :title 27 | 28 | # relations 29 | belongs_to :folder, :required => false 30 | 31 | # hookers 32 | 33 | # instance helpers 34 | def html? 35 | type == 1 36 | end 37 | 38 | def table? 39 | type == 2 40 | end 41 | 42 | def self.get_type(type) 43 | I18n.t "models.object.attributes.type_#{Types[type]}" 44 | end 45 | 46 | def get_type 47 | self.class.get_type(type) 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /lib/swift/helpers/legacy.rb: -------------------------------------------------------------------------------- 1 | module Swift 2 | module Helpers 3 | module Legacy 4 | LEGACY_FILE = 'config/legacy.yml' 5 | DEFAULT_LEGACY_URL_BASE = 'legacy/' 6 | DEFAULT_LEGACY_URL_MAP = '/' 7 | 8 | def process_legacy 9 | legacy_settings = load_legacy_settings 10 | url = params[:request_uri].partition(legacy_settings['url_base'] || DEFAULT_LEGACY_URL_BASE).last 11 | new_url = Option(:legacy_url_map)[url] rescue nil 12 | new_url ||= legacy_settings['url_map'][url] rescue nil 13 | redirect new_url || DEFAULT_LEGACY_URL_MAP 14 | end 15 | 16 | private 17 | 18 | def load_legacy_settings 19 | file = Padrino.root(LEGACY_FILE) 20 | return({}) unless File.file?(file) 21 | @legacy_settings = nil if @last_legacy_update.to_i < File.mtime(file).to_i 22 | @legacy_settings ||= YAML.load_file(file) 23 | @last_legacy_update = File.mtime(file) 24 | @legacy_settings 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /test/elements/sitemap_test.rb: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | require 'elements_helper' 3 | 4 | describe Swift do 5 | before do 6 | @page1 = Page.new :title => "Page 1", :path => "/", :parent => nil 7 | @page2 = Page.new :title => "Page 2", :path => "/page2", :parent => @page1 8 | @page3 = Page.new :title => "Page 3", :path => "/page2/page3", :parent => @page2 9 | @page4 = Page.new :title => "Page 4", :path => "page4", :parent => nil 10 | @page5 = Page.new :title => "Page 5", :path => "page5", :parent => nil 11 | @page6 = Page.new :title => "Page 6", :path => "page6", :parent => nil 12 | @page7 = Page.new :title => "Page 7", :path => "page7", :parent => nil 13 | @swift = {} 14 | @swift[:path_pages] = [@page1, @page2, @page3, @page4, @page5, @page6, @page7] 15 | @swift[:path_ids] = [@page1.id, @page2.id, @page3.id, @page4.id, @page5.id, @page6.id, @page7.id] 16 | end 17 | 18 | it 'should view map' do 19 | skip 20 | el = element('SiteMap') 21 | el.must_equal "" 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/swift/model_plugins.rb: -------------------------------------------------------------------------------- 1 | Dir.glob( File.dirname(__FILE__) + '/model_plugins/*.rb' ).each { |file| require file } 2 | 3 | module Swift 4 | module ModelPlugins 5 | module ClassMethods 6 | include Swift::ModelPlugins::Amorphous::ClassMethods 7 | include Swift::ModelPlugins::Bondable::ClassMethods 8 | include Swift::ModelPlugins::Dateable::ClassMethods 9 | include Swift::ModelPlugins::Loggable::ClassMethods 10 | include Swift::ModelPlugins::Metable::ClassMethods 11 | include Swift::ModelPlugins::Multilingual::ClassMethods 12 | include Swift::ModelPlugins::Publishable::ClassMethods 13 | include Swift::ModelPlugins::Recursive::ClassMethods 14 | include Swift::ModelPlugins::Sluggable::ClassMethods 15 | include Swift::ModelPlugins::Stamps::ClassMethods 16 | include Swift::ModelPlugins::Datatables::ClassMethods 17 | include Swift::ModelPlugins::Positionable::ClassMethods 18 | include Swift::ModelPlugins::UUID::ClassMethods 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/swift/helpers/error.rb: -------------------------------------------------------------------------------- 1 | module Swift 2 | module Helpers 3 | module Error 4 | def report_error( error, subsystem = 'system', fallback = nil ) 5 | @_out_buf ||= ''.html_safe # !!! FIXME this might be fixed at tilt 1.3.8+ 6 | if Padrino.env == :production 7 | messages = '' 8 | [ "Swift caught a runtime error at #{subsystem}", 9 | "Fallback for development was #{fallback||'empty'}, production displayed empty string.", 10 | error.message, 11 | ].each do |message| 12 | logger.error message 13 | messages << message + "\r\n" 14 | end 15 | error.backtrace.reject{ |e| e.match /phusion_passenger/ }.each do |step| 16 | logger << step 17 | messages << step + "\r\n" 18 | end 19 | swift.error_messages ||= [] 20 | swift.error_messages << messages 21 | '' 22 | else 23 | fallback || raise 24 | end 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /admin/views/login/new.slim: -------------------------------------------------------------------------------- 1 | h4 2 | = pat 'login.title' 3 | br 4 | small= Option(:site_title) 5 | br 6 | small= link_to request.env['HTTP_HOST'], '/' 7 | = form_tag( url(:login, :create), :class => 'form-horizontal well' ) do 8 | = partial 'base/flash' 9 | 10 | legend 11 | .control-group 12 | .input-prepend 13 | span.add-on 14 | i.icon-envelope 15 | = text_field_tag :email, :value => params[:email], :placeholder => "email" 16 | .control-group 17 | .input-prepend 18 | span.add-on 19 | i.icon-lock 20 | = password_field_tag :password, :value => params[:password], :placeholder => "password" 21 | .control-group 22 | = submit_tag(pat('login.signin'), :class => 'btn btn-primary pull-right') 23 | - if Option(:bypass) && Padrino.env == :development 24 | - Account.all( :group_id => nil ).map(&:name).each do |name| 25 | label.radio 26 | = t('group.'+name) 27 | = radio_button_tag :bypass, :value => name 28 | small 29 | = link_to pat('login.forgot'), url(:login, :reset) 30 | --------------------------------------------------------------------------------