Skip to content

Commit cc48756

Browse files
committed
Afisam intrebari pe pagina de index
1 parent c738c7f commit cc48756

File tree

9 files changed

+1024
-1
lines changed

9 files changed

+1024
-1
lines changed

miniflow.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1+
require "ostruct"
2+
13
require "bundler/setup"
24
Bundler.require :default, ENV["RACK_ENV"]
35

46
class Miniflow < Sinatra::Base
7+
enable :static
8+
9+
configure do
10+
set :questions, []
11+
12+
question = OpenStruct.new
13+
question.score = 128
14+
question.title = "O intrebare de Ruby"
15+
question.category = "ruby"
16+
question.created_at = Time.now
17+
18+
settings.questions << question
19+
end
20+
521
get "/" do
6-
"Hello, world"
22+
@questions = settings.questions
23+
erb :index
724
end
825
end

public/images/logo-webdev.png

1.92 KB
Loading

public/javascripts/jquery.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/show.html

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<!DOCTYPE html>
2+
<!--[if lt IE 7 ]><html lang="en" class="no-js ie6"><![endif]-->
3+
<!--[if IE 7 ]><html lang="en" class="no-js ie7"><![endif]-->
4+
<!--[if IE 8 ]><html lang="en" class="no-js ie8"><![endif]-->
5+
<!--[if IE 9 ]><html lang="en" class="no-js ie9"><![endif]-->
6+
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]-->
7+
<head>
8+
<meta charset="UTF-8" />
9+
<link href="ui/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css" />
10+
</head>
11+
<body class="questions_show">
12+
<section class="header">
13+
<h1>
14+
<a href="#">WebDev Overflow</a>
15+
</h1>
16+
<p>Locul in care poti sa pui cele mai inteligente intrebari,<br /> ca sa poti primi cele mai inteligente raspunsuri.</p>
17+
</section>
18+
19+
<section class="answers">
20+
<p><a href="#">&larr; inapoi la intrebari</a></p>
21+
<article class="question upvoted">
22+
<div class="democracy"><a href="#" class="btn-vote_up">up vote</a> <strong>28</strong> <a href="#" class="btn-vote_down">down vote</a></div>
23+
<h1>This is the question title</h1>
24+
<div class="description">
25+
<p>The Python C API has the PyObject *PyType_Type object, which is equivalent to type in the interpreter. If I want to define a metaclass in C++, how can I set type as one of its bases in Boost.Python? Also, what other things should I take into consideration when defining a Python metaclass in C++?</p>
26+
27+
<p>It'd be ideal if there was a Boost.Python solution to this. If not, a solution that uses the Python C API (or a combination of Boost and the C API) is good as well. Since my other classes are exposed with Boost, I'd rather leave SWIG as a last resort.</p>
28+
29+
<p>Note: This is actually part of a bigger problem I'm trying to solve, which I've asked about in Setting metaclass of wrapped class with Boost.Python, if you're interested.</p>
30+
</div>
31+
<aside>
32+
Categorie: <a href="#">category name</a> &middot; Data intrebarii: <time dtime="12-12-2012">acum 5 ore</time> &middot; Intrebat de: <a href="mailto:[email protected]">Silviu Postavaru</a>
33+
</aside>
34+
</article>
35+
<h2>Raspunsuri</h2>
36+
<ol>
37+
<li class="downvoted">
38+
<div class="democracy"><a href="#" class="btn-vote_up">up vote</a> <strong>28</strong> <a href="#" class="btn-vote_down">down vote</a></div>
39+
<div class="answer">
40+
<p><strong>Mixing Table-Entities with View-Entities is ok and largely depends on your requirements.</strong> </p>
41+
<p>My experience has been these are things you are going to have to deal with.</p>
42+
<p>When I first started using Entity, I used views a lot because I was told I needed to use them. As I became more familiar with Entity I began to <em>prefer</em> the use of table-entities over view-entities; mainly because I felt I had more control. Views are ok when you are presenting read-only info, or as you described (flattend data, pivots, joins etc.); however, when your requirements change and you now have to add CRUD, you are going to have to use stored procedures or change your model to use table-entites anyway, so you might as well use table-entities from the start.</p>
43+
<blockquote>
44+
<p>The Views contains lots and lots of Keys. Some quick googling seems to
45+
indicate I will need to manually edit the EDMX file to remove this
46+
info.</p>
47+
</blockquote>
48+
<p><strong>This wasn't ever really a problem for me.</strong> You can undo keys of the view-entity in the designer. If your talking about doing this for the view in the storage layer, then yes, you can, to make it work, but as soon as you update your model from the database, you are going to have to do this over again -- I wouldn't recommend doing this. You are better off working with your DBA to adjust the key constraints in the database.</p>
49+
<blockquote>
50+
<p>The Views don't have any relationships to the other table entities.
51+
These associations need to be manually added in order to link a View
52+
-&gt; Table.</p>
53+
</blockquote>
54+
<p><strong>This was <em>often</em> a problem for me.</strong> Sometimes you are able to add keys and create relationships without any problems, but often times you may have to change the keys and/or relationships in the db to make it work -- this depends on your requirements; you may have to deal with this even when using table-entities.</p>
55+
<p>Hope this helps.</p>
56+
</div>
57+
<aside>
58+
Raspuns la: <time dtime="12-12-2012">acum 5 ore</time> &middot; Raspuns de: <a href="mailto:[email protected]">Silviu Postavaru</a>
59+
</aside>
60+
</li>
61+
<li>
62+
<div class="democracy"><a href="#" class="btn-vote_up">up vote</a> <strong>28</strong> <a href="#" class="btn-vote_down">down vote</a></div>
63+
<div class="answer">
64+
<p>My experience has been these are things you are going to have to deal with.</p>
65+
<p>When I first started using Entity, I used views a lot because I was told I needed to use them. As I became more familiar with Entity I began to <em>prefer</em> the use of table-entities over view-entities; mainly because I felt I had more control. Views are ok when you are presenting read-only info, or as you described (flattend data, pivots, joins etc.); however, when your requirements change and you now have to add CRUD, you are going to have to use stored procedures or change your model to use table-entites anyway, so you might as well use table-entities from the start.</p>
66+
<blockquote>
67+
<p>The Views contains lots and lots of Keys. Some quick googling seems to
68+
indicate I will need to manually edit the EDMX file to remove this
69+
info.</p>
70+
</blockquote>
71+
<p><strong>This wasn't ever really a problem for me.</strong> You can undo keys of the view-entity in the designer. If your talking about doing this for the view in the storage layer, then yes, you can, to make it work, but as soon as you update your model from the database, you are going to have to do this over again -- I wouldn't recommend doing this. You are better off working with your DBA to adjust the key constraints in the database.</p>
72+
<blockquote>
73+
<p>The Views don't have any relationships to the other table entities.
74+
These associations need to be manually added in order to link a View
75+
-&gt; Table.</p>
76+
</blockquote>
77+
<p><strong>This was <em>often</em> a problem for me.</strong> Sometimes you are able to add keys and create relationships without any problems, but often times you may have to change the keys and/or relationships in the db to make it work -- this depends on your requirements; you may have to deal with this even when using table-entities.</p>
78+
<p>Hope this helps.</p>
79+
</div>
80+
<aside>
81+
Raspuns la: <time dtime="12-12-2012">acum 5 ore</time> &middot; Raspuns de: <a href="mailto:[email protected]">Silviu Postavaru</a>
82+
</aside>
83+
</li>
84+
</ol>
85+
<div class="pagination">
86+
<a href="#" class="btn-more">mai multe</a>
87+
</div>
88+
<section class="add_answer">
89+
<h2>Raspunde si tu</h2>
90+
<form>
91+
<p>
92+
<label>Nume:</label>
93+
<input type="text" size="30" />
94+
</p>
95+
<p>
96+
<label>Email:</label>
97+
<input type="text" size="30" />
98+
</p>
99+
<p>
100+
<label>Raspunsul tau:</label>
101+
<textarea cols="80" rows="8"></textarea>
102+
</p>
103+
<p><button>trimite raspuns</button></p>
104+
</form>
105+
</section>
106+
</section>
107+
108+
<section class="related_questions">
109+
<h2>Din aceasi categorie</h2>
110+
<ol>
111+
<li>
112+
<h3><a href="#">This is the question title</a></h3>
113+
<p>Data intrebarii: <time dtime="12-12-2012">acum 5 ore</time> &middot; Data ultimului raspuns: <time dtime="12-12-2012">acum 3 minute</time></p>
114+
</li>
115+
<li>
116+
<h3><a href="#">This is the question title</a></h3>
117+
<p>Data intrebarii: <time dtime="12-12-2012">acum 5 ore</time> &middot; Data ultimului raspuns: <time dtime="12-12-2012">acum 3 minute</time></p>
118+
</li>
119+
<li>
120+
<h3><a href="#">This is the question title</a></h3>
121+
<p>Data intrebarii: <time dtime="12-12-2012">acum 5 ore</time> &middot; Data ultimului raspuns: <time dtime="12-12-2012">acum 3 minute</time></p>
122+
</li>
123+
<li>
124+
<h3><a href="#">This is the question title</a></h3>
125+
<p>Data intrebarii: <time dtime="12-12-2012">acum 5 ore</time> &middot; Data ultimului raspuns: <time dtime="12-12-2012">acum 3 minute</time></p>
126+
</li>
127+
<li>
128+
<h3><a href="#">This is the question title</a></h3>
129+
<p>Data intrebarii: <time dtime="12-12-2012">acum 5 ore</time> &middot; Data ultimului raspuns: <time dtime="12-12-2012">acum 3 minute</time></p>
130+
</li>
131+
</ol>
132+
</section>
133+
134+
<section class="closer">
135+
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.<br />
136+
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" /></a>
137+
</section>
138+
</body>
139+
</html>

public/stylesheets/.DS_Store

6 KB
Binary file not shown.

public/stylesheets/reset.scss

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
HTML5 Reset :: style.css
3+
----------------------------------------------------------
4+
We have learned much from/been inspired by/taken code where offered from:
5+
6+
Eric Meyer :: http://ericmeyer.com
7+
HTML5 Doctor :: http://html5doctor.com
8+
and the HTML5 Boilerplate :: http://html5boilerplate.com
9+
10+
-------------------------------------------------------------------------------*/
11+
12+
/* Let's default this puppy out
13+
-------------------------------------------------------------------------------*/
14+
15+
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video {
16+
margin: 0;
17+
padding: 0;
18+
border: 0;
19+
outline: 0;
20+
font-size: 100%;
21+
vertical-align: baseline;
22+
background: transparent;
23+
}
24+
25+
article, aside, figure, footer, header, hgroup, nav, section {display: block;}
26+
27+
/* Responsive images and other embedded objects
28+
Note: keeping IMG here will cause problems if you're using foreground images as sprites.
29+
If this default setting for images is causing issues, you might want to replace it with a .responsive class instead. */
30+
img,
31+
object,
32+
embed {max-width: 100%;}
33+
34+
/* force a vertical scrollbar to prevent a jumpy page */
35+
html {overflow-y: scroll;}
36+
37+
/* we use a lot of ULs that aren't bulleted.
38+
don't forget to restore the bullets within content. */
39+
ul {list-style: none;}
40+
41+
input, select {vertical-align: middle;}
42+
43+
input[type="radio"] {vertical-align: text-bottom;}
44+
input[type="checkbox"] {vertical-align: bottom; *vertical-align: baseline;}
45+
46+
/* Accessible focus treatment
47+
people.opera.com/patrickl/experiments/keyboard/test */
48+
a:hover, a:active {outline: none;}
49+
50+
/* hand cursor on clickable elements */
51+
.clickable,
52+
label,
53+
input[type=button],
54+
input[type=submit],
55+
button {cursor: pointer;}
56+
57+
/* Webkit browsers add a 2px margin outside the chrome of form elements */
58+
button, input, select, textarea {margin: 0;}
59+
60+
/* make buttons play nice in IE */
61+
button {width: auto; overflow: visible;}
62+
63+
/* these work great with modernizr */
64+
.ie7 img {-ms-interpolation-mode: bicubic;}
65+
.ie6 html {filter: expression(document.execCommand("BackgroundImageCache", false, true));}
66+
.ie6 input {vertical-align: text-bottom;}
67+
68+
/* fancy stuff */
69+
::-moz-selection{background: rgba(0, 0, 0, 0.5); color: #fff; text-shadow: none;}
70+
::selection {background: rgba(0, 0, 0, 0.5); color: #fff; text-shadow: none;}
71+
72+
/* j.mp/webkit-tap-highlight-color */
73+
a:link {-webkit-tap-highlight-color: #fcd700;}

0 commit comments

Comments
 (0)